[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 76eb752e5447 by Brett Cannon in branch '3.5':
Issue #26114: Remove a reference to 'Numerical Recipes'.
https://hg.python.org/cpython/rev/76eb752e5447

New changeset 8ad701463cd7 by Brett Cannon in branch 'default':
Merge for issue #26114
https://hg.python.org/cpython/rev/8ad701463cd7

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Roundup Robot

Roundup Robot added the comment:

New changeset faac8f09020d by Brett Cannon in branch '2.7':
Issue #26114: Remove mention of 'Numerical Recipes'.
https://hg.python.org/cpython/rev/faac8f09020d

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Brett Cannon

Changes by Brett Cannon :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Brett Cannon

Brett Cannon added the comment:

Thanks for the historical information, Mark! I'll either update the comment or 
flat-out delete it so it doesn't trip anyone else up.

I'll also scale back the scope of the update since it's just a cleanup and not 
an IP issue.

--
assignee:  -> brett.cannon
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Mark Dickinson

Mark Dickinson added the comment:

The comment is unfortunate. The code in Modules/mathmodule.c *was* written from 
scratch (by me). All I took from Numerical Recipes was the idea of using 
continued fractions from one part of the domain and a power-series expansion 
for another part. If you compare the code with the NR code, there's really no 
similarity beyond that part.

Perhaps just deleting the NR reference is the way to go.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Mark Dickinson

Mark Dickinson added the comment:

... and the way I read it, the NR licence applies specifically to their code, 
not to the basic numerical ideas set out in the text (which is all we're 
using). We're not using the actual code from NR at all.

IOW, IANAL but I really don't think there's an issue here.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

erf() is a part of C99. May be move hand-writen implementation to 
Modules/_math.c and use libc erf() if available?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 15.01.2016 10:05, Mark Dickinson wrote:
> 
> Mark Dickinson added the comment:
> 
> ... and the way I read it, the NR licence applies specifically to their code, 
> not to the basic numerical ideas set out in the text (which is all we're 
> using). We're not using the actual code from NR at all.
> 
> IOW, IANAL but I really don't think there's an issue here.

The license is a copyright license, so it only applies to the
actual code from the book. The ideas would have to be patented
to be protected. Copyright in some code or text is not enough
to (potentially) prevent someone else from reusing the ideas.

If someone is aware of a patent on the algorithm, we may have
an issue. Otherwise, there's no issue if we're using Mark's
implementation.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Mark Dickinson

Mark Dickinson added the comment:

@Serhiy: Sure, that would work (the same way that we do for log1p). I *think* I 
tried this at the time, but it turns out that some libm implementations of erf 
and erfc are pretty bad, so our tests failed. (But I may be misremembering.)

In any case, the proposal to use the libm erf/erfc should be a separate issue, 
I think.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-14 Thread Brett Cannon

New submission from Brett Cannon:

If you look Modules/mathmodule.c you will notice there is a comment that goes 
with erf() and erfc() stating that the algorithms were taken from a book 
entitled 'Numerical Recipes'. Unfortunately that book has a license dictating 
that any information from the book is only allowed for non-commercial use; 
commercial use requires negotiating a license 
(http://numerical.recipes/aboutNR3license.html). That's bad for anyone who has 
a commercial distribution of Python as that's a special requirement they have 
to follow.

It would be best to do a clean room implementation of both math.erf() and 
math.erfc() that does not use information from 'Numerical Recipes' in order to 
not be violating that license. That way Python can be sold commercially without 
having to negotiate a separate license just for those two functions.

Unfortunately this code exists since at least Python 2.7, so I have flagged all 
Python releases as needing the eventual clean room implementation applied to it 
(although Python 3.2 goes out of security maintenance next month so I don't 
know how critical it is to fix that far back).

--
components: Library (Lib)
messages: 258218
nosy: benjamin.peterson, brett.cannon, eric.smith, georg.brandl, larry, 
lemburg, mark.dickinson, stutzbach
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Rewrite math.erf() and math.erfc() from scratch
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-14 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +peter, teoliphant

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-14 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -peter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com