Blitz logo

Blitz Support :

From: Jiri Kraus (mail_at_[hidden])
Date: 2004-12-19 17:17:00


Hi Patrik,

I don't think that this is a bug, because arithmetic with computers are
neither commutative, associative nor the distributive law is valid.

Jiri Kraus
> Hi for the third time,
> As part of this whole deal, I've also discovered something that looks like
> an evaluation bug unless I'm missing something stupid. In the following
> code, T_indep_vector means Array<TinyVector<double,4>,1> and vector means
> Array<double,1>.
>
> vector operator()(const T_indep_vector& x, const vector& par) {
> T_indep_vector xx(static_cast<T_indep_vector>(x));
> const vector vv(par(0)*pow(xx[0]/1e11,par(1))*
> pow(xx[1]/0.02,par(2))*pow(xx[2]/1e11,par(3))*
> *pow(xx[3]/1,par(4)));
> const vector v1(pow(xx[0]/1e11,par(1)));
> const vector v2(pow(xx[1]/0.02,par(2)));
> const vector v3(pow(xx[2]/1e11,par(3)));
> const vector v4(pow(xx[3]/1,par(4)));
> const vector crap(par(0)*v1*v2*v3*v4);
>
> I hope that I haven't screwed up and that in this example, vv and crap
> should contain identical numbers at the end. They don't. crap is right, but
> vv is incorrectly calculated (by a small amount, very deceptive...) Looks
> pretty serious if it's indeed true and I haven't screwed up.
>
> That's the last bug for now. Promise. :-)
>
> cheers,
>
> /Patrik
>
>
> ============================================================
> Patrik Jonsson (831) 459-3828
> Department of Astronomy & Astrophysics
> University of California, Santa Cruz, CA 95064
>
> This message has been written using a voice recognition system.
> Words that don't make sense or not the fault of the author...
>
> _______________________________________________
> Blitz-support mailing list
> Blitz-support_at_[hidden]
> http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>