Deutsch English Français Italiano |
<ut17ji$27n6b$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Terje Mathisen <terje.mathisen@tmsw.no> Newsgroups: comp.lang.c,comp.arch Subject: Re: Radians Or Degrees? Date: Fri, 15 Mar 2024 11:23:45 +0100 Organization: A noiseless patient Spider Lines: 84 Message-ID: <ut17ji$27n6b$1@dont-email.me> References: <ur5trn$3d64t$1@dont-email.me> <ur5v05$3ccut$1@dont-email.me> <20240222015920.00000260@yahoo.com> <ur69j9$3ftgj$3@dont-email.me> <ur86eg$1aip$1@dont-email.me> <ur88e4$1rr1$5@dont-email.me> <ur8a2p$2446$1@dont-email.me> <ur8ctk$2vbd$2@dont-email.me> <20240222233838.0000572f@yahoo.com> <3b2e86cdb0ee8785b4405ab10871c5ca@www.novabbs.org> <ur8nud$4n1r$1@dont-email.me> <936a852388e7e4414cb7e529da7095ea@www.novabbs.org> <ur9qtp$fnm9$1@dont-email.me> <20240314112655.000011f8@yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Date: Fri, 15 Mar 2024 10:23:46 -0000 (UTC) Injection-Info: dont-email.me; posting-host="6f1799d9c53815839a977e52488ad30c"; logging-data="2350283"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX181fYvg5yDaSjPPaPOVTfBPlPC7tmjGo/DMoB69mRKwxA==" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 SeaMonkey/2.53.18.1 Cancel-Lock: sha1:VHMQsFZWyw/iKluth4B4Vbc79HI= In-Reply-To: <20240314112655.000011f8@yahoo.com> Bytes: 4793 Michael, I for the main part agree with you here, i.e. calculating=20 sin(x) with x larger than 2^53 or so, is almost certainly stupid. Actually using and depending upon the result is more stupid. OTOH, it is and have always been, a core principle of ieee754 that basic = operations (FADD/FSUB/FMUL/FDIV/FSQRT) shall assume that the inputs are=20 exact (no fractional ulp uncertainty), and that we from that starting=20 point must deliver a correctly rounded version of the infinitely precise = exact result of the operation. Given the latter, it is in fact very tempting to see if that basic=20 result rule could be applied to more of the non-core operations, but I=20 cannot foresee any situation where I would use it myself: If I find=20 myself in a situation where the final fractional ulp is important, then=20 I would far rather switch to doing the operation in fp128. Terje Michael S wrote: > On Fri, 23 Feb 2024 11:10:00 +0100 > Terje Mathisen <terje.mathisen@tmsw.no> wrote: >=20 >> MitchAlsup1 wrote: >>> Steven G. Kargl wrote: >>>> Agreed a programmer should use what is required by the problem >>>> that they are solving.=C2=A0 I'll note that SW implementations have >>>> their sets of tricks (e.g., use of double-double arithmetic to >>>> achieve double precision). >>> >>> To get near IEEE desired precision, one HAS TO use more than 754 >>> precision. >> >> There are groups who have shown that exactly rounded trancendental >> functions are in fact achievable with maybe 3X reduced performance. >> >=20 > At which cost in tables sizes? >=20 >=20 >> There is a suggestion on the table to make that a (probably optional >> imho) feature for an upcoming ieee754 revision. >> >> Terje >> >=20 > The critical point here is definition of what considered exact. If > 'exact' is measured only on y side of y=3Dfoo(x), disregarding > possible imprecision on the x side then you are very likely to end up > with results that are slower to calculate, but not at all more useful > from point of view of engineer or physicist. Exactly like Payne-Hanek > or Mitch's equivalent of Payne-Hanek. >=20 > The definition of 'exact' should be: > For any finite-precision function foo(x) lets designate the same > mathematical function calculated with infinite precision as Foo(x). > Let's designate an operation of rounding of infinite-precision number t= o > desired finite precision as Rnd(). Rounding is done in to-nearest mode.= > Unlike in the case of basic operations, ties are allowed to be broken i= n > any direction. > The result of y=3Dfoo(x) for finite-precision number x considered > exact if *at least one* two conditions is true: > (1=3DY-clause) Rnd(Foo(x)) =3D=3D y > (2=3DX-clause) There exist an infinite precision number X for which > both Foo(X) =3D=3D y and Rnd(X) =3D=3D x. >=20 > As follows from the (2), it is possible and not uncommon that more > than one finite-precision number y is accepted exact result of foo(x). >=20 > If Committee omits the 2nd clause then the whole proposition will be no= t > just not useful, but harmful. >=20 --=20 - <Terje.Mathisen at tmsw.no> "almost all programming can be viewed as an exercise in caching"