This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2008年08月04日 22:20 by ms, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Messages (4) | |||
|---|---|---|---|
| msg70722 - (view) | Author: Mike Speciner (ms) | Date: 2008年08月04日 22:20 | |
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. |
|||
| msg70723 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2008年08月04日 22:44 | |
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. |
|||
| msg70724 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2008年08月04日 23:07 | |
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. |
|||
| msg77076 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2008年12月05日 21:44 | |
I'm absorbing this issue into issue 3366. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:37 | admin | set | github: 47751 |
| 2008年12月05日 21:44:58 | mark.dickinson | set | status: open -> closed resolution: duplicate superseder: Add gamma function, error functions and other C99 math.h functions to math module messages: + msg77076 |
| 2008年08月09日 15:27:48 | mark.dickinson | set | priority: normal assignee: mark.dickinson components: + Extension Modules, - None versions: + Python 3.1, Python 2.7, - Python 3.0 |
| 2008年08月04日 23:07:06 | mark.dickinson | set | messages: + msg70724 |
| 2008年08月04日 22:44:57 | mark.dickinson | set | nosy:
+ mark.dickinson messages: + msg70723 |
| 2008年08月04日 22:20:47 | ms | create | |