<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/python-packages/numpy.git/numpy/random/src/distributions, branch main</title>
<subtitle>github.com: numpy/numpy.git
</subtitle>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/'/>
<entry>
<title>BUG: random: Don't return negative values from Generator.geometric.</title>
<updated>2023-05-01T03:28:44+00:00</updated>
<author>
<name>warren</name>
<email>warren.weckesser@gmail.com</email>
</author>
<published>2023-04-27T15:52:47+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=40ae83411b275b68425b5c85a7243c69599edc59'/>
<id>40ae83411b275b68425b5c85a7243c69599edc59</id>
<content type='text'>
In C, when the integer part of a double exceeds the maximum int64, casting
the double to int64_t is undefined behavior.  On some platforms, the result
is 2**64-1 and on others it is -2**64.  That results in rng.geometric()
returning -2**64 when p was sufficiently small on some platforms.

The fix is to never invoke undefined behavior by ensuring we don't attempt
to cast very large double values to int64_t.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In C, when the integer part of a double exceeds the maximum int64, casting
the double to int64_t is undefined behavior.  On some platforms, the result
is 2**64-1 and on others it is -2**64.  That results in rng.geometric()
returning -2**64 when p was sufficiently small on some platforms.

The fix is to never invoke undefined behavior by ensuring we don't attempt
to cast very large double values to int64_t.
</pre>
</div>
</content>
</entry>
<entry>
<title>MAINT: replace `NPY_INLINE` with `inline`</title>
<updated>2022-11-25T09:51:14+00:00</updated>
<author>
<name>Ralf Gommers</name>
<email>ralf.gommers@gmail.com</email>
</author>
<published>2022-11-25T09:04:49+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=3947b1a023a07a55522de65b4d302339bac2bad7'/>
<id>3947b1a023a07a55522de65b4d302339bac2bad7</id>
<content type='text'>
Closes gh-22100
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Closes gh-22100
</pre>
</div>
</content>
</entry>
<entry>
<title>BUG: Get full precision for 32 bit floating point random values.</title>
<updated>2021-11-06T07:20:51+00:00</updated>
<author>
<name>warren</name>
<email>warren.weckesser@gmail.com</email>
</author>
<published>2021-11-06T06:59:05+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=4b9e56921e6343b980b27e308534ca433a4a1fe8'/>
<id>4b9e56921e6343b980b27e308534ca433a4a1fe8</id>
<content type='text'>
The formula to convert a 32 bit random integer to a random float32,

    (next_uint32(bitgen_state) &gt;&gt; 9) * (1.0f / 8388608.0f)

shifts by one bit too many, resulting in uniform float32 samples always
having a 0 in the least significant bit. The formula is corrected to

    (next_uint32(bitgen_state) &gt;&gt; 8) * (1.0f / 16777216.0f)

Occurrences of the incorrect formula in numpy/random/tests/test_direct.py
were also corrected.

Closes gh-17478.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The formula to convert a 32 bit random integer to a random float32,

    (next_uint32(bitgen_state) &gt;&gt; 9) * (1.0f / 8388608.0f)

shifts by one bit too many, resulting in uniform float32 samples always
having a 0 in the least significant bit. The formula is corrected to

    (next_uint32(bitgen_state) &gt;&gt; 8) * (1.0f / 16777216.0f)

Occurrences of the incorrect formula in numpy/random/tests/test_direct.py
were also corrected.

