Re: math.erfc OverflowError

2010-06-14 Thread D'Arcy J.M. Cain
On 13 Jun 2010 18:23:28 -0700
a...@pythoncraft.com (Aahz) wrote:

 What's your cite that URLs never end with a period?  AFAIK, that's
 perfectly valid by the rules.

Technically that may be true but when do you ever see one?  If your
email client discards trailing periods I think you can expect it to do
the right thing virtually 100% of the time.

-- 
D'Arcy J.M. Cain da...@druid.net |  Democracy is three wolves
http://www.druid.net/darcy/|  and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-14 Thread geremy condra
On Sun, Jun 13, 2010 at 10:36 PM, Ben Finney ben+pyt...@benfinney.id.au wrote:
 geremy condra debat...@gmail.com writes:

 You know, I've never been a part of a community in which the URL
 format was the most contentious part of filing a bug report.

 Heck no, the bug report is already filed, and contentions about the bug
 report should presumably be going into that report. This issue isn't
 about the bug report at all.

 The contentious issue here is how to *refer to* a bug report by URL in a
 plain-text natural-language medium :-)

 --
  \         “How wonderful that we have met with a paradox. Now we have |
  `\                        some hope of making progress.” —Niels Bohr |
 _o__)                                                                  |
 Ben Finney

I love this quote, and have added it to my list of potential future tattoos.

Geremy Condra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread Aahz
In article mailman.1348.1276386991.32709.python-l...@python.org,
geremy condra  debat...@gmail.com wrote:

Bug filed, http://bugs.python.org/issue8986.

Please don't put extraneous punctuation on URLs.  That period is a valid
URL character, but it's invalid for this URL, and it's not obvious to the
reader whether the period should be part of the URL.  URLs in general
should go on their own line, but at least separate them with whitespace
(or use the icky angle-bracket hack supported by most mail/newsreaders).
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you don't know what your program is supposed to do, you'd better not
start writing it.  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread Mark Dickinson
On Jun 13, 12:56 am, geremy condra debat...@gmail.com wrote:
 On Sat, Jun 12, 2010 at 4:40 PM, Robert Kern robert.k...@gmail.com wrote:
  On 2010-06-12 17:49 , geremy condra wrote:

  In Python3.2, calling math.erfc with a value in [-27.2, -30) raises
  an OverflowError: math range error. This is inconsistent with the
  erfc function from scipy (scipy.special.erfc) as well as with the C99
  function by the same name, both of which return 2. I suspect that
  this is the result of the cutoff for the use of the continuing fraction
  approximation of erfc beginning when abs(x)  30, but I'm not sure.
  Is this desired behavior or should I file a bug report?

  Bug, I think.

 Bug filed,http://bugs.python.org/issue8986.

A bug indeed.  Many thanks for catching and reporting this, Geremy;
it would have been embarrassing for Python 2.7 to be released with
this bug in it.  (Well, I would have been embarrassed, anyway; not
sure about anyone else.)

In case anyone cares, the bug was due to a misinterpreted errno
value:  there's an exp(-x*x) term in the formulas for erf(x) and
erfc(x), and that term underflows to zero at abs(x) =
sqrt(1075*log(2)), which is around 27.297.  Some system math libraries
(unfortunately not including the ones I tested on;  I *did* test,
honest!) set errno on underflow to zero;  this errno value was then
being misinterpreted as an indication of overflow by Python's general
libm wrappings.

Anyway, it's fixed now.

--
Mark
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread D'Arcy J.M. Cain
On 13 Jun 2010 09:49:03 -0700
a...@pythoncraft.com (Aahz) wrote:
 Bug filed, http://bugs.python.org/issue8986.
 
 Please don't put extraneous punctuation on URLs.  That period is a valid
 URL character, but it's invalid for this URL, and it's not obvious to the
 reader whether the period should be part of the URL.  URLs in general
 should go on their own line, but at least separate them with whitespace
 (or use the icky angle-bracket hack supported by most mail/newsreaders).

Or get a proper mail/news reader.  That URL is perfectly fine.  Any
reader that can't figure out that URLs never end with a period should
be chucked.  This ain't the seventies where people had to format their
input exactly as the computer demanded.

-- 
D'Arcy J.M. Cain da...@druid.net |  Democracy is three wolves
http://www.druid.net/darcy/|  and a sheep voting on
+1 416 425 1212 (DoD#0082)(eNTP)   |  what's for dinner.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread Aahz
In article mailman.1409.1276477866.32709.python-l...@python.org,
D'Arcy J.M. Cain da...@druid.net wrote:
On 13 Jun 2010 09:49:03 -0700
a...@pythoncraft.com (Aahz) wrote:
 
 Please don't put extraneous punctuation on URLs.  That period is a valid
 URL character, but it's invalid for this URL, and it's not obvious to the
 reader whether the period should be part of the URL.  URLs in general
 should go on their own line, but at least separate them with whitespace
 (or use the icky angle-bracket hack supported by most mail/newsreaders).

Or get a proper mail/news reader.  That URL is perfectly fine.  Any
reader that can't figure out that URLs never end with a period should
be chucked.  This ain't the seventies where people had to format their
input exactly as the computer demanded.

What's your cite that URLs never end with a period?  AFAIK, that's
perfectly valid by the rules.
-- 
Aahz (a...@pythoncraft.com)   * http://www.pythoncraft.com/

If you don't know what your program is supposed to do, you'd better not
start writing it.  --Dijkstra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread Ben Finney
a...@pythoncraft.com (Aahz) writes:

 In article mailman.1348.1276386991.32709.python-l...@python.org,
 geremy condra  debat...@gmail.com wrote:
 
 Bug filed, http://bugs.python.org/issue8986.

 Please don't put extraneous punctuation on URLs.

The punctuation isn't extraneous; it's a necessary part of a natural
English sentence. That's where it belongs.

Better is to follow the “Recommendations for Delimiting URI in Context”
in RFC 2396 URL:http://www.ietf.org/rfc/rfc2396.txt, which allow
natural punctuation around such delimited URLs.

-- 
 \  “I find the whole business of religion profoundly interesting. |
  `\ But it does mystify me that otherwise intelligent people take |
_o__)it seriously.” —Douglas Adams |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread geremy condra
On Sun, Jun 13, 2010 at 6:44 PM, Ben Finney ben+pyt...@benfinney.id.au wrote:
 a...@pythoncraft.com (Aahz) writes:

 In article mailman.1348.1276386991.32709.python-l...@python.org,
 geremy condra  debat...@gmail.com wrote:
 
 Bug filed, http://bugs.python.org/issue8986.

 Please don't put extraneous punctuation on URLs.

 The punctuation isn't extraneous; it's a necessary part of a natural
 English sentence. That's where it belongs.

 Better is to follow the “Recommendations for Delimiting URI in Context”
 in RFC 2396 URL:http://www.ietf.org/rfc/rfc2396.txt, which allow
 natural punctuation around such delimited URLs.

You know, I've never been a part of a community in which the
URL format was the most contentious part of filing a bug report.

Geremy Condra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread Steven D'Aprano
On Sun, 13 Jun 2010 19:05:28 -0700, geremy condra wrote:

 On Sun, Jun 13, 2010 at 6:44 PM, Ben Finney ben+pyt...@benfinney.id.au
 wrote:
 a...@pythoncraft.com (Aahz) writes:

 In article mailman.1348.1276386991.32709.python-l...@python.org,
 geremy condra  debat...@gmail.com wrote:
 
 Bug filed, http://bugs.python.org/issue8986.

[...]

 You know, I've never been a part of a community in which the URL format
 was the most contentious part of filing a bug report.

Good lord man, don't you realise what you've done??? In your reply to 
Mark on the tracker, you misused a hyphen as an m-dash, and to add insult 
to injury you then got the spacing around it completely wrong.

We have to stamp this behaviour out before it spreads. It's already 
affected Mark, who replied and used three(!) hyphens instead of an m-
dash. This is completely unacceptable!!!


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-13 Thread Ben Finney
geremy condra debat...@gmail.com writes:

 You know, I've never been a part of a community in which the URL
 format was the most contentious part of filing a bug report.

