#660 double factorial defn incorrect for noninteger operand

Lisp Core (471)

The double factorial x!! yields an incorrect result for
x other than an integer. It appears that x!! is
computed as the product x*(x-2)*(x-4)*...*y, where y is
the least term (x-2*k) s.t. x-2*k > 1. This agrees with
published defns (Arfken, Mathworld) for positive
integers but not otherwise.

states a formula for z!!, z complex, translated into
Maxima as follows --

doublefact (z) := block ([a: 1+2*z-cos(%pi*z), b:
cos(%pi*z)-1], 2^(a/4) * %pi^(b/4) * gamma(1+z/2));

It seems that Maxima could evaluate this function for
noninteger arguments.

Note that Maxima translates input x!! into an noun form
genfact (x, x/2, 2).


  • Dieter Kaiser

    Dieter Kaiser - 2008-09-21

    In a first step (asum.lisp, Rev. 1.30) the numerical evaluation of the function genfact(x,y,z) is specialized to integer arguments within the following range

    x, y, z, integer and z <= x and y <= x/z.

    For non valid integers a Maxima error is thrown. For all other numbers Maxima returns a noun form.

    With this changes Maxima no longer calculate wrong results.

    To get more general results for real and complex values for the Double factorial function a new function factorial_double has been suggested on the mailing list.

    Because Maxima no longer gets incorrect results this bug report could be closed.

    Dieter Kaiser

  • Dieter Kaiser

    Dieter Kaiser - 2008-09-27
    • status: open --> closed
  • Dieter Kaiser

    Dieter Kaiser - 2008-09-27

    Closing this bug report. The function $genfact(x,y,z) no longer gives wrong results.

    A function factorial_double has been implemented.

    Dieter Kaiser

  • Dieter Kaiser

    Dieter Kaiser - 2008-09-27

    Change resolution to "fixed".


Log in to post a comment.