The “typeinfo” shows it is scalar, but maybe I’ll try find out…
ans = scalar
ans = 100000000001001001000011111101101010100010001000010110100011000
ans = 63
it looks difficult to find the pattern “11.001…” here (maybe as 1st ‘1’ is hidden).
The length still is ‘63’, not ‘64’, but maybe no issues. It going to show when it will.
pi = 0 10000000000 1001001000011111101101010100010001000010110100011000
Maybe the 1st zero is missing if I use this type cast? or something like that…
If I can see all the contents of the floating point register (including the sign) and with space separated, it can be more clear.
I hope to know some examples / function / method that can check equation accuracies.
Also it looks the below would work:
ans = 8.289046058458095e-317
even the exponent is outside the IEEE -format…
Below case however, the answer looks too short:
ans = 1000000000000000000000000
ans = 25
I guess it would work, except for plotting these numbers (cause leading zeroes missing…?)
ok. It seems it is ‘subnormal’ number.
I was wondering though why the ‘supernormal’ numbers are missing in this code (some numbers between 1.797693134862316e+308 and infinity, but up to 10^323).
Maybe if they are hard to calculate than the subnormals?
Can this be possible?
ans = 4.940656458412465e-324
I guess it would not show the actual step between these subnormal numbers as this is same eps as that used for zero.
It could be interesting not only to know this representation but how they are operated (that is how each operation is done in the register(s)).
And as I said how can I find the accuracy of some operation in octave?
Output result accuracy might be dependent of the operation, not only about the input numbers. Maybe I guess that it need some type of “Monte Carlo” simulation to see how much output is affected when input is changed by the input*eps/2 or similar amounts.
Is this how to test it:
i=0:11; x=(1-i*eps/2); y=acos(x), diff(y)
So comparing to
i=0:11; x=(i*eps/2); y=asin(x), diff(y)
would suggest asin(x) is more accuracy with small angles.
i=0:11; x=(i*eps/2); y=cos(x), diff(y)
i=0:11; x=(i*eps/2); y=sin(x), diff(y)
Maybe I can find out how to test.
Below is some testing, but its for simple multiplication function only:
LONGFORMAT.xls (11 KB)