Wednesday 12 October 2011

IEEE-754 ... is the suitcase of errors but still used in JAVA why ...

Look every-thing is this world is created or built for some reason ... but my topic first part is indicating that IEEE-754 is the source of errors ... now what are the errors .
1 . can-not differentiate between -0.0 and + 0.0 in compile time .
2 . weak , complex number representation .
3 . what is NAN ... i think this should be represented with something else ... because if it is something than two   NAN should be equal .
4 . rounding off problem .

now i have represent 4 errors in front of you .. and still there are too many errors but still java follows IEEE-754
, now the question arises that still we are using the suitcase ...
now i will explain why we or JAVA is using IEEE-754 .
two examples ...
1 . rounding off .
2 . matrix problem .

Rounding off problem :- rounding off problem is created not by IEEE .. but we say that IEEE-754 is the source of rounding  off problem .
now who is the representator of this problem . if i say that our machine is the problem is the cause behind rounding off error ...
example :- create a application in your system ... where instruction set is for 64bit because ultimately every thing is stored in memory so JVM 32 bits consideration is wrong thinking .

           and perform 4/7 : -and your machine will get the answer ( .5714285714285714)
but if your machine or windows console represent only 4 bits than you will get -- ( .5714 )
and if 6 bits supported by windows console than you will get -- ( .571428 )
if you will use 7 bits than you will get ( .57144286 )

see all results we get are different means we are depend upon machine representation .. now why we use IEEE-754 . we use it because when c is created after it we have nothing for proper understanding of floating point representation so in 1985 IEEE-754 is created and C just use it , because it is feasible and lighter for programmer who need speed now what is the relation to speed now i will explain it in matrix multiplication .

Matrix problem :- matrix problem is the ... very typical problem now how it is typical ...
********************** C = A.B ************************
perform this operation ..
look we have two options ...
1 . accurate result .
2 . speed .

if you love accurate result than IEEE-754 hurts you because when you multiply this matrix and solve the terms in matrix than we have to perform addition there which are all in rounded off form and added so you never get the accurate result .. so if you want pure or accurate result than kahan rules are good for you .

but if you love speed than IEEE-754 is best for you , because in IEEE-754 we all just depend upon .. quickness and we predict the result in IEEE-754 we do not use the accurate or depend upon accurate result .

 ********** now I think in some cases IEEE-754 is used for user benefit **********

No comments: