|
On Jan 27, 3:04=A0pm, "Roger Stafford"
<ellieandrogerxy...@mindspring.com.invalid> wrote:
> aralimarad...@gmail.com wrote in message <18642ed7-fb80-4875-a7db-a79a15a=
12...@r37g2000prr.googlegroups.com>...
> > Hello friends, i have written a program below which can generate 64
> > bit double precision hex value but i require a value of more than 128
> > bits can anyone of you help me in this matter thank you
> > clc;
> > clear all;
> > format long
>
> > N=3D1000;
> > x=3D[.197];
> > Y=3D0;
> > y1=3D0;
> > for n=3D1:1:N
> > =A0 =A0Y=3D4.*x.*(1-x);
> > =A0 =A0y1=3Dy1+Y;
> > =A0 =A0x=3Dy1;
> > =A0 =A0y1=3D0;
>
> > =A0 end
> > disp (Y)
> > key=3Dnum2hex(Y)
>
> =A0 There are only 53 bits of precision in matlab's double format signifi=
cand, the other 11 bits being used for exponent and sign. =A0If you really =
need 128 bits you might consider the Symbolic Toolbox with decimal number p=
recision set to some very high level in an endeavor to achieve 128 bits acc=
uracy. =A0However you must realize that decimal precision is not precisely =
equivalent to binary accuracy. =A0You might make a single bit error in the =
128th bit even though decimal accuracy is set far above 128*log(10)/log(2) =
=3D 38 decimal place accuracy. =A0You should also realize that even if you =
had a machine using binary floating point numbers with 128 bit precision, y=
our algorithm would still be making rounding errors down at that 128-th pla=
ce in its multiplications. =A0Why do you feel the need of just 128 bit prec=
ision in particular, as opposed to some other value, higher or lower?
>
> =A0 Your code is puzzling. =A0The quantity y1 is always equal to zero whe=
n you do y1=3Dy1+Y, so you are just copying Y into y1 and then on into the =
next x. =A0Why are you doing things in this round-about way, as opposed to =
just
>
> =A0x =3D 4*x*(1-x);
>
> at each step?
>
> =A0 The iteration is interesting. =A0If you plot the x values as a functi=
on of the number of steps, it makes an almost random distribution of values=
which seem to fill up the screen area in a rectangle in a nearly uniform m=
anner except of course in the vicinity of x =3D 0.75 where one would expect=
an anomaly, since an exact x =3D 0.75 would stay constant. =A0Where did yo=
u encounter this peculiar iteration? =A0It looks like a good example of the=
fractals in chaos theory.
>
> Roger Stafford- Hide quoted text -
>
> - Show quoted text -
sir,actually i am working on Advanced encryption standard algoritham
where it uses fixed key for encryption so by using logistic map
equation i want to generate that key.key size varies from 128bits,....
so on sir.wheather it is possibleto get that key length from my
progrmme what i have written sir ?.of course if i write like this
x=3D4*x*(1-x) then also it genrates the value.but i need the required
size of bits sir.can you please help in this matter sir ? thanking you
|