OK for normal functions:
(%i1) declare(f, complex)$
(%i2) csign(f(x));
(%o2) complex
Wrong for subscripted functions like li:
(%i1) featurep(li, complex);
(%o1) true
(%i2) csign(li[n](x));
(%o2) pnz
Caused by this code in sign-any (compar.lisp) not handling subscripted functions correctly:
((and *complexsign*
(not (atom x))
(decl-complexp (caar x)))
;; A function f(x), where f is declared to be imaginary or complex.
(if ($featurep (caar x) '$imaginary)
(setq sign '$imaginary)
(setq sign '$complex)))
Fixed by commit [4c2ce8].
Related
Commit: [4c2ce8]