Skip to content

Commit b875f9b

Browse files
committed
Merge branch 'develop' into feat/cpolarf
2 parents 7413030 + 4f74869 commit b875f9b

File tree

8 files changed

+170
-123
lines changed

8 files changed

+170
-123
lines changed

lib/node_modules/@stdlib/math/base/special/coversinf/package.json

Lines changed: 86 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,5 +71,90 @@
7171
"trigonometry",
7272
"radians",
7373
"angle"
74-
]
74+
],
75+
"__stdlib__": {
76+
"scaffold": {
77+
"$schema": "math/[email protected]",
78+
"base_alias": "coversin",
79+
"alias": "coversinf",
80+
"pkg_desc": "compute the coversed sine of a single-precision floating-point number (in radians)",
81+
"desc": "computes the coversed sine of a single-precision floating-point number (in radians)",
82+
"short_desc": "coversed sine",
83+
"parameters": [
84+
{
85+
"name": "x",
86+
"desc": "input value (in radians)",
87+
"type": {
88+
"javascript": "number",
89+
"jsdoc": "number",
90+
"c": "float",
91+
"dtype": "float32"
92+
},
93+
"domain": [
94+
{
95+
"min": "-infinity",
96+
"max": "infinity"
97+
}
98+
],
99+
"rand": {
100+
"prng": "random/base/uniform",
101+
"parameters": [
102+
-10,
103+
10
104+
]
105+
},
106+
"example_values": [
107+
64,
108+
27,
109+
0,
110+
0.1,
111+
-9,
112+
8,
113+
-1,
114+
125,
115+
-10.2,
116+
11.3,
117+
-12.4,
118+
3.5,
119+
-1.6,
120+
15.7,
121+
-16,
122+
17.9,
123+
-188,
124+
19.11,
125+
-200,
126+
21.15
127+
]
128+
}
129+
],
130+
"output_policy": "real_floating_point_and_generic",
131+
"returns": {
132+
"desc": "coversed sine",
133+
"type": {
134+
"javascript": "number",
135+
"jsdoc": "number",
136+
"c": "float",
137+
"dtype": "float32"
138+
}
139+
},
140+
"keywords": [
141+
"coversin",
142+
"coversinf",
143+
"coversine",
144+
"coversed",
145+
"coversinus",
146+
"covers",
147+
"cosiv",
148+
"cvs",
149+
"versed",
150+
"sine",
151+
"sin",
152+
"trig",
153+
"trigonometry",
154+
"radians",
155+
"angle"
156+
],
157+
"extra_keywords": []
158+
}
159+
}
75160
}

lib/node_modules/@stdlib/math/base/special/csc/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ Evaluates the [cosecant][trigonometric-functions] of `x` (in radians).
117117
double out = stdlib_base_csc( 0.0 );
118118
// returns Infinity
119119

