Skip to content

Commit aed26d2

Browse files
committed
Auto-generated commit
1 parent ee778ee commit aed26d2

File tree

5 files changed

+35
-88
lines changed

5 files changed

+35
-88
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,8 @@ A total of 82 issues were closed in this release:
717717

718718
<details>
719719

720+
- [`4418e62`](https://github.com/stdlib-js/stdlib/commit/4418e626e0a3ec318b6451f4e3b3397b0d43c6f2) - **test:** fix broken tests _(by Athan Reines)_
721+
- [`4ae9a8a`](https://github.com/stdlib-js/stdlib/commit/4ae9a8a3077bbd8ace12af0e8be28dc750d122e0) - **chore:** clean-up _(by Athan Reines)_
720722
- [`612180d`](https://github.com/stdlib-js/stdlib/commit/612180d3f3bdb24cdb8d4c6a3882ce85ba309dac) - **chore:** clean-up _(by Athan Reines)_
721723
- [`c47b2ba`](https://github.com/stdlib-js/stdlib/commit/c47b2ba406b1466b6c477445a598138b6e1ba6cc) - **chore:** clean-up _(by Athan Reines)_
722724
- [`7f68fc4`](https://github.com/stdlib-js/stdlib/commit/7f68fc4aa254ea41b4d104041ff513239f104ba3) - **feat:** add `math/base/special/atanhf` [(#9514)](https://github.com/stdlib-js/stdlib/pull/9514) _(by Harsh Yadav, Karan Anand, Philipp Burckhardt)_

base/special/atanhf/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,6 @@ int main( void ) {
179179

180180
<section class="related">
181181

182-
* * *
183-
184-
## See Also
185-
186182
</section>
187183

188184
<!-- /.related -->

base/special/atanhf/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@
123123
]
124124
}
125125
],
126-
"output_policy": "real_floating_point_and_generic",
127126
"returns": {
128127
"desc": "hyperbolic arctangent",
129128
"type": {
@@ -134,14 +133,14 @@
134133
}
135134
},
136135
"keywords": [
137-
"atanhf",
136+
"atanh",
138137
"hyperbolic",
139138
"inverse",
140139
"tangent",
141140
"tan"
142141
],
143142
"extra_keywords": [
144-
"math.atanhf"
143+
"math.atanh"
145144
]
146145
}
147146
}

base/special/atanhf/test/test.js

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

2323
var tape = require( 'tape' );
24-
var abs = require( './../../../../base/special/abs' );
2524
var PINF = require( '@stdlib/constants/float32/pinf' );
2625
var NINF = require( '@stdlib/constants/float32/ninf' );
2726
var EPS = require( '@stdlib/constants/float32/eps' );
@@ -30,7 +29,7 @@ var randu = require( '@stdlib/random/base/randu' );
3029
var isNegativeZerof = require( './../../../../base/assert/is-negative-zerof' );
3130
var isPositiveZerof = require( './../../../../base/assert/is-positive-zerof' );
3231
var f32 = require( '@stdlib/number/float64/base/to-float32' );
33-
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
32+
var isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' );
3433
var atanhf = require( './../lib' );
3534

3635

@@ -52,8 +51,7 @@ tape( 'main export is a function', function test( t ) {
5251

5352
tape( 'the function computes the hyperbolic arctangent (negative values)', function test( t ) {
5453
var expected;
55-
var delta;
56-
var tol;
54+
var ulps;
5755
var x;
5856
var y;
5957
var i;
@@ -62,24 +60,18 @@ tape( 'the function computes the hyperbolic arctangent (negative values)', funct
6260
x = negative.x;
6361
expected = negative.expected;
6462

63+
ulps = 4;
6564
for ( i = 0; i < x.length; i++ ) {
6665
y = atanhf( x[ i ] );
6766
e = f32( expected[ i ] );
68-
if ( isAlmostSameValue( y, e, 4 ) ) {
69-
t.strictEqual( y, e, 'x: '+x[i]+'. E: '+e );
70-
} else {
71-
delta = abs( y - e );
72-
tol = 1.3 * EPS * abs( e );
73-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. tol: '+tol+'.' );
74-
}
67+
t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. x: '+x[i]+'. y: '+y+'. E: '+e );
7568
}
7669
t.end();
7770
});
7871

7972
tape( 'the function computes the hyperbolic arctangent (positive values)', function test( t ) {
8073
var expected;
81-
var delta;
82-
var tol;
74+
var ulps;
8375
var x;
8476
var y;
8577
var i;
@@ -88,24 +80,18 @@ tape( 'the function computes the hyperbolic arctangent (positive values)', funct
8880
x = positive.x;
8981
expected = positive.expected;
9082

83+
ulps = 4;
9184
for ( i = 0; i < x.length; i++ ) {
9285
y = atanhf( x[ i ] );
9386
e = f32( expected[ i ] );
94-
if ( isAlmostSameValue( y, e, 4 ) ) {
95-
t.strictEqual( y, e, 'x: '+x[i]+'. E: '+e );
96-
} else {
97-
delta = abs( y - e );
98-
tol = 1.3 * EPS * abs( e );
99-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. tol: '+tol+'.' );
100-
}
87+
t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. x: '+x[i]+'. y: '+y+'. E: '+e );
10188
}
10289
t.end();
10390
});
10491

10592
tape( 'the function computes the hyperbolic arctangent (small negative)', function test( t ) {
10693
var expected;
107-
var delta;
108-
var tol;
94+
var ulps;
10995
var x;
11096
var y;
11197
var i;
@@ -114,24 +100,18 @@ tape( 'the function computes the hyperbolic arctangent (small negative)', functi
114100
x = smallNegative.x;
115101
expected = smallNegative.expected;
116102

103+
ulps = 1;
117104
for ( i = 0; i < x.length; i++ ) {
118105
y = atanhf( x[ i ] );
119106
e = f32( expected[ i ] );
120-
if ( isAlmostSameValue( y, e, 4 ) ) {
121-
t.strictEqual( y, e, 'x: '+x[i]+'. E: '+e );
122-
} else {
123-
delta = abs( y - e );
124-
tol = 1.0 * EPS * abs( e );
125-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. tol: '+tol+'.' );
126-
}
107+
t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. x: '+x[i]+'. y: '+y+'. E: '+e );
127108
}
128109
t.end();
129110
});
130111

131112
tape( 'the function computes the hyperbolic arctangent (small positive)', function test( t ) {
132113
var expected;
133-
var delta;
134-
var tol;
114+
var ulps;
135115
var x;
136116
var y;
137117
var i;
@@ -140,16 +120,11 @@ tape( 'the function computes the hyperbolic arctangent (small positive)', functi
140120
x = smallPositive.x;
141121
expected = smallPositive.expected;
142122

123+
ulps = 1;
143124
for ( i = 0; i < x.length; i++ ) {
144125
y = atanhf( x[i] );
145126
e = f32( expected[ i ] );
146-
if ( isAlmostSameValue( y, e, 4 ) ) {
147-
t.strictEqual( y, e, 'x: '+x[i]+'. E: '+e );
148-
} else {
149-
delta = abs( y - e );
150-
tol = 1.0 * EPS * abs( e );
151-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. tol: '+tol+'.' );
152-
}
127+
t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. x: '+x[i]+'. y: '+y+'. E: '+e );
153128
}
154129
t.end();
155130
});
@@ -170,7 +145,7 @@ tape( 'the function returns `NaN` if provided a value less than `-1`', function
170145
var v;
171146
var i;
172147

173-
for ( i = 0; i < 1e3; i++ ) {
148+
for ( i = 0; i < 1e2; i++ ) {
174149
v = -( randu() * 1.0e6 ) - ( 1.0 + EPS );
175150
t.strictEqual( isnanf( atanhf( v ) ), true, 'returns NaN when provided '+v );
176151
}
@@ -181,7 +156,7 @@ tape( 'the function returns `NaN` if provided a value greater than `1`', functio
181156
var v;
182157
var i;
183158

184-
for ( i = 0; i < 1e3; i++ ) {
159+
for ( i = 0; i < 1e2; i++ ) {
185160
v = ( randu() * 1.0e6 ) + 1.0 + EPS;
186161
t.strictEqual( isnanf( atanhf( v ) ), true, 'returns NaN when provided '+v );
187162
}

base/special/atanhf/test/test.native.js

Lines changed: 16 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
var resolve = require( 'path' ).resolve;
2424
var tape = require( 'tape' );
25-
var abs = require( './../../../../base/special/abs' );
2625
var PINF = require( '@stdlib/constants/float32/pinf' );
2726
var NINF = require( '@stdlib/constants/float32/ninf' );
2827
var tryRequire = require( '@stdlib/utils/try-require' );
@@ -31,7 +30,7 @@ var isnanf = require( './../../../../base/assert/is-nanf' );
3130
var randu = require( '@stdlib/random/base/randu' );
3231
var isNegativeZerof = require( './../../../../base/assert/is-negative-zerof' );
3332
var isPositiveZerof = require( './../../../../base/assert/is-positive-zerof' );
34-
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
33+
var isAlmostSameValue = require( '@stdlib/number/float32/base/assert/is-almost-same-value' );
3534
var f32 = require( '@stdlib/number/float64/base/to-float32' );
3635

3736

@@ -61,8 +60,7 @@ tape( 'main export is a function', opts, function test( t ) {
6160

6261
tape( 'the function computes the hyperbolic arctangent (negative values)', opts, function test( t ) {
6362
var expected;
64-
var delta;
65-
var tol;
63+
var ulps;
6664
var x;
6765
var y;
6866
var i;
@@ -71,24 +69,18 @@ tape( 'the function computes the hyperbolic arctangent (negative values)', opts,
7169
x = negative.x;
7270
expected = negative.expected;
7371

72+
ulps = 4;
7473
for ( i = 0; i < x.length; i++ ) {
7574
y = atanhf( x[ i ] );
7675
e = f32( expected[ i ] );
77-
if ( isAlmostSameValue( y, e, 4 ) ) {
78-
t.strictEqual( y, e, 'x: '+x[i]+'. E: '+e );
79-
} else {
80-
delta = abs( y - e );
81-
tol = 1.3 * EPS * abs( e );
82-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. tol: '+tol+'.' );
83-
}
76+
t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. x: '+x[i]+'. y: '+y+'. E: '+e );
8477
}
8578
t.end();
8679
});
8780

8881
tape( 'the function computes the hyperbolic arctangent (positive values)', opts, function test( t ) {
8982
var expected;
90-
var delta;
91-
var tol;
83+
var ulps;
9284
var x;
9385
var y;
9486
var i;
@@ -97,24 +89,18 @@ tape( 'the function computes the hyperbolic arctangent (positive values)', opts,
9789
x = positive.x;
9890
expected = positive.expected;
9991

92+
ulps = 4;
10093
for ( i = 0; i < x.length; i++ ) {
10194
y = atanhf( x[ i ] );
10295
e = f32( expected[ i ] );
103-
if ( isAlmostSameValue( y, e, 4 ) ) {
104-
t.strictEqual( y, e, 'x: '+x[i]+'. E: '+e );
105-
} else {
106-
delta = abs( y - e );
107-
tol = 1.3 * EPS * abs( e );
108-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. tol: '+tol+'.' );
109-
}
96+
t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. x: '+x[i]+'. y: '+y+'. E: '+e );
11097
}
11198
t.end();
11299
});
113100

114101
tape( 'the function computes the hyperbolic arctangent (small negative)', opts, function test( t ) {
115102
var expected;
116-
var delta;
117-
var tol;
103+
var ulps;
118104
var x;
119105
var y;
120106
var i;
@@ -123,24 +109,18 @@ tape( 'the function computes the hyperbolic arctangent (small negative)', opts,
123109
x = smallNegative.x;
124110
expected = smallNegative.expected;
125111

112+
ulps = 1;
126113
for ( i = 0; i < x.length; i++ ) {
127114
y = atanhf( x[ i ] );
128115
e = f32( expected[ i ] );
129-
if ( isAlmostSameValue( y, e, 4 ) ) {
130-
t.strictEqual( y, e, 'x: '+x[i]+'. E: '+e );
131-
} else {
132-
delta = abs( y - e );
133-
tol = 1.0 * EPS * abs( e );
134-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. tol: '+tol+'.' );
135-
}
116+
t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. x: '+x[i]+'. y: '+y+'. E: '+e );
136117
}
137118
t.end();
138119
});
139120

140121
tape( 'the function computes the hyperbolic arctangent (small positive)', opts, function test( t ) {
141122
var expected;
142-
var delta;
143-
var tol;
123+
var ulps;
144124
var x;
145125
var y;
146126
var i;
@@ -149,16 +129,11 @@ tape( 'the function computes the hyperbolic arctangent (small positive)', opts,
149129
x = smallPositive.x;
150130
expected = smallPositive.expected;
151131

132+
ulps = 1;
152133
for ( i = 0; i < x.length; i++ ) {
153-
y = atanhf( x[i] );
134+
y = atanhf( x[ i ] );
154135
e = f32( expected[ i ] );
155-
if ( isAlmostSameValue( y, e, 4 ) ) {
156-
t.strictEqual( y, e, 'x: '+x[i]+'. E: '+e );
157-
} else {
158-
delta = abs( y - e );
159-
tol = 1.0 * EPS * abs( e );
160-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+e+'. Δ: '+delta+'. tol: '+tol+'.' );
161-
}
136+
t.strictEqual( isAlmostSameValue( y, e, ulps ), true, 'within '+ulps+' ULPs. x: '+x[i]+'. y: '+y+'. E: '+e );
162137
}
163138
t.end();
164139
});
@@ -179,7 +154,7 @@ tape( 'the function returns `NaN` if provided a value less than `-1`', opts, fun
179154
var v;
180155
var i;
181156

182-
for ( i = 0; i < 1e3; i++ ) {
157+
for ( i = 0; i < 1e2; i++ ) {
183158
v = -( randu() * 1.0e6 ) - ( 1.0 + EPS );
184159
t.strictEqual( isnanf( atanhf( v ) ), true, 'returns NaN when provided '+v );
185160
}
@@ -190,7 +165,7 @@ tape( 'the function returns `NaN` if provided a value greater than `1`', opts, f
190165
var v;
191166
var i;
192167

193-
for ( i = 0; i < 1e3; i++ ) {
168+
for ( i = 0; i < 1e2; i++ ) {
194169
v = ( randu() * 1.0e6 ) + 1.0 + EPS;
195170
t.strictEqual( isnanf( atanhf( v ) ), true, 'returns NaN when provided '+v );
196171
}

0 commit comments

Comments
 (0)