Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

In the long run, every program becomes rococco, and then rubble. -- Alan Perlis


devel / comp.lang.c / Re: Radians Or Degrees?

SubjectAuthor
* Radians Or Degrees?Lawrence D'Oliveiro
+* Re: Radians Or Degrees?James Kuyper
|`* Re: Radians Or Degrees?Michael S
| `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|  `* Re: Radians Or Degrees?Steven G. Kargl
|   `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|    `* Re: Radians Or Degrees?Steven G. Kargl
|     `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      +* Re: Radians Or Degrees?Michael S
|      |+- Re: Radians Or Degrees?Lawrence D'Oliveiro
|      |+* Re: Radians Or Degrees?MitchAlsup1
|      ||`* Re: Radians Or Degrees?Steven G. Kargl
|      || +* Re: Radians Or Degrees?Chris M. Thomasson
|      || |`* Re: Radians Or Degrees?Chris M. Thomasson
|      || | `* Re: Radians Or Degrees?MitchAlsup1
|      || |  `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |   `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      || |    `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |     `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      || |      `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |       +- Re: Radians Or Degrees?Lawrence D'Oliveiro
|      || |       `- Re: Radians Or Degrees?Chris M. Thomasson
|      || +* Re: Radians Or Degrees?MitchAlsup1
|      || |`* Re: Radians Or Degrees?Terje Mathisen
|      || | `* Re: Radians Or Degrees?Michael S
|      || |  +* Re: Radians Or Degrees?MitchAlsup1
|      || |  |+* Re: Radians Or Degrees?MitchAlsup1
|      || |  ||`- Re: Radians Or Degrees?Terje Mathisen
|      || |  |+* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      || |  ||+- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  ||`* Re: Radians Or Degrees?MitchAlsup1
|      || |  || `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  ||  `- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  |`- Re: Radians Or Degrees?Michael S
|      || |  +* Re: Radians Or Degrees?Terje Mathisen
|      || |  |+* Re: Radians Or Degrees?Michael S
|      || |  ||`* Re: Radians Or Degrees?MitchAlsup1
|      || |  || `- Re: Radians Or Degrees?Terje Mathisen
|      || |  |`* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | +* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | |`- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | +* Re: Radians Or Degrees?Keith Thompson
|      || |  | |+* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | ||`* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | || `* Re: Radians Or Degrees?Keith Thompson
|      || |  | ||  `* Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | ||   `- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  | |`* Re: Radians Or Degrees?MitchAlsup1
|      || |  | | `* Re: Radians Or Degrees?Michael S
|      || |  | |  `* Re: Radians Or Degrees?MitchAlsup1
|      || |  | |   +- Re: Radians Or Degrees?Scott Lurndal
|      || |  | |   +- Re: Radians Or Degrees?Michael S
|      || |  | |   `* Re: Radians Or Degrees?Keith Thompson
|      || |  | |    +* Re: Radians Or Degrees?bart
|      || |  | |    |`* Re: Radians Or Degrees?Keith Thompson
|      || |  | |    | `* Re: Radians Or Degrees?bart
|      || |  | |    |  `* Re: Radians Or Degrees?Keith Thompson
|      || |  | |    |   `- Re: Radians Or Degrees?David Brown
|      || |  | |    `* Re: Radians Or Degrees?Michael S
|      || |  | |     +- Re: Radians Or Degrees?Michael S
|      || |  | |     `* Re: Radians Or Degrees?bart
|      || |  | |      `- Re: Radians Or Degrees?Michael S
|      || |  | `- Re: Radians Or Degrees?Chris M. Thomasson
|      || |  `* Re: Radians Or Degrees?Stefan Monnier
|      || |   `* Re: Radians Or Degrees?MitchAlsup1
|      || |    `* Re: Radians Or Degrees?Stefan Monnier
|      || |     +* Re: Radians Or Degrees?Michael S
|      || |     |+* Re: Radians Or Degrees?Stefan Monnier
|      || |     ||`* Re: Radians Or Degrees?MitchAlsup1
|      || |     || `* Re: Radians Or Degrees?Terje Mathisen
|      || |     ||  `* Re: Radians Or Degrees?Michael S
|      || |     ||   +- Re: Radians Or Degrees?MitchAlsup1
|      || |     ||   `- Re: Radians Or Degrees?Terje Mathisen
|      || |     |+* Re: Radians Or Degrees?Steven G. Kargl
|      || |     ||`- Re: Radians Or Degrees?MitchAlsup1
|      || |     |`* Re: Radians Or Degrees?MitchAlsup1
|      || |     | `- Re: Radians Or Degrees?Michael S
|      || |     +* Re: Radians Or Degrees?MitchAlsup1
|      || |     |`- Re: Radians Or Degrees?Stefan Monnier
|      || |     `- Re: Radians Or Degrees?Terje Mathisen
|      || `* Re: Radians Or Degrees?Michael S
|      ||  `* Re: Radians Or Degrees?MitchAlsup1
|      ||   `* Re: Radians Or Degrees?Steven G. Kargl
|      ||    +* Re: Radians Or Degrees?MitchAlsup1
|      ||    |+* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    ||`* Re: Radians Or Degrees?Steven G. Kargl
|      ||    || +* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    || |`* Re: Radians Or Degrees?Steven G. Kargl
|      ||    || | `- Re: Radians Or Degrees?Kaz Kylheku
|      ||    || `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    ||  `* Re: Radians Or Degrees?Steven G. Kargl
|      ||    ||   `- Re: Radians Or Degrees?MitchAlsup1
|      ||    |`- Re: Radians Or Degrees?Steven G. Kargl
|      ||    +* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    |+* Re: Radians Or Degrees?Ben Bacarisse
|      ||    ||`* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    || `* Re: Radians Or Degrees?Ben Bacarisse
|      ||    ||  +* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    ||  |`* Re: Radians Or Degrees?Ben Bacarisse
|      ||    ||  | +* Re: Radians Or Degrees?Kaz Kylheku
|      ||    ||  | |`* Re: Radians Or Degrees?Ben Bacarisse
|      ||    ||  | `* Re: Radians Or Degrees?Lawrence D'Oliveiro
|      ||    ||  `- Re: Radians Or Degrees?Tim Rentsch
|      ||    |+- Re: Radians Or Degrees?Kaz Kylheku
|      ||    |`* Re: Radians Or Degrees?James Kuyper
|      ||    `* Re: Radians Or Degrees?Terje Mathisen
|      |`- Re: Radians Or Degrees?Terje Mathisen
|      `* Re: Radians Or Degrees?Steven G. Kargl
+* Re: Radians Or Degrees?fir
+* Re: Radians Or Degrees?Malcolm McLean
+- Re: Radians Or Degrees?David Brown
`* Re: Radians Or Degrees?Blue-Maned_Hawk

Pages:1234567
Re: Radians Or Degrees?

<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34541&group=comp.lang.c#34541

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Wed, 20 Mar 2024 09:54:36 -0400
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Injection-Info: dont-email.me; posting-host="08c998265a5aa3c91d4e4d5bc7e921b3";
logging-data="1609880"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fhfr4alqs+x6kijMtq/fpOvekCwTsqRM="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:J0RW/UYDtWFQ8PR7OkhajfOxAM4=
sha1:v8pFaN9c1uDvJF6Dy7aN3RiCZ08=
 by: Stefan Monnier - Wed, 20 Mar 2024 13:54 UTC

>>>> There are groups who have shown that exactly rounded trancendental
>>>> functions are in fact achievable with maybe 3X reduced performance.
>> That much? I had the impression it was significantly cheaper.
> The J. M. Muller book indicates about 2× to 2.5×

The [Rlibm](https://people.cs.rutgers.edu/~sn349/rlibm/) project claims
to get much better performance (basically, in the same ballpark as
not-correctly-rounded implementations).

[ Their key insight is the idea that to get correct rounding, you
shouldn't try to compute the best approximation of the exact result
and then round, but you should instead try to compute any
approximation whose rounding gives the correct result. ]

My impression was that their performance was good enough that the case
for not-correctly-rounded implementations becomes very weak.

>> I don't know what are/were the motivations for the people working on
>> exact transcendentals, but they have applications unrelated to the fact
>> that they're "better": the main benefit (from this here PL guy) is that
>> it gives them a reliable, reproducible semantics.
>> Bit-for-bit reproducibility makes several things much easier.
>
> Consider moving an application which uses libm from machine to machine.
> When libm is correctly rounded, there is no issue at all; not so other-
> wise.

Exactly!
[ Or should I say "Correctly rounded!"? ]

Stefan

Re: Radians Or Degrees?

<20240320182147.000067e1@yahoo.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34555&group=comp.lang.c#34555

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Wed, 20 Mar 2024 18:21:47 +0200
Organization: A noiseless patient Spider
Lines: 74
Message-ID: <20240320182147.000067e1@yahoo.com>
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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: dont-email.me; posting-host="92be935da1beff2666dcf9ddcb3e2080";
logging-data="1601670"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+dtfdjUJraEPs8gXAl+iBAmm6oM0uEXhQ="
Cancel-Lock: sha1:tE/CzX8hXLsBWZ7avQxVfduJ45Q=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Wed, 20 Mar 2024 16:21 UTC

On Wed, 20 Mar 2024 09:54:36 -0400
Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> >>>> There are groups who have shown that exactly rounded
> >>>> trancendental functions are in fact achievable with maybe 3X
> >>>> reduced performance.
> >> That much? I had the impression it was significantly cheaper.
> > The J. M. Muller book indicates about 2× to 2.5×
>
> The [Rlibm](https://people.cs.rutgers.edu/~sn349/rlibm/) project
> claims to get much better performance (basically, in the same
> ballpark as not-correctly-rounded implementations).
>

I had only read the 1st page.
It sounds like they are not particularly interested in IEEE binary64
which appears to be the major point of interest of math libs of
conventional languages.

> [ Their key insight is the idea that to get correct rounding, you
> shouldn't try to compute the best approximation of the exact result
> and then round, but you should instead try to compute any
> approximation whose rounding gives the correct result. ]
>
> My impression was that their performance was good enough that the case
> for not-correctly-rounded implementations becomes very weak.
>

It all depend of what you compare against.
For scalar call for majority of transcendental functions on IEEE-754
list, it's probably very easy to get correctly rounded binary32 results
in approximately the same time as results calculated with max. err of,
say, 0.75 ULP. Especially so if target machine has fast binary64
arithmetic.
But in practice when we use lower (than binary64) precision we often
care about vector performance rather than scalar.
I.e. we care little about speed of sinf(), but want ippsTone_32f() as
fast as possible. In case you wonder, this function is part Intel
Performance Primitives and it is FAST. Writing correctly rounded
function that approaches the speed of this *almost* correctly
rounded routine (I think, for sane input ranges it's better than
0.55 ULP) would not be easy at all!

> >> I don't know what are/were the motivations for the people working
> >> on exact transcendentals, but they have applications unrelated to
> >> the fact that they're "better": the main benefit (from this here
> >> PL guy) is that it gives them a reliable, reproducible semantics.
> >> Bit-for-bit reproducibility makes several things much easier.
> >
> > Consider moving an application which uses libm from machine to
> > machine. When libm is correctly rounded, there is no issue at all;
> > not so other- wise.
>
> Exactly!
> [ Or should I say "Correctly rounded!"? ]
>
>
> Stefan

You like this proposal because you are implementer of the language/lib.
It makes your regression tests easier. And it's good challenge.
I don't like it because I am primarily user of the language/lib. My
floating-point tests have zero chance of repeatability of this sort for
a thousand of other reasons.
I don't want to pay for correct rounding of transcendental functions.
Neither in speed and especially nor in tables footprint. Not even a
little. Because for me there are no advantages.
Now, there are things that I am ready to pay for. E.g. preservation of
mathematical properties of original exact function. I.e. if original is
monotonic on certain interval then I do want at least weak monotonicity
of approximation. If original is even (or odd) I want the same for
approximation. If original never exceed 1, I want the same
for approximation. Etc... But correct rounding is not on the list.

Re: Radians Or Degrees?

<jwvr0g4j1ta.fsf-monnier+comp.arch@gnu.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34559&group=comp.lang.c#34559

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Wed, 20 Mar 2024 12:59:24 -0400
Organization: A noiseless patient Spider
Lines: 52
Message-ID: <jwvr0g4j1ta.fsf-monnier+comp.arch@gnu.org>
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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
<20240320182147.000067e1@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="08c998265a5aa3c91d4e4d5bc7e921b3";
logging-data="1691518"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/GAujKTRQM7dUiPgeq/LHbDbLaJV+Rhwg="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:0VJh6KLw7G5wBhVCnjrcHRJsDFI=
sha1:2yzPqhZauM5Q5xcdtkb2nrdc2pU=
 by: Stefan Monnier - Wed, 20 Mar 2024 16:59 UTC

>> The [Rlibm](https://people.cs.rutgers.edu/~sn349/rlibm/) project
>> claims to get much better performance (basically, in the same
>> ballpark as not-correctly-rounded implementations).
> I had only read the 1st page.
> It sounds like they are not particularly interested in IEEE binary64
> which appears to be the major point of interest of math libs of
> conventional languages.

Indeed, I hoped by now they had attacked the world of 64bit floats, but
it looks like it's not the case yet. In theory the same idea is
applicable there and should give similar results, but of course it's
harder for two reasons:

- The search space to consider is much larger, making it much more
costly to do exhaustive testing (and to collect the info they need to
choose/compute the polynomials).
- You can't cheaply use higher-precision floats for internal computations.

> It all depend of what you compare against.
> For scalar call for majority of transcendental functions on IEEE-754
> list, it's probably very easy to get correctly rounded binary32 results
> in approximately the same time as results calculated with max. err of,
> say, 0.75 ULP. Especially so if target machine has fast binary64
> arithmetic.

IIUC that was not the case before their work: it was "easy" to get the
correct result in 99% of the cases, but covering all 100% of the cases
used to be costly because those few cases needed a lot more
internal precision.

> I don't want to pay for correct rounding of transcendental functions.
> Neither in speed and especially nor in tables footprint. Not even a
> little. Because for me there are no advantages.

For that reason, correctly rounded results were nowhere near the menu,
indeed. But the proposition of Rlibm is that maybe we can have our cake
and eat it too, because (if all goes well) you don't have to pay for it
in speed nor in table size.

I'm hoping that pans out :-)

> Now, there are things that I am ready to pay for. E.g. preservation of
> mathematical properties of original exact function. I.e. if original is
> monotonic on certain interval then I do want at least weak monotonicity
> of approximation. If original is even (or odd) I want the same for
> approximation. If original never exceed 1, I want the same
> for approximation. Etc... But correct rounding is not on the list.

But correct rounding would give you those properties.

Stefan

Re: Radians Or Degrees?

<utf4s1$1jei0$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34562&group=comp.lang.c#34562

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: sgk...@REMOVEtroutmask.apl.washington.edu (Steven G. Kargl)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Wed, 20 Mar 2024 17:02:57 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 32
Message-ID: <utf4s1$1jei0$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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
<20240320182147.000067e1@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 20 Mar 2024 17:02:57 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e049053cb2d7a4db1601c778c974b911";
logging-data="1686080"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ShAigAsfGwcAPpHm/Iw+a"
User-Agent: Pan/0.145 (Duplicitous mercenary valetism; d7e168a
git.gnome.org/pan2)
Cancel-Lock: sha1:dDa/DBWL0PVyOH+gMsuGqXy2bk4=
 by: Steven G. Kargl - Wed, 20 Mar 2024 17:02 UTC

On Wed, 20 Mar 2024 18:21:47 +0200, Michael S wrote:

> On Wed, 20 Mar 2024 09:54:36 -0400
> Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
>> >>>> There are groups who have shown that exactly rounded
>> >>>> trancendental functions are in fact achievable with maybe 3X
>> >>>> reduced performance.
>> >> That much? I had the impression it was significantly cheaper.
>> > The J. M. Muller book indicates about 2× to 2.5×
>>
>> The [Rlibm](https://people.cs.rutgers.edu/~sn349/rlibm/) project
>> claims to get much better performance (basically, in the same
>> ballpark as not-correctly-rounded implementations).
>>
>
> I had only read the 1st page.
> It sounds like they are not particularly interested in IEEE binary64
> which appears to be the major point of interest of math libs of
> conventional languages.
>

I skimmed their logf(x) implementation. Their technique will
fall a part for binary64 (and other higher precisions). With
logf(x), they combine an argument step with table look-up and
a 5th-order polynomial approximation. The polynomial is computed
in double precision, and provides the correct rounding. For
binary64, the polynomial would require many more terms and
double-double or binary128 evaluation.

--
steve

Re: Radians Or Degrees?

<45a87cfd06631ecc5820e21b8a58fe08@www.novabbs.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34574&group=comp.lang.c#34574

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchal...@aol.com (MitchAlsup1)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Wed, 20 Mar 2024 20:26:03 +0000
Organization: Rocksolid Light
Message-ID: <45a87cfd06631ecc5820e21b8a58fe08@www.novabbs.org>
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> <jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org> <9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org> <jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2659703"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: ac58ceb75ea22753186dae54d967fed894c3dce8
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$kojM0A5GJRjhtIh/QRC76ONL3KqVjEwIpjEnB4Y7kmjiikK8QXQBK
 by: MitchAlsup1 - Wed, 20 Mar 2024 20:26 UTC

Stefan Monnier wrote:

>>>>> There are groups who have shown that exactly rounded trancendental
>>>>> functions are in fact achievable with maybe 3X reduced performance.
>>> That much? I had the impression it was significantly cheaper.
>> The J. M. Muller book indicates about 2× to 2.5×

> The [Rlibm](https://people.cs.rutgers.edu/~sn349/rlibm/) project claims
> to get much better performance (basically, in the same ballpark as
> not-correctly-rounded implementations).

> [ Their key insight is the idea that to get correct rounding, you
> shouldn't try to compute the best approximation of the exact result
> and then round, but you should instead try to compute any
> approximation whose rounding gives the correct result. ]

This sounds like the "Minefield Method"

> My impression was that their performance was good enough that the case
> for not-correctly-rounded implementations becomes very weak.

>>> I don't know what are/were the motivations for the people working on
>>> exact transcendentals, but they have applications unrelated to the fact
>>> that they're "better": the main benefit (from this here PL guy) is that
>>> it gives them a reliable, reproducible semantics.
>>> Bit-for-bit reproducibility makes several things much easier.
>>
>> Consider moving an application which uses libm from machine to machine.
>> When libm is correctly rounded, there is no issue at all; not so other-
>> wise.

> Exactly!
> [ Or should I say "Correctly rounded!"? ]

> Stefan

Re: Radians Or Degrees?

<874a1d36b91024222a126fbedb677615@www.novabbs.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34575&group=comp.lang.c#34575

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchal...@aol.com (MitchAlsup1)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Wed, 20 Mar 2024 20:33:44 +0000
Organization: Rocksolid Light
Message-ID: <874a1d36b91024222a126fbedb677615@www.novabbs.org>
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> <jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org> <9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org> <jwv8r2djafq.fsf-monnier+comp.arch@gnu.org> <20240320182147.000067e1@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2659994"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: Rocksolid Light
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: ac58ceb75ea22753186dae54d967fed894c3dce8
X-Rslight-Site: $2y$10$p0vgPbMJIgjrgoJ2T9qt3.J/fgAd5t2wwDijGpXJBcc6coWT3tWC6
 by: MitchAlsup1 - Wed, 20 Mar 2024 20:33 UTC

Michael S wrote:

> On Wed, 20 Mar 2024 09:54:36 -0400
> Stefan Monnier <monnier@iro.umontreal.ca> wrote:

>> [ Their key insight is the idea that to get correct rounding, you
>> shouldn't try to compute the best approximation of the exact result
>> and then round, but you should instead try to compute any
>> approximation whose rounding gives the correct result. ]
>>
>> My impression was that their performance was good enough that the case
>> for not-correctly-rounded implementations becomes very weak.
>>

> It all depend of what you compare against.
> For scalar call for majority of transcendental functions on IEEE-754
> list, it's probably very easy to get correctly rounded binary32 results
> in approximately the same time as results calculated with max. err of,
> say, 0.75 ULP. Especially so if target machine has fast binary64
> arithmetic.

> But in practice when we use lower (than binary64) precision we often
> care about vector performance rather than scalar.
> I.e. we care little about speed of sinf(), but want ippsTone_32f() as
> fast as possible. In case you wonder, this function is part Intel
> Performance Primitives and it is FAST. Writing correctly rounded
> function that approaches the speed of this *almost* correctly
> rounded routine (I think, for sane input ranges it's better than
> 0.55 ULP) would not be easy at all!

I challenge ANY software version of SIN() correctly rounded or not
to compete with my <patented> HW implementations for speed (or even
power).

>> >> I don't know what are/were the motivations for the people working
>> >> on exact transcendentals, but they have applications unrelated to
>> >> the fact that they're "better": the main benefit (from this here
>> >> PL guy) is that it gives them a reliable, reproducible semantics.
>> >> Bit-for-bit reproducibility makes several things much easier.
>> >
>> > Consider moving an application which uses libm from machine to
>> > machine. When libm is correctly rounded, there is no issue at all;
>> > not so other- wise.
>>
>> Exactly!
>> [ Or should I say "Correctly rounded!"? ]
>>
>>
>> Stefan

> You like this proposal because you are implementer of the language/lib.
> It makes your regression tests easier. And it's good challenge.
> I don't like it because I am primarily user of the language/lib. My
> floating-point tests have zero chance of repeatability of this sort for
> a thousand of other reasons.

> I don't want to pay for correct rounding of transcendental functions.

Even when the HW is 7× faster than SW algorithms ??

> Neither in speed and especially nor in tables footprint. Not even a
> little. Because for me there are no advantages.

My HW algorithms use no memory (cache, DRAM, or even LDs.)

> Now, there are things that I am ready to pay for. E.g. preservation of
> mathematical properties of original exact function.

You know, of course, that incorrectly rounded SIN() and COS() do not
maintain the property of SIN()^2+COS()^2 == 1.0

> I.e. if original is
> monotonic on certain interval then I do want at least weak monotonicity
> of approximation.

My HW algorithms have a numeric proof of this maintenance.

> If original is even (or odd) I want the same for
> approximation. If original never exceed 1, I want the same
> for approximation. Etc... But correct rounding is not on the list.

SIN(x) can be incorrectly rounded to be greater than 1.0.

Still want incorrect rounding--or just a polynomial that does not
have SI(X) > 1.0 ??

Re: Radians Or Degrees?

<jwvy1achccw.fsf-monnier+comp.arch@gnu.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34576&group=comp.lang.c#34576

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: monn...@iro.umontreal.ca (Stefan Monnier)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Wed, 20 Mar 2024 16:34:22 -0400
Organization: A noiseless patient Spider
Lines: 11
Message-ID: <jwvy1achccw.fsf-monnier+comp.arch@gnu.org>
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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
<45a87cfd06631ecc5820e21b8a58fe08@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="08c998265a5aa3c91d4e4d5bc7e921b3";
logging-data="1795065"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ybaqPPSx58HDwwYOPBTz24LfVYRMl7HE="
User-Agent: Gnus/5.13 (Gnus v5.13)
Cancel-Lock: sha1:2FyZmJhjmHOa+rOCjy0SNCa5rHI=
sha1:9iXB0eR3ccvdwojdKsKW1FRIhUk=
 by: Stefan Monnier - Wed, 20 Mar 2024 20:34 UTC

>> [ Their key insight is the idea that to get correct rounding, you
>> shouldn't try to compute the best approximation of the exact result
>> and then round, but you should instead try to compute any
>> approximation whose rounding gives the correct result. ]
>
> This sounds like the "Minefield Method"

Indeed it is.

Stefan

Re: Radians Or Degrees?

<7df63e6620be0871ed9201ae9bedf765@www.novabbs.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34577&group=comp.lang.c#34577

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchal...@aol.com (MitchAlsup1)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Wed, 20 Mar 2024 20:40:25 +0000
Organization: Rocksolid Light
Message-ID: <7df63e6620be0871ed9201ae9bedf765@www.novabbs.org>
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> <jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org> <9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org> <jwv8r2djafq.fsf-monnier+comp.arch@gnu.org> <20240320182147.000067e1@yahoo.com> <jwvr0g4j1ta.fsf-monnier+comp.arch@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2660577"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: Rocksolid Light
X-Rslight-Posting-User: ac58ceb75ea22753186dae54d967fed894c3dce8
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Site: $2y$10$yFefu6JrK3js.iOcdZi0QeqrpXsKmi3EWvNS0XDsLe/s5iB5QZ/K.
 by: MitchAlsup1 - Wed, 20 Mar 2024 20:40 UTC

Stefan Monnier wrote:

>>> The [Rlibm](https://people.cs.rutgers.edu/~sn349/rlibm/) project
>>> claims to get much better performance (basically, in the same
>>> ballpark as not-correctly-rounded implementations).
>> I had only read the 1st page.
>> It sounds like they are not particularly interested in IEEE binary64
>> which appears to be the major point of interest of math libs of
>> conventional languages.

> Indeed, I hoped by now they had attacked the world of 64bit floats, but
> it looks like it's not the case yet. In theory the same idea is
> applicable there and should give similar results, but of course it's
> harder for two reasons:

> - The search space to consider is much larger, making it much more
> costly to do exhaustive testing (and to collect the info they need to
> choose/compute the polynomials).
> - You can't cheaply use higher-precision floats for internal computations.

You can in HW, just not in SW. That is a strong algorithms to migrate
these functions from SW procedures to HW instructions. You do not need
FP128, just FP with a 64-bit fraction.

>> It all depend of what you compare against.

OK:: SIN(x) takes 19-cycles and is 0.5002 accurate with Payne & Hanek argument
reduction--Against any SW implementation.

>> For scalar call for majority of transcendental functions on IEEE-754
>> list, it's probably very easy to get correctly rounded binary32 results
>> in approximately the same time as results calculated with max. err of,
>> say, 0.75 ULP.

Yes, at the cost of 4× larger tables.

> Especially so if target machine has fast binary64
>> arithmetic.

Obviously.

> IIUC that was not the case before their work: it was "easy" to get the
> correct result in 99% of the cases, but covering all 100% of the cases
> used to be costly because those few cases needed a lot more
> internal precision.

Muller indicates one typically need 2×n+6 to 2×n+12 bits to get correct
roundings 100% of the time. FP128 only has 2×n+3 and is insufficient by
itself.

>> I don't want to pay for correct rounding of transcendental functions.
>> Neither in speed and especially nor in tables footprint. Not even a
>> little. Because for me there are no advantages.

> For that reason, correctly rounded results were nowhere near the menu,
> indeed. But the proposition of Rlibm is that maybe we can have our cake
> and eat it too, because (if all goes well) you don't have to pay for it
> in speed nor in table size.

> I'm hoping that pans out :-)

>> Now, there are things that I am ready to pay for. E.g. preservation of
>> mathematical properties of original exact function. I.e. if original is
>> monotonic on certain interval then I do want at least weak monotonicity
>> of approximation. If original is even (or odd) I want the same for
>> approximation. If original never exceed 1, I want the same
>> for approximation. Etc... But correct rounding is not on the list.

> But correct rounding would give you those properties.

> Stefan

Re: Radians Or Degrees?

<f70bb5a0593faf21ddf941798a5ff976@www.novabbs.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34578&group=comp.lang.c#34578

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchal...@aol.com (MitchAlsup1)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Wed, 20 Mar 2024 20:47:02 +0000
Organization: Rocksolid Light
Message-ID: <f70bb5a0593faf21ddf941798a5ff976@www.novabbs.org>
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> <jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org> <9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org> <jwv8r2djafq.fsf-monnier+comp.arch@gnu.org> <20240320182147.000067e1@yahoo.com> <utf4s1$1jei0$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2661356"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$uPPKU/dBxQiK1qP3WgflEObduvypS2yJPsxmKAEGRKnZ8EKC3okb2
X-Spam-Checker-Version: SpamAssassin 4.0.0
X-Rslight-Posting-User: ac58ceb75ea22753186dae54d967fed894c3dce8
 by: MitchAlsup1 - Wed, 20 Mar 2024 20:47 UTC

Steven G. Kargl wrote:

> On Wed, 20 Mar 2024 18:21:47 +0200, Michael S wrote:

>> On Wed, 20 Mar 2024 09:54:36 -0400
>> Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>>
>>> >>>> There are groups who have shown that exactly rounded
>>> >>>> trancendental functions are in fact achievable with maybe 3X
>>> >>>> reduced performance.
>>> >> That much? I had the impression it was significantly cheaper.
>>> > The J. M. Muller book indicates about 2× to 2.5×
>>>
>>> The [Rlibm](https://people.cs.rutgers.edu/~sn349/rlibm/) project
>>> claims to get much better performance (basically, in the same
>>> ballpark as not-correctly-rounded implementations).
>>>
>>
>> I had only read the 1st page.
>> It sounds like they are not particularly interested in IEEE binary64
>> which appears to be the major point of interest of math libs of
>> conventional languages.
>>

> I skimmed their logf(x) implementation. Their technique will
> fall a part for binary64 (and other higher precisions). With
> logf(x), they combine an argument step with table look-up and
> a 5th-order polynomial approximation. The polynomial is computed
> in double precision, and provides the correct rounding. For
> binary64, the polynomial would require many more terms and
> double-double or binary128 evaluation.

The first 7 terms of the DP polynomial do not require FP128, whereas
the last 3 do/will.

Whereas: HW with 64-bits of fraction does not need FP128 at all.
64-bits of fraction with 64-bit coefficients added into a 128-bit
accumulator is more than sufficient.

Note FP64 has 53-bits of fraction.....

Re: Radians Or Degrees?

<20240321000348.00004b37@yahoo.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34581&group=comp.lang.c#34581

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Thu, 21 Mar 2024 00:03:48 +0200
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <20240321000348.00004b37@yahoo.com>
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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
<20240320182147.000067e1@yahoo.com>
<874a1d36b91024222a126fbedb677615@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: dont-email.me; posting-host="81d7bc9a7495271f9790b1be0b3006b0";
logging-data="1791105"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19cyZYeuCyvAojJd1kynwfnymVHzC/TqE0="
Cancel-Lock: sha1:aIrOBE91mjbDy8uj4TTMpCWGk9E=
X-Newsreader: Claws Mail 4.1.1 (GTK 3.24.34; x86_64-w64-mingw32)
 by: Michael S - Wed, 20 Mar 2024 22:03 UTC

On Wed, 20 Mar 2024 20:33:44 +0000
mitchalsup@aol.com (MitchAlsup1) wrote:

> Michael S wrote:
>
> > On Wed, 20 Mar 2024 09:54:36 -0400
> > Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> >> [ Their key insight is the idea that to get correct rounding, you
> >> shouldn't try to compute the best approximation of the exact
> >> result and then round, but you should instead try to compute any
> >> approximation whose rounding gives the correct result. ]
> >>
> >> My impression was that their performance was good enough that the
> >> case for not-correctly-rounded implementations becomes very weak.
> >>
>
> > It all depend of what you compare against.
> > For scalar call for majority of transcendental functions on IEEE-754
> > list, it's probably very easy to get correctly rounded binary32
> > results in approximately the same time as results calculated with
> > max. err of, say, 0.75 ULP. Especially so if target machine has
> > fast binary64 arithmetic.
>
> > But in practice when we use lower (than binary64) precision we often
> > care about vector performance rather than scalar.
> > I.e. we care little about speed of sinf(), but want ippsTone_32f()
> > as fast as possible. In case you wonder, this function is part Intel
> > Performance Primitives and it is FAST. Writing correctly rounded
> > function that approaches the speed of this *almost* correctly
> > rounded routine (I think, for sane input ranges it's better than
> > 0.55 ULP) would not be easy at all!
>
> I challenge ANY software version of SIN() correctly rounded or not
> to compete with my <patented> HW implementations for speed (or even
> power).
>

Before you post this response, you could as well look at what
ippsTone_32f() is doing. Hint - it's not generic scalar sin().
IMHO, for long enough vector and on modern enough Intel or AMD CPU it
will very easily beat any scalar-oriented binary64-oriented HW
implementation of sin() or cos().
This function is not about latency. It's about throughput.

AFAIR, youu were quite surprised by speed (throughput) of another IPP
primitive, ippsSin_64f_A53() when I posted results of timing
measurement here less than 2 yeears ago. So, before you issue a
challenge, just take into account that ippsTone_32f() is both more
specialized than ippsSin_64f_A53() and has much lower precision. So,
while I didn't test, I expect that it is much much faster.

Re: Radians Or Degrees?

<utgo6e$22viq$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34586&group=comp.lang.c#34586

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Thu, 21 Mar 2024 08:38:53 +0100
Organization: A noiseless patient Spider
Lines: 58
Message-ID: <utgo6e$22viq$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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Injection-Date: Thu, 21 Mar 2024 07:38:54 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="16aaa23000bff4241c492889ab7e0581";
logging-data="2195034"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19pA0rOVZCgDgshxWxOcgT9gStTHvGGCrefSZw7RoB15Q=="
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:h/Qlf1653EHaLHgWwBnAFnqO0WQ=
In-Reply-To: <jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
 by: Terje Mathisen - Thu, 21 Mar 2024 07:38 UTC

Stefan Monnier wrote:
>>>>> There are groups who have shown that exactly rounded trancendental
>>>>> functions are in fact achievable with maybe 3X reduced performance.
>>> That much? I had the impression it was significantly cheaper.
>> The J. M. Muller book indicates about 2× to 2.5×
>
> The [Rlibm](https://people.cs.rutgers.edu/~sn349/rlibm/) project claims
> to get much better performance (basically, in the same ballpark as
> not-correctly-rounded implementations).
>
> [ Their key insight is the idea that to get correct rounding, you
> shouldn't try to compute the best approximation of the exact result
> and then round, but you should instead try to compute any
> approximation whose rounding gives the correct result. ]

That is indeed interesting. However, it is also very interesting that
they only do this for 32-bit or less. I.e. the domains for which it is
almost trivially easy to verify the results by checking all possible
inputs. :-)
>
> My impression was that their performance was good enough that the case
> for not-correctly-rounded implementations becomes very weak.

I agree in priniciple: If you can use polys that are not much more
complicated than the min-max/cheby case, and which always round to the
desired values, then that's an obvious good.
...
Reading the full log2f() code, it seems that they can use double for all
evaluations, and with a single (!) mantissa exception, this produces the
correct results for all inputs and all rounding modes. :-)

I.e. with 53 bits to work with, giving up about one ulp for the range
reduction, the 52 remaining bits corresponds to 2n+6 bits available for
the 5-term poly to evaluate a final float result.

When asking for perfectly rounded trancendentals, with approximately the
same runtime, the float case is a form of cheating, simply because
current FPUs tend to run float and double at the same speed.

OTOH, I'm still persuaded that for a float library, using this approach
might in fact be included in the 754 standard.

Doing the same for double by "simply" doing all operations with fp128
variables would definitely take significantly longer, and verification
would be an "interesting" problem. (Interesting in the "multiple PhDs"
domain.)

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Re: Radians Or Degrees?

<utgovj$2360k$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34587&group=comp.lang.c#34587

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Thu, 21 Mar 2024 08:52:18 +0100
Organization: A noiseless patient Spider
Lines: 34
Message-ID: <utgovj$2360k$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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
<20240320182147.000067e1@yahoo.com>
<jwvr0g4j1ta.fsf-monnier+comp.arch@gnu.org>
<7df63e6620be0871ed9201ae9bedf765@www.novabbs.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Injection-Date: Thu, 21 Mar 2024 07:52:19 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="16aaa23000bff4241c492889ab7e0581";
logging-data="2201620"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+jEdoa1tLczckhvzJWsi2rTQFS97GM8Ui3V80LvHbkqg=="
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:Q1KHH3OE5RccyKCVxZzjYEctMZs=
In-Reply-To: <7df63e6620be0871ed9201ae9bedf765@www.novabbs.org>
 by: Terje Mathisen - Thu, 21 Mar 2024 07:52 UTC

MitchAlsup1 wrote:
> Stefan Monnier wrote:
>> IIUC that was not the case before their work: it was "easy" to get the
>> correct result in 99% of the cases, but covering all 100% of the cases
>> used to be costly because those few cases needed a lot more
>> internal precision.
>
> Muller indicates one typically need 2×n+6 to 2×n+12 bits to get correct
> roundings 100% of the time. FP128 only has 2×n+3 and is insufficient by
> itself.

I agree with everything else you've written about this subject, but
afair, fp128 is using 1:15:112 while double is of course 1:10:53.

On the one hand, 53*2+6 -> 112, on the other hand (if we include the
hidden bits) we get 54*2+5 -> 113.

So significantly more than 2n+3 but not enough on its own to guarantee
correct rounding.

As Michael S have mentioned, we want these algorithms to work for
vector/SIMD calculations, and at that point both lookup tables and
widening the size of the temporaries are very costly.

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Re: Radians Or Degrees?

<20240321145133.0000160f@yahoo.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34591&group=comp.lang.c#34591

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: already5...@yahoo.com (Michael S)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Thu, 21 Mar 2024 14:51:33 +0200
Organization: A noiseless patient Spider
Lines: 48
Message-ID: <20240321145133.0000160f@yahoo.com>
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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
<20240320182147.000067e1@yahoo.com>
<jwvr0g4j1ta.fsf-monnier+comp.arch@gnu.org>
<7df63e6620be0871ed9201ae9bedf765@www.novabbs.org>
<utgovj$2360k$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: dont-email.me; posting-host="9aa046efa41c2e95b44878331137a41b";
logging-data="2271091"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+x+Yhw/5BfUKWn/A1rM2l07fEJpDISWaE="
Cancel-Lock: sha1:v0a44iWMmRhiACi7y1v38AR3uZ0=
X-Newsreader: Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
 by: Michael S - Thu, 21 Mar 2024 12:51 UTC

On Thu, 21 Mar 2024 08:52:18 +0100
Terje Mathisen <terje.mathisen@tmsw.no> wrote:

> MitchAlsup1 wrote:
> > Stefan Monnier wrote:
> >> IIUC that was not the case before their work: it was "easy" to get
> >> the correct result in 99% of the cases, but covering all 100% of
> >> the cases used to be costly because those few cases needed a lot
> >> more internal precision.
> >
> > Muller indicates one typically need 2×n+6 to 2×n+12 bits to get
> > correct roundings 100% of the time. FP128 only has 2×n+3 and is
> > insufficient by itself.
>
> I agree with everything else you've written about this subject, but
> afair, fp128 is using 1:15:112 while double is of course 1:10:53.
>

IEEE-754 binary64 is 1:11:52 :-)

But anyway I am skeptical about Miller's rules of thumb.
I'd expect that different transcendental functions would exercise
non-trivially different behaviors, mostly because they have different
relationships between input and output ranges. Some of them compress
wider inputs into narrower output and some do the opposite.
Yet another factor is luck.

Besides, I see nothing special about binary128 as a helper format.
It is not supported on wast majority of HW, And even when it is
supported, like on IBM POWER, for majority of operations it is slower
than emulated 128-bit fixed-point. Fix-point is more work for coder, but
sounds like more sure path to success.

> On the one hand, 53*2+6 -> 112, on the other hand (if we include the
> hidden bits) we get 54*2+5 -> 113.
>
> So significantly more than 2n+3 but not enough on its own to
> guarantee correct rounding.
>
> As Michael S have mentioned, we want these algorithms to work for
> vector/SIMD calculations, and at that point both lookup tables and
> widening the size of the temporaries are very costly.
>
> Terje
>

Re: Radians Or Degrees?

<d8269e715ac6557d4265337f425d29a1@www.novabbs.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34599&group=comp.lang.c#34599

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!.POSTED!not-for-mail
From: mitchal...@aol.com (MitchAlsup1)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Thu, 21 Mar 2024 16:37:29 +0000
Organization: Rocksolid Light
Message-ID: <d8269e715ac6557d4265337f425d29a1@www.novabbs.org>
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> <jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org> <9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org> <jwv8r2djafq.fsf-monnier+comp.arch@gnu.org> <20240320182147.000067e1@yahoo.com> <jwvr0g4j1ta.fsf-monnier+comp.arch@gnu.org> <7df63e6620be0871ed9201ae9bedf765@www.novabbs.org> <utgovj$2360k$1@dont-email.me> <20240321145133.0000160f@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Info: i2pn2.org;
logging-data="2746940"; mail-complaints-to="usenet@i2pn2.org";
posting-account="PGd4t4cXnWwgUWG9VtTiCsm47oOWbHLcTr4rYoM0Edo";
User-Agent: Rocksolid Light
X-Rslight-Site: $2y$10$Mbqj3iChHH3P54FDxiyS0OWiwdWqkT8C0mZ35C/qR1IUn8PX1tM/O
X-Rslight-Posting-User: ac58ceb75ea22753186dae54d967fed894c3dce8
X-Spam-Checker-Version: SpamAssassin 4.0.0
 by: MitchAlsup1 - Thu, 21 Mar 2024 16:37 UTC

Michael S wrote:

> On Thu, 21 Mar 2024 08:52:18 +0100
> Terje Mathisen <terje.mathisen@tmsw.no> wrote:

>> MitchAlsup1 wrote:
>> > Stefan Monnier wrote:
>> >> IIUC that was not the case before their work: it was "easy" to get
>> >> the correct result in 99% of the cases, but covering all 100% of
>> >> the cases used to be costly because those few cases needed a lot
>> >> more internal precision.
>> >
>> > Muller indicates one typically need 2×n+6 to 2×n+12 bits to get
>> > correct roundings 100% of the time. FP128 only has 2×n+3 and is
>> > insufficient by itself.
>>
>> I agree with everything else you've written about this subject, but
>> afair, fp128 is using 1:15:112 while double is of course 1:10:53.
>>

> IEEE-754 binary64 is 1:11:52 :-)

> But anyway I am skeptical about Miller's rules of thumb.

See Chapter 10 "Elementary Functions: Algorithms and Implementation"
Jean-Michael Muller {you can find a free copy on the net} and in
particular tables 10.5-10.14 -- quoting from the book::

"In his PhD dissertation [206], Lef`evre gives algorithms for finding
the worst cases of the table maker’s dilemma. These algorithms use linear
approximations and massive parallelism. A recent presentation of these
algorithms, with some improvements, can be found in [207]. We have run
Lef`evre’s algorithms to find worst cases in double-precision for the
most common functions and domains. The results obtained so far, first
published in [208] are given in Tables 10.5 to 10.14

They are NOT rules of thumb !! But go read it for yourself.

> I'd expect that different transcendental functions would exercise
> non-trivially different behaviors, mostly because they have different
> relationships between input and output ranges. Some of them compress
> wider inputs into narrower output and some do the opposite.
> Yet another factor is luck.

> Besides, I see nothing special about binary128 as a helper format.
> It is not supported on wast majority of HW, And even when it is
> supported, like on IBM POWER, for majority of operations it is slower
> than emulated 128-bit fixed-point. Fix-point is more work for coder, but
> sounds like more sure path to success.

>> On the one hand, 53*2+6 -> 112, on the other hand (if we include the
>> hidden bits) we get 54*2+5 -> 113.
>>
>> So significantly more than 2n+3 but not enough on its own to
>> guarantee correct rounding.
>>
>> As Michael S have mentioned, we want these algorithms to work for
>> vector/SIMD calculations, and at that point both lookup tables and
>> widening the size of the temporaries are very costly.
>>
>> Terje
>>

Re: Radians Or Degrees?

<utlni9$3ergd$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34672&group=comp.lang.c#34672

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: chris.m....@gmail.com (Chris M. Thomasson)
Newsgroups: comp.lang.c
Subject: Re: Radians Or Degrees?
Date: Fri, 22 Mar 2024 21:58:49 -0700
Organization: A noiseless patient Spider
Lines: 17
Message-ID: <utlni9$3ergd$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> <ur8q2k$5nfr$1@dont-email.me>
<ur8qlp$5nfr$2@dont-email.me>
<a2a5c98883cafb6ab19668403b2dfb15@www.novabbs.org>
<urav5o$nqvp$1@dont-email.me> <urb704$phho$4@dont-email.me>
<urdk8j$1cis4$1@dont-email.me> <urdrv1$1e8e4$2@dont-email.me>
<urec1s$1l3du$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sat, 23 Mar 2024 04:58:49 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="136108bc033d63220533a114254bf648";
logging-data="3632653"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18GsD8vO1/AXpl2T0w/3kWKysesA85Cf+4="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:Uwj/8v8Jm3jZ3aPP/ujE4R6kn8o=
Content-Language: en-US
In-Reply-To: <urec1s$1l3du$1@dont-email.me>
 by: Chris M. Thomasson - Sat, 23 Mar 2024 04:58 UTC

On 2/24/2024 7:26 PM, Chris M. Thomasson wrote:
> On 2/24/2024 2:52 PM, Lawrence D'Oliveiro wrote:
>> On Sat, 24 Feb 2024 12:40:52 -0800, Chris M. Thomasson wrote:
>>
[...]
> think of the following interesting aspect:
>
> https://forums.parallax.com/discussion/147522/dog-leg-hypotenuse-approximation
>
> Vs "needing" to get much more accurate results, for say medical imaging
> wrt volumetric renders...

Another "high cycle" fractal of mine that benefits from higher
precision, under iteration:

https://paulbourke.net/fractals/cubicjulia

Re: Radians Or Degrees?

<utm2rr$3hb2q$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34674&group=comp.lang.c#34674

  copy link   Newsgroups: comp.lang.c comp.arch
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: terje.ma...@tmsw.no (Terje Mathisen)
Newsgroups: comp.lang.c,comp.arch
Subject: Re: Radians Or Degrees?
Date: Sat, 23 Mar 2024 09:11:38 +0100
Organization: A noiseless patient Spider
Lines: 69
Message-ID: <utm2rr$3hb2q$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>
<jwv1q87l5ou.fsf-monnier+comp.arch@gnu.org>
<9a5b9a6a445bd41ff75a93b589982970@www.novabbs.org>
<jwv8r2djafq.fsf-monnier+comp.arch@gnu.org>
<20240320182147.000067e1@yahoo.com>
<jwvr0g4j1ta.fsf-monnier+comp.arch@gnu.org>
<7df63e6620be0871ed9201ae9bedf765@www.novabbs.org>
<utgovj$2360k$1@dont-email.me> <20240321145133.0000160f@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
Injection-Date: Sat, 23 Mar 2024 08:11:39 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="00aa802448ec57a94e59f55df19f8322";
logging-data="3714138"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+YCQk10Wz//8W24VPzFTDsz3/0CZyGrWhhDZjloyZ39Q=="
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:nLpTckvMla8WUS88majnay+ov9A=
In-Reply-To: <20240321145133.0000160f@yahoo.com>
 by: Terje Mathisen - Sat, 23 Mar 2024 08:11 UTC

Michael S wrote:
> On Thu, 21 Mar 2024 08:52:18 +0100
> Terje Mathisen <terje.mathisen@tmsw.no> wrote:
>
>> MitchAlsup1 wrote:
>>> Stefan Monnier wrote:
>>>> IIUC that was not the case before their work: it was "easy" to get
>>>> the correct result in 99% of the cases, but covering all 100% of
>>>> the cases used to be costly because those few cases needed a lot
>>>> more internal precision.
>>>
>>> Muller indicates one typically need 2×n+6 to 2×n+12 bits to get
>>> correct roundings 100% of the time. FP128 only has 2×n+3 and is
>>> insufficient by itself.
>>
>> I agree with everything else you've written about this subject, but
>> afair, fp128 is using 1:15:112 while double is of course 1:10:53.
>>
>
> IEEE-754 binary64 is 1:11:52 :-)

Oops! Mea Culpa!
I _do_ know that double has a 10-bit exponent bias (1023), so it has to
be 11 bits wide. :-(

>
> But anyway I am skeptical about Miller's rules of thumb.
> I'd expect that different transcendental functions would exercise
> non-trivially different behaviors, mostly because they have different
> relationships between input and output ranges. Some of them compress
> wider inputs into narrower output and some do the opposite.
> Yet another factor is luck.

I agree, this is a per-function problem, with some being substantially
harder than others.
>
> Besides, I see nothing special about binary128 as a helper format.
> It is not supported on wast majority of HW, And even when it is
> supported, like on IBM POWER, for majority of operations it is slower
> than emulated 128-bit fixed-point. Fix-point is more work for coder, but
> sounds like more sure path to success.

In my own code (since I don't have Mitch's ability to use much wider
internal fp formats) I also prefer 64-bit u64 as the working chunk size.

Almost 30 years ago, during the FDIV workaround, I needed a q&d way to
verify that our fpatan2 replacement was correct, so what I did was to
write a 1:31:96 format library over a weekend.

Yeah, it was much more exponent than needed, but with only 32-bit
registers available it was much easier to get the asm correct.

For the fpatan2 I used a dead simple approach with little range
reduction, just a longish Taylor series (i.e. no Cheby optimizations).

I had previously written 3-4 different iomplementations of arbitrary
precision atan2() when I wanted to calculatie as many digits of pi as
possible, so I just reused one of those algorithms.

Terje

--
- <Terje.Mathisen at tmsw.no>
"almost all programming can be viewed as an exercise in caching"

Pages:1234567
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor