Skip to content

Commit 2e1f0a9

Browse files
author
aayush0325
committed
docs: update README
1 parent 9a6e4e0 commit 2e1f0a9

File tree

1 file changed

+90
-0
lines changed
  • lib/node_modules/@stdlib/stats/base/dists/arcsine/entropy

1 file changed

+90
-0
lines changed

lib/node_modules/@stdlib/stats/base/dists/arcsine/entropy/README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,96 @@ for ( i = 0; i < 10; i++ ) {
132132

133133
<!-- /.examples -->
134134

135+
<!-- C interface documentation. -->
136+
137+
* * *
138+
139+
<section class="c">
140+
141+
## C APIs
142+
143+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
144+
145+
<section class="intro">
146+
147+
</section>
148+
149+
<!-- /.intro -->
150+
151+
<!-- C usage documentation. -->
152+
153+
<section class="usage">
154+
155+
### Usage
156+
157+
```c
158+
#include "stdlib/stats/base/dists/arcsine/entropy.h"
159+
```
160+
161+
#### stdlib_base_dists_arcsine_entropy( a, b )
162+
163+
Returns the differential entropy of an arcsine distribution.
164+
165+
```c
166+
double out = stdlib_base_dists_arcsine_entropy( -4.0, 4.0 );
167+
// returns ~1.838
168+
```
169+
170+
The function accepts the following arguments:
171+
172+
- **a**: `[in] double` minimum support
173+
- **b**: `[in] double` maximum support
174+
175+
```c
176+
double stdlib_base_dists_arcsine_entropy( const double a, const double b );
177+
```
178+
179+
</section>
180+
181+
<!-- /.usage -->
182+
183+
<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
184+
185+
<section class="notes">
186+
187+
</section>
188+
189+
<!-- /.notes -->
190+
191+
<!-- C API usage examples. -->
192+
193+
<section class="examples">
194+
195+
### Examples
196+
197+
```c
198+
#include "stdlib/stats/base/dists/arcsine/entropy.h"
199+
#include <stdlib.h>
200+
#include <stdio.h>
201+
202+
int main( void ) {
203+
double a;
204+
double b;
205+
double y;
206+
int i;
207+
208+
for ( i = 0; i < 25; i++ ) {
209+
a = ( (double)rand() / (double)RAND_MAX ) * 20.0 - 20.0;
210+
b = a + ( (double)rand() / (double)RAND_MAX ) * 40.0;
211+
y = stdlib_base_dists_arcsine_entropy( a, b );
212+
printf( "x: %lf, a: %lf, b: %lf, h(X;a,b): %lf\n", a, b, y );
213+
}
214+
}
215+
```
216+
217+
</section>
218+
219+
<!-- /.examples -->
220+
221+
</section>
222+
223+
<!-- /.c -->
224+
135225
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
136226

137227
<section class="references">

0 commit comments

Comments
 (0)