Opened 6 years ago

Last modified 5 years ago

#17866 new enhancement

provide list of existing symbolic functions together with example argument(s)

Reported by: rws Owned by:
Priority: major Milestone: sage-6.6
Component: symbolics Keywords:
Cc: vdelecroix, paulmasson Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by rws)

For testing purposes it would be great to somehow get a list containing tuples with

  • the Function operator
  • nargs
  • name
  • a tuple with example args

Is the pynac symbol table complete?

sage: from sage.symbolic.pynac import symbol_table
sage: dic=symbol_table['functions']
sage: dic['lambert_w']
lambert_w
sage: type(_)
<class 'sage.functions.log.Function_lambert_w'>

Change History (4)

comment:1 Changed 6 years ago by vdelecroix

  • Cc vdelecroix added

Good idea! But what are you thinking: writing it down by hand or just parsing the source code?

comment:2 Changed 6 years ago by rws

  • Description modified (diff)

Apparently on startup all symbolic functions get registered in the Pynac symbol table.

EDIT: This list includes even the numerical ones.

Last edited 6 years ago by rws (previous) (diff)

comment:3 Changed 6 years ago by rws

For example,

sage: def builtin_symbolic_function_list():     
        from sage.symbolic.pynac import symbol_table
        from sage.symbolic.function import BuiltinFunction
        fdict = symbol_table['functions']
        return ([c for c in fdict.itervalues()
            if isinstance(c, BuiltinFunction) ])
sage: for c in builtin_symbolic_function_list():
    argl = []
    for n in range(c.number_of_arguments()):
        argl.append(2.5)
    print c
    print(CC(c(*argl)))

This allowed me to quickly find that elliptic_e(2.5,2.5) which should give 0.535648... +1.63996... i according to Wolfram, throws an ECL error (fixed in #15046).

Last edited 6 years ago by rws (previous) (diff)

comment:4 Changed 5 years ago by paulmasson

  • Cc paulmasson added
Note: See TracTickets for help on using tickets.