*/
/*
- __float128 expansions are
+ Long double expansions are
Copyright (C) 2001 Stephen L. Moshier <moshier@na-net.ornl.gov>
- and are incorporated herein by permission of the author. The author
+ and are incorporated herein by permission of the author. The author
reserves the right to distribute this material elsewhere under different
- copying permissions. These modifications are distributed here under
+ copying permissions. These modifications are distributed here under
the following terms:
This library is free software; you can redistribute it and/or
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
+ <http://www.gnu.org/licenses/>. */
-/* __ieee754_acosl(x)
+/* acosq(x)
* Method :
* acos(x) = pi/2 - asin(x)
* acos(-x) = pi/2 + asin(x)
* if x is NaN, return x itself;
* if |x|>1, return NaN with invalid signal.
*
- * Functions needed: __ieee754_sqrtl.
+ * Functions needed: sqrtq.
*/
#include "quadmath-imp.h"
static const __float128
- one = 1.0Q,
+ one = 1,
pio2_hi = 1.5707963267948966192313216916397514420986Q,
pio2_lo = 4.3359050650618905123985220130216759843812E-35Q,
}
else if (ix < 0x3ffe0000) /* |x| < 0.5 */
{
- if (ix < 0x3fc60000) /* |x| < 2**-57 */
+ if (ix < 0x3f8e0000) /* |x| < 2**-113 */
return pio2_hi + pio2_lo;
if (ix < 0x3ffde000) /* |x| < .4375 */
{
s = sqrtq (z);
/* Compute an extended precision square root from
the Newton iteration s -> 0.5 * (s + z / s).
- The change w from s to the improved value is
+ The change w from s to the improved value is
w = 0.5 * (s + z / s) - s = (s^2 + z)/2s - s = (z - s^2)/2s.
- Express s = f1 + f2 where f1 * f1 is exactly representable.
+ Express s = f1 + f2 where f1 * f1 is exactly representable.
w = (z - s^2)/2s = (z - f1^2 - 2 f1 f2 - f2^2)/2s .
- s + w has extended precision. */
+ s + w has extended precision. */
u.value = s;
u.words32.w2 = 0;
u.words32.w3 = 0;