20241028 On machines with arithmetic conforming to IEEE standard 754 (most modern machines) option allow_NaN 2; now permits handling Infinity and NaN (Not a Number) as specified in the IEEE standard, whereas option allow_NaN 1; turns Infinity into NaN and the default option allow_NaN 0; causes computations that would involve NaNs and Infinities to give error messages. "option allow_NaN 1" has long been available; "option allow_NaN 2" is new. For example, if file krf defines and uses a rational function # See W. Kahan (1987), "Presubstitution, and Continued Fractions" # http://www.arithmazium.org/classroom/lib/Kahan_Presubstitution_and_Continued_Fractions.pdf var x; var f = 4 - 3/(x - 2 - 1/(x - 7 + 10/(x - 2 - 2/(x-3)))); for{i in 1..4} { let x := i; display x, f; } then by default "ampl krf" says x = 1 Error at _cmdno 3 executing "display" command (file f/krf, line 7, offset 255): error computing defined variable f: can't compute 10/0 but the input "option allow_NaN 2; include krf" gives x = 1 f = 7 x = 2 f = 4 x = 3 f = 1.6 x = 4 f = 2.5 and "option allow_NaN 1; include krf" gives x = 1 f = NaN x = 2 f = NaN x = 3 f = NaN x = 4 f = NaN If file zork contains option allow_NaN 2; display exp(3000); option allow_NaN 1; display exp(3000); option allow_NaN 0; display exp(3000); then "ampl zork" gives exp(3000) = Infinity exp(3000) = NaN Error at _cmdno 6 executing "display" command (file zork, line 6, offset 98): can't evaluate exp(3000): Numerical result out of range Fix some bugs with a defined variable involving a piecewise-linear term applied to another defined variable that involves another piecewise-linear term, possibly indirectly. Examples: var x1 >= -100 := -100; var x2 >= -100 := -100; var x3 = 3*x1 - 2*x2 + 100; var x4; x4def: x4 = 0.5*(3*x1 - 2*x2 - 100 + <<0;-1,1>>x3); var x5 = 3*x1 + 2*x2 - x4 + 9; minimize o: 0.5*(3*x1 + 2*x2 + x4 + <<0;-1,1>>x5); option solver cplex; solve; CPLEX 20.1.0.0: Constraint _scon[1] is not convex quadratic since it is an equality constraint. With the bug fixed, "solve;" says CPLEX 20.1.0.0: optimal integer solution; objective -104.5 Another, similar but more troublesome example is the above with x4 as a defined variable, i.e., var x1 >= -100 := -100; var x2 >= -100 := -100; var x3 = 3*x1 - 2*x2 + 100; var x4 = 0.5*(3*x1 - 2*x2 - 100 + <<0;-1,1>>x3); var x5 = 3*x1 + 2*x2 - x4 + 9; minimize o: 0.5*(3*x1 + 2*x2 + x4 + <<0;-1,1>>x5); After the fixes, "option solver cplex; solve;" says CPLEX 20.1.0.0: optimal integer solution; objective -104.5 2 MIP simplex iterations 0 branch-and-bound nodes Fix a bug (corrupted del_mblk arg) with ord(i) when i is a dummy variable. The bug appeared in a complicated example; some simple examples work correctly. Allow "from", "to" and some more obscure values to appear as dummy variables. Example: set A dimen 2; var x{(to,from) in A: to != from}; previously elicited a syntax error message. Now it is accepted.