E_n(x) = euler(n,x) is an Euler polynomial, the most
simple of which is the constant polynomial n=0.
E_0(x) = euler(0,x) = 1 for all x.
However, euler(0,1); -> -1
Release 5, IBM INTEL NT, Jun 16 1998
I could not imagine such a bug in Maple before
this bug bit me. Any information how many
'versions' this bug survived?
What can we expect of the integrity of Maple,
if they cannot guarantee that a constant function
assumes only one value? What will we see next? 1+1=0?
Easy: 1 + euler(0,1) = 0.
Regards Peter
Same thing happens in Maple v8.00 (Windows); haven't checked in v9 yet.
--
John Cordes
> Same thing happens in Maple v8.00 (Windows); haven't checked in v9 yet.
and in Maple 9.03 (Windows).
--
John Cordes
Printing out the code for euler(n,x) shows:
... elif x=1 then -euler(n,x) ...
erroneously occurs before the test for n=0.
--
G. A. Edgar http://www.math.ohio-state.edu/~edgar/
>E_n(x) = euler(n,x) is an Euler polynomial, the most
>simple of which is the constant polynomial n=0.
>E_0(x) = euler(0,x) = 1 for all x.
>However, euler(0,1); -> -1
>Release 5, IBM INTEL NT, Jun 16 1998
>I could not imagine such a bug in Maple before
>this bug bit me. Any information how many
>'versions' this bug survived?
It's still in Maple 9.
The code for euler checks several special cases: unfortunately it checks
for z=1 (and then returns -euler(n,0)) before it checks for n=0.
The problem is that euler(n,1) = -euler(n,0) for n > 0 but not n = 0:
this comes from the identity
euler(n,z) = 2*(z-1)^n-euler(n,z-1).
Robert Israel isr...@math.ubc.ca
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2
> The code for euler checks several special cases: unfortunately it checks
> for z=1 (and then returns -euler(n,0)) before it checks for n=0.
> The problem is that euler(n,1) = -euler(n,0) for n > 0 but not n = 0:
> this comes from the identity
> euler(n,z) = 2*(z-1)^n-euler(n,z-1).
My interpretation of the bug, as I already said
in a reply to Alex, is as follows:
Line 24: elif x = 1 then -euler(n, 0)
is meant to be formula 23.1.8 in the Handbook of
Mathematical Functions, the 'symmetry relation'
of the Euler polynomials, which says
euler(n,1-x) = (-1)^n*euler(n,x)
applied to x=0. Now the bug amounts to writing
'-' instead of '(-1)^n'. Replacing line 24 by
Line 24*: elif x = 1 then (-1)^n*euler(n, 0)
kills the bug ;-)
But studying the code it seems clear to me
that the *real bug* is something different:
If this piece of code would have been written
according to software standards of the year 2004,
and not of the year 1990, and techniques and
tools of today would have been used, such a bug
would not appear.
But Maplesoft sells this piece of (obsolete) software
as if it is state of the art. It certainly is not.
Regards Peter