• Using extended float to get 128-bit precision

    From marcel hendrix@mhx@iae.nl to comp.lang.forth on Fri Sep 25 02:17:45 2026
    From Newsgroup: comp.lang.forth

    It is possible to use extended floats -- the native 80-bit format of Intel/IBM/Siemens FPUs -- to implement something like quad precision (D.Bailey's qd package) with only 2 float words, not 4. This is of
    course highly nonstandard, even in the Forth sense. I have not yet found
    an implementation of this idea in the usual profane languages.

    The biggest nuisance of ddfloats are that the FPU must be set to a
    mantissa width of 53. At every exception iForth resets the width to 80
    bits (the default), and reinitialization is needed when ddfloats are to
    be used. The qd-fp package does not need this reset.

    In the past few days I ported D.H.Bailey's floating point library over
    from double to extended floats. It is interesting that Bailey's code did
    not need adjustment when the mantissa was widened from 106 to 128 bits.
    The package is able to deliver about 38 decimal digits, about 6 orders
    of magnitude better than ddfloat manages. Also, the exponent can be
    +/-4900 instead of +/-308. Unfortunately, qd-fp.frt is about 2 to 3
    times slower than dd-fp.frt.

    I still have some problems with the trigonometric functions, which
    *appear* to become inaccurate for large angles. However, this may again
    be caused by limitations in MATLAB's vpa() function -- I use vpa to test
    the accuracy of the functions, and it works just fine for 106 bits but
    not for 128.

    Appended are some preliminary tests (output generated with vpa).

    -marcel

    XDEXP ( 1.00000000000000000000000000000000000000e-030 ) has error -1.35001010726940274778500643976785620174e-040 expchar added
    XDEXP ( 0.99999999999999999997967120926589679187e-002 ) has error 7.95334711142122328758217457342823396163e-038 expchar added
    XDEXP ( 1.99999999999999999995934241853179358373e-002 ) has error -2.34602465560110836556237025841717461555e-037 expchar added
    XDEXP ( 2.99999999999999999993901362779769037559e-002 ) has error -8.90015182123255725775030829606321528160e-038 expchar added
    XDEXP ( 3.99999999999999999991868483706358716745e-002 ) has error 1.02442345479246992409141659939917726655e-037 expchar added
    XDEXP ( 4.99999999999999999972894945687862389149e-002 ) has error -1.13192354205185929377894251038233573192e-037 expchar added
    XDEXP ( 5.99999999999999999953921407669366061555e-002 ) has error -1.11235740266616457397255370376398581130e-037 expchar added
    XDEXP ( 6.99999999999999999934947869650869733959e-002 ) has error -1.74577563329057033989163045653068591741e-037 expchar added
    XDEXP ( 7.99999999999999999915974331632373406364e-002 ) has error 1.16029913046450705531443519394111648223e-037 expchar added
    XDEXP ( 8.99999999999999999897000793613877078770e-002 ) has error 5.78242639214134402816438613421888410023e-037 expchar added

    XDLN ( 1.00000000000000000000000000000000000000e-030 ) has error -6.62657639597789005615137714159118611472e-036 expchar added
    XDLN ( 0.99999999999999999997967120926589679187e-002 ) has error -1.82260575780620520509693296377754605128e-037 expchar added
    XDLN ( 1.99999999999999999995934241853179358373e-002 ) has error -5.19141374642514070732114864602456209898e-038 expchar added
    XDLN ( 2.99999999999999999993901362779769037559e-002 ) has error -5.13601233479184842711692194951161479525e-038 expchar added
    XDLN ( 3.99999999999999999991868483706358716745e-002 ) has error -3.86289632708550728270522615395458095235e-038 expchar added
    XDLN ( 4.99999999999999999972894945687862389149e-002 ) has error -9.78443975026303739518139703913070595005e-039 expchar added
    XDLN ( 5.99999999999999999953921407669366061555e-002 ) has error 1.89723972174531190042213362500928170603e-037 expchar added
    XDLN ( 6.99999999999999999934947869650869733959e-002 ) has error 2.04139505614833356407245773908884322822e-038 expchar added
    XDLN ( 7.99999999999999999915974331632373406364e-002 ) has error -1.36584142960955786130173490862701305215e-037 expchar added
    XDLN ( 8.99999999999999999897000793613877078770e-002 ) has error 3.80919460561440779898110925649743572350e-037 expchar added

    XDLOG ( 1.00000000000000000000000000000000000000e-030 ) has error -2.79999999999998072463991967917809971633e-036 expchar added
    XDLOG ( 0.99999999999999999997967120926589679187e-002 ) has error -8.02173724408943904376045536976719860122e-038 expchar added
    XDLOG ( 1.99999999999999999995934241853179358373e-002 ) has error -2.40861932708648128310326872412112677599e-038 expchar added
    XDLOG ( 2.99999999999999999993901362779769037559e-002 ) has error -3.27097257823375987672480319518338656983e-038 expchar added
    XDLOG ( 3.99999999999999999991868483706358716745e-002 ) has error -1.68529881469298327181612370242125644237e-038 expchar added
    XDLOG ( 4.99999999999999999972894945687862389149e-002 ) has error -1.10644318847425602993510640594713770800e-038 expchar added
    XDLOG ( 5.99999999999999999953921407669366061555e-002 ) has error 7.99152458036595493424030126974362246939e-038 expchar added
    XDLOG ( 6.99999999999999999934947869650869733959e-002 ) has error 1.26481008172245424107219032529501739132e-038 expchar added
    XDLOG ( 7.99999999999999999915974331632373406364e-002 ) has error -5.74504882914446682704155819817708403443e-038 expchar added
    XDLOG ( 8.99999999999999999897000793613877078770e-002 ) has error 1.57729768287389546992421038820577613935e-037 expchar added

    XDSIN ( 1.00000000000000000000000000000000000000e-030 ) has error 1.29101793204526163878010874270477467373e-070 normal
    XDSIN ( 0.99999999999999999997967120926589679187e-002 ) has error 6.67299578116222596068330094441902572832e-041 normal
    XDSIN ( 1.99999999999999999995934241853179358373e-002 ) has error 1.24885574859123552268091835334773198283e-041 normal
    XDSIN ( 2.99999999999999999993901362779769037559e-002 ) has error 1.21631175297416474361116945624806745813e-040 expchar added
    XDSIN ( 3.99999999999999999991868483706358716745e-002 ) has error -4.56160168988821978591675563199633575058e-043 normal
    XDSIN ( 4.99999999999999999972894945687862389149e-002 ) has error -2.86472223571241775607725623527257367953e-040 expchar added
    XDSIN ( 5.99999999999999999953921407669366061555e-002 ) has error 2.64866800639651315642396207025943678811e-040 expchar added
    XDSIN ( 6.99999999999999999934947869650869733959e-002 ) has error 5.68100956488468287061974233130754295455e-040 expchar added
    XDSIN ( 7.99999999999999999915974331632373406364e-002 ) has error 4.03879768466879197813639605257794197950e-040 expchar added
    XDSIN ( 8.99999999999999999897000793613877078770e-002 ) has error 4.04548586565586929034874064680559050536e-041 normal

    XDCOS ( 1.00000000000000000000000000000000000000e-030 ) has error
    0e expchar added
    XDCOS ( 0.99999999999999999997967120926589679187e-002 ) has error 2.26937651611572857123963236041557813488e-040 expchar added
    XDCOS ( 1.99999999999999999995934241853179358373e-002 ) has error 1.05784431943303690784331098108059315728e-039 expchar added
    XDCOS ( 2.99999999999999999993901362779769037559e-002 ) has error -8.28853581603496815709572059523320314393e-040 expchar added
    XDCOS ( 3.99999999999999999991868483706358716745e-002 ) has error 1.28229080295341980606824813320399109491e-039 expchar added
    XDCOS ( 4.99999999999999999972894945687862389149e-002 ) has error -3.06529862908267391729975099510125667134e-040 expchar added
    XDCOS ( 5.99999999999999999953921407669366061555e-002 ) has error 9.97657349563875152650246408342715956471e-041 normal
    XDCOS ( 6.99999999999999999934947869650869733959e-002 ) has error 1.52728318105864276118103887006545643018e-040 expchar added
    XDCOS ( 7.99999999999999999915974331632373406364e-002 ) has error -2.65581659424352908798763436721582770342e-040 expchar added
    XDCOS ( 8.99999999999999999897000793613877078770e-002 ) has error 4.17538880771243050540144723085664223212e-040 expchar added

    XDTAN ( 1.00000000000000000000000000000000000000e-030 ) has error 1.29101793204526163878010874270477467373e-070 normal
    XDTAN ( 0.99999999999999999997967120926589679187e-002 ) has error 7.86198890534976134568111350333511371198e-041 normal
    XDTAN ( 1.99999999999999999995934241853179358373e-002 ) has error 2.54642545569919150907936311564749938879e-041 normal
    XDTAN ( 2.99999999999999999993901362779769037559e-002 ) has error 4.92412263652751450868215686185657599274e-041 normal
    XDTAN ( 3.99999999999999999991868483706358716745e-002 ) has error 3.21603332096879876026518381127338163351e-041 normal
    XDTAN ( 4.99999999999999999972894945687862389149e-002 ) has error 2.22863455391605914260061047495957019492e-042 normal
    XDTAN ( 5.99999999999999999953921407669366061555e-002 ) has error 1.96435421395972713386363507539118404382e-040 expchar added
    XDTAN ( 6.99999999999999999934947869650869733959e-002 ) has error 1.03661273910346295609968523871441374912e-039 expchar added
    XDTAN ( 7.99999999999999999915974331632373406364e-002 ) has error 6.16348565478431763845182753514320382210e-040 expchar added
    XDTAN ( 8.99999999999999999897000793613877078770e-002 ) has error 5.89663295158040800914685228081667779445e-040 expchar added

    XDASIN ( 1.00000000000000000000000000000000000000e-030 ) has error 1.29101793204526163878010874270477467373e-070 normal
    XDASIN ( 0.99999999999999999997967120926589679187e-002 ) has error 1.06288506739692023014014514202286693952e-040 expchar added
    XDASIN ( 1.99999999999999999995934241853179358373e-002 ) has error 1.18620521396941756939619038753891561966e-043 normal
    XDASIN ( 2.99999999999999999993901362779769037559e-002 ) has error 6.42015268649882094913063256350676037959e-041 normal
    XDASIN ( 3.99999999999999999991868483706358716745e-002 ) has error 1.68541643545119660632015195728775873850e-040 expchar added
    XDASIN ( 4.99999999999999999972894945687862389149e-002 ) has error 1.14962662396038758784288486170491461689e-041 normal
    XDASIN ( 5.99999999999999999953921407669366061555e-002 ) has error 1.62810626917765837106168005717175964603e-040 expchar added
    XDASIN ( 6.99999999999999999934947869650869733959e-002 ) has error -1.67287339125982550596132456268490151294e-040 expchar added
    XDASIN ( 7.99999999999999999915974331632373406364e-002 ) has error 6.86827595924907968786371383493869519313e-041 normal
    XDASIN ( 8.99999999999999999897000793613877078770e-002 ) has error 3.14687940601246525241859643446236853175e-041 normal

    XDACOS ( 1.00000000000000000000000000000000000000e-030 ) has error 8.51286412869876136686264348996348688469e-039 expchar added
    XDACOS ( 0.99999999999999999997967120926589679187e-002 ) has error 8.42080729251333728973200350387143176605e-039 expchar added
    XDACOS ( 1.99999999999999999995934241853179358373e-002 ) has error 1.12523608380982682142506708955444733839e-038 expchar added
    XDACOS ( 2.99999999999999999993901362779769037559e-002 ) has error 1.48317708944889972291458431835143398293e-038 expchar added
    XDACOS ( 3.99999999999999999991868483706358716745e-002 ) has error 1.15552392225237634959455118056863072452e-038 expchar added
    XDACOS ( 4.99999999999999999972894945687862389149e-002 ) has error 1.68155995330049493767239224548987985836e-038 expchar added
    XDACOS ( 5.99999999999999999953921407669366061555e-002 ) has error 8.42499729059892514556429302028788691345e-039 expchar added
    XDACOS ( 6.99999999999999999934947869650869733959e-002 ) has error 1.68910682051921274990158959761560038106e-038 expchar added
    XDACOS ( 7.99999999999999999915974331632373406364e-002 ) has error 9.20764572090292031685733397098994361595e-039 expchar added
    XDACOS ( 8.99999999999999999897000793613877078770e-002 ) has error 1.91152709460365462879754513293760859821e-038 expchar added

    XDATAN ( 1.00000000000000000000000000000000000000e-030 ) has error 1.29101793204526163878010874270477467373e-070 normal
    XDATAN ( 0.99999999999999999997967120926589679187e-002 ) has error 1.46995245650580134516746711707684970180e-040 expchar added
    XDATAN ( 1.99999999999999999995934241853179358373e-002 ) has error 1.29456958273411133186131077405795619810e-040 expchar added
    XDATAN ( 2.99999999999999999993901362779769037559e-002 ) has error 2.27300277760536400638003788107729613513e-041 normal
    XDATAN ( 3.99999999999999999991868483706358716745e-002 ) has error 1.71440273282904156112860920349050971320e-041 normal
    XDATAN ( 4.99999999999999999972894945687862389149e-002 ) has error -8.79785088439346384114473172443475991097e-042 normal
    XDATAN ( 5.99999999999999999953921407669366061555e-002 ) has error 1.84403390678171343042388210407934034976e-040 expchar added
    XDATAN ( 6.99999999999999999934947869650869733959e-002 ) has error 4.05825057760390352615737698621819921881e-041 normal
    XDATAN ( 7.99999999999999999915974331632373406364e-002 ) has error 8.16823863486507319535699187413473620757e-041 normal
    XDATAN ( 8.99999999999999999897000793613877078770e-002 ) has error 1.05743761801235163669978118474130445934e-039 expchar added

    XDSINH ( 1.00000000000000000000000000000000000000e-030 ) has error 1.29101793204526163878010874270477467373e-070 normal
    XDSINH ( 0.99999999999999999997967120926589679187e-002 ) has error 6.66658725054865502347635772291632867493e-041 normal
    XDSINH ( 1.99999999999999999995934241853179358373e-002 ) has error 1.21544028925414281827860405321564854051e-040 expchar added
    XDSINH ( 2.99999999999999999993901362779769037559e-002 ) has error 1.13965354916657485958368021204057531056e-040 expchar added
    XDSINH ( 3.99999999999999999991868483706358716745e-002 ) has error 6.36746803902351348380215660014531863561e-041 normal
    XDSINH ( 4.99999999999999999972894945687862389149e-002 ) has error -6.19350314211832201158140467664350602576e-041 normal
    XDSINH ( 5.99999999999999999953921407669366061555e-002 ) has error -1.10756748596389831844071503128403503510e-037 expchar added
    XDSINH ( 6.99999999999999999934947869650869733959e-002 ) has error -1.69843400737121067012067782815167729304e-037 expchar added
    XDSINH ( 7.99999999999999999915974331632373406364e-002 ) has error 1.02386660553226925138354878440952397856e-037 expchar added
    XDSINH ( 8.99999999999999999897000793613877078770e-002 ) has error 5.26939542105025559462841427815592898393e-037 expchar added

    XDCOSH ( 1.00000000000000000000000000000000000000e-030 ) has error
    0e expchar added
    XDCOSH ( 0.99999999999999999997967120926589679187e-002 ) has error 1.61712748653502725813106251724239562941e-039 expchar added
    XDCOSH ( 1.99999999999999999995934241853179358373e-002 ) has error 5.58771255439826073192845112959033622641e-040 expchar added
    XDCOSH ( 2.99999999999999999993901362779769037559e-002 ) has error 4.52469446231384234736939737058591448150e-039 expchar added
    XDCOSH ( 3.99999999999999999991868483706358716745e-002 ) has error 1.35049446060763628276868078708558924732e-038 expchar added
    XDCOSH ( 4.99999999999999999972894945687862389149e-002 ) has error 1.53845744834404858132277248246384080207e-039 expchar added
    XDCOSH ( 5.99999999999999999953921407669366061555e-002 ) has error 3.62917283360377523730065781421359167182e-039 expchar added
    XDCOSH ( 6.99999999999999999934947869650869733959e-002 ) has error -9.36528596982320693957147731437974174324e-039 expchar added
    XDCOSH ( 7.99999999999999999915974331632373406364e-002 ) has error 1.39284581230363223746491515174768838391e-038 expchar added
    XDCOSH ( 8.99999999999999999897000793613877078770e-002 ) has error 5.15867681014260389053134954059155740386e-038 expchar added

    XDTANH ( 1.00000000000000000000000000000000000000e-030 ) has error -3.16901234324314520198708982067954726578e-050 normal
    XDTANH ( 0.99999999999999999997967120926589679187e-002 ) has error 6.99258308085801556012356152590914491796e-038 expchar added
    XDTANH ( 1.99999999999999999995934241853179358373e-002 ) has error -2.34185189676210026338369339725855457041e-037 expchar added
    XDTANH ( 2.99999999999999999993901362779769037559e-002 ) has error -8.83362021317197352394598273700628202781e-038 expchar added
    XDTANH ( 3.99999999999999999991868483706358716745e-002 ) has error 9.03353190409145319445598305845210662363e-038 expchar added
    XDTANH ( 4.99999999999999999972894945687862389149e-002 ) has error -1.12206306526338686337254757423296952280e-037 expchar added
    XDTANH ( 5.99999999999999999953921407669366061555e-002 ) has error -1.09841328168573829423052716972172158527e-037 expchar added
    XDTANH ( 6.99999999999999999934947869650869733959e-002 ) has error -1.68718775105643630414843188399470564280e-037 expchar added
    XDTANH ( 7.99999999999999999915974331632373406364e-002 ) has error 1.01384009110270185905869516846537618394e-037 expchar added
    XDTANH ( 8.99999999999999999897000793613877078770e-002 ) has error 5.20238836564657603984514006242231737241e-037 expchar added

    XDASINH( 1.00000000000000000000000000000000000000e-030 ) has error -3.16901234324314520198708982067954726578e-050 normal
    XDASINH( 0.99999999999999999997967120926589679187e-002 ) has error 2.54950692882792047539694401485770252108e-038 expchar added
    XDASINH( 1.99999999999999999995934241853179358373e-002 ) has error -6.53222301622647624144964122987232593347e-038 expchar added
    XDASINH( 2.99999999999999999993901362779769037559e-002 ) has error 7.16819087474554567837232238989505566402e-038 expchar added
    XDASINH( 3.99999999999999999991868483706358716745e-002 ) has error -2.62672669316884280291780464337701491593e-037 expchar added
    XDASINH( 4.99999999999999999972894945687862389149e-002 ) has error 2.17793401186525439733820056763616235352e-037 expchar added
    XDASINH( 5.99999999999999999953921407669366061555e-002 ) has error 1.06085336740476079219929318908653265834e-037 expchar added
    XDASINH( 6.99999999999999999934947869650869733959e-002 ) has error -2.41354649887017888319499794682299836959e-037 expchar added
    XDASINH( 7.99999999999999999915974331632373406364e-002 ) has error 1.56444657256269445542468566412666689321e-037 expchar added
    XDASINH( 8.99999999999999999897000793613877078770e-002 ) has error 8.63349103149272010742278617385455734849e-038 expchar added

    XDACOSH( 1.00000000000000010000000000000000000000e+000 ) has error 2.69173276826217051404600892373900203296e-031 expchar added
    XDACOSH( 1.01000000000000009999132638262011596452e+000 ) has error -9.62429803808536888746950665655043490514e-038 expchar added
    XDACOSH( 1.02000000000000009998265276524023192905e+000 ) has error 2.61789597347813577599325573598184916324e-037 expchar added
    XDACOSH( 1.03000000000000009997397914786034789357e+000 ) has error -1.00074314612366941028293983563965698460e-038 expchar added
    XDACOSH( 1.04000000000000009996530553048046385810e+000 ) has error -4.08672420396043582913609893667594241835e-038 expchar added
    XDACOSH( 1.05000000000000009995663191310057982263e+000 ) has error 2.87388771943744337655053706167053629462e-037 expchar added
    XDACOSH( 1.06000000000000009994795829572069578716e+000 ) has error -1.31071117298809540338617114100959818592e-037 expchar added
    XDACOSH( 1.07000000000000009993928467834081175169e+000 ) has error 2.86829898437437490159982211625950916307e-037 expchar added
    XDACOSH( 1.08000000000000009993061106096092771621e+000 ) has error 1.74070834489375103728204137054984643440e-037 expchar added
    XDACOSH( 1.09000000000000009992193744358104368074e+000 ) has error -3.73907362595109425682726744637036719139e-037 expchar added

    XDATANH( 1.00000000000000000000000000000000000000e-030 ) has error -3.16901234324314520198708982067954726578e-050 normal
    XDATANH( 0.99999999999999999997967120926589679187e-002 ) has error -6.84591537158660817667307062849685511665e-038 expchar added
    XDATANH( 1.99999999999999999995934241853179358373e-002 ) has error -3.07960078624571265701577961751167967305e-039 expchar added
    XDATANH( 2.99999999999999999993901362779769037559e-002 ) has error 2.93599934165176916724748910283698720772e-038 expchar added
    XDATANH( 3.99999999999999999991868483706358716745e-002 ) has error 3.92322721598532734709953462506017364374e-038 expchar added
    XDATANH( 4.99999999999999999972894945687862389149e-002 ) has error 6.55298354507196840476064261684460851056e-039 expchar added
    XDATANH( 5.99999999999999999953921407669366061555e-002 ) has error -9.34781850647456507787794949571845255261e-039 expchar added
    XDATANH( 6.99999999999999999934947869650869733959e-002 ) has error -3.77383817245999396071290692867139404961e-038 expchar added
    XDATANH( 7.99999999999999999915974331632373406364e-002 ) has error -4.30257078807194955510957384377328559904e-039 expchar added
    XDATANH( 8.99999999999999999897000793613877078770e-002 ) has error 2.74361337204287938711070985886299316063e-038 expchar added ok
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Fri Sep 25 10:43:12 2026
    From Newsgroup: comp.lang.forth

    On 25/09/2026 10:17 am, marcel hendrix wrote:
    ...
    In the past few days I ported D.H.Bailey's floating point library over from double to extended floats. It is interesting that Bailey's code did not need adjustment when the mantissa was widened from 106 to 128 bits.

    I wondered about the constant SPLIT. Apparently some sort of magic number.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From marcel hendrix@mhx@iae.nl to comp.lang.forth on Fri Sep 25 08:24:06 2026
    From Newsgroup: comp.lang.forth

    On 9/25/2026 2:43 AM, dxf wrote:
    On 25/09/2026 10:17 am, marcel hendrix wrote:
    ...
    In the past few days I ported D.H.Bailey's floating point library over from double to extended floats. It is interesting that Bailey's code did not need adjustment when the mantissa was widened from 106 to 128 bits.

    I wondered about the constant SPLIT. Apparently some sort of magic number.

    No, not magic. The algorithm to convert a floating point number x in two
    new fp values a and b gives very specific instructions for the
    properties of the value of SPLIT, if the sum of a and b is to be exactly
    equal to the properly rounded value of x. It can be used to split a 53
    bit x into two other 53 bit numbers a and b. For example, the extended
    float 0.7e0 is equal to the sum of the extended floats 7.0000000000000000000e-0001 and 1.0842021724855044340e-0020.

    The original paper mentioned by JVN, "Software for Doubled-Precision Floating-Point Computations", Seppo Linnainmaa, ACM Transactions on Mathematical Software, Vol 7, No 3, September 1981, Pages 272-283,
    explains the procedure and gives the algorithm for SPLIT. Maybe
    unfortunately, Julian decided to define SPLIT as a magic number instead
    of writing
    -- split = beta^(p-floor(p/2)) + 1, for beta=2 p=53
    53e 53e F2/ FLOOR F- F2^X F1+ FCONSTANT split ( 134217729e )

    This is like finding the two halves of a double (integer) number: $1234567891011121314151617. swap . . 1157726452361532951 4886718345 .

    I found the mentioned paper (and more modern papers like it) very
    difficult to read because they assume the reader already knows the above
    and immediately dive into lengthy mathematical definitions.

    -marcel

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sat Sep 26 00:38:04 2026
    From Newsgroup: comp.lang.forth

    On 25/09/2026 4:24 pm, marcel hendrix wrote:
    ...
    The original paper mentioned by JVN, "Software for Doubled-Precision Floating-Point Computations", Seppo Linnainmaa, ACM Transactions on Mathematical Software, Vol 7, No 3, September 1981, Pages 272-283, explains the procedure and gives the algorithm for SPLIT. Maybe unfortunately, Julian decided to define SPLIT as a magic number instead
    of writing
    -- split = beta^(p-floor(p/2)) + 1, for beta=2 p=53
    53e 53e F2/ FLOOR F- F2^X F1+ FCONSTANT split ( 134217729e )
    ...

    So SPLIT for extended precision is 4294967297e ?

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From marcel hendrix@mhx@iae.nl to comp.lang.forth on Fri Sep 25 17:13:23 2026
    From Newsgroup: comp.lang.forth

    On 9/25/2026 4:38 PM, dxf wrote:
    On 25/09/2026 4:24 pm, marcel hendrix wrote:
    ...
    The original paper mentioned by JVN, "Software for Doubled-Precision Floating-Point Computations", Seppo Linnainmaa, ACM Transactions on Mathematical Software, Vol 7, No 3, September 1981, Pages 272-283, explains the procedure and gives the algorithm for SPLIT. Maybe unfortunately, Julian decided to define SPLIT as a magic number instead
    of writing
    -- split = beta^(p-floor(p/2)) + 1, for beta=2 p=53
    53e 53e F2/ FLOOR F- F2^X F1+ FCONSTANT split ( 134217729e )
    ...

    So SPLIT for extended precision is 4294967297e ?

    FORTH> split f. 4294967297.0000000000000000000

    -marcel
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sat Sep 26 11:40:39 2026
    From Newsgroup: comp.lang.forth

    On 26/09/2026 1:13 am, marcel hendrix wrote:
    On 9/25/2026 4:38 PM, dxf wrote:
    On 25/09/2026 4:24 pm, marcel hendrix wrote:
    ...
    The original paper mentioned by JVN, "Software for Doubled-Precision Floating-Point Computations", Seppo Linnainmaa, ACM Transactions on Mathematical Software, Vol 7, No 3, September 1981, Pages 272-283, explains the procedure and gives the algorithm for SPLIT. Maybe unfortunately, Julian decided to define SPLIT as a magic number instead
    of writing
    -- split = beta^(p-floor(p/2)) + 1, for beta=2 p=53
    53e 53e F2/ FLOOR F- F2^X F1+ FCONSTANT split ( 134217729e )
    ...

    So SPLIT for extended precision is 4294967297e ?

    FORTH> split f.-a 4294967297.0000000000000000000

    Much better. Thanks! I had used D>F not realizing it was out of range
    (by two digits).


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Hans Bezemer@the.beez.speaks@gmail.com to comp.lang.forth on Sat Sep 26 14:37:57 2026
    From Newsgroup: comp.lang.forth

    On 25-09-2026 02:17, marcel hendrix wrote:
    In the past few days I ported D.H.Bailey's floating point library over
    from double to extended floats. It is interesting that Bailey's code did
    not need adjustment when the mantissa was widened from 106 to 128 bits.
    The package is able to deliver about 38 decimal digits, about 6 orders
    of magnitude better than ddfloat manages. Also, the exponent can be
    +/-4900 instead of +/-308. Unfortunately, qd-fp.frt is about 2 to 3
    times slower than dd-fp.frt.

    If you only want 128 bit precision, the Eckert FP library offers 128 bit
    on 64 bit platforms, since its mantissa is two cells (and one cell for exponent and sign bits).

    However, I suspect D.H.Bailey library also features math functions,
    tuned for that task -- and that's quite a different story. I tuned all
    my float libraries for 64-bit, but I doubt I'll get that accuracy. ;-)

    I still have some problems with the trigonometric functions, which
    *appear* to become inaccurate for large angles. However, this may again
    be caused by limitations in MATLAB's vpa() function -- I use vpa to test
    the accuracy of the functions, and it works just fine for 106 bits but
    not for 128.

    We used to have Casio's "Keisan Online Calculator for Math and Science"
    online -- which was great. I used it extensively for developing my
    incomplete Beta functions. However, it's gone.

    Nowadays I use Qalculate! You can set the precision in the display "set precision <n>" (https://qalculate.github.io/ -- yeah, it's got Windows
    as well).

    It's pretty extensive..

    Hans Bezemer

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From dxf@dxforth@gmail.com to comp.lang.forth on Sun Sep 27 20:02:07 2026
    From Newsgroup: comp.lang.forth

    On 26/09/2026 1:13 am, marcel hendrix wrote:
    On 9/25/2026 4:38 PM, dxf wrote:
    On 25/09/2026 4:24 pm, marcel hendrix wrote:
    ...
    The original paper mentioned by JVN, "Software for Doubled-Precision Floating-Point Computations", Seppo Linnainmaa, ACM Transactions on Mathematical Software, Vol 7, No 3, September 1981, Pages 272-283, explains the procedure and gives the algorithm for SPLIT. Maybe unfortunately, Julian decided to define SPLIT as a magic number instead
    of writing
    -- split = beta^(p-floor(p/2)) + 1, for beta=2 p=53
    53e 53e F2/ FLOOR F- F2^X F1+ FCONSTANT split ( 134217729e )
    ...

    So SPLIT for extended precision is 4294967297e ?

    FORTH> split f.-a 4294967297.0000000000000000000

    -marcel

    Here's my DD updated for Extended-precision:

    https://pastebin.com/ZNV592Wb

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From marcel hendrix@mhx@iae.nl to comp.lang.forth on Sun Sep 27 12:30:01 2026
    From Newsgroup: comp.lang.forth

    On 9/27/2026 12:02 PM, dxf wrote:
    On 26/09/2026 1:13 am, marcel hendrix wrote:
    On 9/25/2026 4:38 PM, dxf wrote:
    On 25/09/2026 4:24 pm, marcel hendrix wrote:
    ...
    The original paper mentioned by JVN, "Software for Doubled-Precision Floating-Point Computations", Seppo Linnainmaa, ACM Transactions on Mathematical Software, Vol 7, No 3, September 1981, Pages 272-283, explains the procedure and gives the algorithm for SPLIT. Maybe unfortunately, Julian decided to define SPLIT as a magic number instead
    of writing
    -- split = beta^(p-floor(p/2)) + 1, for beta=2 p=53
    53e 53e F2/ FLOOR F- F2^X F1+ FCONSTANT split ( 134217729e )
    ...

    So SPLIT for extended precision is 4294967297e ?

    FORTH> split f.-a 4294967297.0000000000000000000

    -marcel

    Here's my DD updated for Extended-precision:

    https://pastebin.com/ZNV592Wb

    Congratulations! I am still struggling with XDSIN and friends.

    -marcel
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Paul Rubin@no.email@nospam.invalid to comp.lang.forth on Mon Sep 28 14:00:58 2026
    From Newsgroup: comp.lang.forth

    marcel hendrix <mhx@iae.nl> writes:
    I still have some problems with the trigonometric functions, which
    *appear* to become inaccurate for large angles. However, this may
    again be caused by limitations in MATLAB's vpa() function -- I use vpa
    to test the accuracy of the functions, and it works just fine for 106
    bits but not for 128.

    You could try mpmath with python, see mpmath.org .
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From albert@albert@spenarnc.xs4all.nl to comp.lang.forth on Tue Sep 29 01:02:51 2026
    From Newsgroup: comp.lang.forth

    In article <1198eb6$fpan$1@dont-email.me>,
    Hans Bezemer <the.beez.speaks@gmail.com> wrote:
    On 25-09-2026 02:17, marcel hendrix wrote:
    In the past few days I ported D.H.Bailey's floating point library over
    from double to extended floats. It is interesting that Bailey's code did
    not need adjustment when the mantissa was widened from 106 to 128 bits.
    The package is able to deliver about 38 decimal digits, about 6 orders
    of magnitude better than ddfloat manages. Also, the exponent can be
    +/-4900 instead of +/-308. Unfortunately, qd-fp.frt is about 2 to 3
    times slower than dd-fp.frt.

    If you only want 128 bit precision, the Eckert FP library offers 128 bit
    on 64 bit platforms, since its mantissa is two cells (and one cell for >exponent and sign bits).

    However, I suspect D.H.Bailey library also features math functions,
    tuned for that task -- and that's quite a different story. I tuned all
    my float libraries for 64-bit, but I doubt I'll get that accuracy. ;-)

    I still have some problems with the trigonometric functions, which
    *appear* to become inaccurate for large angles. However, this may again
    be caused by limitations in MATLAB's vpa() function -- I use vpa to test
    the accuracy of the functions, and it works just fine for 106 bits but
    not for 128.

    We used to have Casio's "Keisan Online Calculator for Math and Science" >online -- which was great. I used it extensively for developing my
    incomplete Beta functions. However, it's gone.

    Nowadays I use Qalculate! You can set the precision in the display "set >precision <n>" (https://qalculate.github.io/ -- yeah, it's got Windows
    as well).

    For the transputer Forth 1993 we were forced to generate power
    series coefficients. It is based on UBASIC, that has practically
    infinite precision.
    https://home.hccnet.nl/a.w.m.van.der.horst/approx.html

    It approximates the real (!) Chebychev coefficients for functions
    UBASIC knows about. That is pretty optimal.
    A caveat, it works for functions without poles, e.g. sin exp etc.

    It lands on 1 of 2 ulp's , which I find quite impressive for an
    amateur math package, if I may say myself.
    Range reduction was not done as fanatically as in this discussion.


    It's pretty extensive..

    Hans Bezemer

    --
    The Chinese government is satisfied with its military superiority over USA.
    The next 5 year plan has as primary goal to advance life expectancy
    over 80 years, like Western Europe.
    --- Synchronet 3.22a-Linux NewsLink 1.2