diff options
author | Ulrich Drepper <drepper@redhat.com> | 2001-10-14 22:33:08 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2001-10-14 22:33:08 +0000 |
commit | 1f5649f86b7de5aec990e03f2700df36a01c2752 (patch) | |
tree | c6126aff7f80434c64f21dd6033215864afd57cd /sysdeps | |
parent | 459a31635e9fe474c05e995312fde318d7c4a5b0 (diff) | |
download | glibc-1f5649f86b7de5aec990e03f2700df36a01c2752.tar.gz glibc-1f5649f86b7de5aec990e03f2700df36a01c2752.tar.xz glibc-1f5649f86b7de5aec990e03f2700df36a01c2752.zip |
Update.
2001-10-14 Ulrich Drepper <drepper@redhat.com> * locale/programs/ld-collate.c (handle_ellipsis): Use %lX not %lx to generate hexadecimal identifier. Patch by Jungshik Shin <jungshik.shin@yale.edu>. 2001-10-09 Stephen L Moshier <moshier@mediaone.net> * sysdeps/ieee754/ldbl-96/s_cbrtl.c (__cbrtl): Fix algorithm. 2001-10-14 Ulrich Drepper <drepper@redhat.com> * sysdeps/ieee754/ldbl-128/e_powl.c: New file. * sysdeps/ieee754/ldbl-128/s_cbrtl.c: New file. Contributed by Stephen L Moshier <moshier@mediaone.net>. * sysdeps/ieee754/ldbl-128/e_j0l.c: Constify float variables. * sysdeps/ieee754/ldbl-128/e_j1l.c: Likewise. * sysdeps/ieee754/ldbl-128/e_lgammal_r.c: Likewise * sysdeps/ieee754/ldbl-128/s_erfl.c: Likewise * sysdeps/ieee754/ldbl-128/s_expm1l.c: Likewise * sysdeps/ieee754/ldbl-128/s_log1pl.c: Likewise * timezone/africa: Update from tzdata2001d. * timezone/asia: Likewise. * timezone/australasia: Likewise. * timezone/backward: Likewise. * timezone/europe: Likewise. * timezone/leapseconds: Likewise. * timezone/northamerica: Likewise. * timezone/southamerica: Likewise. * timezone/zone.tab: Likewise. 2001-10-09 Martin Schwidefsky <schwidefsky@de.ibm.com> * sysdeps/s390/s390-32/sys/ucontext.h: Correct __psw_t typedef. * sysdeps/s390/s390-64/sys/ucontext.h: Likewise.
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/ieee754/ldbl-128/e_j0l.c | 74 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/e_j1l.c | 74 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/e_lgammal_r.c | 150 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/e_powl.c | 422 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_cbrtl.c | 121 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_erfl.c | 106 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_expm1l.c | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-128/s_log1pl.c | 16 | ||||
-rw-r--r-- | sysdeps/ieee754/ldbl-96/s_cbrtl.c | 31 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h | 2 |
11 files changed, 770 insertions, 234 deletions
diff --git a/sysdeps/ieee754/ldbl-128/e_j0l.c b/sysdeps/ieee754/ldbl-128/e_j0l.c index e0a61f0658..a804f0a276 100644 --- a/sysdeps/ieee754/ldbl-128/e_j0l.c +++ b/sysdeps/ieee754/ldbl-128/e_j0l.c @@ -81,16 +81,16 @@ #include "math_private.h" /* 1 / sqrt(pi) */ -static long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L; +static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L; /* 2 / pi */ -static long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L; -static long double zero = 0.0L; +static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L; +static const long double zero = 0.0L; /* J0(x) = 1 - x^2/4 + x^2 x^2 R(x^2) Peak relative error 3.4e-37 0 <= x <= 2 */ #define NJ0_2N 6 -static long double J0_2N[NJ0_2N + 1] = { +static const long double J0_2N[NJ0_2N + 1] = { 3.133239376997663645548490085151484674892E16L, -5.479944965767990821079467311839107722107E14L, 6.290828903904724265980249871997551894090E12L, @@ -100,7 +100,7 @@ static long double J0_2N[NJ0_2N + 1] = { 1.562826808020631846245296572935547005859E2L, }; #define NJ0_2D 6 -static long double J0_2D[NJ0_2D + 1] = { +static const long double J0_2D[NJ0_2D + 1] = { 2.005273201278504733151033654496928968261E18L, 2.063038558793221244373123294054149790864E16L, 1.053350447931127971406896594022010524994E14L, @@ -115,7 +115,7 @@ static long double J0_2D[NJ0_2D + 1] = { 0 <= 1/x <= .0625 Peak relative error 3.3e-36 */ #define NP16_IN 9 -static long double P16_IN[NP16_IN + 1] = { +static const long double P16_IN[NP16_IN + 1] = { -1.901689868258117463979611259731176301065E-16L, -1.798743043824071514483008340803573980931E-13L, -6.481746687115262291873324132944647438959E-11L, @@ -128,7 +128,7 @@ static long double P16_IN[NP16_IN + 1] = { -1.271468546258855781530458854476627766233E-1L, }; #define NP16_ID 9 -static long double P16_ID[NP16_ID + 1] = { +static const long double P16_ID[NP16_ID + 1] = { 2.704625590411544837659891569420764475007E-15L, 2.562526347676857624104306349421985403573E-12L, 9.259137589952741054108665570122085036246E-10L, @@ -146,7 +146,7 @@ static long double P16_ID[NP16_ID + 1] = { 0.0625 <= 1/x <= 0.125 Peak relative error 2.4e-35 */ #define NP8_16N 10 -static long double P8_16N[NP8_16N + 1] = { +static const long double P8_16N[NP8_16N + 1] = { -2.335166846111159458466553806683579003632E-15L, -1.382763674252402720401020004169367089975E-12L, -3.192160804534716696058987967592784857907E-10L, @@ -160,7 +160,7 @@ static long double P8_16N[NP8_16N + 1] = { -1.670703190068873186016102289227646035035E-1L, }; #define NP8_16D 10 -static long double P8_16D[NP8_16D + 1] = { +static const long double P8_16D[NP8_16D + 1] = { 3.321126181135871232648331450082662856743E-14L, 1.971894594837650840586859228510007703641E-11L, 4.571144364787008285981633719513897281690E-9L, @@ -179,7 +179,7 @@ static long double P8_16D[NP8_16D + 1] = { 0.125 <= 1/x <= 0.1875 Peak relative error 2.7e-35 */ #define NP5_8N 10 -static long double P5_8N[NP5_8N + 1] = { +static const long double P5_8N[NP5_8N + 1] = { -1.270478335089770355749591358934012019596E-12L, -4.007588712145412921057254992155810347245E-10L, -4.815187822989597568124520080486652009281E-8L, @@ -193,7 +193,7 @@ static long double P5_8N[NP5_8N + 1] = { -8.920026499909994671248893388013790366712E-3L, }; #define NP5_8D 9 -static long double P5_8D[NP5_8D + 1] = { +static const long double P5_8D[NP5_8D + 1] = { 1.806902521016705225778045904631543990314E-11L, 5.728502760243502431663549179135868966031E-9L, 6.938168504826004255287618819550667978450E-7L, @@ -211,7 +211,7 @@ static long double P5_8D[NP5_8D + 1] = { Peak relative error 3.5e-35 0.1875 <= 1/x <= 0.25 */ #define NP4_5N 9 -static long double P4_5N[NP4_5N + 1] = { +static const long double P4_5N[NP4_5N + 1] = { -9.791405771694098960254468859195175708252E-10L, -1.917193059944531970421626610188102836352E-7L, -1.393597539508855262243816152893982002084E-5L, @@ -224,7 +224,7 @@ static long double P4_5N[NP4_5N + 1] = { -2.251804386252969656586810309252357233320E-1L, }; #define NP4_5D 9 -static long double P4_5D[NP4_5D + 1] = { +static const long double P4_5D[NP4_5D + 1] = { 1.392555487577717669739688337895791213139E-8L, 2.748886559120659027172816051276451376854E-6L, 2.024717710644378047477189849678576659290E-4L, @@ -242,7 +242,7 @@ static long double P4_5D[NP4_5D + 1] = { Peak relative error 2.3e-36 0.25 <= 1/x <= 0.3125 */ #define NP3r2_4N 9 -static long double P3r2_4N[NP3r2_4N + 1] = { +static const long double P3r2_4N[NP3r2_4N + 1] = { -2.589155123706348361249809342508270121788E-8L, -3.746254369796115441118148490849195516593E-6L, -1.985595497390808544622893738135529701062E-4L, @@ -255,7 +255,7 @@ static long double P3r2_4N[NP3r2_4N + 1] = { -2.518966692256192789269859830255724429375E-1L, }; #define NP3r2_4D 9 -static long double P3r2_4D[NP3r2_4D + 1] = { +static const long double P3r2_4D[NP3r2_4D + 1] = { 3.682353957237979993646169732962573930237E-7L, 5.386741661883067824698973455566332102029E-5L, 2.906881154171822780345134853794241037053E-3L, @@ -273,7 +273,7 @@ static long double P3r2_4D[NP3r2_4D + 1] = { Peak relative error 1.0e-35 0.3125 <= 1/x <= 0.375 */ #define NP2r7_3r2N 9 -static long double P2r7_3r2N[NP2r7_3r2N + 1] = { +static const long double P2r7_3r2N[NP2r7_3r2N + 1] = { -1.917322340814391131073820537027234322550E-7L, -1.966595744473227183846019639723259011906E-5L, -7.177081163619679403212623526632690465290E-4L, @@ -286,7 +286,7 @@ static long double P2r7_3r2N[NP2r7_3r2N + 1] = { -4.098025357743657347681137871388402849581E-3L, }; #define NP2r7_3r2D 8 -static long double P2r7_3r2D[NP2r7_3r2D + 1] = { +static const long double P2r7_3r2D[NP2r7_3r2D + 1] = { 2.726858489303036441686496086962545034018E-6L, 2.840430827557109238386808968234848081424E-4L, 1.063826772041781947891481054529454088832E-2L, @@ -303,7 +303,7 @@ static long double P2r7_3r2D[NP2r7_3r2D + 1] = { Peak relative error 1.3e-36 0.3125 <= 1/x <= 0.4375 */ #define NP2r3_2r7N 9 -static long double P2r3_2r7N[NP2r3_2r7N + 1] = { +static const long double P2r3_2r7N[NP2r3_2r7N + 1] = { -1.594642785584856746358609622003310312622E-6L, -1.323238196302221554194031733595194539794E-4L, -3.856087818696874802689922536987100372345E-3L, @@ -316,7 +316,7 @@ static long double P2r3_2r7N[NP2r3_2r7N + 1] = { -3.246859189246653459359775001466924610236E-3L, }; #define NP2r3_2r7D 8 -static long double P2r3_2r7D[NP2r3_2r7D + 1] = { +static const long double P2r3_2r7D[NP2r3_2r7D + 1] = { 2.267936634217251403663034189684284173018E-5L, 1.918112982168673386858072491437971732237E-3L, 5.771704085468423159125856786653868219522E-2L, @@ -333,7 +333,7 @@ static long double P2r3_2r7D[NP2r3_2r7D + 1] = { Peak relative error 1.2e-35 0.4375 <= 1/x <= 0.5 */ #define NP2_2r3N 8 -static long double P2_2r3N[NP2_2r3N + 1] = { +static const long double P2_2r3N[NP2_2r3N + 1] = { -1.001042324337684297465071506097365389123E-4L, -6.289034524673365824853547252689991418981E-3L, -1.346527918018624234373664526930736205806E-1L, @@ -345,7 +345,7 @@ static long double P2_2r3N[NP2_2r3N + 1] = { -3.000348318524471807839934764596331810608E-1L, }; #define NP2_2r3D 8 -static long double P2_2r3D[NP2_2r3D + 1] = { +static const long double P2_2r3D[NP2_2r3D + 1] = { 1.423705538269770974803901422532055612980E-3L, 9.171476630091439978533535167485230575894E-2L, 2.049776318166637248868444600215942828537E0L, @@ -363,7 +363,7 @@ static long double P2_2r3D[NP2_2r3D + 1] = { Peak relative error 2.2e-35 0 <= 1/x <= .0625 */ #define NQ16_IN 10 -static long double Q16_IN[NQ16_IN + 1] = { +static const long double Q16_IN[NQ16_IN + 1] = { 2.343640834407975740545326632205999437469E-18L, 2.667978112927811452221176781536278257448E-15L, 1.178415018484555397390098879501969116536E-12L, @@ -377,7 +377,7 @@ static long double Q16_IN[NQ16_IN + 1] = { 1.107891967702173292405380993183694932208E-2L, }; #define NQ16_ID 9 -static long double Q16_ID[NQ16_ID + 1] = { +static const long double Q16_ID[NQ16_ID + 1] = { 3.199850952578356211091219295199301766718E-17L, 3.652601488020654842194486058637953363918E-14L, 1.620179741394865258354608590461839031281E-11L, @@ -396,7 +396,7 @@ static long double Q16_ID[NQ16_ID + 1] = { Peak relative error 5.1e-36 0.0625 <= 1/x <= 0.125 */ #define NQ8_16N 11 -static long double Q8_16N[NQ8_16N + 1] = { +static const long double Q8_16N[NQ8_16N + 1] = { 1.001954266485599464105669390693597125904E-17L, 7.545499865295034556206475956620160007849E-15L, 2.267838684785673931024792538193202559922E-12L, @@ -411,7 +411,7 @@ static long double Q8_16N[NQ8_16N + 1] = { 7.598886310387075708640370806458926458301E-2L, }; #define NQ8_16D 11 -static long double Q8_16D[NQ8_16D + 1] = { +static const long double Q8_16D[NQ8_16D + 1] = { 1.368001558508338469503329967729951830843E-16L, 1.034454121857542147020549303317348297289E-13L, 3.128109209247090744354764050629381674436E-11L, @@ -432,7 +432,7 @@ static long double Q8_16D[NQ8_16D + 1] = { Peak relative error 3.9e-35 0.125 <= 1/x <= 0.1875 */ #define NQ5_8N 10 -static long double Q5_8N[NQ5_8N + 1] = { +static const long double Q5_8N[NQ5_8N + 1] = { 1.750399094021293722243426623211733898747E-13L, 6.483426211748008735242909236490115050294E-11L, 9.279430665656575457141747875716899958373E-9L, @@ -446,7 +446,7 @@ static long double Q5_8N[NQ5_8N + 1] = { 8.383984859679804095463699702165659216831E-2L, }; #define NQ5_8D 10 -static long double Q5_8D[NQ5_8D + 1] = { +static const long double Q5_8D[NQ5_8D + 1] = { 2.389878229704327939008104855942987615715E-12L, 8.926142817142546018703814194987786425099E-10L, 1.294065862406745901206588525833274399038E-7L, @@ -466,7 +466,7 @@ static long double Q5_8D[NQ5_8D + 1] = { Peak relative error 3.2e-35 0.1875 <= 1/x <= 0.25 */ #define NQ4_5N 10 -static long double Q4_5N[NQ4_5N + 1] = { +static const long double Q4_5N[NQ4_5N + 1] = { 2.233870042925895644234072357400122854086E-11L, 5.146223225761993222808463878999151699792E-9L, 4.459114531468296461688753521109797474523E-7L, @@ -480,7 +480,7 @@ static long double Q4_5N[NQ4_5N + 1] = { 1.941595365256460232175236758506411486667E-3L, }; #define NQ4_5D 9 -static long double Q4_5D[NQ4_5D + 1] = { +static const long double Q4_5D[NQ4_5D + 1] = { 3.049977232266999249626430127217988047453E-10L, 7.120883230531035857746096928889676144099E-8L, 6.301786064753734446784637919554359588859E-6L, @@ -499,7 +499,7 @@ static long double Q4_5D[NQ4_5D + 1] = { Peak relative error 1.4e-36 0.25 <= 1/x <= 0.3125 */ #define NQ3r2_4N 10 -static long double Q3r2_4N[NQ3r2_4N + 1] = { +static const long double Q3r2_4N[NQ3r2_4N + 1] = { 6.126167301024815034423262653066023684411E-10L, 1.043969327113173261820028225053598975128E-7L, 6.592927270288697027757438170153763220190E-6L, @@ -513,7 +513,7 @@ static long double Q3r2_4N[NQ3r2_4N + 1] = { 1.229509543620976530030153018986910810747E-3L, }; #define NQ3r2_4D 9 -static long double Q3r2_4D[NQ3r2_4D + 1] = { +static const long double Q3r2_4D[NQ3r2_4D + 1] = { 8.364260446128475461539941389210166156568E-9L, 1.451301850638956578622154585560759862764E-6L, 9.431830010924603664244578867057141839463E-5L, @@ -532,7 +532,7 @@ static long double Q3r2_4D[NQ3r2_4D + 1] = { Peak relative error 3.8e-36 0.3125 <= 1/x <= 0.375 */ #define NQ2r7_3r2N 9 -static long double Q2r7_3r2N[NQ2r7_3r2N + 1] = { +static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = { 7.584861620402450302063691901886141875454E-8L, 9.300939338814216296064659459966041794591E-6L, 4.112108906197521696032158235392604947895E-4L, @@ -545,7 +545,7 @@ static long double Q2r7_3r2N[NQ2r7_3r2N + 1] = { 9.805848115375053300608712721986235900715E-2L, }; #define NQ2r7_3r2D 9 -static long double Q2r7_3r2D[NQ2r7_3r2D + 1] = { +static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = { 1.035586492113036586458163971239438078160E-6L, 1.301999337731768381683593636500979713689E-4L, 5.993695702564527062553071126719088859654E-3L, @@ -564,7 +564,7 @@ static long double Q2r7_3r2D[NQ2r7_3r2D + 1] = { Peak relative error 2.2e-35 0.375 <= 1/x <= 0.4375 */ #define NQ2r3_2r7N 9 -static long double Q2r3_2r7N[NQ2r3_2r7N + 1] = { +static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = { 4.455027774980750211349941766420190722088E-7L, 4.031998274578520170631601850866780366466E-5L, 1.273987274325947007856695677491340636339E-3L, @@ -577,7 +577,7 @@ static long double Q2r3_2r7N[NQ2r3_2r7N + 1] = { 7.261345286655345047417257611469066147561E-4L, }; #define NQ2r3_2r7D 8 -static long double Q2r3_2r7D[NQ2r3_2r7D + 1] = { +static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = { 6.082600739680555266312417978064954793142E-6L, 5.693622538165494742945717226571441747567E-4L, 1.901625907009092204458328768129666975975E-2L, @@ -595,7 +595,7 @@ static long double Q2r3_2r7D[NQ2r3_2r7D + 1] = { Peak relative error 3.1e-36 0.4375 <= 1/x <= 0.5 */ #define NQ2_2r3N 9 -static long double Q2_2r3N[NQ2_2r3N + 1] = { +static const long double Q2_2r3N[NQ2_2r3N + 1] = { 2.817566786579768804844367382809101929314E-6L, 2.122772176396691634147024348373539744935E-4L, 5.501378031780457828919593905395747517585E-3L, @@ -608,7 +608,7 @@ static long double Q2_2r3N[NQ2_2r3N + 1] = { 5.317668723070450235320878117210807236375E-4L, }; #define NQ2_2r3D 8 -static long double Q2_2r3D[NQ2_2r3D + 1] = { +static const long double Q2_2r3D[NQ2_2r3D + 1] = { 3.846924354014260866793741072933159380158E-5L, 3.017562820057704325510067178327449946763E-3L, 8.356305620686867949798885808540444210935E-2L, diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c index c564237ac1..ad899be3de 100644 --- a/sysdeps/ieee754/ldbl-128/e_j1l.c +++ b/sysdeps/ieee754/ldbl-128/e_j1l.c @@ -88,16 +88,16 @@ extern long double sqrtl (long double); extern long double logl (long double); /* 1 / sqrt(pi) */ -static long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L; +static const long double ONEOSQPI = 5.6418958354775628694807945156077258584405E-1L; /* 2 / pi */ -static long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L; -static long double zero = 0.0L; +static const long double TWOOPI = 6.3661977236758134307553505349005744813784E-1L; +static const long double zero = 0.0L; /* J1(x) = .5x + x x^2 R(x^2) Peak relative error 1.9e-35 0 <= x <= 2 */ #define NJ0_2N 6 -static long double J0_2N[NJ0_2N + 1] = { +static const long double J0_2N[NJ0_2N + 1] = { -5.943799577386942855938508697619735179660E16L, 1.812087021305009192259946997014044074711E15L, -2.761698314264509665075127515729146460895E13L, @@ -107,7 +107,7 @@ static long double J0_2N[NJ0_2N + 1] = { -1.559552840946694171346552770008812083969E3L }; #define NJ0_2D 6 -static long double J0_2D[NJ0_2D + 1] = { +static const long double J0_2D[NJ0_2D + 1] = { 9.510079323819108569501613916191477479397E17L, 1.063193817503280529676423936545854693915E16L, 5.934143516050192600795972192791775226920E13L, @@ -122,7 +122,7 @@ static long double J0_2D[NJ0_2D + 1] = { 0 <= 1/x <= .0625 Peak relative error 3.6e-36 */ #define NP16_IN 9 -static long double P16_IN[NP16_IN + 1] = { +static const long double P16_IN[NP16_IN + 1] = { 5.143674369359646114999545149085139822905E-16L, 4.836645664124562546056389268546233577376E-13L, 1.730945562285804805325011561498453013673E-10L, @@ -135,7 +135,7 @@ static long double P16_IN[NP16_IN + 1] = { 3.032580002220628812728954785118117124520E-1L, }; #define NP16_ID 9 -static long double P16_ID[NP16_ID + 1] = { +static const long double P16_ID[NP16_ID + 1] = { 4.389268795186898018132945193912677177553E-15L, 4.132671824807454334388868363256830961655E-12L, 1.482133328179508835835963635130894413136E-9L, @@ -153,7 +153,7 @@ static long double P16_ID[NP16_ID + 1] = { 0.0625 <= 1/x <= 0.125 Peak relative error 1.9e-36 */ #define NP8_16N 11 -static long double P8_16N[NP8_16N + 1] = { +static const long double P8_16N[NP8_16N + 1] = { 2.984612480763362345647303274082071598135E-16L, 1.923651877544126103941232173085475682334E-13L, 4.881258879388869396043760693256024307743E-11L, @@ -168,7 +168,7 @@ static long double P8_16N[NP8_16N + 1] = { 2.991314703282528370270179989044994319374E-2L, }; #define NP8_16D 10 -static long double P8_16D[NP8_16D + 1] = { +static const long double P8_16D[NP8_16D + 1] = { 2.546869316918069202079580939942463010937E-15L, 1.644650111942455804019788382157745229955E-12L, 4.185430770291694079925607420808011147173E-10L, @@ -187,7 +187,7 @@ static long double P8_16D[NP8_16D + 1] = { 0.125 <= 1/x <= 0.1875 Peak relative error 1.3e-36 */ #define NP5_8N 10 -static long double P5_8N[NP5_8N + 1] = { +static const long double P5_8N[NP5_8N + 1] = { 2.837678373978003452653763806968237227234E-12L, 9.726641165590364928442128579282742354806E-10L, 1.284408003604131382028112171490633956539E-7L, @@ -201,7 +201,7 @@ static long double P5_8N[NP5_8N + 1] = { 5.465927698800862172307352821870223855365E-1L }; #define NP5_8D 10 -static long double P5_8D[NP5_8D + 1] = { +static const long double P5_8D[NP5_8D + 1] = { 2.421485545794616609951168511612060482715E-11L, 8.329862750896452929030058039752327232310E-9L, 1.106137992233383429630592081375289010720E-6L, @@ -220,7 +220,7 @@ static long double P5_8D[NP5_8D + 1] = { Peak relative error 1.4e-36 0.1875 <= 1/x <= 0.25 */ #define NP4_5N 10 -static long double P4_5N[NP4_5N + 1] = { +static const long double P4_5N[NP4_5N + 1] = { 1.846029078268368685834261260420933914621E-10L, 3.916295939611376119377869680335444207768E-8L, 3.122158792018920627984597530935323997312E-6L, @@ -234,7 +234,7 @@ static long double P4_5N[NP4_5N + 1] = { 1.804473805689725610052078464951722064757E-2L, }; #define NP4_5D 9 -static long double P4_5D[NP4_5D + 1] = { +static const long double P4_5D[NP4_5D + 1] = { 1.575278146806816970152174364308980863569E-9L, 3.361289173657099516191331123405675054321E-7L, 2.704692281550877810424745289838790693708E-5L, @@ -252,7 +252,7 @@ static long double P4_5D[NP4_5D + 1] = { Peak relative error 3.0e-36 0.25 <= 1/x <= 0.3125 */ #define NP3r2_4N 9 -static long double P3r2_4N[NP3r2_4N + 1] = { +static const long double P3r2_4N[NP3r2_4N + 1] = { 8.240803130988044478595580300846665863782E-8L, 1.179418958381961224222969866406483744580E-5L, 6.179787320956386624336959112503824397755E-4L, @@ -265,7 +265,7 @@ static long double P3r2_4N[NP3r2_4N + 1] = { 7.299530852495776936690976966995187714739E-1L, }; #define NP3r2_4D 9 -static long double P3r2_4D[NP3r2_4D + 1] = { +static const long double P3r2_4D[NP3r2_4D + 1] = { 7.032152009675729604487575753279187576521E-7L, 1.015090352324577615777511269928856742848E-4L, 5.394262184808448484302067955186308730620E-3L, @@ -283,7 +283,7 @@ static long double P3r2_4D[NP3r2_4D + 1] = { Peak relative error 1.0e-35 0.3125 <= 1/x <= 0.375 */ #define NP2r7_3r2N 9 -static long double P2r7_3r2N[NP2r7_3r2N + 1] = { +static const long double P2r7_3r2N[NP2r7_3r2N + 1] = { 4.599033469240421554219816935160627085991E-7L, 4.665724440345003914596647144630893997284E-5L, 1.684348845667764271596142716944374892756E-3L, @@ -296,7 +296,7 @@ static long double P2r7_3r2N[NP2r7_3r2N + 1] = { 1.316470424456061252962568223251247207325E-2L, }; #define NP2r7_3r2D 8 -static long double P2r7_3r2D[NP2r7_3r2D + 1] = { +static const long double P2r7_3r2D[NP2r7_3r2D + 1] = { 3.924508608545520758883457108453520099610E-6L, 4.029707889408829273226495756222078039823E-4L, 1.484629715787703260797886463307469600219E-2L, @@ -313,7 +313,7 @@ static long double P2r7_3r2D[NP2r7_3r2D + 1] = { Peak relative error 1.7e-36 0.3125 <= 1/x <= 0.4375 */ #define NP2r3_2r7N 9 -static long double P2r3_2r7N[NP2r3_2r7N + 1] = { +static const long double P2r3_2r7N[NP2r3_2r7N + 1] = { 3.916766777108274628543759603786857387402E-6L, 3.212176636756546217390661984304645137013E-4L, 9.255768488524816445220126081207248947118E-3L, @@ -326,7 +326,7 @@ static long double P2r3_2r7N[NP2r3_2r7N + 1] = { 1.109902737860249670981355149101343427885E-2L, }; #define NP2r3_2r7D 8 -static long double P2r3_2r7D[NP2r3_2r7D + 1] = { +static const long double P2r3_2r7D[NP2r3_2r7D + 1] = { 3.342307880794065640312646341190547184461E-5L, 2.782182891138893201544978009012096558265E-3L, 8.221304931614200702142049236141249929207E-2L, @@ -343,7 +343,7 @@ static long double P2r3_2r7D[NP2r3_2r7D + 1] = { Peak relative error 1.7e-35 0.4375 <= 1/x <= 0.5 */ #define NP2_2r3N 8 -static long double P2_2r3N[NP2_2r3N + 1] = { +static const long double P2_2r3N[NP2_2r3N + 1] = { 3.397930802851248553545191160608731940751E-4L, 2.104020902735482418784312825637833698217E-2L, 4.442291771608095963935342749477836181939E-1L, @@ -355,7 +355,7 @@ static long double P2_2r3N[NP2_2r3N + 1] = { 9.455702270242780642835086549285560316461E-1L, }; #define NP2_2r3D 8 -static long double P2_2r3D[NP2_2r3D + 1] = { +static const long double P2_2r3D[NP2_2r3D + 1] = { 2.899568897241432883079888249845707400614E-3L, 1.831107138190848460767699919531132426356E-1L, 3.999350044057883839080258832758908825165E0L, @@ -373,7 +373,7 @@ static long double P2_2r3D[NP2_2r3D + 1] = { Peak relative error 8.0e-36 0 <= 1/x <= .0625 */ #define NQ16_IN 10 -static long double Q16_IN[NQ16_IN + 1] = { +static const long double Q16_IN[NQ16_IN + 1] = { -3.917420835712508001321875734030357393421E-18L, -4.440311387483014485304387406538069930457E-15L, -1.951635424076926487780929645954007139616E-12L, @@ -387,7 +387,7 @@ static long double Q16_IN[NQ16_IN + 1] = { -1.922298704033332356899546792898156493887E-2L, }; #define NQ16_ID 9 -static long double Q16_ID[NQ16_ID + 1] = { +static const long double Q16_ID[NQ16_ID + 1] = { 3.820418034066293517479619763498400162314E-17L, 4.340702810799239909648911373329149354911E-14L, 1.914985356383416140706179933075303538524E-11L, @@ -406,7 +406,7 @@ static long double Q16_ID[NQ16_ID + 1] = { Peak relative error 1.9e-36 0.0625 <= 1/x <= 0.125 */ #define NQ8_16N 11 -static long double Q8_16N[NQ8_16N + 1] = { +static const long double Q8_16N[NQ8_16N + 1] = { -2.028630366670228670781362543615221542291E-17L, -1.519634620380959966438130374006858864624E-14L, -4.540596528116104986388796594639405114524E-12L, @@ -421,7 +421,7 @@ static long double Q8_16N[NQ8_16N + 1] = { -1.365364204556573800719985118029601401323E-1L, }; #define NQ8_16D 11 -static long double Q8_16D[NQ8_16D + 1] = { +static const long double Q8_16D[NQ8_16D + 1] = { 1.978397614733632533581207058069628242280E-16L, 1.487361156806202736877009608336766720560E-13L, 4.468041406888412086042576067133365913456E-11L, @@ -442,7 +442,7 @@ static long double Q8_16D[NQ8_16D + 1] = { Peak relative error 1.5e-35 0.125 <= 1/x <= 0.1875 */ #define NQ5_8N 10 -static long double Q5_8N[NQ5_8N + 1] = { +static const long double Q5_8N[NQ5_8N + 1] = { -3.656082407740970534915918390488336879763E-13L, -1.344660308497244804752334556734121771023E-10L, -1.909765035234071738548629788698150760791E-8L, @@ -456,7 +456,7 @@ static long double Q5_8N[NQ5_8N + 1] = { -1.549000892545288676809660828213589804884E-1L, }; #define NQ5_8D 10 -static long double Q5_8D[NQ5_8D + 1] = { +static const long double Q5_8D[NQ5_8D + 1] = { 3.565550843359501079050699598913828460036E-12L, 1.321016015556560621591847454285330528045E-9L, 1.897542728662346479999969679234270605975E-7L, @@ -476,7 +476,7 @@ static long double Q5_8D[NQ5_8D + 1] = { Peak relative error 1.3e-35 0.1875 <= 1/x <= 0.25 */ #define NQ4_5N 10 -static long double Q4_5N[NQ4_5N + 1] = { +static const long double Q4_5N[NQ4_5N + 1] = { -4.079513568708891749424783046520200903755E-11L, -9.326548104106791766891812583019664893311E-9L, -8.016795121318423066292906123815687003356E-7L, @@ -490,7 +490,7 @@ static long double Q4_5N[NQ4_5N + 1] = { -4.320429862021265463213168186061696944062E-3L, }; #define NQ4_5D 9 -static long double Q4_5D[NQ4_5D + 1] = { +static const long double Q4_5D[NQ4_5D + 1] = { 3.978497042580921479003851216297330701056E-10L, 9.203304163828145809278568906420772246666E-8L, 8.059685467088175644915010485174545743798E-6L, @@ -509,7 +509,7 @@ static long double Q4_5D[NQ4_5D + 1] = { Peak relative error 2.1e-35 0.25 <= 1/x <= 0.3125 */ #define NQ3r2_4N 9 -static long double Q3r2_4N[NQ3r2_4N + 1] = { +static const long double Q3r2_4N[NQ3r2_4N + 1] = { -1.087480809271383885936921889040388133627E-8L, -1.690067828697463740906962973479310170932E-6L, -9.608064416995105532790745641974762550982E-5L, @@ -522,7 +522,7 @@ static long double Q3r2_4N[NQ3r2_4N + 1] = { -1.812932453006641348145049323713469043328E-1L, }; #define NQ3r2_4D 9 -static long double Q3r2_4D[NQ3r2_4D + 1] = { +static const long double Q3r2_4D[NQ3r2_4D + 1] = { 1.060552717496912381388763753841473407026E-7L, 1.676928002024920520786883649102388708024E-5L, 9.803481712245420839301400601140812255737E-4L, @@ -541,7 +541,7 @@ static long double Q3r2_4D[NQ3r2_4D + 1] = { Peak relative error 1.6e-36 0.3125 <= 1/x <= 0.375 */ #define NQ2r7_3r2N 9 -static long double Q2r7_3r2N[NQ2r7_3r2N + 1] = { +static const long double Q2r7_3r2N[NQ2r7_3r2N + 1] = { -1.723405393982209853244278760171643219530E-7L, -2.090508758514655456365709712333460087442E-5L, -9.140104013370974823232873472192719263019E-4L, @@ -554,7 +554,7 @@ static long double Q2r7_3r2N[NQ2r7_3r2N + 1] = { -1.930796319299022954013840684651016077770E-1L, }; #define NQ2r7_3r2D 9 -static long double Q2r7_3r2D[NQ2r7_3r2D + 1] = { +static const long double Q2r7_3r2D[NQ2r7_3r2D + 1] = { 1.680730662300831976234547482334347983474E-6L, 2.084241442440551016475972218719621841120E-4L, 9.445316642108367479043541702688736295579E-3L, @@ -573,7 +573,7 @@ static long double Q2r7_3r2D[NQ2r7_3r2D + 1] = { Peak relative error 9.5e-36 0.375 <= 1/x <= 0.4375 */ #define NQ2r3_2r7N 9 -static long double Q2r3_2r7N[NQ2r3_2r7N + 1] = { +static const long double Q2r3_2r7N[NQ2r3_2r7N + 1] = { -8.603042076329122085722385914954878953775E-7L, -7.701746260451647874214968882605186675720E-5L, -2.407932004380727587382493696877569654271E-3L, @@ -586,7 +586,7 @@ static long double Q2r3_2r7N[NQ2r3_2r7N + 1] = { -1.890595651683552228232308756569450822905E-3L, }; #define NQ2r3_2r7D 8 -static long double Q2r3_2r7D[NQ2r3_2r7D + 1] = { +static const long double Q2r3_2r7D[NQ2r3_2r7D + 1] = { 8.390017524798316921170710533381568175665E-6L, 7.738148683730826286477254659973968763659E-4L, 2.541480810958665794368759558791634341779E-2L, @@ -604,7 +604,7 @@ static long double Q2r3_2r7D[NQ2r3_2r7D + 1] = { Peak relative error 1.4e-36 0.4375 <= 1/x <= 0.5 */ #define NQ2_2r3N 9 -static long double Q2_2r3N[NQ2_2r3N + 1] = { +static const long double Q2_2r3N[NQ2_2r3N + 1] = { -5.552507516089087822166822364590806076174E-6L, -4.135067659799500521040944087433752970297E-4L, -1.059928728869218962607068840646564457980E-2L, @@ -617,7 +617,7 @@ static long double Q2_2r3N[NQ2_2r3N + 1] = { -1.458550613639093752909985189067233504148E-3L, }; #define NQ2_2r3D 8 -static long double Q2_2r3D[NQ2_2r3D + 1] = { +static const long double Q2_2r3D[NQ2_2r3D + 1] = { 5.415024336507980465169023996403597916115E-5L, 4.179246497380453022046357404266022870788E-3L, 1.136306384261959483095442402929502368598E-1L, diff --git a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c index 8adcccc6fc..9537f12b5c 100644 --- a/sysdeps/ieee754/ldbl-128/e_lgammal_r.c +++ b/sysdeps/ieee754/ldbl-128/e_lgammal_r.c @@ -57,18 +57,18 @@ #include "math.h" #include "math_private.h" -static long double PIL = 3.1415926535897932384626433832795028841972E0L; -static long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L; -static long double one = 1.0L; -static long double zero = 0.0L; -static long double huge = 1.0e4000L; +static const long double PIL = 3.1415926535897932384626433832795028841972E0L; +static const long double MAXLGM = 1.0485738685148938358098967157129705071571E4928L; +static const long double one = 1.0L; +static const long double zero = 0.0L; +static const long double huge = 1.0e4000L; /* log gamma(x) = ( x - 0.5 ) * log(x) - x + LS2PI + 1/x P(1/x^2) 1/x <= 0.0741 (x >= 13.495...) Peak relative error 1.5e-36 */ -static long double ls2pi = 9.1893853320467274178032973640561763986140E-1L; +static const long double ls2pi = 9.1893853320467274178032973640561763986140E-1L; #define NRASY 12 -static long double RASY[NRASY + 1] = +static const long double RASY[NRASY + 1] = { 8.333333333333333333333333333310437112111E-2L, -2.777777777777777777777774789556228296902E-3L, @@ -90,10 +90,10 @@ static long double RASY[NRASY + 1] = -0.5 <= x <= 0.5 12.5 <= x+13 <= 13.5 Peak relative error 1.1e-36 */ -static long double lgam13a = 1.9987213134765625E1L; -static long double lgam13b = 1.3608962611495173623870550785125024484248E-6L; +static const long double lgam13a = 1.9987213134765625E1L; +static const long double lgam13b = 1.3608962611495173623870550785125024484248E-6L; #define NRN13 7 -static long double RN13[NRN13 + 1] = +static const long double RN13[NRN13 + 1] = { 8.591478354823578150238226576156275285700E11L, 2.347931159756482741018258864137297157668E11L, @@ -105,7 +105,7 @@ static long double RN13[NRN13 + 1] = 6.850783280018706668924952057996075215223E0L }; #define NRD13 6 -static long double RD13[NRD13 + 1] = +static const long double RD13[NRD13 + 1] = { 3.401225382297342302296607039352935541669E11L, 8.756765276918037910363513243563234551784E10L, @@ -122,10 +122,10 @@ static long double RD13[NRD13 + 1] = -0.5 <= x <= 0.5 11.5 <= x+12 <= 12.5 Peak relative error 4.1e-36 */ -static long double lgam12a = 1.75023040771484375E1L; -static long double lgam12b = 3.7687254483392876529072161996717039575982E-6L; +static const long double lgam12a = 1.75023040771484375E1L; +static const long double lgam12b = 3.7687254483392876529072161996717039575982E-6L; #define NRN12 7 -static long double RN12[NRN12 + 1] = +static const long double RN12[NRN12 + 1] = { 4.709859662695606986110997348630997559137E11L, 1.398713878079497115037857470168777995230E11L, @@ -137,7 +137,7 @@ static long double RN12[NRN12 + 1] = 6.769610657004672719224614163196946862747E0L }; #define NRD12 6 -static long double RD12[NRD12 + 1] = +static const long double RD12[NRD12 + 1] = { 1.928167007860968063912467318985802726613E11L, 5.383198282277806237247492369072266389233E10L, @@ -154,10 +154,10 @@ static long double RD12[NRD12 + 1] = -0.5 <= x <= 0.5 10.5 <= x+11 <= 11.5 Peak relative error 1.8e-35 */ -static long double lgam11a = 1.5104400634765625E1L; -static long double lgam11b = 1.1938309890295225709329251070371882250744E-5L; +static const long double lgam11a = 1.5104400634765625E1L; +static const long double lgam11b = 1.1938309890295225709329251070371882250744E-5L; #define NRN11 7 -static long double RN11[NRN11 + 1] = +static const long double RN11[NRN11 + 1] = { 2.446960438029415837384622675816736622795E11L, 7.955444974446413315803799763901729640350E10L, @@ -169,7 +169,7 @@ static long double RN11[NRN11 + 1] = 6.681356101133728289358838690666225691363E0L }; #define NRD11 6 -static long double RD11[NRD11 + 1] = +static const long double RD11[NRD11 + 1] = { 1.040483786179428590683912396379079477432E11L, 3.172251138489229497223696648369823779729E10L, @@ -186,10 +186,10 @@ static long double RD11[NRD11 + 1] = -0.5 <= x <= 0.5 9.5 <= x+10 <= 10.5 Peak relative error 5.4e-37 */ -static long double lgam10a = 1.280181884765625E1L; -static long double lgam10b = 8.6324252196112077178745667061642811492557E-6L; +static const long double lgam10a = 1.280181884765625E1L; +static const long double lgam10b = 8.6324252196112077178745667061642811492557E-6L; #define NRN10 7 -static long double RN10[NRN10 + 1] = +static const long double RN10[NRN10 + 1] = { -1.239059737177249934158597996648808363783E14L, -4.725899566371458992365624673357356908719E13L, @@ -201,7 +201,7 @@ static long double RN10[NRN10 + 1] = -2.350975266781548931856017239843273049384E4L }; #define NRD10 7 -static long double RD10[NRD10 + 1] = +static const long double RD10[NRD10 + 1] = { -5.502645997581822567468347817182347679552E13L, -1.970266640239849804162284805400136473801E13L, @@ -219,10 +219,10 @@ static long double RD10[NRD10 + 1] = -0.5 <= x <= 0.5 8.5 <= x+9 <= 9.5 Peak relative error 3.6e-36 */ -static long double lgam9a = 1.06045989990234375E1L; -static long double lgam9b = 3.9037218127284172274007216547549861681400E-6L; +static const long double lgam9a = 1.06045989990234375E1L; +static const long double lgam9b = 3.9037218127284172274007216547549861681400E-6L; #define NRN9 7 -static long double RN9[NRN9 + 1] = +static const long double RN9[NRN9 + 1] = { -4.936332264202687973364500998984608306189E13L, -2.101372682623700967335206138517766274855E13L, @@ -234,7 +234,7 @@ static long double RN9[NRN9 + 1] = -2.036280038903695980912289722995505277253E4L }; #define NRD9 7 -static long double RD9[NRD9 + 1] = +static const long double RD9[NRD9 + 1] = { -2.306006080437656357167128541231915480393E13L, -9.183606842453274924895648863832233799950E12L, @@ -252,10 +252,10 @@ static long double RD9[NRD9 + 1] = -0.5 <= x <= 0.5 7.5 <= x+8 <= 8.5 Peak relative error 2.4e-37 */ -static long double lgam8a = 8.525146484375E0L; -static long double lgam8b = 1.4876690414300165531036347125050759667737E-5L; +static const long double lgam8a = 8.525146484375E0L; +static const long double lgam8b = 1.4876690414300165531036347125050759667737E-5L; #define NRN8 8 -static long double RN8[NRN8 + 1] = +static const long double RN8[NRN8 + 1] = { 6.600775438203423546565361176829139703289E11L, 3.406361267593790705240802723914281025800E11L, @@ -268,7 +268,7 @@ static long double RN8[NRN8 + 1] = 6.596977510622195827183948478627058738034E0L }; #define NRD8 7 -static long double RD8[NRD8 + 1] = +static const long double RD8[NRD8 + 1] = { 3.274776546520735414638114828622673016920E11L, 1.581811207929065544043963828487733970107E11L, @@ -286,10 +286,10 @@ static long double RD8[NRD8 + 1] = -0.5 <= x <= 0.5 6.5 <= x+7 <= 7.5 Peak relative error 3.2e-36 */ -static long double lgam7a = 6.5792388916015625E0L; -static long double lgam7b = 1.2320408538495060178292903945321122583007E-5L; +static const long double lgam7a = 6.5792388916015625E0L; +static const long double lgam7b = 1.2320408538495060178292903945321122583007E-5L; #define NRN7 8 -static long double RN7[NRN7 + 1] = +static const long double RN7[NRN7 + 1] = { 2.065019306969459407636744543358209942213E11L, 1.226919919023736909889724951708796532847E11L, @@ -302,7 +302,7 @@ static long double RN7[NRN7 + 1] = 6.460280377802030953041566617300902020435E0L }; #define NRD7 7 -static long double RD7[NRD7 + 1] = +static const long double RD7[NRD7 + 1] = { 1.102646614598516998880874785339049304483E11L, 6.099297512712715445879759589407189290040E10L, @@ -320,10 +320,10 @@ static long double RD7[NRD7 + 1] = -0.5 <= x <= 0.5 5.5 <= x+6 <= 6.5 Peak relative error 6.2e-37 */ -static long double lgam6a = 4.7874908447265625E0L; -static long double lgam6b = 8.9805548349424770093452324304839959231517E-7L; +static const long double lgam6a = 4.7874908447265625E0L; +static const long double lgam6b = 8.9805548349424770093452324304839959231517E-7L; #define NRN6 8 -static long double RN6[NRN6 + 1] = +static const long double RN6[NRN6 + 1] = { -3.538412754670746879119162116819571823643E13L, -2.613432593406849155765698121483394257148E13L, @@ -336,7 +336,7 @@ static long double RN6[NRN6 + 1] = -1.576834867378554185210279285358586385266E4L }; #define NRD6 8 -static long double RD6[NRD6 + 1] = +static const long double RD6[NRD6 + 1] = { -2.073955870771283609792355579558899389085E13L, -1.421592856111673959642750863283919318175E13L, @@ -355,10 +355,10 @@ static long double RD6[NRD6 + 1] = -0.5 <= x <= 0.5 4.5 <= x+5 <= 5.5 Peak relative error 3.4e-37 */ -static long double lgam5a = 3.17803955078125E0L; -static long double lgam5b = 1.4279566695619646941601297055408873990961E-5L; +static const long double lgam5a = 3.17803955078125E0L; +static const long double lgam5b = 1.4279566695619646941601297055408873990961E-5L; #define NRN5 9 -static long double RN5[NRN5 + 1] = +static const long double RN5[NRN5 + 1] = { 2.010952885441805899580403215533972172098E11L, 1.916132681242540921354921906708215338584E11L, @@ -372,7 +372,7 @@ static long double RN5[NRN5 + 1] = 6.330318119566998299106803922739066556550E0L }; #define NRD5 8 -static long double RD5[NRD5 + 1] = +static const long double RD5[NRD5 + 1] = { 1.335189758138651840605141370223112376176E11L, 1.174130445739492885895466097516530211283E11L, @@ -391,10 +391,10 @@ static long double RD5[NRD5 + 1] = -0.5 <= x <= 0.5 3.5 <= x+4 <= 4.5 Peak relative error 6.7e-37 */ -static long double lgam4a = 1.791748046875E0L; -static long double lgam4b = 1.1422353055000812477358380702272722990692E-5L; +static const long double lgam4a = 1.791748046875E0L; +static const long double lgam4b = 1.1422353055000812477358380702272722990692E-5L; #define NRN4 9 -static long double RN4[NRN4 + 1] = +static const long double RN4[NRN4 + 1] = { -1.026583408246155508572442242188887829208E13L, -1.306476685384622809290193031208776258809E13L, @@ -408,7 +408,7 @@ static long double RN4[NRN4 + 1] = -1.180509051468390914200720003907727988201E4L }; #define NRD4 9 -static long double RD4[NRD4 + 1] = +static const long double RD4[NRD4 + 1] = { -8.172669122056002077809119378047536240889E12L, -9.477592426087986751343695251801814226960E12L, @@ -428,11 +428,11 @@ static long double RD4[NRD4 + 1] = -0.25 <= x <= 0.5 2.75 <= x+3 <= 3.5 Peak relative error 6.0e-37 */ -static long double lgam3a = 6.93145751953125E-1L; -static long double lgam3b = 1.4286068203094172321214581765680755001344E-6L; +static const long double lgam3a = 6.93145751953125E-1L; +static const long double lgam3b = 1.4286068203094172321214581765680755001344E-6L; #define NRN3 9 -static long double RN3[NRN3 + 1] = +static const long double RN3[NRN3 + 1] = { -4.813901815114776281494823863935820876670E11L, -8.425592975288250400493910291066881992620E11L, @@ -446,7 +446,7 @@ static long double RN3[NRN3 + 1] = -8.333374463411801009783402800801201603736E3L }; #define NRD3 9 -static long double RD3[NRD3 + 1] = +static const long double RD3[NRD3 + 1] = { -5.216713843111675050627304523368029262450E11L, -8.014292925418308759369583419234079164391E11L, @@ -465,10 +465,10 @@ static long double RD3[NRD3 + 1] = /* log gamma(x+2.5) = log gamma(2.5) + x P(x)/Q(x) -0.125 <= x <= 0.25 2.375 <= x+2.5 <= 2.75 */ -static long double lgam2r5a = 2.8466796875E-1L; -static long double lgam2r5b = 1.4901722919159632494669682701924320137696E-5L; +static const long double lgam2r5a = 2.8466796875E-1L; +static const long double lgam2r5b = 1.4901722919159632494669682701924320137696E-5L; #define NRN2r5 8 -static long double RN2r5[NRN2r5 + 1] = +static const long double RN2r5[NRN2r5 + 1] = { -4.676454313888335499356699817678862233205E9L, -9.361888347911187924389905984624216340639E9L, @@ -481,7 +481,7 @@ static long double RN2r5[NRN2r5 + 1] = -4.717341584067827676530426007495274711306E3L }; #define NRD2r5 8 -static long double RD2r5[NRD2r5 + 1] = +static const long double RD2r5[NRD2r5 + 1] = { -6.650657966618993679456019224416926875619E9L, -1.099511409330635807899718829033488771623E10L, @@ -501,7 +501,7 @@ static long double RD2r5[NRD2r5 + 1] = 1.875 <= x+2 <= 2.375 Peak relative error 4.6e-36 */ #define NRN2 9 -static long double RN2[NRN2 + 1] = +static const long double RN2[NRN2 + 1] = { -3.716661929737318153526921358113793421524E9L, -1.138816715030710406922819131397532331321E10L, @@ -515,7 +515,7 @@ static long double RN2[NRN2 + 1] = -4.778761333044147141559311805999540765612E3L }; #define NRD2 9 -static long double RD2[NRD2 + 1] = +static const long double RD2[NRD2 + 1] = { -8.790916836764308497770359421351673950111E9L, -2.023108608053212516399197678553737477486E10L, @@ -535,10 +535,10 @@ static long double RD2[NRD2 + 1] = -0.125 <= x <= +0.125 1.625 <= x+1.75 <= 1.875 Peak relative error 9.2e-37 */ -static long double lgam1r75a = -8.441162109375E-2L; -static long double lgam1r75b = 1.0500073264444042213965868602268256157604E-5L; +static const long double lgam1r75a = -8.441162109375E-2L; +static const long double lgam1r75b = 1.0500073264444042213965868602268256157604E-5L; #define NRN1r75 8 -static long double RN1r75[NRN1r75 + 1] = +static const long double RN1r75[NRN1r75 + 1] = { -5.221061693929833937710891646275798251513E7L, -2.052466337474314812817883030472496436993E8L, @@ -551,7 +551,7 @@ static long double RN1r75[NRN1r75 + 1] = -2.698453601378319296159355612094598695530E3L }; #define NRD1r75 8 -static long double RD1r75[NRD1r75 + 1] = +static const long double RD1r75[NRD1r75 + 1] = { -2.109754689501705828789976311354395393605E8L, -5.036651829232895725959911504899241062286E8L, @@ -570,12 +570,12 @@ static long double RD1r75[NRD1r75 + 1] = -0.0867 <= x <= +0.1634 1.374932... <= x+x0 <= 1.625032... Peak relative error 4.0e-36 */ -static long double x0a = 1.4616241455078125L; -static long double x0b = 7.9994605498412626595423257213002588621246E-6L; -static long double y0a = -1.21490478515625E-1L; -static long double y0b = 4.1879797753919044854428223084178486438269E-6L; +static const long double x0a = 1.4616241455078125L; +static const long double x0b = 7.9994605498412626595423257213002588621246E-6L; +static const long double y0a = -1.21490478515625E-1L; +static const long double y0b = 4.1879797753919044854428223084178486438269E-6L; #define NRN1r5 8 -static long double RN1r5[NRN1r5 + 1] = +static const long double RN1r5[NRN1r5 + 1] = { 6.827103657233705798067415468881313128066E5L, 1.910041815932269464714909706705242148108E6L, @@ -588,7 +588,7 @@ static long double RN1r5[NRN1r5 + 1] = 5.040631576303952022968949605613514584950E0L }; #define NRD1r5 8 -static long double RD1r5[NRD1r5 + 1] = +static const long double RD1r5[NRD1r5 + 1] = { 1.411036368843183477558773688484699813355E6L, 4.378121767236251950226362443134306184849E6L, @@ -607,10 +607,10 @@ static long double RD1r5[NRD1r5 + 1] = -.125 <= x <= +.125 1.125 <= x+1.25 <= 1.375 Peak relative error = 4.9e-36 */ -static long double lgam1r25a = -9.82818603515625E-2L; -static long double lgam1r25b = 1.0023929749338536146197303364159774377296E-5L; +static const long double lgam1r25a = -9.82818603515625E-2L; +static const long double lgam1r25b = 1.0023929749338536146197303364159774377296E-5L; #define NRN1r25 9 -static long double RN1r25[NRN1r25 + 1] = +static const long double RN1r25[NRN1r25 + 1] = { -9.054787275312026472896002240379580536760E4L, -8.685076892989927640126560802094680794471E4L, @@ -624,7 +624,7 @@ static long double RN1r25[NRN1r25 + 1] = 4.907821957946273805080625052510832015792E0L }; #define NRD1r25 8 -static long double RD1r25[NRD1r25 + 1] = +static const long double RD1r25[NRD1r25 + 1] = { 3.980939377333448005389084785896660309000E5L, 1.429634893085231519692365775184490465542E6L, @@ -644,7 +644,7 @@ static long double RD1r25[NRD1r25 + 1] = 1.0 <= x+1 <= 1.125 Peak relative error 1.1e-35 */ #define NRN1 8 -static long double RN1[NRN1 + 1] = +static const long double RN1[NRN1 + 1] = { -9.987560186094800756471055681088744738818E3L, -2.506039379419574361949680225279376329742E4L, @@ -657,7 +657,7 @@ static long double RN1[NRN1 + 1] = 4.516830313569454663374271993200291219855E0L }; #define NRD1 7 -static long double RD1[NRD1 + 1] = +static const long double RD1[NRD1 + 1] = { 1.730299573175751778863269333703788214547E4L, 6.807080914851328611903744668028014678148E4L, @@ -676,7 +676,7 @@ static long double RD1[NRD1 + 1] = 0.875 <= x+1 <= 1.0 Peak relative error 7.0e-37 */ #define NRNr9 8 -static long double RNr9[NRNr9 + 1] = +static const long double RNr9[NRNr9 + 1] = { 4.441379198241760069548832023257571176884E5L, 1.273072988367176540909122090089580368732E6L, @@ -689,7 +689,7 @@ static long double RNr9[NRNr9 + 1] = -1.032901669542994124131223797515913955938E3L, }; #define NRDr9 8 -static long double RDr9[NRDr9 + 1] = +static const long double RDr9[NRDr9 + 1] = { -7.694488331323118759486182246005193998007E5L, -3.301918855321234414232308938454112213751E6L, diff --git a/sysdeps/ieee754/ldbl-128/e_powl.c b/sysdeps/ieee754/ldbl-128/e_powl.c new file mode 100644 index 0000000000..6d5b9d52d2 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/e_powl.c @@ -0,0 +1,422 @@ +/* + * ==================================================== + * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. + * + * Developed at SunPro, a Sun Microsystems, Inc. business. + * Permission to use, copy, modify, and distribute this + * software is freely granted, provided that this notice + * is preserved. + * ==================================================== + */ + +/* Expansions and modifications for 128-bit long double contributed by + Stephen L. Moshier <moshier@na-net.ornl.gov> */ + +/* __ieee754_powl(x,y) return x**y + * + * n + * Method: Let x = 2 * (1+f) + * 1. Compute and return log2(x) in two pieces: + * log2(x) = w1 + w2, + * where w1 has 113-53 = 60 bit trailing zeros. + * 2. Perform y*log2(x) = n+y' by simulating muti-precision + * arithmetic, where |y'|<=0.5. + * 3. Return x**y = 2**n*exp(y'*log2) + * + * Special cases: + * 1. (anything) ** 0 is 1 + * 2. (anything) ** 1 is itself + * 3. (anything) ** NAN is NAN + * 4. NAN ** (anything except 0) is NAN + * 5. +-(|x| > 1) ** +INF is +INF + * 6. +-(|x| > 1) ** -INF is +0 + * 7. +-(|x| < 1) ** +INF is +0 + * 8. +-(|x| < 1) ** -INF is +INF + * 9. +-1 ** +-INF is NAN + * 10. +0 ** (+anything except 0, NAN) is +0 + * 11. -0 ** (+anything except 0, NAN, odd integer) is +0 + * 12. +0 ** (-anything except 0, NAN) is +INF + * 13. -0 ** (-anything except 0, NAN, odd integer) is +INF + * 14. -0 ** (odd integer) = -( +0 ** (odd integer) ) + * 15. +INF ** (+anything except 0,NAN) is +INF + * 16. +INF ** (-anything except 0,NAN) is +0 + * 17. -INF ** (anything) = -0 ** (-anything) + * 18. (-anything) ** (integer) is (-1)**(integer)*(+anything**integer) + * 19. (-anything except 0 and inf) ** (non-integer) is NAN + * + */ + +#include "math.h" +#include "math_private.h" + +static const long double bp[] = { + 1.0L, + 1.5L, +}; + +/* log_2(1.5) */ +static const long double dp_h[] = { + 0.0, + 5.8496250072115607565592654282227158546448E-1L +}; + +/* Low part of log_2(1.5) */ +static const long double dp_l[] = { + 0.0, + 1.0579781240112554492329533686862998106046E-16L +}; + +static const long double zero = 0.0L, + one = 1.0L, + two = 2.0L, + two113 = 1.0384593717069655257060992658440192E34L, + huge = 1.0e3000L, + tiny = 1.0e-3000L; + +/* 3/2 log x = 3 z + z^3 + z^3 (z^2 R(z^2)) + z = (x-1)/(x+1) + 1 <= x <= 1.25 + Peak relative error 2.3e-37 */ +static const long double LN[] = +{ + -3.0779177200290054398792536829702930623200E1L, + 6.5135778082209159921251824580292116201640E1L, + -4.6312921812152436921591152809994014413540E1L, + 1.2510208195629420304615674658258363295208E1L, + -9.9266909031921425609179910128531667336670E-1L +}; +static const long double LD[] = +{ + -5.129862866715009066465422805058933131960E1L, + 1.452015077564081884387441590064272782044E2L, + -1.524043275549860505277434040464085593165E2L, + 7.236063513651544224319663428634139768808E1L, + -1.494198912340228235853027849917095580053E1L + /* 1.0E0 */ +}; + +/* exp(x) = 1 + x - x / (1 - 2 / (x - x^2 R(x^2))) + 0 <= x <= 0.5 + Peak relative error 5.7e-38 */ +static const long double PN[] = +{ + 5.081801691915377692446852383385968225675E8L, + 9.360895299872484512023336636427675327355E6L, + 4.213701282274196030811629773097579432957E4L, + 5.201006511142748908655720086041570288182E1L, + 9.088368420359444263703202925095675982530E-3L, +}; +static const long double PD[] = +{ + 3.049081015149226615468111430031590411682E9L, + 1.069833887183886839966085436512368982758E8L, + 8.259257717868875207333991924545445705394E5L, + 1.872583833284143212651746812884298360922E3L, + /* 1.0E0 */ +}; + +static const long double + /* ln 2 */ + lg2 = 6.9314718055994530941723212145817656807550E-1L, + lg2_h = 6.9314718055994528622676398299518041312695E-1L, + lg2_l = 2.3190468138462996154948554638754786504121E-17L, + ovt = 8.0085662595372944372e-0017L, + /* 2/(3*log(2)) */ + cp = 9.6179669392597560490661645400126142495110E-1L, + cp_h = 9.6179669392597555432899980587535537779331E-1L, + cp_l = 5.0577616648125906047157785230014751039424E-17L; + +#ifdef __STDC__ +long double +__ieee754_powl (long double x, long double y) +#else +long double +__ieee754_powl (x, y) + long double x, y; +#endif +{ + long double z, ax, z_h, z_l, p_h, p_l; + long double y1, t1, t2, r, s, t, u, v, w; + long double s2, s_h, s_l, t_h, t_l; + int32_t i, j, k, yisint, n; + u_int32_t ix, iy; + int32_t hx, hy; + ieee854_long_double_shape_type o, p, q; + + p.value = x; + hx = p.parts32.w0; + ix = hx & 0x7fffffff; + + q.value = y; + hy = q.parts32.w0; + iy = hy & 0x7fffffff; + + + /* y==zero: x**0 = 1 */ + if ((iy | q.parts32.w1 | q.parts32.w2 | q.parts32.w3) == 0) + return one; + + /* +-NaN return x+y */ + if ((ix > 0x7fff0000) + || ((ix == 0x7fff0000) + && ((p.parts32.w1 | p.parts32.w2 | p.parts32.w3) != 0)) + || (iy > 0x7fff0000) + || ((iy == 0x7fff0000) + && ((q.parts32.w1 | q.parts32.w2 | q.parts32.w3) != 0))) + return x + y; + + /* determine if y is an odd int when x < 0 + * yisint = 0 ... y is not an integer + * yisint = 1 ... y is an odd int + * yisint = 2 ... y is an even int + */ + yisint = 0; + if (hx < 0) + { + if (iy >= 0x40700000) /* 2^113 */ + yisint = 2; /* even integer y */ + else if (iy >= 0x3fff0000) /* 1.0 */ + { + if (__floorl (y) == y) + { + z = 0.5 * y; + if (__floorl (z) == z) + yisint = 2; + else + yisint = 1; + } + } + } + + /* special value of y */ + if ((q.parts32.w1 | q.parts32.w2 | q.parts32.w3) == 0) + { + if (iy == 0x7fff0000) /* y is +-inf */ + { + if (((ix - 0x3fff0000) | p.parts32.w1 | p.parts32.w2 | p.parts32.w3) + == 0) + return y - y; /* inf**+-1 is NaN */ + else if (ix >= 0x3fff0000) /* (|x|>1)**+-inf = inf,0 */ + return (hy >= 0) ? y : zero; + else /* (|x|<1)**-,+inf = inf,0 */ + return (hy < 0) ? -y : zero; + } + if (iy == 0x3fff0000) + { /* y is +-1 */ + if (hy < 0) + return one / x; + else + return x; + } + if (hy == 0x40000000) + return x * x; /* y is 2 */ + if (hy == 0x3ffe0000) + { /* y is 0.5 */ + if (hx >= 0) /* x >= +0 */ + return __ieee754_sqrtl (x); + } + } + + ax = fabsl (x); + /* special value of x */ + if ((p.parts32.w1 | p.parts32.w2 | p.parts32.w3) == 0) + { + if (ix == 0x7fff0000 || ix == 0 || ix == 0x3fff0000) + { + z = ax; /*x is +-0,+-inf,+-1 */ + if (hy < 0) + z = one / z; /* z = (1/|x|) */ + if (hx < 0) + { + if (((ix - 0x3fff0000) | yisint) == 0) + { + z = (z - z) / (z - z); /* (-1)**non-int is NaN */ + } + else if (yisint == 1) + z = -z; /* (x<0)**odd = -(|x|**odd) */ + } + return z; + } + } + + /* (x<0)**(non-int) is NaN */ + if (((((u_int32_t) hx >> 31) - 1) | yisint) == 0) + return (x - x) / (x - x); + + /* |y| is huge. + 2^-16495 = 1/2 of smallest representable value. + If (1 - 1/131072)^y underflows, y > 1.4986e9 */ + if (iy > 0x401d654b) + { + /* if (1 - 2^-113)^y underflows, y > 1.1873e38 */ + if (iy > 0x407d654b) + { + if (ix <= 0x3ffeffff) + return (hy < 0) ? huge * huge : tiny * tiny; + if (ix >= 0x3fff0000) + return (hy > 0) ? huge * huge : tiny * tiny; + } + /* over/underflow if x is not close to one */ + if (ix < 0x3ffeffff) + return (hy < 0) ? huge * huge : tiny * tiny; + if (ix > 0x3fff0000) + return (hy > 0) ? huge * huge : tiny * tiny; + } + + n = 0; + /* take care subnormal number */ + if (ix < 0x00010000) + { + ax *= two113; + n -= 113; + o.value = ax; + ix = o.parts32.w0; + } + n += ((ix) >> 16) - 0x3fff; + j = ix & 0x0000ffff; + /* determine interval */ + ix = j | 0x3fff0000; /* normalize ix */ + if (j <= 0x3988) + k = 0; /* |x|<sqrt(3/2) */ + else if (j < 0xbb67) + k = 1; /* |x|<sqrt(3) */ + else + { + k = 0; + n += 1; + ix -= 0x00010000; + } + + o.value = ax; + o.parts32.w0 = ix; + ax = o.value; + + /* compute s = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */ + u = ax - bp[k]; /* bp[0]=1.0, bp[1]=1.5 */ + v = one / (ax + bp[k]); + s = u * v; + s_h = s; + + o.value = s_h; + o.parts32.w3 = 0; + o.parts32.w2 &= 0xf8000000; + s_h = o.value; + /* t_h=ax+bp[k] High */ + t_h = ax + bp[k]; + o.value = t_h; + o.parts32.w3 = 0; + o.parts32.w2 &= 0xf8000000; + t_h = o.value; + t_l = ax - (t_h - bp[k]); + s_l = v * ((u - s_h * t_h) - s_h * t_l); + /* compute log(ax) */ + s2 = s * s; + u = LN[0] + s2 * (LN[1] + s2 * (LN[2] + s2 * (LN[3] + s2 * LN[4]))); + v = LD[0] + s2 * (LD[1] + s2 * (LD[2] + s2 * (LD[3] + s2 * (LD[4] + s2)))); + r = s2 * s2 * u / v; + r += s_l * (s_h + s); + s2 = s_h * s_h; + t_h = 3.0 + s2 + r; + o.value = t_h; + o.parts32.w3 = 0; + o.parts32.w2 &= 0xf8000000; + t_h = o.value; + t_l = r - ((t_h - 3.0) - s2); + /* u+v = s*(1+...) */ + u = s_h * t_h; + v = s_l * t_h + t_l * s; + /* 2/(3log2)*(s+...) */ + p_h = u + v; + o.value = p_h; + o.parts32.w3 = 0; + o.parts32.w2 &= 0xf8000000; + p_h = o.value; + p_l = v - (p_h - u); + z_h = cp_h * p_h; /* cp_h+cp_l = 2/(3*log2) */ + z_l = cp_l * p_h + p_l * cp + dp_l[k]; + /* log2(ax) = (s+..)*2/(3*log2) = n + dp_h + z_h + z_l */ + t = (long double) n; + t1 = (((z_h + z_l) + dp_h[k]) + t); + o.value = t1; + o.parts32.w3 = 0; + o.parts32.w2 &= 0xf8000000; + t1 = o.value; + t2 = z_l - (((t1 - t) - dp_h[k]) - z_h); + + /* s (sign of result -ve**odd) = -1 else = 1 */ + s = one; + if (((((u_int32_t) hx >> 31) - 1) | (yisint - 1)) == 0) + s = -one; /* (-ve)**(odd int) */ + + /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */ + y1 = y; + o.value = y1; + o.parts32.w3 = 0; + o.parts32.w2 &= 0xf8000000; + y1 = o.value; + p_l = (y - y1) * t1 + y * t2; + p_h = y1 * t1; + z = p_l + p_h; + o.value = z; + j = o.parts32.w0; + if (j >= 0x400d0000) /* z >= 16384 */ + { + /* if z > 16384 */ + if (((j - 0x400d0000) | o.parts32.w1 | o.parts32.w2 | o.parts32.w3) != 0) + return s * huge * huge; /* overflow */ + else + { + if (p_l + ovt > z - p_h) + return s * huge * huge; /* overflow */ + } + } + else if ((j & 0x7fffffff) >= 0x400d01b9) /* z <= -16495 */ + { + /* z < -16495 */ + if (((j - 0xc00d01bc) | o.parts32.w1 | o.parts32.w2 | o.parts32.w3) + != 0) + return s * tiny * tiny; /* underflow */ + else + { + if (p_l <= z - p_h) + return s * tiny * tiny; /* underflow */ + } + } + /* compute 2**(p_h+p_l) */ + i = j & 0x7fffffff; + k = (i >> 16) - 0x3fff; + n = 0; + if (i > 0x3ffe0000) + { /* if |z| > 0.5, set n = [z+0.5] */ + n = __floorl (z + 0.5L); + t = n; + p_h -= t; + } + t = p_l + p_h; + o.value = t; + o.parts32.w3 = 0; + o.parts32.w2 &= 0xf8000000; + t = o.value; + u = t * lg2_h; + v = (p_l - (t - p_h)) * lg2 + t * lg2_l; + z = u + v; + w = v - (z - u); + /* exp(z) */ + t = z * z; + u = PN[0] + t * (PN[1] + t * (PN[2] + t * (PN[3] + t * PN[4]))); + v = PD[0] + t * (PD[1] + t * (PD[2] + t * (PD[3] + t))); + t1 = z - t * u / v; + r = (z * t1) / (t1 - two) - (w + z * w); + z = one - (r - z); + o.value = z; + j = o.parts32.w0; + j += (n << 16); + if ((j >> 16) <= 0) + z = __scalbnl (z, n); /* subnormal output */ + else + { + o.parts32.w0 = j; + z = o.value; + } + return s * z; +} diff --git a/sysdeps/ieee754/ldbl-128/s_cbrtl.c b/sysdeps/ieee754/ldbl-128/s_cbrtl.c new file mode 100644 index 0000000000..298754ea74 --- /dev/null +++ b/sysdeps/ieee754/ldbl-128/s_cbrtl.c @@ -0,0 +1,121 @@ +/* cbrtl.c + * + * Cube root, long double precision + * + * + * + * SYNOPSIS: + * + * long double x, y, cbrtl(); + * + * y = cbrtl( x ); + * + * + * + * DESCRIPTION: + * + * Returns the cube root of the argument, which may be negative. + * + * Range reduction involves determining the power of 2 of + * the argument. A polynomial of degree 2 applied to the + * mantissa, and multiplication by the cube root of 1, 2, or 4 + * approximates the root to within about 0.1%. Then Newton's + * iteration is used three times to converge to an accurate + * result. + * + * + * + * ACCURACY: + * + * Relative error: + * arithmetic domain # trials peak rms + * IEEE -8,8 100000 1.3e-34 3.9e-35 + * IEEE exp(+-707) 100000 1.3e-34 4.3e-35 + * + */ + +/* +Cephes Math Library Release 2.2: January, 1991 +Copyright 1984, 1991 by Stephen L. Moshier +Adapted for glibc October, 2001. +*/ + +#include "math.h" +#include "math_private.h" + +static const long double CBRT2 = 1.259921049894873164767210607278228350570251L; +static const long double CBRT4 = 1.587401051968199474751705639272308260391493L; +static const long double CBRT2I = 0.7937005259840997373758528196361541301957467L; +static const long double CBRT4I = 0.6299605249474365823836053036391141752851257L; + + +long double +__cbrtl (long double x) +{ + int e, rem, sign; + long double z; + + if (!__finitel (x)) + return x + x; + + if (x == 0) + return (x); + + if (x > 0) + sign = 1; + else + { + sign = -1; + x = -x; + } + + z = x; + /* extract power of 2, leaving mantissa between 0.5 and 1 */ + x = __frexpl (x, &e); + + /* Approximate cube root of number between .5 and 1, + peak relative error = 1.2e-6 */ + x = ((((1.3584464340920900529734e-1L * x + - 6.3986917220457538402318e-1L) * x + + 1.2875551670318751538055e0L) * x + - 1.4897083391357284957891e0L) * x + + 1.3304961236013647092521e0L) * x + 3.7568280825958912391243e-1L; + + /* exponent divided by 3 */ + if (e >= 0) + { + rem = e; + e /= 3; + rem -= 3 * e; + if (rem == 1) + x *= CBRT2; + else if (rem == 2) + x *= CBRT4; + } + else + { /* argument less than 1 */ + e = -e; + rem = e; + e /= 3; + rem -= 3 * e; + if (rem == 1) + x *= CBRT2I; + else if (rem == 2) + x *= CBRT4I; + e = -e; + } + + /* multiply by power of 2 */ + x = __ldexpl (x, e); + + /* Newton iteration */ + x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L; + x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L; + x -= (x - (z / (x * x))) * 0.3333333333333333333333333333333333333333L; + + if (sign < 0) + x = -x; + return (x); +} + +weak_alias (__cbrtl, cbrtl) diff --git a/sysdeps/ieee754/ldbl-128/s_erfl.c b/sysdeps/ieee754/ldbl-128/s_erfl.c index 57202253a6..efa0e8fcb3 100644 --- a/sysdeps/ieee754/ldbl-128/s_erfl.c +++ b/sysdeps/ieee754/ldbl-128/s_erfl.c @@ -137,7 +137,7 @@ tiny = 1e-4931L, 0 <= x <= 7/8 Peak relative error 1.8e-35 */ #define NTN1 8 -static long double TN1[NTN1 + 1] = +static const long double TN1[NTN1 + 1] = { -3.858252324254637124543172907442106422373E10L, 9.580319248590464682316366876952214879858E10L, @@ -150,7 +150,7 @@ static long double TN1[NTN1 + 1] = 3.390868480059991640235675479463287886081E1L }; #define NTD1 8 -static long double TD1[NTD1 + 1] = +static const long double TD1[NTD1 + 1] = { -3.005357030696532927149885530689529032152E11L, -1.342602283126282827411658673839982164042E11L, @@ -168,9 +168,9 @@ static long double TD1[NTD1 + 1] = /* erf(z+1) = erf_const + P(z)/Q(z) -.125 <= z <= 0 Peak relative error 7.3e-36 */ -static long double erf_const = 0.845062911510467529296875L; +static const long double erf_const = 0.845062911510467529296875L; #define NTN2 8 -static long double TN2[NTN2 + 1] = +static const long double TN2[NTN2 + 1] = { -4.088889697077485301010486931817357000235E1L, 7.157046430681808553842307502826960051036E3L, @@ -183,7 +183,7 @@ static long double TN2[NTN2 + 1] = 5.127662277706787664956025545897050896203E-1L }; #define NTD2 8 -static long double TD2[NTD2 + 1] = +static const long double TD2[NTD2 + 1] = { 1.731026445926834008273768924015161048885E4L, 1.209682239007990370796112604286048173750E4L, @@ -202,7 +202,7 @@ static long double TD2[NTD2 + 1] = 0 <= x < 0.125 Peak relative error 1.4e-35 */ #define NRNr13 8 -static long double RNr13[NRNr13 + 1] = +static const long double RNr13[NRNr13 + 1] = { -2.353707097641280550282633036456457014829E3L, 3.871159656228743599994116143079870279866E2L, @@ -215,7 +215,7 @@ static long double RNr13[NRNr13 + 1] = -8.098602878463854789780108161581050357814E-2L }; #define NRDr13 7 -static long double RDr13[NRDr13 + 1] = +static const long double RDr13[NRDr13 + 1] = { 2.220448796306693503549505450626652881752E3L, 1.899133258779578688791041599040951431383E2L, @@ -228,15 +228,15 @@ static long double RDr13[NRDr13 + 1] = /* 1.0E0 */ }; /* erfc(0.25) = C13a + C13b to extra precision. */ -static long double C13a = 0.723663330078125L; -static long double C13b = 1.0279753638067014931732235184287934646022E-5L; +static const long double C13a = 0.723663330078125L; +static const long double C13b = 1.0279753638067014931732235184287934646022E-5L; /* erfc(x + 0.375) = erfc(0.375) + x R(x) 0 <= x < 0.125 Peak relative error 1.2e-35 */ #define NRNr14 8 -static long double RNr14[NRNr14 + 1] = +static const long double RNr14[NRNr14 + 1] = { -2.446164016404426277577283038988918202456E3L, 6.718753324496563913392217011618096698140E2L, @@ -249,7 +249,7 @@ static long double RNr14[NRNr14 + 1] = -2.230395570574153963203348263549700967918E-2L }; #define NRDr14 7 -static long double RDr14[NRDr14 + 1] = +static const long double RDr14[NRDr14 + 1] = { 2.495187439241869732696223349840963702875E3L, 2.503549449872925580011284635695738412162E2L, @@ -262,14 +262,14 @@ static long double RDr14[NRDr14 + 1] = /* 1.0E0 */ }; /* erfc(0.375) = C14a + C14b to extra precision. */ -static long double C14a = 0.5958709716796875L; -static long double C14b = 1.2118885490201676174914080878232469565953E-5L; +static const long double C14a = 0.5958709716796875L; +static const long double C14b = 1.2118885490201676174914080878232469565953E-5L; /* erfc(x + 0.5) = erfc(0.5) + x R(x) 0 <= x < 0.125 Peak relative error 4.7e-36 */ #define NRNr15 8 -static long double RNr15[NRNr15 + 1] = +static const long double RNr15[NRNr15 + 1] = { -2.624212418011181487924855581955853461925E3L, 8.473828904647825181073831556439301342756E2L, @@ -282,7 +282,7 @@ static long double RNr15[NRNr15 + 1] = 1.990253655948179713415957791776180406812E-2L }; #define NRDr15 7 -static long double RDr15[NRDr15 + 1] = +static const long double RDr15[NRDr15 + 1] = { 2.986190760847974943034021764693341524962E3L, 5.288262758961073066335410218650047725985E2L, @@ -295,14 +295,14 @@ static long double RDr15[NRDr15 + 1] = /* 1.0E0 */ }; /* erfc(0.5) = C15a + C15b to extra precision. */ -static long double C15a = 0.4794921875L; -static long double C15b = 7.9346869534623172533461080354712635484242E-6L; +static const long double C15a = 0.4794921875L; +static const long double C15b = 7.9346869534623172533461080354712635484242E-6L; /* erfc(x + 0.625) = erfc(0.625) + x R(x) 0 <= x < 0.125 Peak relative error 5.1e-36 */ #define NRNr16 8 -static long double RNr16[NRNr16 + 1] = +static const long double RNr16[NRNr16 + 1] = { -2.347887943200680563784690094002722906820E3L, 8.008590660692105004780722726421020136482E2L, @@ -315,7 +315,7 @@ static long double RNr16[NRNr16 + 1] = 2.022958279982138755020825717073966576670E-2L, }; #define NRDr16 7 -static long double RDr16[NRDr16 + 1] = +static const long double RDr16[NRDr16 + 1] = { 3.075166170024837215399323264868308087281E3L, 8.730468942160798031608053127270430036627E2L, @@ -328,14 +328,14 @@ static long double RDr16[NRDr16 + 1] = /* 1.0E0 */ }; /* erfc(0.625) = C16a + C16b to extra precision. */ -static long double C16a = 0.3767547607421875L; -static long double C16b = 4.3570693945275513594941232097252997287766E-6L; +static const long double C16a = 0.3767547607421875L; +static const long double C16b = 4.3570693945275513594941232097252997287766E-6L; /* erfc(x + 0.75) = erfc(0.75) + x R(x) 0 <= x < 0.125 Peak relative error 1.7e-35 */ #define NRNr17 8 -static long double RNr17[NRNr17 + 1] = +static const long double RNr17[NRNr17 + 1] = { -1.767068734220277728233364375724380366826E3L, 6.693746645665242832426891888805363898707E2L, @@ -348,7 +348,7 @@ static long double RNr17[NRNr17 + 1] = -1.488945487149634820537348176770282391202E-2L }; #define NRDr17 7 -static long double RDr17[NRDr17 + 1] = +static const long double RDr17[NRDr17 + 1] = { 2.748457523498150741964464942246913394647E3L, 1.020213390713477686776037331757871252652E3L, @@ -361,15 +361,15 @@ static long double RDr17[NRDr17 + 1] = /* 1.0E0 */ }; /* erfc(0.75) = C17a + C17b to extra precision. */ -static long double C17a = 0.2888336181640625L; -static long double C17b = 1.0748182422368401062165408589222625794046E-5L; +static const long double C17a = 0.2888336181640625L; +static const long double C17b = 1.0748182422368401062165408589222625794046E-5L; /* erfc(x + 0.875) = erfc(0.875) + x R(x) 0 <= x < 0.125 Peak relative error 2.2e-35 */ #define NRNr18 8 -static long double RNr18[NRNr18 + 1] = +static const long double RNr18[NRNr18 + 1] = { -1.342044899087593397419622771847219619588E3L, 6.127221294229172997509252330961641850598E2L, @@ -382,7 +382,7 @@ static long double RNr18[NRNr18 + 1] = -5.557645435858916025452563379795159124753E-2L }; #define NRDr18 7 -static long double RDr18[NRDr18 + 1] = +static const long double RDr18[NRDr18 + 1] = { 2.557518000661700588758505116291983092951E3L, 1.070171433382888994954602511991940418588E3L, @@ -395,14 +395,14 @@ static long double RDr18[NRDr18 + 1] = /* 1.0E0 */ }; /* erfc(0.875) = C18a + C18b to extra precision. */ -static long double C18a = 0.215911865234375L; -static long double C18b = 1.3073705765341685464282101150637224028267E-5L; +static const long double C18a = 0.215911865234375L; +static const long double C18b = 1.3073705765341685464282101150637224028267E-5L; /* erfc(x + 1.0) = erfc(1.0) + x R(x) 0 <= x < 0.125 Peak relative error 1.6e-35 */ #define NRNr19 8 -static long double RNr19[NRNr19 + 1] = +static const long double RNr19[NRNr19 + 1] = { -1.139180936454157193495882956565663294826E3L, 6.134903129086899737514712477207945973616E2L, @@ -415,7 +415,7 @@ static long double RNr19[NRNr19 + 1] = -8.629945436917752003058064731308767664446E-2L }; #define NRDr19 7 -static long double RDr19[NRDr19 + 1] = +static const long double RDr19[NRDr19 + 1] = { 2.744303447981132701432716278363418643778E3L, 1.266396359526187065222528050591302171471E3L, @@ -428,14 +428,14 @@ static long double RDr19[NRDr19 + 1] = /* 1.0E0 */ }; /* erfc(1.0) = C19a + C19b to extra precision. */ -static long double C19a = 0.15728759765625L; -static long double C19b = 1.1609394035130658779364917390740703933002E-5L; +static const long double C19a = 0.15728759765625L; +static const long double C19b = 1.1609394035130658779364917390740703933002E-5L; /* erfc(x + 1.125) = erfc(1.125) + x R(x) 0 <= x < 0.125 Peak relative error 3.6e-36 */ #define NRNr20 8 -static long double RNr20[NRNr20 + 1] = +static const long double RNr20[NRNr20 + 1] = { -9.652706916457973956366721379612508047640E2L, 5.577066396050932776683469951773643880634E2L, @@ -448,7 +448,7 @@ static long double RNr20[NRNr20 + 1] = -9.611744011489092894027478899545635991213E-2L }; #define NRDr20 7 -static long double RDr20[NRDr20 + 1] = +static const long double RDr20[NRDr20 + 1] = { 3.032829629520142564106649167182428189014E3L, 1.659648470721967719961167083684972196891E3L, @@ -461,14 +461,14 @@ static long double RDr20[NRDr20 + 1] = /* 1.0E0 */ }; /* erfc(1.125) = C20a + C20b to extra precision. */ -static long double C20a = 0.111602783203125L; -static long double C20b = 8.9850951672359304215530728365232161564636E-6L; +static const long double C20a = 0.111602783203125L; +static const long double C20b = 8.9850951672359304215530728365232161564636E-6L; /* erfc(1/x) = 1/x exp (-1/x^2 - 0.5625 + R(1/x^2)) 7/8 <= 1/x < 1 Peak relative error 1.4e-35 */ #define NRNr8 9 -static long double RNr8[NRNr8 + 1] = +static const long double RNr8[NRNr8 + 1] = { 3.587451489255356250759834295199296936784E1L, 5.406249749087340431871378009874875889602E2L, @@ -482,7 +482,7 @@ static long double RNr8[NRNr8 + 1] = 4.876422978828717219629814794707963640913E-2L }; #define NRDr8 8 -static long double RDr8[NRDr8 + 1] = +static const long double RDr8[NRDr8 + 1] = { 6.358593134096908350929496535931630140282E1L, 9.900253816552450073757174323424051765523E2L, @@ -500,7 +500,7 @@ static long double RDr8[NRDr8 + 1] = 0.75 <= 1/x <= 0.875 Peak relative error 2.0e-36 */ #define NRNr7 9 -static long double RNr7[NRNr7 + 1] = +static const long double RNr7[NRNr7 + 1] = { 1.686222193385987690785945787708644476545E1L, 1.178224543567604215602418571310612066594E3L, @@ -514,7 +514,7 @@ static long double RNr7[NRNr7 + 1] = 6.700393957480661937695573729183733234400E2L }; #define NRDr7 9 -static long double RDr7[NRDr7 + 1] = +static const long double RDr7[NRDr7 + 1] = { -1.709305024718358874701575813642933561169E3L, -3.280033887481333199580464617020514788369E4L, @@ -533,7 +533,7 @@ static long double RDr7[NRDr7 + 1] = 5/8 <= 1/x < 3/4 Peak relative error 1.9e-35 */ #define NRNr6 9 -static long double RNr6[NRNr6 + 1] = +static const long double RNr6[NRNr6 + 1] = { 1.642076876176834390623842732352935761108E0L, 1.207150003611117689000664385596211076662E2L, @@ -547,7 +547,7 @@ static long double RNr6[NRNr6 + 1] = 4.506934806567986810091824791963991057083E2L }; #define NRDr6 9 -static long double RDr6[NRDr6 + 1] = +static const long double RDr6[NRDr6 + 1] = { -1.664557643928263091879301304019826629067E2L, -3.800035902507656624590531122291160668452E3L, @@ -566,7 +566,7 @@ static long double RDr6[NRDr6 + 1] = 1/2 <= 1/x < 5/8 Peak relative error 4.6e-36 */ #define NRNr5 10 -static long double RNr5[NRNr5 + 1] = +static const long double RNr5[NRNr5 + 1] = { -3.332258927455285458355550878136506961608E-3L, -2.697100758900280402659586595884478660721E-1L, @@ -581,7 +581,7 @@ static long double RNr5[NRNr5 + 1] = -2.077715925587834606379119585995758954399E0L }; #define NRDr5 9 -static long double RDr5[NRDr5 + 1] = +static const long double RDr5[NRDr5 + 1] = { 3.377879570417399341550710467744693125385E-1L, 1.021963322742390735430008860602594456187E1L, @@ -600,7 +600,7 @@ static long double RDr5[NRDr5 + 1] = 3/8 <= 1/x < 1/2 Peak relative error 2.0e-36 */ #define NRNr4 10 -static long double RNr4[NRNr4 + 1] = +static const long double RNr4[NRNr4 + 1] = { 3.258530712024527835089319075288494524465E-3L, 2.987056016877277929720231688689431056567E-1L, @@ -615,7 +615,7 @@ static long double RNr4[NRNr4 + 1] = 2.127493573166454249221983582495245662319E2L }; #define NRDr4 10 -static long double RDr4[NRDr4 + 1] = +static const long double RDr4[NRDr4 + 1] = { -3.303141981514540274165450687270180479586E-1L, -1.353768629363605300707949368917687066724E1L, @@ -635,7 +635,7 @@ static long double RDr4[NRDr4 + 1] = 1/4 <= 1/x < 3/8 Peak relative error 8.4e-37 */ #define NRNr3 11 -static long double RNr3[NRNr3 + 1] = +static const long double RNr3[NRNr3 + 1] = { -1.952401126551202208698629992497306292987E-6L, -2.130881743066372952515162564941682716125E-4L, @@ -651,7 +651,7 @@ static long double RNr3[NRNr3 + 1] = -1.787995944187565676837847610706317833247E0L }; #define NRDr3 10 -static long double RDr3[NRDr3 + 1] = +static const long double RDr3[NRDr3 + 1] = { 1.979130686770349481460559711878399476903E-4L, 1.156941716128488266238105813374635099057E-2L, @@ -671,7 +671,7 @@ static long double RDr3[NRDr3 + 1] = 1/8 <= 1/x < 1/4 Peak relative error 1.5e-36 */ #define NRNr2 11 -static long double RNr2[NRNr2 + 1] = +static const long double RNr2[NRNr2 + 1] = { -2.638914383420287212401687401284326363787E-8L, -3.479198370260633977258201271399116766619E-6L, @@ -687,7 +687,7 @@ static long double RNr2[NRNr2 + 1] = -1.572436106228070195510230310658206154374E0L }; #define NRDr2 10 -static long double RDr2[NRDr2 + 1] = +static const long double RDr2[NRDr2 + 1] = { 2.675042728136731923554119302571867799673E-6L, 2.170997868451812708585443282998329996268E-4L, @@ -707,7 +707,7 @@ static long double RDr2[NRDr2 + 1] = 1/128 <= 1/x < 1/8 Peak relative error 2.2e-36 */ #define NRNr1 9 -static long double RNr1[NRNr1 + 1] = +static const long double RNr1[NRNr1 + 1] = { -4.250780883202361946697751475473042685782E-8L, -5.375777053288612282487696975623206383019E-6L, @@ -721,7 +721,7 @@ static long double RNr1[NRNr1 + 1] = -1.290865243944292370661544030414667556649E0L }; #define NRDr1 8 -static long double RDr1[NRDr1 + 1] = +static const long double RDr1[NRDr1 + 1] = { 4.308976661749509034845251315983612976224E-6L, 3.265390126432780184125233455960049294580E-4L, diff --git a/sysdeps/ieee754/ldbl-128/s_expm1l.c b/sysdeps/ieee754/ldbl-128/s_expm1l.c index c03635e2ab..1ed68d6e34 100644 --- a/sysdeps/ieee754/ldbl-128/s_expm1l.c +++ b/sysdeps/ieee754/ldbl-128/s_expm1l.c @@ -45,7 +45,7 @@ -.5 ln 2 < x < .5 ln 2 Theoretical peak relative error = 8.1e-36 */ -static long double +static const long double P0 = 2.943520915569954073888921213330863757240E8L, P1 = -5.722847283900608941516165725053359168840E7L, P2 = 8.944630806357575461578107295909719817253E6L, @@ -103,11 +103,11 @@ __expm1l (long double x) /* expm1(+- 0) = +- 0. */ if ((ix == 0) && (u.parts32.w1 | u.parts32.w2 | u.parts32.w3) == 0) return x; - + /* Overflow. */ if (x > maxlog) return (big * big); - + /* Minimum value. */ if (x < minarg) return (4.0/big - 1.0L); diff --git a/sysdeps/ieee754/ldbl-128/s_log1pl.c b/sysdeps/ieee754/ldbl-128/s_log1pl.c index c19bea83d1..73e9501330 100644 --- a/sysdeps/ieee754/ldbl-128/s_log1pl.c +++ b/sysdeps/ieee754/ldbl-128/s_log1pl.c @@ -46,7 +46,7 @@ * Theoretical peak relative error = 5.3e-37, * relative peak error spread = 2.3e-14 */ -static long double +static const long double P12 = 1.538612243596254322971797716843006400388E-6L, P11 = 4.998469661968096229986658302195402690910E-1L, P10 = 2.321125933898420063925789532045674660756E1L, @@ -80,7 +80,7 @@ static long double * Theoretical peak relative error = 1.1e-35, * relative peak error spread 1.1e-9 */ -static long double +static const long double R5 = -8.828896441624934385266096344596648080902E-1L, R4 = 8.057002716646055371965756206836056074715E1L, R3 = -2.024301798136027039250415126250455056397E3L, @@ -96,14 +96,14 @@ static long double S0 = 1.701761051846631278975701529965589676574E6L; /* C1 + C2 = ln 2 */ -static long double C1 = 6.93145751953125E-1L; -static long double C2 = 1.428606820309417232121458176568075500134E-6L; +static const long double C1 = 6.93145751953125E-1L; +static const long double C2 = 1.428606820309417232121458176568075500134E-6L; -static long double sqrth = 0.7071067811865475244008443621048490392848L; +static const long double sqrth = 0.7071067811865475244008443621048490392848L; /* ln (2^16384 * (1 - 2^-113)) */ -static long double maxlog = 1.1356523406294143949491931077970764891253E4L; -static long double big = 2e4932L; -static long double zero = 0.0L; +static const long double maxlog = 1.1356523406294143949491931077970764891253E4L; +static const long double big = 2e4932L; +static const long double zero = 0.0L; #if 1 /* Make sure these are prototyped. */ diff --git a/sysdeps/ieee754/ldbl-96/s_cbrtl.c b/sysdeps/ieee754/ldbl-96/s_cbrtl.c index eef722f696..0f8227a04b 100644 --- a/sysdeps/ieee754/ldbl-96/s_cbrtl.c +++ b/sysdeps/ieee754/ldbl-96/s_cbrtl.c @@ -37,11 +37,12 @@ static const double factor[5] = SQR_CBRT2 }; +static const long double third = 0.3333333333333333333333333L; long double __cbrtl (long double x) { - long double xm, ym, u, t2; + long double xm, u; int xe; /* Reduce X. XM now is an range 1.0 to 0.5. */ @@ -54,25 +55,17 @@ __cbrtl (long double x) if (xe == 0 && fpclassify (x) <= FP_ZERO) return x + x; - u = (0.338058687610520237 - + (1.67595307700780102 - + (-2.82414939754975962 - + (4.09559907378707839 + - (-4.11151425200350531 - + (2.65298938441952296 + - (-0.988553671195413709 - + 0.161617097923756032 * xm) - * xm) - * xm) - * xm) - * xm) - * xm) - *xm); + u = (((-1.34661104733595206551E-1 * xm + + 5.46646013663955245034E-1) * xm + - 9.54382247715094465250E-1) * xm + + 1.13999833547172932737E0) * xm + + 4.02389795645447521269E-1; - t2 = u * u * u; + u *= factor[2 + xe % 3]; + u = __ldexpl (x > 0.0 ? u : -u, xe / 3); - ym = u * (t2 + 2.0 * xm) / (2.0 * t2 + xm) * factor[2 + xe % 3]; - - return __ldexpl (x > 0.0 ? ym : -ym, xe / 3); + u -= (u - (x / (u * u))) * third; + u -= (u - (x / (u * u))) * third; + return u; } weak_alias (__cbrtl, cbrtl) diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h b/sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h index eedd5db7f6..dfc7968a83 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h +++ b/sysdeps/unix/sysv/linux/s390/s390-32/sys/ucontext.h @@ -34,7 +34,7 @@ typedef struct { unsigned long mask; unsigned long addr; -} __psw_t __attribute__ ((aligned(8))); +} __attribute__ ((aligned(8))) __psw_t; /* Type for a general-purpose register. */ typedef unsigned long greg_t; diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h b/sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h index 7402199d1f..336178e758 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/sys/ucontext.h @@ -34,7 +34,7 @@ typedef struct { unsigned long mask; unsigned long addr; -} __psw_t __attribute__ ((aligned(8))); +} __attribute__ ((aligned(8))) __psw_t; /* Type for a general-purpose register. */ typedef unsigned long greg_t; |