Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/lib/libm/noieee_src Pull up revision 1.5 (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/21c9267f7983
branches:  netbsd-1-6
changeset: 527951:21c9267f7983
user:      lukem <lukem%NetBSD.org@localhost>
date:      Tue Jun 18 13:39:40 2002 +0000

description:
Pull up revision 1.5 (requested by matt in ticket #286):
Ansify libm noieeesrc (for VAX).  Also make const data really const.
libm for VAX can compiles with WARNS=2

diffstat:

 lib/libm/noieee_src/n_j0.c |  60 +++++++++++++++++-----------------
 lib/libm/noieee_src/n_j1.c |  78 +++++++++++++++++++++++-----------------------
 lib/libm/noieee_src/n_jn.c |  13 ++++---
 3 files changed, 76 insertions(+), 75 deletions(-)

diffs (truncated from 537 to 300 lines):

diff -r 526108e371a7 -r 21c9267f7983 lib/libm/noieee_src/n_j0.c
--- a/lib/libm/noieee_src/n_j0.c        Tue Jun 18 13:39:12 2002 +0000
+++ b/lib/libm/noieee_src/n_j0.c        Tue Jun 18 13:39:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_j0.c,v 1.4 1999/07/02 15:37:37 simonb Exp $  */
+/*     $NetBSD: n_j0.c,v 1.4.10.1 2002/06/18 13:39:40 lukem Exp $      */
 /*-
  * Copyright (c) 1992, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -124,9 +124,9 @@
 #define infnan(x) (0.0)
 #endif
 
-static double pzero __P((double)), qzero __P((double));
+static double pzero (double), qzero (double);
 
-static double
+static const double
 huge   = 1e300,
 zero    = 0.0,
 one    = 1.0,
@@ -143,8 +143,7 @@
 s04 =   1.166140033337900097836930825478674320464e-0009;
 
 double
-j0(x)
-       double x;
+j0(double x)
 {
        double z, s,c,ss,cc,r,u,v;
 
@@ -193,7 +192,7 @@
        }
 }
 
-static double
+static const double
 u00 =  -7.380429510868722527422411862872999615628e-0002,
 u01 =   1.766664525091811069896442906220827182707e-0001,
 u02 =  -1.381856719455968955440002438182885835344e-0002,
@@ -207,8 +206,7 @@
 v04 =   4.411103113326754838596529339004302243157e-0010;
 
 double
-y0(x)
-       double x;
+y0(double x)
 {
        double z, s, c, ss, cc, u, v;
     /* Y0(NaN) is NaN, y0(-inf) is Nan, y0(inf) is 0  */
@@ -277,7 +275,7 @@
  * and
  *     | pzero(x)-1-R/S | <= 2  ** ( -60.26)
  */
-static double pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
+static const double pr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
    0.0,
   -7.031249999999003994151563066182798210142e-0002,
   -8.081670412753498508883963849859423939871e+0000,
@@ -285,7 +283,7 @@
   -2.485216410094288379417154382189125598962e+0003,
   -5.253043804907295692946647153614119665649e+0003,
 };
-static double ps8[5] = {
+static const double ps8[5] = {
    1.165343646196681758075176077627332052048e+0002,
    3.833744753641218451213253490882686307027e+0003,
    4.059785726484725470626341023967186966531e+0004,
@@ -293,7 +291,7 @@
    4.762772841467309430100106254805711722972e+0004,
 };
 
-static double pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
+static const double pr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
   -1.141254646918944974922813501362824060117e-0011,
   -7.031249408735992804117367183001996028304e-0002,
   -4.159610644705877925119684455252125760478e+0000,
@@ -301,7 +299,7 @@
   -3.312312996491729755731871867397057689078e+0002,
   -3.464333883656048910814187305901796723256e+0002,
 };
-static double ps5[5] = {
+static const double ps5[5] = {
    6.075393826923003305967637195319271932944e+0001,
    1.051252305957045869801410979087427910437e+0003,
    5.978970943338558182743915287887408780344e+0003,
@@ -309,7 +307,7 @@
    2.406058159229391070820491174867406875471e+0003,
 };
 
-static double pr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
+static const double pr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
   -2.547046017719519317420607587742992297519e-0009,
   -7.031196163814817199050629727406231152464e-0002,
   -2.409032215495295917537157371488126555072e+0000,
@@ -317,7 +315,7 @@
   -5.807917047017375458527187341817239891940e+0001,
   -3.144794705948885090518775074177485744176e+0001,
 };
-static double ps3[5] = {
+static const double ps3[5] = {
    3.585603380552097167919946472266854507059e+0001,
    3.615139830503038919981567245265266294189e+0002,
    1.193607837921115243628631691509851364715e+0003,
@@ -325,7 +323,7 @@
    1.735809308133357510239737333055228118910e+0002,
 };
 
-static double pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
+static const double pr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
   -8.875343330325263874525704514800809730145e-0008,
   -7.030309954836247756556445443331044338352e-0002,
   -1.450738467809529910662233622603401167409e+0000,
@@ -333,7 +331,7 @@
   -1.119316688603567398846655082201614524650e+0001,
   -3.233645793513353260006821113608134669030e+0000,
 };
-static double ps2[5] = {
+static const double ps2[5] = {
    2.222029975320888079364901247548798910952e+0001,
    1.362067942182152109590340823043813120940e+0002,
    2.704702786580835044524562897256790293238e+0002,
@@ -341,10 +339,11 @@
    1.465761769482561965099880599279699314477e+0001,
 };
 
-static double pzero(x)
-       double x;
+static double
+pzero(double x)
 {
-       double *p,*q,z,r,s;
+       const double *p,*q;
+       double z,r,s;
        if (x >= 8.00)                     {p = pr8; q= ps8;}
        else if (x >= 4.54545211791992188) {p = pr5; q= ps5;}
        else if (x >= 2.85714149475097656) {p = pr3; q= ps3;}
@@ -365,7 +364,7 @@
  * and
  *     | qzero(x)/s +1.25-R/S | <= 2  ** ( -61.22)
  */
-static double qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
+static const double qr8[6] = { /* for x in [inf, 8]=1/[0,0.125] */
    0.0,
    7.324218749999350414479738504551775297096e-0002,
    1.176820646822526933903301695932765232456e+0001,
@@ -373,7 +372,7 @@
    8.859197207564685717547076568608235802317e+0003,
    3.701462677768878501173055581933725704809e+0004,
 };
-static double qs8[6] = {
+static const double qs8[6] = {
    1.637760268956898345680262381842235272369e+0002,
    8.098344946564498460163123708054674227492e+0003,
    1.425382914191204905277585267143216379136e+0005,
@@ -382,7 +381,7 @@
   -3.438992935378666373204500729736454421006e+0005,
 };
 
-static double qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
+static const double qr5[6] = { /* for x in [8,4.5454]=1/[0.125,0.22001] */
    1.840859635945155400568380711372759921179e-0011,
    7.324217666126847411304688081129741939255e-0002,
    5.835635089620569401157245917610984757296e+0000,
@@ -390,7 +389,7 @@
    1.027243765961641042977177679021711341529e+0003,
    1.989977858646053872589042328678602481924e+0003,
 };
-static double qs5[6] = {
+static const double qs5[6] = {
    8.277661022365377058749454444343415524509e+0001,
    2.077814164213929827140178285401017305309e+0003,
    1.884728877857180787101956800212453218179e+0004,
@@ -399,7 +398,7 @@
   -5.354342756019447546671440667961399442388e+0003,
 };
 
-static double qr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
+static const double qr3[6] = {/* for x in [4.547,2.8571]=1/[0.2199,0.35001] */
    4.377410140897386263955149197672576223054e-0009,
    7.324111800429115152536250525131924283018e-0002,
    3.344231375161707158666412987337679317358e+0000,
@@ -407,7 +406,7 @@
    1.708080913405656078640701512007621675724e+0002,
    1.667339486966511691019925923456050558293e+0002,
 };
-static double qs3[6] = {
+static const double qs3[6] = {
    4.875887297245871932865584382810260676713e+0001,
    7.096892210566060535416958362640184894280e+0002,
    3.704148226201113687434290319905207398682e+0003,
@@ -416,7 +415,7 @@
   -1.492474518361563818275130131510339371048e+0002,
 };
 
-static double qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
+static const double qr2[6] = {/* for x in [2.8570,2]=1/[0.3499,0.5] */
    1.504444448869832780257436041633206366087e-0007,
    7.322342659630792930894554535717104926902e-0002,
    1.998191740938159956838594407540292600331e+0000,
@@ -424,7 +423,7 @@
    3.166623175047815297062638132537957315395e+0001,
    1.625270757109292688799540258329430963726e+0001,
 };
-static double qs2[6] = {
+static const double qs2[6] = {
    3.036558483552191922522729838478169383969e+0001,
    2.693481186080498724211751445725708524507e+0002,
    8.447837575953201460013136756723746023736e+0002,
@@ -433,10 +432,11 @@
   -5.310954938826669402431816125780738924463e+0000,
 };
 
-static double qzero(x)
-       double x;
+static double
+qzero(double x)
 {
-       double *p,*q, s,r,z;
+       const double *p,*q;
+       double s,r,z;
        if (x >= 8.00)                     {p = qr8; q= qs8;}
        else if (x >= 4.54545211791992188) {p = qr5; q= qs5;}
        else if (x >= 2.85714149475097656) {p = qr3; q= qs3;}
diff -r 526108e371a7 -r 21c9267f7983 lib/libm/noieee_src/n_j1.c
--- a/lib/libm/noieee_src/n_j1.c        Tue Jun 18 13:39:12 2002 +0000
+++ b/lib/libm/noieee_src/n_j1.c        Tue Jun 18 13:39:40 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: n_j1.c,v 1.4 1999/07/02 15:37:37 simonb Exp $  */
+/*     $NetBSD: n_j1.c,v 1.4.10.1 2002/06/18 13:39:49 lukem Exp $      */
 /*-
  * Copyright (c) 1992, 1993
  *     The Regents of the University of California.  All rights reserved.
@@ -124,9 +124,9 @@
 #define infnan(x) (0.0)
 #endif
 
-static double pone __P((double)), qone __P((double));
+static double pone (double), qone (double);
 
-static double
+static const double
 huge    = 1e300,
 zero    = 0.0,
 one    = 1.0,
@@ -146,8 +146,9 @@
 
 #define two_129        6.80564733841876926e+038        /* 2^129 */
 #define two_m54        5.55111512312578270e-017        /* 2^-54 */
-double j1(x)
-       double x;
+
+double
+j1(double x)
 {
        double z, s,c,ss,cc,r,u,v,y;
        y = fabs(x);
@@ -158,8 +159,7 @@
                        return (copysign(x, zero));
        }
        y = fabs(x);
-       if (y >= 2)                     /* |x| >= 2.0 */
-       {
+       if (y >= 2) {                   /* |x| >= 2.0 */
                s = sin(y);
                c = cos(y);
                ss = -s-c;
@@ -195,14 +195,14 @@
        return (x*0.5+r/s);
 }
 
-static double u0[5] = {
+static const double u0[5] = {
   -1.960570906462389484206891092512047539632e-0001,
    5.044387166398112572026169863174882070274e-0002,
   -1.912568958757635383926261729464141209569e-0003,
    2.352526005616105109577368905595045204577e-0005,
    -9.190991580398788465315411784276789663849e-0008,
 };
-static double v0[5] = {
+static const double v0[5] = {
    1.991673182366499064031901734535479833387e-0002,
    2.025525810251351806268483867032781294682e-0004,
    1.356088010975162198085369545564475416398e-0006,
@@ -210,8 +210,8 @@
    1.665592462079920695971450872592458916421e-0011,
 };
 
-double y1(x)
-       double x;
+double
+y1(double x)
 {
        double z, s, c, ss, cc, u, v;
     /* if Y1(NaN) is NaN, Y1(-inf) is NaN, Y1(inf) is 0 */
@@ -230,14 +230,12 @@
                else if(_IEEE) return (zero/zero);
                else return(infnan(EDOM));
        }
-        if (x >= 2)                     /* |x| >= 2.0 */



Home | Main Index | Thread Index | Old Index