Closes gh-17478.
</pre>
</div>
</content>
</entry>
<entry>
<title>DOC: Fix typos in the random and f2py documentation. (#20004)</title>
<updated>2021-10-01T08:51:27+00:00</updated>
<author>
<name>MalikIdreesHasanKhan</name>
<email>77000356+MalikIdreesHasanKhan@users.noreply.github.com</email>
</author>
<published>2021-10-01T08:51:27+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=c4b0b9d898ff958dcaa422e9fc6d554eafb284d5'/>
<id>c4b0b9d898ff958dcaa422e9fc6d554eafb284d5</id>
<content type='text'>
* Fix typos</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Fix typos</pre>
</div>
</content>
</entry>
<entry>
<title>MAINT: random: Use expm1 where appropriate.</title>
<updated>2021-09-23T11:01:41+00:00</updated>
<author>
<name>warren</name>
<email>warren.weckesser@gmail.com</email>
</author>
<published>2021-09-23T11:01:41+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=d1ed2c2b1eecac38cc31a9cc2ad15c86fd520137'/>
<id>d1ed2c2b1eecac38cc31a9cc2ad15c86fd520137</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>PERF: Use exponentials in place of inversion</title>
<updated>2021-03-22T17:13:07+00:00</updated>
<author>
<name>Kevin Sheppard</name>
<email>kevin.k.sheppard@gmail.com</email>
</author>
<published>2021-03-22T12:28:45+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=d4a270640b451636c76cb7cff52cc5a1a8a12b6c'/>
<id>d4a270640b451636c76cb7cff52cc5a1a8a12b6c</id>
<content type='text'>
Use exponentials rather than generating exponentials via inversion
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use exponentials rather than generating exponentials via inversion
</pre>
</div>
</content>
</entry>
<entry>
<title>BUG: Use lop1p to improve numerical precision</title>
<updated>2021-03-17T14:25:41+00:00</updated>
<author>
<name>Kevin Sheppard</name>
<email>kevin.k.sheppard@gmail.com</email>
</author>
<published>2021-03-17T10:46:14+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=4572e12e199c2032c159121ae9afd12c3d3d5a5a'/>
<id>4572e12e199c2032c159121ae9afd12c3d3d5a5a</id>
<content type='text'>
Use log1p(-x) instead of log(1 - x)
Seperate legacy version from current

closes #17020
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use log1p(-x) instead of log(1 - x)
Seperate legacy version from current

closes #17020
</pre>
</div>
</content>
</entry>
<entry>
<title>BUG: np.random: Use log1p to improve precision</title>
<updated>2021-03-17T09:52:02+00:00</updated>
<author>
<name>Eric Wieser</name>
<email>wieser.eric@gmail.com</email>
</author>
<published>2020-08-06T09:59:32+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=398b01f346116e7974ef9bacf0a2b29f1b3492e4'/>
<id>398b01f346116e7974ef9bacf0a2b29f1b3492e4</id>
<content type='text'>
This reduces the number of cases when floating point precision makes the argument to `log` become `0`
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reduces the number of cases when floating point precision makes the argument to `log` become `0`
</pre>
</div>
</content>
</entry>
<entry>
<title>CLN: Move to legacy function</title>
<updated>2021-02-26T18:42:51+00:00</updated>
<author>
<name>Kevin Sheppard</name>
<email>kevin.k.sheppard@gmail.com</email>
</author>
<published>2021-02-26T18:19:43+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=aa529592b33262bb9fdd73df3b493a3d3cf2e392'/>
<id>aa529592b33262bb9fdd73df3b493a3d3cf2e392</id>
<content type='text'>
Avoid conditional compilation and move old version to legacy_vonmises
Small clean up
Additional comments
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Avoid conditional compilation and move old version to legacy_vonmises
Small clean up
Additional comments
</pre>
</div>
</content>
</entry>
<entry>
<title>BUG: Prevent RandomState from changing</title>
<updated>2021-02-26T14:50:28+00:00</updated>
<author>
<name>Kevin Sheppard</name>
<email>kevin.k.sheppard@gmail.com</email>
</author>
<published>2021-02-26T13:04:38+00:00</published>
<link rel='alternate' type='text/html' href='http://91.123.203.49/cgit/delta/python-packages/numpy.git/commit/?id=79c30300390c267bacb5297f36c1e9605bca8f2c'/>
<id>79c30300390c267bacb5297f36c1e9605bca8f2c</id>
<content type='text'>
Apply vonmises fix only to Generator
Add tests for correctness

closes #17378
closes #17275
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Apply vonmises fix only to Generator
Add tests for correctness

closes #17378
closes #17275
</pre>
</div>
</content>
</entry>
</feed>
