Thread View: comp.arch
7 messages
7 total messages
Started by MitchAlsup
Tue, 13 Oct 2026 21:33
Re: Taking hypot(3) To The Edge
Author: MitchAlsup
Date: Tue, 13 Oct 2026 21:33
Date: Tue, 13 Oct 2026 21:33
42 lines
2541 bytes
2541 bytes
Michael S <already5chosen@yahoo.com> posted:
> On Thu, 1 Oct 2026 10:17:57 +0200
> David Brown <david.brown@hesbynett.no> wrote:
>
> > On 01/10/2026 03:33, bart wrote:
> > > On 01/10/2026 01:47, Lawrence D’Oliveiro wrote:
> > >
> > >> A couple of things stand out immediately: one is that the “long
> > >> double” type doesn’t seem to make use of all the 128 bits it
> > >> occupies. I was expecting a mantissa length closer to 100 bits,
> > >> but it’s nowhere near that.
> > >
> > > Probably it uses Intel's 80-bit x87 FPU format. That uses a 64-bit
> > > mantissa (with explicit top bit).
> > >
> >
> > Yes, that's the default for "long double" in the standard x86-64 ABI.
> >
> > On 32-bit x86, these 10-byte doubles were often stored in 12-byte
> > (96-bit) containers for better alignment, but I don't know the ABI
> > standards here.
> >
> > On 64-bit x86, for better alignment they are stored in 16-byte
> > containers. The rest of the space will be padding.
> >
> > gcc supports "-mlong-double-64", "-mlong-double-80" and
> > "-mlong-double-128" flags.
>
> The latter appears to be a default on ARM64 Linux.
I personally have not seen an extended FP format supported for a long time
{20 years)--yes, x86 still gives lip service to then, but "support is iffy"
at best.
For example, I have eXcel from 2003, and on AMD machines I get 80-bit
precision (when real careful in eXcel math)--but those same programs
on Intel and Arm display 64-bit precision.
I think looking forward, one should anticipate long double being 128-bits
rather than 80-bits.
Re: Taking hypot(3) To The Edge
Author: Lawrence D’Oliveiro
Date: Tue, 13 Oct 2026 21:51
Date: Tue, 13 Oct 2026 21:51
9 lines
1633 bytes
1633 bytes
On Tue, 13 Oct 2026 21:33:23 GMT, MitchAlsup wrote: > I think looking forward, one should anticipate long double being > 128-bits rather than 80-bits. Allocation or actual usage? My test script indicated that, even though sizeof(long double) = 16, the mantissa was only using about 64 bits, and the exponent around 15.
Re: Taking hypot(3) To The Edge
Author: Anton Ertl
Date: Tue, 13 Oct 2026 21:54
Date: Tue, 13 Oct 2026 21:54
13 lines
1816 bytes
1816 bytes
MitchAlsup <user5857@newsgrouper.org.invalid> writes:
>I personally have not seen an extended FP format supported for a long time
>{20 years)--yes, x86 still gives lip service to then, but "support is iffy"
>at best.
Not in the least. 387 FP works fine, and, e.g., VFX Forth a first
switched to SSE2 in their 64-bit port, but due to customer complaints
about the reduced precision, they switched back to using 387 FP.
- anton
--
'Anyone trying for "industrial quality" ISA should avoid undefined behavior.'
Mitch Alsup, <c17fcd89-f024-40e7-a594-88a85ac10d20o@googlegroups.com>
Re: Taking hypot(3) To The Edge
Author: Michael S
Date: Wed, 14 Oct 2026 19:45
Date: Wed, 14 Oct 2026 19:45
18 lines
2083 bytes
2083 bytes
On Tue, 13 Oct 2026 21:33:23 GMT MitchAlsup <user5857@newsgrouper.org.invalid> wrote: > > For example, I have eXcel from 2003, and on AMD machines I get 80-bit > precision (when real careful in eXcel math)--but those same programs > on Intel and Arm display 64-bit precision. > Are you sure that you use exactly the same version of Excel on AMD and Intel? Also, what OS do you have on each machine? Also, how exactly do you detect that precision is higher than IEEE binary64? By forcing mantisa to hold more than 53 bits (incl.hidden) or by forcing exponent to hold more than 11 bits?
Re: Taking hypot(3) To The Edge
Author: MitchAlsup
Date: Wed, 14 Oct 2026 22:13
Date: Wed, 14 Oct 2026 22:13
37 lines
2470 bytes
2470 bytes
Michael S <already5chosen@yahoo.com> posted:
> On Tue, 13 Oct 2026 21:33:23 GMT
> MitchAlsup <user5857@newsgrouper.org.invalid> wrote:
>
> >
> > For example, I have eXcel from 2003, and on AMD machines I get 80-bit
> > precision (when real careful in eXcel math)--but those same programs
> > on Intel and Arm display 64-bit precision.
> >
>
> Are you sure that you use exactly the same version of Excel on AMD
> and Intel? Also, what OS do you have on each machine?
>
> Also, how exactly do you detect that precision is higher than IEEE
> binary64? By forcing mantisa to hold more than 53 bits (incl.hidden) or
> by forcing exponent to hold more than 11 bits?
Very carefully crafted arithmetic. I calculated the Chebyshev points on
a 128-bit FP machine and then transported the ASCII data back and gained
1.2ULP instead of calculating them using COS( point/k ) which is the
standard formula.
Also, instead of calculating a bunch of terms in multiple cells, I use
SUMPRODUCT() which I found to be ~0.3ULP better than writing the
equations out by hand.
I have no idea why, just that I can measure {LOG(ABS(value),2)} as the
number of bits of precision--where value is the {AMD,Intel} builtin
minus my Chebyshev polynomial evaluated at the same point. Given 1,000
evaluations points between [a, b] with random dither at each point
the shape of the graph shows the accuracy while the noise on the graph
shows the arithmetic noise.
>
>
>
Re: Taking hypot(3) To The Edge
Author: Michael S
Date: Thu, 15 Oct 2026 19:03
Date: Thu, 15 Oct 2026 19:03
56 lines
3315 bytes
3315 bytes
On Wed, 14 Oct 2026 22:13:04 GMT
MitchAlsup <user5857@newsgrouper.org.invalid> wrote:
> Michael S <already5chosen@yahoo.com> posted:
>
> > On Tue, 13 Oct 2026 21:33:23 GMT
> > MitchAlsup <user5857@newsgrouper.org.invalid> wrote:
> >
> > >
> > > For example, I have eXcel from 2003, and on AMD machines I get
> > > 80-bit precision (when real careful in eXcel math)--but those
> > > same programs on Intel and Arm display 64-bit precision.
> > >
> >
> > Are you sure that you use exactly the same version of Excel on AMD
> > and Intel? Also, what OS do you have on each machine?
> >
> > Also, how exactly do you detect that precision is higher than IEEE
> > binary64? By forcing mantisa to hold more than 53 bits
> > (incl.hidden) or by forcing exponent to hold more than 11 bits?
>
> Very carefully crafted arithmetic. I calculated the Chebyshev points
> on a 128-bit FP machine and then transported the ASCII data back and
> gained 1.2ULP instead of calculating them using COS( point/k ) which
> is the standard formula.
>
> Also, instead of calculating a bunch of terms in multiple cells, I use
> SUMPRODUCT() which I found to be ~0.3ULP better than writing the
> equations out by hand.
>
> I have no idea why, just that I can measure {LOG(ABS(value),2)} as the
> number of bits of precision--where value is the {AMD,Intel} builtin
> minus my Chebyshev polynomial evaluated at the same point. Given 1,000
> evaluations points between [a, b] with random dither at each point
> the shape of the graph shows the accuracy while the noise on the graph
> shows the arithmetic noise.
> >
> >
> >
All that sounds non-trivial. The difference can be easily related to
something else, e.g. to results of evaluation of trigs. Which do differ
a little between AMD and Intel.
What about trivial tests?
A = 1; B = A + 1e-18; C = B - 1;
Re: Taking hypot(3) To The Edge
Author: MitchAlsup
Date: Thu, 15 Oct 2026 19:19
Date: Thu, 15 Oct 2026 19:19
57 lines
3510 bytes
3510 bytes
Michael S <already5chosen@yahoo.com> posted:
> On Wed, 14 Oct 2026 22:13:04 GMT
> MitchAlsup <user5857@newsgrouper.org.invalid> wrote:
>
> > Michael S <already5chosen@yahoo.com> posted:
> >
> > > On Tue, 13 Oct 2026 21:33:23 GMT
> > > MitchAlsup <user5857@newsgrouper.org.invalid> wrote:
> > >
> > > >
> > > > For example, I have eXcel from 2003, and on AMD machines I get
> > > > 80-bit precision (when real careful in eXcel math)--but those
> > > > same programs on Intel and Arm display 64-bit precision.
> > > >
> > >
> > > Are you sure that you use exactly the same version of Excel on AMD
> > > and Intel? Also, what OS do you have on each machine?
> > >
> > > Also, how exactly do you detect that precision is higher than IEEE
> > > binary64? By forcing mantisa to hold more than 53 bits
> > > (incl.hidden) or by forcing exponent to hold more than 11 bits?
> >
> > Very carefully crafted arithmetic. I calculated the Chebyshev points
> > on a 128-bit FP machine and then transported the ASCII data back and
> > gained 1.2ULP instead of calculating them using COS( point/k ) which
> > is the standard formula.
> >
> > Also, instead of calculating a bunch of terms in multiple cells, I use
> > SUMPRODUCT() which I found to be ~0.3ULP better than writing the
> > equations out by hand.
> >
> > I have no idea why, just that I can measure {LOG(ABS(value),2)} as the
> > number of bits of precision--where value is the {AMD,Intel} builtin
> > minus my Chebyshev polynomial evaluated at the same point. Given 1,000
> > evaluations points between [a, b] with random dither at each point
> > the shape of the graph shows the accuracy while the noise on the graph
> > shows the arithmetic noise.
> > >
> > >
> > >
>
> All that sounds non-trivial. The difference can be easily related to
> something else, e.g. to results of evaluation of trigs. Which do differ
> a little between AMD and Intel.
>
> What about trivial tests?
> A = 1; B = A + 1e-18; C = B - 1;
It is really something which is a lot easier to see in graphical form--
like the difference between a multimeter and an oscilloscope.
And yes, there is a lot more numerical noise when I compare EXPM1 with
EXP-1 or LNP1 with Ln+1. But mostly the noise stays down near 52.3-bits
of precision {after all the careful attention to "things"; whereas it
started near 51-bits of precision before care was applied.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads