[issue37454] Clarify docs for math.log1p()

2019-08-23 Thread Tim Peters
Tim Peters added the comment: > Sometimes you guys make me feel dumb as a rock. I expect we all do that favor for each other at times ;-) -- ___ Python tracker ___

[issue37454] Clarify docs for math.log1p()

2019-08-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Sometimes you guys make me feel dumb as a rock. Sorry for the distraction. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue37454] Clarify docs for math.log1p()

2019-07-01 Thread Tim Peters
Tim Peters added the comment: Mark's analysis is spot-on - good eye :-) Here under 3.7.3 [MSC v.1916 64 bit (AMD64)] on win32, in the original script it makes no difference at all for negative "small x" (where, as Mark said, `1 - random.random()` is exactly representable):

[issue37454] Clarify docs for math.log1p()

2019-07-01 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: +steven.daprano ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37454] Clarify docs for math.log1p()

2019-07-01 Thread Mark Dickinson
Mark Dickinson added the comment: Ah, now I've looked at the script. There's an issue with using `random.random()` to create "small" values for testing, since its result is always an integer multiple of 2**-53. That means in particular that if x = random.random(), then 1 - x is always

[issue37454] Clarify docs for math.log1p()

2019-07-01 Thread Mark Dickinson
Mark Dickinson added the comment: > however, for x < 0.0 it is always worse That's quite surprising. Which platform? And can you give some example inputs and outputs? With a good math library, I'd expect `log1p(x)` to almost always be at least as accurate as `log(1 + x)`, and substantially

[issue37454] Clarify docs for math.log1p()

2019-06-30 Thread Raymond Hettinger
New submission from Raymond Hettinger : Currently the docs say, "The result is calculated in a way which is accurate for x near zero." That is somewhat vague. Some quick tests show that it is often more accurate than log() for the whole range of 0.0 < x < 1.0; however, for x < 0.0 it is