Skip to content

Improve formula for Bell numbers #17157

@jdemeyer

Description

@jdemeyer

Improve the error analysis for the implementation of Dobinski's formula to compute the Bell numbers leading to

  1. code which is actually consistent with the mathematical formulas
  2. code which is cleaner and simpler than before
  3. a complete error estimate including the final real approximation
  4. faster code:

Before:

sage: timeit('bell_number(200)', number=2000)
2000 loops, best of 3: 1.45 ms per loop

After:

sage: timeit('bell_number(200)', number=2000)
2000 loops, best of 3: 441 µs per loop

Depends on #16428
Depends on #15300

Component: combinatorics

Author: Jeroen Demeyer

Branch/Commit: 330617c

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/17157

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions