Skip to content

Commit 048af9c

Browse files
committed
Auto-generated commit
1 parent 7b20988 commit 048af9c

20 files changed

Lines changed: 68 additions & 63 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -459,6 +459,7 @@ A total of 41 issues were closed in this release:
459459

460460
<details>
461461

462+
- [`6a4f52a`](https://github.com/stdlib-js/stdlib/commit/6a4f52a9c96dbdc023c2d85eaf1c33d8749a4202) - **docs:** correct domain of inverse coversed cosine _(by Karan Anand)_
462463
- [`3dd8cb3`](https://github.com/stdlib-js/stdlib/commit/3dd8cb379ea22c4a92d610d146cdd662d3187e27) - **chore:** minor clean-up _(by Philipp Burckhardt)_
463464
- [`f51b7b2`](https://github.com/stdlib-js/stdlib/commit/f51b7b2ea5c3cceca335f3089fba079d4290bde7) - **test:** update tests to match valid domain of acovercos _(by Karan Anand)_
464465
- [`e525deb`](https://github.com/stdlib-js/stdlib/commit/e525debf09ec10ada9ec72ea4674ee9fd8e049cb) - **fix:** use correct inverse coversed cosine formula _(by Karan Anand)_

base/special/acovercos/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,8 @@ logEachMap( 'acovercos(%0.4f) = %0.4f', x, acovercos );
131131
Computes the [inverse coversed cosine][inverse-coversed-cosine] of a double-precision floating-point number.
132132

133133
```c
134-
double out = stdlib_base_acovercos( -3.141592653589793/2.0 );
135-
// returns ~-0.6075
134+
double out = stdlib_base_acovercos( 3.141592653589793/2.0 );
135+
// returns ~0.6075
136136
```
137137

138138
The function accepts the following arguments:

iter/special/acovercos/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ Returns an [iterator][mdn-iterator-protocol] which iteratively computes the [inv
4747
```javascript
4848
var array2iterator = require( '@stdlib/array/to-iterator' );
4949

50-
var x = [ 0.0, -3.141592653589793/2.0, -3.141592653589793/6.0 ];
50+
var x = [ 0.0, 3.141592653589793/2.0, 3.141592653589793/6.0 ];
5151
var it = iterAcovercos( array2iterator( x ) );
5252
// returns <Object>
5353

5454
var r = it.next().value;
55-
// returns ~1.5708
55+
// returns ~-1.5708
5656

5757
r = it.next().value;
58-
// returns ~-0.6075
58+
// returns ~0.6075
5959

6060
r = it.next().value;
61-
// returns ~0.4966
61+
// returns ~-0.4966
6262

6363
// ...
6464
```
@@ -78,7 +78,7 @@ The returned [iterator][mdn-iterator-protocol] protocol-compliant object has the
7878

7979
## Notes
8080

81-
- The domain of inverse coversed cosine is restricted to `[-2,0]`. If an iterated value is outside of the domain, the returned [iterator][mdn-iterator-protocol] returns `NaN`.
81+
- The domain of inverse coversed cosine is restricted to `[0,2]`. If an iterated value is outside of the domain, the returned [iterator][mdn-iterator-protocol] returns `NaN`.
8282
- If an iterated value is non-numeric (including `NaN`), the returned [iterator][mdn-iterator-protocol] returns `NaN`. If non-numeric iterated values are possible, you are advised to provide an [`iterator`][mdn-iterator-protocol] which type checks and handles non-numeric values accordingly.
8383
- If an environment supports `Symbol.iterator` **and** a provided [iterator][mdn-iterator-protocol] is iterable, the returned [iterator][mdn-iterator-protocol] is iterable.
8484

@@ -99,7 +99,7 @@ var uniform = require( '@stdlib/random/iter/uniform' );
9999
var iterAcovercos = require( '@stdlib/math/iter/special/acovercos' );
100100

101101
// Create a seeded iterator for generating pseudorandom numbers:
102-
var rand = uniform( -2.0, 0.0, {
102+
var rand = uniform( 0.0, 2.0, {
103103
'seed': 1234,
104104
'iter': 10
105105
});

iter/special/acovercos/benchmark/benchmark.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bench( pkg, function benchmark( b ) {
3535
var iter;
3636
var i;
3737

38-
rand = uniform( -2.0, 0.0 );
38+
rand = uniform( 0.0, 2.0 );
3939

4040
b.tic();
4141
for ( i = 0; i < b.iterations; i++ ) {
@@ -58,7 +58,7 @@ bench( pkg+'::iteration', function benchmark( b ) {
5858
var z;
5959
var i;
6060

61-
rand = uniform( -2.0, 0.0 );
61+
rand = uniform( 0.0, 2.0 );
6262
iter = iterAcovercos( rand );
6363

6464
b.tic();

iter/special/acovercos/docs/repl.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{alias}}( iterator )
33
Returns an iterator which iteratively computes the inverse coversed cosine.
44

5-
The domain of inverse coversed cosine is restricted to [-2,0]. If an
5+
The domain of inverse coversed cosine is restricted to [0,2]. If an
66
iterated value is outside of the domain, the returned iterator returns
77
`NaN`.
88

@@ -29,7 +29,7 @@
2929

3030
Examples
3131
--------
32-
> var it = {{alias}}( {{alias:@stdlib/random/iter/uniform}}( -2.0, 0.0 ) );
32+
> var it = {{alias}}( {{alias:@stdlib/random/iter/uniform}}( 0.0, 2.0 ) );
3333
> var r = it.next().value
3434
<number>
3535
> r = it.next().value

iter/special/acovercos/docs/types/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ type Iterator = Iter | IterableIterator;
3030
*
3131
* ## Notes
3232
*
33-
* - The domain of inverse coversed cosine is restricted to `[-2,0]`. If an iterated value is outside of the domain, the returned iterator returns `NaN`.
33+
* - The domain of inverse coversed cosine is restricted to `[0,2]`. If an iterated value is outside of the domain, the returned iterator returns `NaN`.
3434
* - If an environment supports `Symbol.iterator` **and** a provided iterator is iterable, the returned iterator is iterable.
3535
*
3636
* @param iterator - input iterator
@@ -39,7 +39,7 @@ type Iterator = Iter | IterableIterator;
3939
* @example
4040
* var uniform = require( '@stdlib/random/iter/uniform' );
4141
*
42-
* var iter = iterAcovercos( uniform( -2.0, 0.0 ) );
42+
* var iter = iterAcovercos( uniform( 0.0, 2.0 ) );
4343
*
4444
* var r = iter.next().value;
4545
* // returns <number>

iter/special/acovercos/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var uniform = require( '@stdlib/random/iter/uniform' );
2222
var iterAcovercos = require( './../lib' );
2323

2424
// Create a seeded iterator for generating pseudorandom numbers:
25-
var rand = uniform( -2.0, 0.0, {
25+
var rand = uniform( 0.0, 2.0, {
2626
'seed': 1234,
2727
'iter': 10
2828
});

iter/special/acovercos/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
* var uniform = require( '@stdlib/random/iter/uniform' );
2828
* var iterAcovercos = require( '@stdlib/math/iter/special/acovercos' );
2929
*
30-
* var iter = iterAcovercos( uniform( -2.0, 0.0 ) );
30+
* var iter = iterAcovercos( uniform( 0.0, 2.0 ) );
3131
*
3232
* var r = iter.next().value;
3333
* // returns <number>

iter/special/acovercos/lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var acovercos = require( './../../../../base/special/acovercos' );
3131
*
3232
* ## Notes
3333
*
34-
* - The domain of inverse coversed cosine is restricted to `[-2,0]`. If an iterated value is outside of the domain, the returned iterator returns `NaN`.
34+
* - The domain of inverse coversed cosine is restricted to `[0,2]`. If an iterated value is outside of the domain, the returned iterator returns `NaN`.
3535
* - If an environment supports `Symbol.iterator` **and** a provided iterator is iterable, the returned iterator is iterable.
3636
*
3737
* @param {Iterator} iterator - input iterator
@@ -41,7 +41,7 @@ var acovercos = require( './../../../../base/special/acovercos' );
4141
* @example
4242
* var uniform = require( '@stdlib/random/iter/uniform' );
4343
*
44-
* var iter = iterAcovercos( uniform( -2.0, 0.0 ) );
44+
* var iter = iterAcovercos( uniform( 0.0, 2.0 ) );
4545
*
4646
* var r = iter.next().value;
4747
* // returns <number>

strided/special/acovercos-by/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ function accessor( v ) {
4747
return v;
4848
}
4949

50-
var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ];
50+
var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ];
5151
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
5252

5353
acovercosBy( x.length, x, 1, y, 1, accessor );
54-
// y => [ ~1.571, ~-0.607, ~0.524, 0.0, ~-0.253 ]
54+
// y => [ ~-1.571, ~0.607, ~-0.524, 0.0, ~0.253 ]
5555
```
5656

5757
The function accepts the following arguments:
@@ -85,11 +85,11 @@ var context = {
8585
'count': 0
8686
};
8787

88-
var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ];
88+
var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ];
8989
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
9090

9191
acovercosBy( x.length, x, 1, y, 1, accessor, context );
92-
// y => [ ~1.571, ~-0.607, ~0.524, 0.0, ~-0.253 ]
92+
// y => [ ~-1.571, ~0.607, ~-0.524, 0.0, ~0.253 ]
9393

9494
var cnt = context.count;
9595
// returns 5
@@ -102,11 +102,11 @@ function accessor( v ) {
102102
return v;
103103
}
104104

105-
var x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ];
105+
var x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ];
106106
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
107107

108108
acovercosBy( 3, x, 2, y, -1, accessor );
109-
// y => [ ~-0.253, ~0.524, ~1.571, 0.0, 0.0, 0.0 ]
109+
// y => [ ~0.253, ~-0.524, ~-1.571, 0.0, 0.0, 0.0 ]
110110
```
111111

112112
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
@@ -119,15 +119,15 @@ function accessor( v ) {
119119
}
120120

121121
// Initial arrays...
122-
var x0 = new Float64Array( [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ] );
122+
var x0 = new Float64Array( [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ] );
123123
var y0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] );
124124

125125
// Create offset views...
126126
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
127127
var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element
128128

129129
acovercosBy( 3, x1, -2, y1, 1, accessor );
130-
// y0 => <Float64Array>[ 0.0, 0.0, 0.0, ~0.336, 0.0, ~-0.607 ]
130+
// y0 => <Float64Array>[ 0.0, 0.0, 0.0, ~-0.336, 0.0, ~0.607 ]
131131
```
132132

133133
#### acovercosBy.ndarray( N, x, strideX, offsetX, y, strideY, offsetY, clbk\[, thisArg] )
@@ -139,11 +139,11 @@ function accessor( v ) {
139139
return v;
140140
}
141141

142-
var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ];
142+
var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ];
143143
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
144144

145145
acovercosBy.ndarray( x.length, x, 1, 0, y, 1, 0, accessor );
146-
// y => [ ~1.571, ~-0.607, ~0.524, 0.0, ~-0.253 ]
146+
// y => [ ~-1.571, ~0.607, ~-0.524, 0.0, ~0.253 ]
147147
```
148148

149149
The function accepts the following additional arguments:
@@ -158,11 +158,11 @@ function accessor( v ) {
158158
return v;
159159
}
160160

161-
var x = [ 0.0, -1.57, -0.5, -1.0, -1.25, -0.67 ];
161+
var x = [ 0.0, 1.57, 0.5, 1.0, 1.25, 0.67 ];
162162
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
163163

164164
acovercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor );
165-
// y => [ 0.0, 0.0, 0.0, ~0.336, 0.0, ~-0.607 ]
165+
// y => [ 0.0, 0.0, 0.0, ~-0.336, 0.0, ~0.607 ]
166166
```
167167

168168
</section>
@@ -180,7 +180,7 @@ acovercosBy.ndarray( 3, x, 2, 1, y, -1, y.length-1, accessor );
180180
// No-op...
181181
}
182182

183-
var x = [ 0.0, -1.57, -0.5, -1.0, -1.25 ];
183+
var x = [ 0.0, 1.57, 0.5, 1.0, 1.25 ];
184184
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0 ];
185185

186186
acovercosBy( x.length, x, 1, y, 1, accessor );
@@ -211,7 +211,7 @@ function accessor( v, i ) {
211211
return v;
212212
}
213213
214-
var x = filledarrayBy( 10, 'generic', uniform( -2.0, 0.0 ) );
214+
var x = filledarrayBy( 10, 'generic', uniform( 0.0, 2.0 ) );
215215
console.log( x );
216216
217217
var y = filledarray( null, 10, 'generic' );

0 commit comments

Comments
 (0)