Skip to content

Commit 233c090

Browse files
committed
Auto-generated commit
1 parent ad59b2b commit 233c090

14 files changed

Lines changed: 21 additions & 268 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ A total of 41 issues were closed in this release:
467467

468468
<details>
469469

470+
- [`5ac2354`](https://github.com/stdlib-js/stdlib/commit/5ac23541c743ae50a46366e9415e7442e70559d7) - **test:** remove redundant fixtures and update tests _(by Karan Anand)_
471+
- [`8dc25bb`](https://github.com/stdlib-js/stdlib/commit/8dc25bbbe0a4ad6310ea0f823e812d38a627adad) - **docs:** fix case conditions and clean-up _(by Karan Anand)_
470472
- [`70d6643`](https://github.com/stdlib-js/stdlib/commit/70d6643c3fc339c76d4f660380e2afd716ce989e) - **feat:** add `math/base/special/gammasgnf` [(#3365)](https://github.com/stdlib-js/stdlib/pull/3365) _(by Vivek Maurya, Athan Reines, stdlib-bot, Gunj Joshi, Karan Anand)_
471473
- [`97ab65f`](https://github.com/stdlib-js/stdlib/commit/97ab65f9a65c9f1510f21309ff4892c752910e0f) - **docs:** fix missing closing section _(by Athan Reines)_
472474
- [`914f4fd`](https://github.com/stdlib-js/stdlib/commit/914f4fda357226b0b19278afb5de75f02773582d) - **docs:** update related packages sections [(#6995)](https://github.com/stdlib-js/stdlib/pull/6995) _(by stdlib-bot)_

base/special/gammasgn/README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,12 @@ limitations under the License.
2626

2727
The sign of the [gamma-function][@stdlib/math/base/special/gamma] is defined as
2828

29-
<!-- <equation class="equation" label="eq:gamma_sign_function" align="center" raw="\operatorname{gammasgn} ( x ) = \begin{cases} 1 & \textrm{if}\ \Gamma > 1 \\ -1 & \textrm{if}\ \Gamma < 1 \\ 0 & \textrm{otherwise}\ \end{cases}" alt="Sign of the gamma function"> -->
29+
<!-- <equation class="equation" label="eq:gamma_sign_function" align="center" raw="\operatorname{gammasgn} ( x ) = \begin{cases} 1 & \textrm{if}\ \Gamma > 0 \\ -1 & \textrm{if}\ \Gamma < 0 \\ 0 & \textrm{otherwise}\ \end{cases}" alt="Sign of the gamma function"> -->
3030

3131
```math
32-
\mathop{\mathrm{gammasgn}} ( x ) = \begin{cases} 1 & \textrm{if}\ \Gamma > 1 \\ -1 & \textrm{if}\ \Gamma < 1 \\ 0 & \textrm{otherwise}\ \end{cases}
32+
\mathop{\mathrm{gammasgn}} ( x ) = \begin{cases} 1 & \textrm{if}\ \Gamma > 0 \\ -1 & \textrm{if}\ \Gamma < 0 \\ 0 & \textrm{otherwise}\ \end{cases}
3333
```
3434

35-
<!-- <div class="equation" align="center" data-raw-text="\operatorname{gammasgn} ( x ) = \begin{cases} 1 &amp; \textrm{if}\ \Gamma &gt; 1 \\ -1 &amp; \textrm{if}\ \Gamma &lt; 1 \\ 0 &amp; \textrm{otherwise}\ \end{cases}" data-equation="eq:gamma_sign_function">
36-
<img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@50b141156b147529227e2eb4247eda81c781dec9/lib/node_modules/@stdlib/math/base/special/gammasgn/docs/img/equation_gamma_sign_function.svg" alt="Sign of the gamma function">
37-
<br>
38-
</div> -->
39-
4035
<!-- </equation> -->
4136

4237
The [gamma function][@stdlib/math/base/special/gamma] can be computed as the product of `gammasgn(x)` and `exp(gammaln(x))`.
@@ -185,7 +180,7 @@ int main( void ) {
185180
for ( i = 0; i < 100; i++ ) {
186181
x = ( (double)rand() / (double)RAND_MAX ) * 100.0;
187182
v = stdlib_base_gammasgn( x );
188-
printf( "gammasgn%lf = %lf\n", x, v );
183+
printf( "gammasgn(%lf) = %lf\n", x, v );
189184
}
190185
}
191186
```

base/special/gammasgn/docs/img/equation_gamma_sign_function.svg

Lines changed: 0 additions & 90 deletions
This file was deleted.

base/special/gammasgn/examples/c/example.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ int main( void ) {
2828
for ( i = 0; i < 100; i++ ) {
2929
x = ( (double)rand() / (double)RAND_MAX ) * 100.0;
3030
v = stdlib_base_gammasgn( x );
31-
printf( "gammasgn%lf = %lf\n", x, v );
31+
printf( "gammasgn(%lf) = %lf\n", x, v );
3232
}
3333
}

base/special/gammasgn/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
"stdmath",
5757
"mathematics",
5858
"math",
59-
"special function",
6059
"special",
6160
"function",
6261
"gamma",

base/special/gammasgn/test/fixtures/python/data.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

base/special/gammasgn/test/fixtures/python/medium_negative.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

base/special/gammasgn/test/fixtures/python/medium_positive.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

base/special/gammasgn/test/fixtures/python/random.json

Lines changed: 0 additions & 1 deletion
This file was deleted.

base/special/gammasgn/test/fixtures/python/runner.py

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ def gen(x, name):
4545
```
4646
"""
4747
y = gammasgn(x)
48+
49+
# Convert all NaN values to 0 according to our convention:
50+
y[np.isnan(y)] = 0
51+
4852
data = {
4953
"x": x.tolist(),
5054
"expected": y.tolist()
@@ -60,25 +64,8 @@ def gen(x, name):
6064

6165
def main():
6266
"""Generate fixture data."""
63-
# Random values across `x`:
64-
x = np.random.random(1000)*100.0
65-
gen(x, "random.json")
66-
67-
# Medium negative:
68-
x = np.linspace(-709.78, -1.0, 1000)
69-
gen(x, "medium_negative.json")
70-
71-
# Medium positive:
72-
x = np.linspace(1.0, 709.78, 1000)
73-
gen(x, "medium_positive.json")
74-
75-
# Small positive:
76-
x = np.linspace(2.0**-54, 1.0, 1000)
77-
gen(x, "small_positive.json")
78-
79-
# Small negative:
80-
x = np.linspace(-1.0, -2.0**-54, 1000)
81-
gen(x, "small_negative.json")
67+
x = np.random.uniform(-1000, 1000, 2001)
68+
gen(x, "data.json")
8269

8370

8471
if __name__ == "__main__":

0 commit comments

Comments
 (0)