IA32 FPU register width
IA32 FPU register width
The IA32 FPU can be run using 64-bit precision or 80-bit precision. The former is IEEE compliant, the latter more precise (which can be interesting for scientific / financial fields). Implementations are even allowed to change the precision on the fly.
How do you lot handle this in your project of choice? Do you go for the (portable and standard) 64 bit, or for the ("better" but proprietary) 80 bit, or do you allow the app to choose?
If the latter, how do you handle this?
How do you lot handle this in your project of choice? Do you go for the (portable and standard) 64 bit, or for the ("better" but proprietary) 80 bit, or do you allow the app to choose?
If the latter, how do you handle this?
Every good solution is obvious once you've found it.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:IA32 FPU register width
most of the time (afaik), this is handled by performing internal computations with the native format and then translate to the IEEE format when delivering datas to an external piece of software.
but numeric precision algorithms are faar faaar away in my fogged mind.
but numeric precision algorithms are faar faaar away in my fogged mind.
Re:IA32 FPU register width
Hi, I think giving process chance to take advantage of any mode desired by programmer would be great since this would make writing programs more professional. But I dont think any people would need more than 64 bit precision. Also I am currently interested in programming fpu/mmx, are there any tutorials you know?
Re:IA32 FPU register width
I am working for a major bank, on a software that calculates sums amounting to millions of Euros. You bet they want more than 64 bit precision. Same goes for most scientific uses, like meteorology.Ozgunh82 wrote: But I dont think any people would need more than 64 bit precision.
Every good solution is obvious once you've found it.
Re:IA32 FPU register width
Well, why isnt 64 enough for representing millions of euros? If 64 bit isnt enough how do they know what precision is enough? I am sure you need it, I am just curious.
Re:IA32 FPU register width
I'm curious, too. 32 bits is enough to represent millions of euros. 64 bits is enough to represent billions of euros and some cents. (I'm not sure what the name is for 18x10^18, but it's big.) In fact, 64 bits could represent the total worth of a large country down to the nearest cent. Am I wrong?
Re:IA32 FPU register width
You Are Spot ON! ;D
2^64 = 18,446,744,073,709,551,616 as a whole number!
using a 32:32 bit representation for real you should get around
4,294,967,296:[4,294,967,296] places
Large isin't it!
2^64 = 18,446,744,073,709,551,616 as a whole number!
using a 32:32 bit representation for real you should get around
4,294,967,296:[4,294,967,296] places
Large isin't it!
Re:IA32 FPU register width
The precision of a 64 bit floating point is ~16 decimal digits (with the usual imprecision inherent in floating points stored as binary).
Don't think of storing a value, or making a single calculations. Think of a total ranging in the ten-million Euro range, converted to a different currency (like, the Euro - Deutsche Mark exchange rate was 1.95583), making a deposit yielding 1.537% interest rate, and calculate how much you'll get at the expiry date, in yet another currency.
Make this calculation for the hundreds of thousands such transactions done on an ordinary day in a large investment bank, over the span of one year.
When calculating your end-of-year balance, would you prefer doing this in 64 or in 80 bit precision?
(Much of this stuff is actually done using "bigint" maths of arbitrary precision. In other areas - i.e., overnight calculations - the time frame is too small to use the precise but slow "bigints".)
Now, take scientists working on global weather modeling, nuclear research etc. - they not only need it precise, they also need it fast. While a bank might be able to enjoy the comforts of bigint maths, they don't make for good calcs / sec. ratio. If the difference between 64 bit and 80 bit are the difference between a 100 mile grid and a 10 mile grid, which would you chose?
Sorry that I can't come up with examples you could follow through with your pocket calculators. But Intel took pains to bring the 80 bit FPU, and it was well received at its time for the added precision.
While today there's SSE2 with its 128 bit registers, I am not sure I am willing to waste 16 perfectly good bits...
Don't think of storing a value, or making a single calculations. Think of a total ranging in the ten-million Euro range, converted to a different currency (like, the Euro - Deutsche Mark exchange rate was 1.95583), making a deposit yielding 1.537% interest rate, and calculate how much you'll get at the expiry date, in yet another currency.
Make this calculation for the hundreds of thousands such transactions done on an ordinary day in a large investment bank, over the span of one year.
When calculating your end-of-year balance, would you prefer doing this in 64 or in 80 bit precision?
(Much of this stuff is actually done using "bigint" maths of arbitrary precision. In other areas - i.e., overnight calculations - the time frame is too small to use the precise but slow "bigints".)
Now, take scientists working on global weather modeling, nuclear research etc. - they not only need it precise, they also need it fast. While a bank might be able to enjoy the comforts of bigint maths, they don't make for good calcs / sec. ratio. If the difference between 64 bit and 80 bit are the difference between a 100 mile grid and a 10 mile grid, which would you chose?
Sorry that I can't come up with examples you could follow through with your pocket calculators. But Intel took pains to bring the 80 bit FPU, and it was well received at its time for the added precision.
While today there's SSE2 with its 128 bit registers, I am not sure I am willing to waste 16 perfectly good bits...
Every good solution is obvious once you've found it.
Re:IA32 FPU register width
I see what you mean. So you're not representing just individual sums of money, but you might be accumulating large sums over long periods of time.
As I write I'm filling out the forms that say I, too, am going to work in a large bank. I hope to start in a couple of weeks.
As I write I'm filling out the forms that say I, too, am going to work in a large bank. I hope to start in a couple of weeks.
Re:IA32 FPU register width
Good luck to you. I am actually trying to get out of the banking field... working for a large bank is like working for a government... bureaucrazy...Tim Robinson wrote: As I write I'm filling out the forms that say I, too, am going to work in a large bank. I hope to start in a couple of weeks.
Every good solution is obvious once you've found it.
Re:IA32 FPU register width
Well, I'm in it for the ???. I figure that, if it turns out to be awful, I can get out and try something else while I'm still young. The pay is good, and a few years experience there should look pretty good too.