Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

FPU addition/multiplication not commutative

Name: Anonymous 2013-11-20 19:14

I've disabled all rounding, enable flush underflows to zero, denormals are zero, and it still matters in which order I add/multiply numbers. What should I do?

Name: Anonymous 2013-11-20 20:06

add/multiply in the correct order

Name: Anonymous 2013-11-20 20:29

Which order gives the correct output?

Name: 1 2013-11-20 21:18

>>3
With addition, adding the operands with the smallest exponents (closest to zero) first gives the closest to correct results. With multiplication, no idea, I just observed that changing some of the operands around sometimes changes the result, but a full reversal of 5 operands had no effect so it isn't the same as with addition. (And no, it's not a case of overflow/underflow.)

I was originally trying to create my own floating point library, but I realized that I can't make it fast enough so I decided just to extend the FPU's, as that's fast but not precise, so I'll just make it precise while trying to keep it fast. Problem is, it's hard to work with something so inconsistent it doesn't even obey the basic laws of arithmetic.

Name: 1 2013-11-20 21:22

>>2
Thanks for this thoughtful reply, but one problem is I don't know the correct order for multiplication. It is a minimization problem to find out, and I need mathematics to solve problems, not create them.

Name: Anonymous 2013-11-23 7:39

Use bignums.

Don't change these.
Name: Email:
Entire Thread Thread List