Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expm1 missing #47751

Closed
ms mannequin opened this issue Aug 4, 2008 · 4 comments
Closed

expm1 missing #47751

ms mannequin opened this issue Aug 4, 2008 · 4 comments
Assignees
Labels
extension-modules C modules in the Modules dir type-feature A feature request or enhancement

Comments

@ms
Copy link
Mannequin

ms mannequin commented Aug 4, 2008

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']

    @ms
    Copy link
    Mannequin Author

    ms mannequin commented Aug 4, 2008

    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.

    @ms ms mannequin added the type-feature A feature request or enhancement label Aug 4, 2008
    @mdickinson
    Copy link
    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.

    @mdickinson
    Copy link
    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.

    @mdickinson mdickinson added the extension-modules C modules in the Modules dir label Aug 9, 2008
    @mdickinson mdickinson self-assigned this Aug 9, 2008
    @mdickinson
    Copy link
    Member

    I'm absorbing this issue into bpo-3366.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant