Skip to content

expm1 missing #47751

Closed
Closed

Description

@ms
mannequin
BPO 3501
Nosy @mdickinson
Superseder
  • bpo-3366: Add gamma function, error functions and other C99 math.h functions to math module
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/mdickinson'
    closed_at = <Date 2008-12-05.21:44:58.685>
    created_at = <Date 2008-08-04.22:20:47.360>
    labels = ['extension-modules', 'type-feature']
    title = 'expm1 missing'
    updated_at = <Date 2008-12-05.21:44:58.683>
    user = 'https://bugs.python.org/ms'

    bugs.python.org fields:

    activity = <Date 2008-12-05.21:44:58.683>
    actor = 'mark.dickinson'
    assignee = 'mark.dickinson'
    closed = True
    closed_date = <Date 2008-12-05.21:44:58.685>
    closer = 'mark.dickinson'
    components = ['Extension Modules']
    creation = <Date 2008-08-04.22:20:47.360>
    creator = 'ms'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 3501
    keywords = []
    message_count = 4.0
    messages = ['70722', '70723', '70724', '77076']
    nosy_count = 2.0
    nosy_names = ['mark.dickinson', 'ms']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = '3366'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue3501'
    versions = ['Python 3.1', 'Python 2.7']

    Activity

    1. ms commented on Aug 4, 2008

      msmannequin
      MannequinAuthor

      The math module contains log1p but is missing expm1 (the inverse of
      log1p). These functions are necessary to avoid loss of precision in
      floating point calculations, and are part of the C99 standard math library.

    2. mdickinson commented on Aug 4, 2008

      @mdickinson
      Member

      Mike,

      Can you propose an implementation, for those platforms that haven't yet
      caught up with C99? Something comparable to the implementation of log1p
      in Python/pymath.c would be appropriate. Ideally, such an
      implementation would:

      • be accurate to within a few ulps across the whole domain,
      • be not too long, and not too slow
      • have a decent chance of working with strange floating-point formats
        (Python doesn't assume IEEE 754)
      • handle IEEE 754 values 'correctly' (i.e., as recommended by Annex F to
        the C99 standard)

      It's too late to get this into Python 2.6/3.0, but patches aimed at 2.7
      or 3.1 would be welcome.

    3. mdickinson commented on Aug 4, 2008

      @mdickinson
      Member

      A cheap trick would be to use the identity

      expm1(x) = 2*exp(x/2)*sinh(x/2)

      This could also be used in Python as a
      workaround, for now. But I agree that
      expm1 should go into the math library.

    4. self-assigned this
      on Aug 9, 2008
    5. mdickinson commented on Dec 5, 2008

      @mdickinson
      Member

      I'm absorbing this issue into bpo-3366.

    6. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    extension-modulesC modules in the Modules dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions