~ubuntu-branches/ubuntu/quantal/uclibc/quantal

« back to all changes in this revision

Viewing changes to libm/e_rem_pio2.c

  • Committer: Bazaar Package Importer
  • Author(s): Hector Oron
  • Date: 2011-06-11 03:06:20 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110611030620-ywjfvyuqvrpsm282
Tags: 0.9.32-1
* New upstream release
* Add myself as maintainer
* Bump standards version 
* Add Vcs-Git, Vcs-Browser and Homepage fields
* Add watch file 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* @(#)e_rem_pio2.c 5.1 93/09/24 */
2
1
/*
3
2
 * ====================================================
4
3
 * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
10
9
 * ====================================================
11
10
 */
12
11
 
13
 
#if defined(LIBM_SCCS) && !defined(lint)
14
 
static char rcsid[] = "$NetBSD: e_rem_pio2.c,v 1.8 1995/05/10 20:46:02 jtc Exp $";
15
 
#endif
16
 
 
17
12
/* __ieee754_rem_pio2(x,y)
18
13
 *
19
14
 * return the remainder of x rem pi/2 in y[0]+y[1]
23
18
#include "math.h"
24
19
#include "math_private.h"
25
20
 
26
 
 
27
21
/*
28
22
 * Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi
29
23
 */
30
 
#ifdef __STDC__
31
24
static const int32_t two_over_pi[] = {
32
 
#else
33
 
static int32_t two_over_pi[] = {
34
 
#endif
35
25
0xA2F983, 0x6E4E44, 0x1529FC, 0x2757D1, 0xF534DD, 0xC0DB62,
36
26
0x95993C, 0x439041, 0xFE5163, 0xABDEBB, 0xC561B7, 0x246E3A,
37
27
0x424DD2, 0xE00649, 0x2EEA09, 0xD1921C, 0xFE1DEB, 0x1CB129,
45
35
0x4D7327, 0x310606, 0x1556CA, 0x73A8C9, 0x60E27B, 0xC08C6B,
46
36
};
47
37
 
48
 
#ifdef __STDC__
49
38
static const int32_t npio2_hw[] = {
50
 
#else
51
 
static int32_t npio2_hw[] = {
52
 
#endif
53
39
0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C,
54
40
0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C,
55
41
0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A,
68
54
 * pio2_3t:  pi/2 - (pio2_1+pio2_2+pio2_3)
69
55
 */
70
56
 
71
 
#ifdef __STDC__
72
57
static const double
73
 
#else
74
 
static double
75
 
#endif
76
58
zero =  0.00000000000000000000e+00, /* 0x00000000, 0x00000000 */
77
59
half =  5.00000000000000000000e-01, /* 0x3FE00000, 0x00000000 */
78
60
two24 =  1.67772160000000000000e+07, /* 0x41700000, 0x00000000 */
84
66
pio2_3  =  2.02226624871116645580e-21, /* 0x3BA3198A, 0x2E000000 */
85
67
pio2_3t =  8.47842766036889956997e-32; /* 0x397B839A, 0x252049C1 */
86
68
 
87
 
#ifdef __STDC__
88
 
        int32_t attribute_hidden __ieee754_rem_pio2(double x, double *y)
89
 
#else
90
 
        int32_t attribute_hidden __ieee754_rem_pio2(x,y)
91
 
        double x,y[];
92
 
#endif
 
69
int32_t attribute_hidden __ieee754_rem_pio2(double x, double *y)
93
70
{
94
71
        double z=0.0,w,t,r,fn;
95
72
        double tx[3];