Skip to content

Commit f766137

Browse files
committed
Auto-generated commit
1 parent 426b773 commit f766137

File tree

18 files changed

+1464
-7
lines changed

18 files changed

+1464
-7
lines changed

CHANGELOG.md

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

7-
## Unreleased (2025-03-05)
7+
## Unreleased (2025-04-06)
8+
9+
<section class="features">
10+
11+
### Features
12+
13+
- [`e6f0da1`](https://github.com/stdlib-js/stdlib/commit/e6f0da1aa09685e99286e1e7efd2b5516d7e40eb) - add C implementation for `stats/base/dists/laplace/quantile` [(#4437)](https://github.com/stdlib-js/stdlib/pull/4437)
14+
15+
</section>
16+
17+
<!-- /.features -->
818

919
<section class="issues">
1020

1121
### Closed Issues
1222

13-
This release closes the following issue:
23+
A total of 2 issues were closed in this release:
1424

15-
[#4976](https://github.com/stdlib-js/stdlib/issues/4976)
25+
[#3718](https://github.com/stdlib-js/stdlib/issues/3718), [#4976](https://github.com/stdlib-js/stdlib/issues/4976)
1626

1727
</section>
1828

@@ -24,6 +34,7 @@ This release closes the following issue:
2434

2535
<details>
2636

37+
- [`e6f0da1`](https://github.com/stdlib-js/stdlib/commit/e6f0da1aa09685e99286e1e7efd2b5516d7e40eb) - **feat:** add C implementation for `stats/base/dists/laplace/quantile` [(#4437)](https://github.com/stdlib-js/stdlib/pull/4437) _(by Dhruv Arvind Singh, Philipp Burckhardt, stdlib-bot)_
2738
- [`e5238bb`](https://github.com/stdlib-js/stdlib/commit/e5238bb96b7138d346ea0db8b535aec64c8a856c) - **bench:** refactor random number generation in `stats/base/dists/laplace` [(#5270)](https://github.com/stdlib-js/stdlib/pull/5270) _(by GK Bishnoi)_
2839
- [`4a70790`](https://github.com/stdlib-js/stdlib/commit/4a707903dfef7c2b56216000165706497d19a251) - **style:** add missing spaces _(by Philipp Burckhardt)_
2940

@@ -37,8 +48,9 @@ This release closes the following issue:
3748

3849
### Contributors
3950

40-
A total of 2 people contributed to this release. Thank you to the following contributors:
51+
A total of 3 people contributed to this release. Thank you to the following contributors:
4152

53+
- Dhruv Arvind Singh
4254
- GK Bishnoi
4355
- Philipp Burckhardt
4456

CONTRIBUTORS

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
# Contributors listed in alphabetical order.
44

55
Aadish Jain <jain.aadishj@gmail.com>
6+
Aarya Balwadkar <142713127+AaryaBalwadkar@users.noreply.github.com>
67
Aayush Khanna <aayushiitbhu23@gmail.com>
8+
Abdelrahman Samir <60700731+abdelrahman04@users.noreply.github.com>
9+
Abdul Kaium <97376242+impawstarlight@users.noreply.github.com>
10+
Abhay Punia <156515195+Hecker165@users.noreply.github.com>
711
Abhijit Raut <abhijitmraut8010@gmail.com>
812
Abhishek Jain <40913033+abhishekblue@users.noreply.github.com>
913
Adarsh Palaskar <adarshpalaskar99@gmail.com>
@@ -14,11 +18,16 @@ Ahmed Khaled <kahmd1444@gmail.com>
1418
Aksshay Balasubramanian <119944779+Aksshay88@users.noreply.github.com>
1519
Aleksandr <112382387+alextes90@users.noreply.github.com>
1620
Ali Salesi <ali_sal1381@yahoo.com>
21+
AlyAbdelmoneim <148393799+AlyAbdelmoneim@users.noreply.github.com>
1722
Aman Bhansali <bhansali.1@iitj.ac.in>
23+
AmanBhadkariya <140033975+AmanBhadkariya@users.noreply.github.com>
1824
Amit Jimiwal <amitjimiwal45@gmail.com>
25+
Anshu Kumar <132515490+anxhukumar@users.noreply.github.com>
26+
Anshu Kumar <contact.anshukumar@protonmail.com>
1927
Anudeep Sanapala <anudeep0306@gmail.com>
2028
Athan Reines <kgryte@gmail.com>
2129
Ayaka <73595362+USERSATOSHI@users.noreply.github.com>
30+
Bhavishy Agrawal <90029607+bhavishy2801@users.noreply.github.com>
2231
Brendan Graetz <bguiz@users.noreply.github.com>
2332
Bruno Fenzl <brunofenzl@gmail.com>
2433
Bryan Elee <rxbryn@gmail.com>
@@ -28,9 +37,13 @@ Dan Rose <danoftheroses@gmail.com>
2837
Daniel Killenberger <daniel.killenberger@gmail.com>
2938
Daniel Yu <40680511+Daniel777y@users.noreply.github.com>
3039
Debashis Maharana <debashismaharana7854@gmail.com>
40+
Deep Trivedi <128926685+thedeeppp@users.noreply.github.com>
3141
Desh Deepak Kant <118960904+DeshDeepakKant@users.noreply.github.com>
3242
Dev Goel <135586571+corsairier@users.noreply.github.com>
43+
Dhanyabad behera <110620935+dhanyabad11@users.noreply.github.com>
3344
Dhruv Arvind Singh <154677013+DhruvArvindSingh@users.noreply.github.com>
45+
Dhruvil Mehta <68022411+dhruvilmehta@users.noreply.github.com>
46+
Dipjyoti Das <126075231+dipexplorer@users.noreply.github.com>
3447
Divyansh Seth <59174836+sethdivyansh@users.noreply.github.com>
3548
Dominic Lim <46486515+domlimm@users.noreply.github.com>
3649
Dominik Moritz <domoritz@gmail.com>
@@ -43,13 +56,17 @@ Gautam sharma <gautamkrishnasharma1@gmail.com>
4356
Golden Kumar <103646877+AuenKr@users.noreply.github.com>
4457
Gunj Joshi <gunjjoshi8372@gmail.com>
4558
Gururaj Gurram <gururajgurram1512@gmail.com>
59+
Haroon Rasheed <51189276+haroon26@users.noreply.github.com>
4660
Harsh <149176984+hrshya@users.noreply.github.com>
4761
HarshaNP <96897754+GittyHarsha@users.noreply.github.com>
4862
Harshita Kalani <harshitakalani02@gmail.com>
63+
Hemant M Mehta <92446645+hemantmm@users.noreply.github.com>
4964
Hridyanshu <124202756+HRIDYANSHU054@users.noreply.github.com>
5065
Jaimin Godhani <112328542+Jai0401@users.noreply.github.com>
66+
Jaison D Souza <123267719+jsndz@users.noreply.github.com>
5167
Jalaj Kumar <142599224+jalajk3004@users.noreply.github.com>
5268
James Gelok <jdgelok@gmail.com>
69+
Jay Soni <jaygsoni14@gmail.com>
5370
Jaysukh Makvana <jaysukhmakvana2004@gmail.com>
5471
Jenish Thapa <141203631+jenish-thapa@users.noreply.github.com>
5572
Jithin KS <jithinks112@gmail.com>
@@ -59,13 +76,16 @@ Jordan Gallivan <115050475+Jordan-Gallivan@users.noreply.github.com>
5976
Joris Labie <joris.labie1@gmail.com>
6077
Justin Dennison <justin1dennison@gmail.com>
6178
Justyn Shelby <96994781+ShelbyJustyn@users.noreply.github.com>
62-
Karan Anand <119553199+anandkaranubc@users.noreply.github.com>
79+
Karan Anand <anandkarancompsci@gmail.com>
6380
Karthik Prakash <116057817+skoriop@users.noreply.github.com>
81+
Kaushikgtm <162317291+Kaushikgtm@users.noreply.github.com>
82+
Kavyansh-Bagdi <153486713+Kavyansh-Bagdi@users.noreply.github.com>
6483
Kohantika Nath <145763549+kohantikanath@users.noreply.github.com>
6584
Krishnam Agarwal <83017176+888krishnam@users.noreply.github.com>
6685
Krishnendu Das <86651039+itskdhere@users.noreply.github.com>
6786
Kshitij-Dale <152467202+Kshitij-Dale@users.noreply.github.com>
6887
Lovelin Dhoni J B <100030865+lovelindhoni@users.noreply.github.com>
88+
MANI <77221000+Eternity0207@users.noreply.github.com>
6989
Manik Sharma <maniksharma.rke@gmail.com>
7090
Manvith M <148960168+manvith2003@users.noreply.github.com>
7191
Marcus Fantham <mfantham@users.noreply.github.com>
@@ -76,25 +96,33 @@ Mohammad Bin Aftab <48010758+MohammadBinAftab@users.noreply.github.com>
7696
Mohammad Kaif <mdkaifprofession@gmail.com>
7797
Momtchil Momtchev <momtchil@momtchev.com>
7898
Muhammad Haris <harriskhan047@outlook.com>
99+
Muhammad Taaha Tariq <166188821+Taaha-Tariq@users.noreply.github.com>
100+
Muhmmad Saad <106260977+saad-imran-dev@users.noreply.github.com>
79101
Naresh Jagadeesan <naresh.naresh000@gmail.com>
80102
Naveen Kumar <stupiddint@gmail.com>
81103
Neeraj Pathak <neerajrpathak710@gmail.com>
104+
NirvedMishra <139633597+NirvedMishra@users.noreply.github.com>
82105
Nishant Shinde <97207366+nishant-s7@users.noreply.github.com>
106+
Nishchay Rajput <121144841+NishchayRajput@users.noreply.github.com>
83107
Nithin Katta <88046362+nithinkatta@users.noreply.github.com>
84108
Nourhan Hasan <109472010+TheNourhan@users.noreply.github.com>
85109
Ognjen Jevremović <ognjenjevremovic@users.noreply.github.com>
86110
Oneday12323 <107678750+Oneday12323@users.noreply.github.com>
87111
Ori Miles <97595296+orimiles5@users.noreply.github.com>
88112
Philipp Burckhardt <pburckhardt@outlook.com>
113+
Prajjwal Bajpai <142303989+prajjwalbajpai@users.noreply.github.com>
89114
Prajwal Kulkarni <prajwalkulkarni76@gmail.com>
90-
Pranav Goswami <goswami.4@iitj.ac.in>
115+
Pranav Goswami <pranavchiku11@gmail.com>
91116
Pranjal Jha <97080887+PraneGIT@users.noreply.github.com>
92117
Prashant Kumar Yadav <144602492+0PrashantYadav0@users.noreply.github.com>
118+
PrathamBhamare <164445568+PrathamBhamare@users.noreply.github.com>
93119
Pratik Singh <97464067+Pratik772846@users.noreply.github.com>
94120
Pratyush Kumar Chouhan <pratyushkumar0308@gmail.com>
95121
Priyansh Prajapati <88396544+itsspriyansh@users.noreply.github.com>
96122
Priyanshu Agarwal <113460573+AgPriyanshu18@users.noreply.github.com>
123+
Pulkit Gupta <65711278+pulkitgupta2@users.noreply.github.com>
97124
Pushpendra Chandravanshi <pushpendrachandravanshi4@gmail.com>
125+
Rahul Kumar <132570066+rahulptl165@users.noreply.github.com>
98126
Raunak Kumar Gupta <raunakmodanwal321@gmail.com>
99127
Rejoan Sardar <119718513+Rejoan-Sardar@users.noreply.github.com>
100128
Ricky Reusser <rsreusser@gmail.com>
@@ -103,11 +131,17 @@ Rishav <115060907+rishav2404@users.noreply.github.com>
103131
Rishav Tarway <rishavtarway@gmail.com>
104132
Robert Gislason <gztown2216@yahoo.com>
105133
Roman Stetsyk <25715951+romanstetsyk@users.noreply.github.com>
134+
Rupa <102663541+Rupa-Rd@users.noreply.github.com>
106135
Rutam Kathale <138517416+performant23@users.noreply.github.com>
107136
Ruthwik Chikoti <145591715+ruthwikchikoti@users.noreply.github.com>
108137
Ryan Seal <splrk@users.noreply.github.com>
109138
Rylan Yang <137365285+rylany27@users.noreply.github.com>
139+
SAHIL KUMAR <168997976+sahilk45@users.noreply.github.com>
140+
SHIVAM YADAV <120725381+Shivam-1827@users.noreply.github.com>
141+
Sahil Goyal <87982509+sahil20021008@users.noreply.github.com>
142+
Sai Avinash <120403424+nasarobot@users.noreply.github.com>
110143
Sai Srikar Dumpeti <80447788+the-r3aper7@users.noreply.github.com>
144+
Sanchay Ketan Sinha <122982233+satansin123@users.noreply.github.com>
111145
Sarthak Paandey <145528240+SarthakPaandey@users.noreply.github.com>
112146
Saurabh Singh <saurabhsraghuvanshi@gmail.com>
113147
Seyyed Parsa Neshaei <spneshaei@users.noreply.github.com>
@@ -124,6 +158,7 @@ Spandan Barve <contact@marsian.dev>
124158
Stephannie Jiménez Gacha <steff456@hotmail.com>
125159
Suhaib Ilahi <suhaib.elahi87@gmail.com>
126160
Suraj Kumar <125961509+kumarsuraj212003@users.noreply.github.com>
161+
Tanishq Ahuja <68651083+TheGEN1U5@users.noreply.github.com>
127162
Tirtadwipa Manunggal <tirtadwipa.manunggal@gmail.com>
128163
Tudor Pagu <104032457+tudor-pagu@users.noreply.github.com>
129164
Tufailahmed Bargir <142114244+Tufailahmed-Bargir@users.noreply.github.com>
@@ -142,6 +177,7 @@ Yuvi Mittal <128018763+yuvi-mittal@users.noreply.github.com>
142177
ditsu <170345142+ditsus@users.noreply.github.com>
143178
ekambains <bainsinbusiness@gmail.com>
144179
fadiothman22 <48636283+fadiothman22@users.noreply.github.com>
180+
lohithganni <116790357+lohithganni@users.noreply.github.com>
145181
olenkabilonizhka <62379231+olenkabilonizhka@users.noreply.github.com>
146182
pranav-1720 <123018993+pranav-1720@users.noreply.github.com>
147183
rahulrangers <127782777+rahulrangers@users.noreply.github.com>

README.md

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,104 @@ for ( i = 0; i < 100; i++ ) {
178178

179179
<!-- /.examples -->
180180

181+
<!-- C interface documentation. -->
182+
183+
* * *
184+
185+
<section class="c">
186+
187+
## C APIs
188+
189+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
190+
191+
<section class="intro">
192+
193+
</section>
194+
195+
<!-- /.intro -->
196+
197+
<!-- C usage documentation. -->
198+
199+
<section class="usage">
200+
201+
### Usage
202+
203+
```c
204+
#include "stdlib/stats/base/dists/laplace/quantile.h"
205+
```
206+
207+
#### stdlib_base_dists_laplace_quantile( p, mu, b )
208+
209+
Evaluates the quantile function for a Laplace distribution with location parameter `mu` and scale parameter `b` at a probability `p`.
210+
211+
```c
212+
double out = stdlib_base_dists_laplace_quantile( 0.8, 0.0, 1.0 );
213+
// returns ~0.916
214+
```
215+
216+
The function accepts the following arguments:
217+
218+
- **p**: `[in] double` probability paarmeter.
219+
- **mu**: `[in] double` location parameter.
220+
- **b**: `[in] double` rate parameter.
221+
222+
```c
223+
double stdlib_base_dists_laplace_quantile( const double p, const double mu, const double b );
224+
```
225+
226+
</section>
227+
228+
<!-- /.usage -->
229+
230+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
231+
232+
<section class="notes">
233+
234+
</section>
235+
236+
<!-- /.notes -->
237+
238+
<!-- C API usage examples. -->
239+
240+
<section class="examples">
241+
242+
### Examples
243+
244+
```c
245+
#include "stdlib/stats/base/dists/laplace/quantile.h"
246+
#include <stdlib.h>
247+
#include <stdio.h>
248+
249+
static double random_uniform( const double min, const double max ) {
250+
double v = (double)rand() / ( (double)RAND_MAX + 1.0 );
251+
return min + ( v*(max-min) );
252+
}
253+
254+
int main( void ) {
255+
double mu;
256+
double b;
257+
double p;
258+
double y;
259+
int i;
260+
261+
for ( i = 0; i < 25; i++ ) {
262+
mu = random_uniform( -5.0, 5.0 );
263+
b = random_uniform( 0.0, 20.0 );
264+
p = random_uniform( 0.0, 1.0 );
265+
y = stdlib_base_dists_laplace_quantile( p, mu, b );
266+
printf( "p: %lf, µ: %lf, b: %lf, Q(p;µ,b): %lf\n", p, mu, b, y );
267+
}
268+
}
269+
```
270+
271+
</section>
272+
273+
<!-- /.examples -->
274+
275+
</section>
276+
277+
<!-- /.c -->
278+
181279
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
182280

183281
<section class="related">

benchmark/benchmark.native.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var resolve = require( 'path' ).resolve;
24+
var bench = require( '@stdlib/bench-harness' );
25+
var Float64Array = require( '@stdlib/array-float64' );
26+
var tryRequire = require( '@stdlib/utils-try-require' );
27+
var uniform = require( '@stdlib/random-base-uniform' );
28+
var isnan = require( '@stdlib/math-base-assert-is-nan' );
29+
var EPS = require( '@stdlib/constants-float64-eps' );
30+
var pkg = require( './../package.json' ).name;
31+
32+
33+
// VARIABLES //
34+
35+
var quantile = tryRequire( resolve( __dirname, './../lib/native.js' ) );
36+
var opts = {
37+
'skip': ( quantile instanceof Error )
38+
};
39+
40+
41+
// MAIN //
42+
43+
bench( pkg, opts, function benchmark( b ) {
44+
var scale;
45+
var len;
46+
var mu;
47+
var p;
48+
var y;
49+
var i;
50+
51+
len = 100;
52+
mu = new Float64Array( len );
53+
scale = new Float64Array( len );
54+
p = new Float64Array( len );
55+
for ( i = 0; i < len; i++ ) {
56+
p[ i ] = uniform( 0.0, 1.0 );
57+
mu[ i ] = uniform( -50.0, 50.0 );
58+
scale[ i ] = uniform( EPS, 20.0 );
59+
}
60+
61+
b.tic();
62+
for ( i = 0; i < b.iterations; i++ ) {
63+
y = quantile( p[ i % len ], mu[ i % len ], scale[ i % len ] );
64+
if ( isnan( y ) ) {
65+
b.fail( 'should not return NaN' );
66+
}
67+
}
68+
b.toc();
69+
if ( isnan( y ) ) {
70+
b.fail( 'should not return NaN' );
71+
}
72+
b.pass( 'benchmark finished' );
73+
b.end();
74+
});

0 commit comments

Comments
 (0)