On 08/06/2017 09:40 PM, Andrew Makhorin wrote: >> FORMULA *op1; >> FORMULA *op2; >> ... >> case O_ADD: >> /* addition */ >> op1 = eval_formula(mpl, code->arg.arg.x); >> op2 = eval_formula(mpl, code->arg.arg.y); >> value = linear_comb(mpl, >> +1.0, op1, >> +1.0, op2); >> break; >> >> gives same result on both arm64 and x86-64. >> >> I suggest you change all binary operands. >> > > This is a normal behavior. Besides, in general case this wouldn't help > (for example, round-off errors may affect the model generation process). > > If you need to avoid the difference in your case, just don't use random > numbers as well as other functions having side effects. > > >
You decided to use a constant starting value for initializing the random function to have reproduceable runs where we use random functions. I think in the coding we should avoid situations where the result depends on the choice of the compiler. This may result in different results on the same architecture when compiling with different compiler versions. It would better to prescribe the evaluation sequence in the coding. I must admit that this would imply some work for you. Best regards Heinrich Schuchardt _______________________________________________ Bug-glpk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-glpk