120-
out = stdlib_base_cos( 3.141592653589793 / 2.0 );
120+
out = stdlib_base_csc( 3.141592653589793 / 2.0 );
121121
// returns 1.0
122122
```
123123

lib/node_modules/@stdlib/math/base/special/csc/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* @return cosecant
2727
*
2828
* @example
29-
* double y = stdlib_base_cos( 3.141592653589793 / 2.0 );
29+
* double y = stdlib_base_csc( 3.141592653589793 / 2.0 );
3030
* // returns 1.0
3131
*/
3232
double stdlib_base_csc( const double x ) {

lib/node_modules/@stdlib/math/base/special/csc/test/fixtures/julia/huge_positive.json

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

lib/node_modules/@stdlib/math/base/special/csc/test/fixtures/julia/runner.jl

100644100755
Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import JSON
2020

2121
"""
22-
gen( domain, name )
22+
gen( domain, name )
2323
2424
Generate fixture data and write to file.
2525
@@ -36,22 +36,23 @@ julia> gen( x, \"data.json\" );
3636
```
3737
"""
3838
function gen( domain, name )
39-
x = collect( domain );
40-
y = csc.( x );
41-
42-
# Store data to be written to file as a collection:
43-
data = Dict([
44-
("x", x),
45-
("expected", y)
46-
]);
47-
48-
# Based on the script directory, create an output filepath:
49-
filepath = joinpath( dir, name );
50-
51-
# Write the data to the output filepath as JSON:
52-
outfile = open( filepath, "w" );
53-
write( outfile, JSON.json(data) );
54-
close( outfile );
39+
x = collect( domain );
40+
y = csc.( x );
41+
42+
# Store data to be written to file as a collection:
43+
data = Dict([
44+
("x", x),
45+
("expected", y)
46+
]);
47+
48+
# Based on the script directory, create an output filepath:
49+
filepath = joinpath( dir, name );
50+
51+
# Write the data to the output filepath as JSON:
52+
outfile = open( filepath, "w" );
53+
write( outfile, JSON.json(data) );
54+
write( outfile, "\n" );
55+
close( outfile );
5556
end
5657

5758
# Get the filename:
@@ -109,5 +110,5 @@ x = range( -2.0^60*(pi/2.0), stop = -2.0^1000*(pi/2.0), length = 1000 )
109110
gen( x, "huge_negative.json" );
110111

111112
# Huge positive values:
112-
x = range( 2.0^20*(pi/2.0), stop = 2.0^60*(pi/2.0), length = 1000 )
113+
x = range( 2.0^60*(pi/2.0), stop = 2.0^1000*(pi/2.0), length = 1000 )
113114
gen( x, "huge_positive.json" );

lib/node_modules/@stdlib/math/base/special/frexp/test/test.assign.js

Lines changed: 32 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
// MODULES //
2222

2323
var tape = require( 'tape' );
24-
var IS_BROWSER = require( '@stdlib/assert/is-browser' );
2524
var NINF = require( '@stdlib/constants/float64/ninf' );
2625
var PINF = require( '@stdlib/constants/float64/pinf' );
2726
var BIAS = require( '@stdlib/constants/float64/exponent-bias' );
@@ -63,8 +62,8 @@ tape( 'the function splits a floating-point number into a normalized fraction an
6362
for ( i = 0; i < x.length; i++ ) {
6463
out = new Float64Array( 2 );
6564
f = frexp( x[i], out, 1, 0 );
66-
t.equal( f, out, 'returns output array' );
67-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
65+
t.strictEqual( f, out, 'returns output array' );
66+
t.deepEqual( f, expected[ i ], 'returns expected value' );
6867
}
6968
t.end();
7069
});
@@ -81,8 +80,8 @@ tape( 'the function splits a floating-point number into a normalized fraction an
8180
for ( i = 0; i < x.length; i++ ) {
8281
out = new Float64Array( 2 );
8382
f = frexp( x[i], out, 1, 0 );
84-
t.equal( f, out, 'returns output array' );
85-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
83+
t.strictEqual( f, out, 'returns output array' );
84+
t.deepEqual( f, expected[ i ], 'returns expected value' );
8685
}
8786
t.end();
8887
});
@@ -99,8 +98,8 @@ tape( 'the function splits a floating-point number into a normalized fraction an
9998
for ( i = 0; i < x.length; i++ ) {
10099
out = new Float64Array( 2 );
101100
f = frexp( x[i], out, 1, 0 );
102-
t.equal( f, out, 'returns output array' );
103-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
101+
t.strictEqual( f, out, 'returns output array' );
102+
t.deepEqual( f, expected[ i ], 'returns expected value' );
104103
}
105104
t.end();
106105
});
@@ -117,14 +116,13 @@ tape( 'the function splits a floating-point number into a normalized fraction an
117116
for ( i = 0; i < x.length; i++ ) {
118117
out = new Float64Array( 2 );
119118
f = frexp( x[i], out, 1, 0 );
120-
t.equal( f, out, 'returns output array' );
121-
t.deepEqual( f, expected[ i ], 'returns expected results for ' + x[i] );
119+
t.strictEqual( f, out, 'returns output array' );
120+
t.deepEqual( f, expected[ i ], 'returns expected value' );
122121
}
123122
t.end();
124123
});
125124

126125
tape( 'the returned normalized fraction and exponent satisfy the relation `x = frac * 2**exp`', function test( t ) {
127-
var total;
128126
var sign;
129127
var frac;
130128
var exp;
@@ -133,12 +131,7 @@ tape( 'the returned normalized fraction and exponent satisfy the relation `x = f
133131
var f;
134132
var i;
135133

136-
if ( IS_BROWSER ) {
137-
total = 200;
138-
} else {
139-
total = 1000;
140-
}
141-
for ( i = 0; i < total; i++ ) {
134+
for ( i = 0; i < 1000; i++ ) {
142135
if ( randu() < 0.5 ) {
143136
sign = -1.0;
144137
} else {
@@ -149,20 +142,19 @@ tape( 'the returned normalized fraction and exponent satisfy the relation `x = f
149142
x = sign * frac * pow( 10.0, exp );
150143
out = new Float64Array( 2 );
151144
f = frexp( x, out, 1, 0 );
152-
t.equal( f, out, 'returns output array' );
145+
t.strictEqual( f, out, 'returns output array' );
153146

154147
if ( f[ 1 ] > BIAS ) {
155148
f = f[ 0 ] * pow( 2.0, BIAS ) * pow( 2.0, f[1]-BIAS );
156149
} else {
157150
f = f[ 0 ] * pow( 2.0, f[ 1 ] );
158151
}
159-
t.equal( f, x, 'frac * 2^exp equals ' + x );
152+
t.strictEqual( f, x, 'returns expected value' );
160153
}
161154
t.end();
162155
});
163156

164157
tape( 'the absolute value of the normalized fraction is on the interval `[1/2,1)`', function test( t ) {
165-
var total;
166158
var sign;
167159
var frac;
168160
var exp;
@@ -171,12 +163,7 @@ tape( 'the absolute value of the normalized fraction is on the interval `[1/2,1)
171163
var f;
172164
var i;
173165

174-
if ( IS_BROWSER ) {
175-
total = 200;
176-
} else {
177-
total = 1000;
178-
}
179-
for ( i = 0; i < total; i++ ) {
166+
for ( i = 0; i < 1000; i++ ) {
180167
if ( randu() < 0.5 ) {
181168
sign = -1.0;
182169
} else {
@@ -187,11 +174,11 @@ tape( 'the absolute value of the normalized fraction is on the interval `[1/2,1)
187174
x = sign * frac * pow( 10.0, exp );
188175
out = new Float64Array( 2 );
189176
f = frexp( x, out, 1, 0 );
190-
t.equal( f, out, 'returns output array' );
177+
t.strictEqual( f, out, 'returns output array' );
191178

192179
// Compute the absolute value of the normalized fraction:
193180
f = abs( f[ 0 ] );
194-
t.ok( f >= 0.5 && f < 1.0, 'absolute value of the normalized fraction is on the interval [1/2,1). x: ' + x + '.' );
181+
t.ok( f >= 0.5 && f < 1.0, 'returns expected value' );
195182
}
196183
t.end();
197184
});
@@ -202,8 +189,8 @@ tape( 'if provided `+0`, the function returns `[0,0]`', function test( t ) {
202189

203190
out = new Float64Array( 2 );
204191
f = frexp( 0.0, out, 1, 0 );
205-
t.equal( f, out, 'returns output array' );
206-
t.deepEqual( f, [0.0, 0], 'returns [0,0]' );
192+
t.strictEqual( f, out, 'returns output array' );
193+
t.deepEqual( f, [ 0.0, 0 ], 'returns expected value' );
207194
t.end();
208195
});
209196

@@ -213,9 +200,9 @@ tape( 'if provided `-0`, the function returns `[-0,0]`', function test( t ) {
213200

214201
out = new Float64Array( 2 );
215202
f = frexp( -0.0, out, 1, 0 );
216-
t.equal( f, out, 'returns output array' );
217-
t.equal( isNegativeZero( f[0] ), true, 'first element is -0' );
218-
t.deepEqual( f, [-0.0, 0], 'returns [-0,0]' );
203+
t.strictEqual( f, out, 'returns output array' );
204+
t.strictEqual( isNegativeZero( f[0] ), true, 'returns expected value' );
205+
t.deepEqual( f, [ -0.0, 0 ], 'returns expected value' );
219206
t.end();
220207
});
221208

@@ -225,8 +212,8 @@ tape( 'if provided `+infinity`, the function returns `[+infinity,0]`', function
225212

226213
out = new Float64Array( 2 );
227214
f = frexp( PINF, out, 1, 0 );
228-
t.equal( f, out, 'returns output array' );
229-
t.deepEqual( f, [PINF, 0], 'returns [+inf,0]' );
215+
t.strictEqual( f, out, 'returns output array' );
216+
t.deepEqual( f, [ PINF, 0 ], 'returns expected value' );
230217
t.end();
231218
});
232219

@@ -236,8 +223,8 @@ tape( 'if provided `-infinity`, the function returns `[-infinity,0]`', function
236223

237224
out = new Float64Array( 2 );
238225
f = frexp( NINF, out, 1, 0 );
239-
t.equal( f, out, 'returns output array' );
240-
t.deepEqual( f, [NINF, 0], 'returns [-inf,0]' );
226+
t.strictEqual( f, out, 'returns output array' );
227+
t.deepEqual( f, [ NINF, 0 ], 'returns expected value' );
241228
t.end();
242229
});
243230

@@ -247,9 +234,9 @@ tape( 'if provided `NaN`, the function returns `[NaN,0]`', function test( t ) {
247234

248235
out = new Float64Array( 2 );
249236
f = frexp( NaN, out, 1, 0 );
250-
t.equal( f, out, 'returns output array' );
251-
t.equal( isnan( f[0] ), true, 'first element is NaN' );
252-
t.equal( f[ 1 ], 0, 'second element is 0' );
237+
t.strictEqual( f, out, 'returns output array' );
238+
t.strictEqual( isnan( f[0] ), true, 'returns expected value' );
239+
t.strictEqual( f[ 1 ], 0, 'returns expected value' );
253240
t.end();
254241
});
255242

@@ -260,9 +247,9 @@ tape( 'the function supports providing an output array', function test( t ) {
260247
out = [ 0.0, 0 ];
261248
f = frexp( 4.0, out, 1, 0 );
262249

263-
t.equal( f, out, 'returns output array' );
264-
t.equal( f[ 0 ], 0.5, 'has expected first element' );
265-
t.equal( f[ 1 ], 3, 'has expected second element' );
250+
t.strictEqual( f, out, 'returns output array' );
251+
t.strictEqual( f[ 0 ], 0.5, 'returns expected value' );
252+
t.strictEqual( f[ 1 ], 3, 'returns expected value' );
266253

267254
t.end();
268255
});
@@ -274,9 +261,9 @@ tape( 'the function supports providing an output typed array', function test( t
274261
out = new Float64Array( 2 );
275262
f = frexp( 4.0, out, 1, 0 );
276263

277-
t.equal( f, out, 'returns output array' );
278-
t.equal( f[ 0 ], 0.5, 'has expected first element' );
279-
t.equal( f[ 1 ], 3, 'has expected second element' );
264+
t.strictEqual( f, out, 'returns output array' );
265+
t.strictEqual( f[ 0 ], 0.5, 'returns expected value' );
266+
t.strictEqual( f[ 1 ], 3, 'returns expected value' );
280267

281268
t.end();
282269
});

0 commit comments

Comments
 (0)