Skip to content

Commit 5eb4ea7

Browse files
committed
Auto-generated commit
1 parent a7f362d commit 5eb4ea7

File tree

9 files changed

+34
-35
lines changed

9 files changed

+34
-35
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,15 @@ indent_style = tab
165165
indent_style = space
166166
indent_size = 2
167167
168+
# Ignore generated lock files for GitHub Agentic Workflows:
169+
[*.lock.yml]
170+
charset = unset
171+
end_of_line = unset
172+
indent_style = unset
173+
indent_size = unset
174+
trim_trailing_whitespace = unset
175+
insert_final_newline = unset
176+
168177
# Set properties for GYP files:
169178
[binding.gyp]
170179
indent_style = space

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ Makefile linguist-vendored
6464

6565
# Configure files which should be included in GitHub language statistics:
6666
docs/types/*.d.ts -linguist-documentation
67+
68+
.github/workflows/*.lock.yml linguist-generated=true merge=ours

CHANGELOG.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44
55
<section class="release" id="unreleased">
66

7-
## Unreleased (2026-02-16)
7+
## Unreleased (2026-04-12)
88

99
<section class="commits">
1010

1111
### Commits
1212

1313
<details>
1414

15+
- [`9430db6`](https://github.com/stdlib-js/stdlib/commit/9430db645b6b1d36afb35e2fe3275d9ce4c384b8) - **refactor:** reuse variance implementation for stdev in `stats/base/dists` [(#11370)](https://github.com/stdlib-js/stdlib/pull/11370) _(by Om-A-osc, Athan Reines)_
1516
- [`f38e8a7`](https://github.com/stdlib-js/stdlib/commit/f38e8a7b433e0e9888eb57c83f4374073089ad85) - **docs:** clean-up parameters in Julia fixtures scripts _(by Philipp Burckhardt)_
1617

1718
</details>
@@ -24,8 +25,10 @@
2425

2526
### Contributors
2627

27-
A total of 1 person contributed to this release. Thank you to this contributor:
28+
A total of 3 people contributed to this release. Thank you to the following contributors:
2829

30+
- Athan Reines
31+
- Om-A-osc
2932
- Philipp Burckhardt
3033

3134
</section>

dist/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/main.js

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
// MODULES //
2222

23-
var isnan = require( '@stdlib/math-base-assert-is-nan' );
2423
var sqrt = require( '@stdlib/math-base-special-sqrt' );
24+
var variance = require( '@stdlib/stats-base-dists-triangular-variance' );
2525

2626

2727
// MAIN //
@@ -67,15 +67,7 @@ var sqrt = require( '@stdlib/math-base-special-sqrt' );
6767
* // returns NaN
6868
*/
6969
function stdev( a, b, c ) {
70-
if (
71-
isnan( a ) ||
72-
isnan( b ) ||
73-
isnan( c ) ||
74-
!( a <= c && c <= b )
75-
) {
76-
return NaN;
77-
}
78-
return sqrt( ( (a*a) + (b*b) + (c*c) - (a*b) - (a*c) - (b*c) ) / 18.0 );
70+
return sqrt( variance( a, b, c ) );
7971
}
8072

8173

manifest.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
"libpath": [],
4040
"dependencies": [
4141
"@stdlib/math-base-napi-ternary",
42-
"@stdlib/math-base-assert-is-nan",
43-
"@stdlib/math-base-special-sqrt"
42+
"@stdlib/math-base-special-sqrt",
43+
"@stdlib/stats-base-dists-triangular-variance"
4444
]
4545
},
4646
{
@@ -55,8 +55,8 @@
5555
"libraries": [],
5656
"libpath": [],
5757
"dependencies": [
58-
"@stdlib/math-base-assert-is-nan",
59-
"@stdlib/math-base-special-sqrt"
58+
"@stdlib/math-base-special-sqrt",
59+
"@stdlib/stats-base-dists-triangular-variance"
6060
]
6161
},
6262
{
@@ -71,8 +71,8 @@
7171
"libraries": [],
7272
"libpath": [],
7373
"dependencies": [
74-
"@stdlib/math-base-assert-is-nan",
75-
"@stdlib/math-base-special-sqrt"
74+
"@stdlib/math-base-special-sqrt",
75+
"@stdlib/stats-base-dists-triangular-variance"
7676
]
7777
}
7878
]

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,15 @@
4040
"url": "https://github.com/stdlib-js/stdlib/issues"
4141
},
4242
"dependencies": {
43-
"@stdlib/math-base-assert-is-nan": "^0.2.3",
4443
"@stdlib/math-base-napi-ternary": "^0.3.2",
4544
"@stdlib/math-base-special-sqrt": "^0.2.3",
45+
"@stdlib/stats-base-dists-triangular-variance": "^0.3.1",
4646
"@stdlib/utils-library-manifest": "^0.2.4"
4747
},
4848
"devDependencies": {
4949
"@stdlib/array-float64": "^0.2.3",
5050
"@stdlib/constants-float64-eps": "^0.2.3",
51+
"@stdlib/math-base-assert-is-nan": "^0.2.3",
5152
"@stdlib/math-base-special-abs": "^0.2.3",
5253
"@stdlib/random-base-randu": "^0.2.3",
5354
"@stdlib/string-format": "^0.2.3",

src/main.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
*/
1818

1919
#include "stdlib/stats/base/dists/triangular/stdev.h"
20-
#include "stdlib/math/base/assert/is_nan.h"
2120
#include "stdlib/math/base/special/sqrt.h"
21+
#include "stdlib/stats/base/dists/triangular/variance.h"
2222

2323
/**
2424
* Returns the standard deviation of a triangular distribution.
@@ -33,13 +33,5 @@
3333
* // returns ~0.204
3434
*/
3535
double stdlib_base_dists_triangular_stdev( const double a, const double b, const double c ) {
36-
if (
37-
stdlib_base_is_nan( a ) ||
38-
stdlib_base_is_nan( b ) ||
39-
stdlib_base_is_nan( c ) ||
40-
!( a <= c && c <= b )
41-
) {
42-
return 0.0/0.0; // NaN
43-
}
44-
return stdlib_base_sqrt( ( ( a*a ) + ( b*b ) + ( c*c ) - ( a*b ) - ( a*c ) - ( b*c ) ) / 18.0 );
36+
return stdlib_base_sqrt( stdlib_base_dists_triangular_variance( a, b, c ) );
4537
}

0 commit comments

Comments
 (0)