[seqfan] Re: Maple strongly discouraged

israel at math.ubc.ca israel at math.ubc.ca
Sun Jan 12 20:59:41 CET 2014


How and when does it produce incorrect answers in Maple 17? In my copy of 
Maple 17 (actually Maple 17.02), as far as I can tell it produces the same 
results as the current updated version.

Cheers,
Robert Israel




On Jan 12 2014, Neil Sloane wrote:

>Dear Seq Fans, Maximilian Hasler has pointed out that
>my Maple program in A109671 (which worked correctly in Maple 16)  no
>longer gives correct results in Maple 17 because it used the RETURN()
>command.
>
>The Maple web site says
>
>"use of the RETURN procedure is strongly discouraged"
>
>and I can see why - it produces incorrect answers (without any warning). Of
>course I don't see WHY they did this.
>
>Now there over 1900 Maple lines in the OEIS that use the RETURN statement.
> Maybe these lines need a comment saying:
>
># Warning: May give incorrect answers because Maple has changed the meaning
>of RETURN. Suggest switching to Mathematica instead.
>
>(Not sure about the second part)
>
>I could (and probably will have to) do this with a global edit.
>Is there any other solution?  It is unethical for us to include programs
>that give wrong answers.
>
>Here's the Maple program that works correctly in Maple 16 but gives wrong
>answers  in Maple 17:
>
>> f:=proc(n) option remember; local t1;
>
>> if n = 1 then RETURN(1);
>
>> elif n mod 2 = 0 then RETURN(f(n/2));
>
>> else t1:= f(n-2)-f((n-1)/2);
>
>> if t1 > 0 then RETURN(t1) else RETURN(f(n-2)+f((n-1)/2)); fi; fi; end;
>
>Neil
>



More information about the SeqFan mailing list