Heck no, the bug report is already filed, and contentions about the bug
report should presumably be going into that report. This issue isn't
about the bug report at all.

The contentious issue here is how to *refer to* a bug report by URL in a
plain-text natural-language medium :-)

-- 
 \ “How wonderful that we have met with a paradox. Now we have |
  `\some hope of making progress.” —Niels Bohr |
_o__)  |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-12 Thread Robert Kern

On 2010-06-12 17:49 , geremy condra wrote:

In Python3.2, calling math.erfc with a value in [-27.2, -30) raises
an OverflowError: math range error. This is inconsistent with the
erfc function from scipy (scipy.special.erfc) as well as with the C99
function by the same name, both of which return 2. I suspect that
this is the result of the cutoff for the use of the continuing fraction
approximation of erfc beginning when abs(x)  30, but I'm not sure.
Is this desired behavior or should I file a bug report?


Bug, I think.

--
Robert Kern

I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth.
  -- Umberto Eco

--
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-12 Thread geremy condra
On Sat, Jun 12, 2010 at 4:40 PM, Robert Kern robert.k...@gmail.com wrote:
 On 2010-06-12 17:49 , geremy condra wrote:

 In Python3.2, calling math.erfc with a value in [-27.2, -30) raises
 an OverflowError: math range error. This is inconsistent with the
 erfc function from scipy (scipy.special.erfc) as well as with the C99
 function by the same name, both of which return 2. I suspect that
 this is the result of the cutoff for the use of the continuing fraction
 approximation of erfc beginning when abs(x)  30, but I'm not sure.
 Is this desired behavior or should I file a bug report?

 Bug, I think.

 --
 Robert Kern

Bug filed, http://bugs.python.org/issue8986.

Geremy Condra
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-12 Thread Steven D'Aprano
On Sat, 12 Jun 2010 15:49:37 -0700, geremy condra wrote:

 In Python3.2, calling math.erfc with a value in [-27.2, -30) raises an
 OverflowError: math range error. This is inconsistent with the erfc
 function from scipy (scipy.special.erfc) as well as with the C99
 function by the same name, both of which return 2. I suspect that this
 is the result of the cutoff for the use of the continuing fraction
 approximation of erfc beginning when abs(x)  30, but I'm not sure. Is
 this desired behavior or should I file a bug report?


Geremy, I know that as a general rule, whenever a person finds what seems 
to be a bug in Python (or the standard library) they should suspect their 
own mistake rather than a bug, but I think this is taking caution to 
extremes. The domain of erfc is the set of all real numbers, and the 
result is bounded by [0, 2]. So asking if OverflowError is desired 
behaviour is a bit like the fellow who bought a new car and then asked if 
it's supposed to catch fire when starting the engine...

:)



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: math.erfc OverflowError

2010-06-12 Thread geremy condra
On Sat, Jun 12, 2010 at 11:05 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
 On Sat, 12 Jun 2010 15:49:37 -0700, geremy condra wrote:

 In Python3.2, calling math.erfc with a value in [-27.2, -30) raises an
 OverflowError: math range error. This is inconsistent with the erfc
 function from scipy (scipy.special.erfc) as well as with the C99
 function by the same name, both of which return 2. I suspect that this
 is the result of the cutoff for the use of the continuing fraction
 approximation of erfc beginning when abs(x)  30, but I'm not sure. Is
 this desired behavior or should I file a bug report?


 Geremy, I know that as a general rule, whenever a person finds what seems
 to be a bug in Python (or the standard library) they should suspect their
 own mistake rather than a bug, but I think this is taking caution to
 extremes. The domain of erfc is the set of all real numbers, and the
 result is bounded by [0, 2]. So asking if OverflowError is desired
 behaviour is a bit like the fellow who bought a new car and then asked if
 it's supposed to catch fire when starting the engine...

 :)

Well, that was more or less my feeling on it, but as a general rule
my opinion on math in python doesn't seem to be shared, so I
thought I'd ask.

Geremy Condra
-- 
http://mail.python.org/mailman/listinfo/python-list