[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-10 Thread Mark Dickinson
Mark Dickinson added the comment: Looks good to me. I can confirm that the new formulas are equivalent to the old, at least for positive kappa. (They're not the same for negative kappa, but that shouldn't matter in this context.) Serhiy: do you know how the original formulas arose? I don't

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Serhiy: do you know how the original formulas arose? No. I have not found any articles or books in the open access. A test would be good! I was waiting for issue13355 and issue17149. Here is an updated patch with tests. -- Added file:

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-10 Thread Mark Dickinson
Mark Dickinson added the comment: I don't think the second added test_avg_std test makes sense, given that the number of random samples used by vonmisesvariate is unpredictable. The variance in the second case should be close to 1/100.0 rather than 1/sqrt(2)/100.0, right? If this code

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The variance in the second case should be close to 1/100.0 rather than 1/sqrt(2)/100.0, right? Yes, but experiments exposed precisely 1/sqrt(2)/100.0 and I were confused by this fact. But now I noticed a comment at the top of the test: Only works for

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0f9113e1b541 by Serhiy Storchaka in branch '2.7': Issue #17141: random.vonmisesvariate() no more hangs for large kappas. http://hg.python.org/cpython/rev/0f9113e1b541 New changeset d94b73c95646 by Serhiy Storchaka in branch '3.2': Issue #17141:

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-10 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17141

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks for review. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17141 ___ ___ Python-bugs-list mailing

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is an implementation which is more precise for small and large kappa, doesn't hang for large kappa, and even a little faster. It is mathematically totally equivalent to existing, but use more accurate calculations. -- keywords: +patch Added

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- stage: needs patch - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17141 ___ ___

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-06 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: random.vonmisesvariate(0, 1e16) hangs. -- components: Library (Lib) messages: 181511 nosy: rhettinger, serhiy.storchaka priority: normal severity: normal stage: needs patch status: open title: random.vonmisesvariate() hangs for large kappa type:

[issue17141] random.vonmisesvariate() hangs for large kappa

2013-02-06 Thread Mark Dickinson
Changes by Mark Dickinson dicki...@gmail.com: -- nosy: +mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17141 ___ ___