Skip to content

Commit e917f26

Browse files
committed
Auto-generated commit
1 parent 1bf8fbd commit e917f26

4 files changed

Lines changed: 21 additions & 167 deletions

File tree

.github/.keepalive

Lines changed: 0 additions & 1 deletion
This file was deleted.

CHANGELOG.md

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

728728
<details>
729729

730+
- [`41ff83e`](https://github.com/stdlib-js/stdlib/commit/41ff83e17c6210cf153ecc80216a9420c0469570) - **test:** migrate `math/base/special/erf` to ULP base testing [(#11355)](https://github.com/stdlib-js/stdlib/pull/11355) _(by Shubham)_
730731
- [`7a04cb9`](https://github.com/stdlib-js/stdlib/commit/7a04cb90b3fbb4a98f74f4299d0cc0b131d482a1) - **fix:** address bug and improve C implementation of `math/base/special/hyp2f1` [(#11353)](https://github.com/stdlib-js/stdlib/pull/11353) _(by anee3)_
731732
- [`2244f8e`](https://github.com/stdlib-js/stdlib/commit/2244f8e59e730c8e721433ac0fdbdbc11c0c1e9c) - **refactor:** improve the implementation of `math/base/special/hyp2f1` [(#11325)](https://github.com/stdlib-js/stdlib/pull/11325) _(by anee3, Athan Reines, stdlib-bot)_
732733
- [`53641f6`](https://github.com/stdlib-js/stdlib/commit/53641f68e978d8c972ff6d0b8129ac40977d2e5e) - **docs:** improve doctests for complex number instances in `math/base/special/cceiln` [(#10213)](https://github.com/stdlib-js/stdlib/pull/10213) _(by AyushiJain18270, Athan Reines, stdlib-bot)_

base/special/erf/test/test.js

Lines changed: 7 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ var isNegativeZero = require( './../../../../base/assert/is-negative-zero' );
2626
var isPositiveZero = require( './../../../../base/assert/is-positive-zero' );
2727
var NINF = require( '@stdlib/constants/float64/ninf' );
2828
var PINF = require( '@stdlib/constants/float64/pinf' );
29-
var EPS = require( '@stdlib/constants/float64/eps' );
30-
var abs = require( './../../../../base/special/abs' );
29+
var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value' );
3130
var erf = require( './../lib' );
3231

3332

@@ -57,8 +56,6 @@ tape( 'main export is a function', function test( t ) {
5756

5857
tape( 'the function evaluates the error function for `x` on the interval `[-5,-100]', function test( t ) {
5958
var expected;
60-
var delta;
61-
var tol;
6259
var x;
6360
var y;
6461
var i;
@@ -67,21 +64,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-5,-1
6764
x = veryLargeNegative.x;
6865
for ( i = 0; i < x.length; i++ ) {
6966
y = erf( x[i] );
70-
if ( y === expected[i] ) {
71-
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
72-
} else {
73-
delta = abs( y - expected[ i ] );
74-
tol = EPS * abs( expected[ i ] );
75-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
76-
}
67+
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
7768
}
7869
t.end();
7970
});
8071

8172
tape( 'the function evaluates the error function for `x` on the interval `[5,100]`', function test( t ) {
8273
var expected;
83-
var delta;
84-
var tol;
8574
var x;
8675
var y;
8776
var i;
@@ -90,21 +79,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[5,100
9079
x = veryLargePositive.x;
9180
for ( i = 0; i < x.length; i++ ) {
9281
y = erf( x[i] );
93-
if ( y === expected[i] ) {
94-
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
95-
} else {
96-
delta = abs( y - expected[ i ] );
97-
tol = EPS * abs( expected[ i ] );
98-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
99-
}
82+
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
10083
}
10184
t.end();
10285
});
10386

10487
tape( 'the function evaluates the error function for `x` on the interval `[-2.5,-5]`', function test( t ) {
10588
var expected;
106-
var delta;
107-
var tol;
10889
var x;
10990
var y;
11091
var i;
@@ -113,21 +94,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-2.5,
11394
x = largeNegative.x;
11495
for ( i = 0; i < x.length; i++ ) {
11596
y = erf( x[i] );
116-
if ( y === expected[i] ) {
117-
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
118-
} else {
119-
delta = abs( y - expected[ i ] );
120-
tol = EPS * abs( expected[ i ] );
121-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
122-
}
97+
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
12398
}
12499
t.end();
125100
});
126101

127102
tape( 'the function evaluates the error function for `x` on the interval `[2.5,5]`', function test( t ) {
128103
var expected;
129-
var delta;
130-
var tol;
131104
var x;
132105
var y;
133106
var i;
@@ -136,21 +109,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[2.5,5
136109
x = largePositive.x;
137110
for ( i = 0; i < x.length; i++ ) {
138111
y = erf( x[i] );
139-
if ( y === expected[i] ) {
140-
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
141-
} else {
142-
delta = abs( y - expected[ i ] );
143-
tol = EPS * abs( expected[ i ] );
144-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
145-
}
112+
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
146113
}
147114
t.end();
148115
});
149116

150117
tape( 'the function evaluates the error function for `x` on the interval `[-1,-3]`', function test( t ) {
151118
var expected;
152-
var delta;
153-
var tol;
154119
var x;
155120
var y;
156121
var i;
@@ -159,21 +124,13 @@ tape( 'the function evaluates the error function for `x` on the interval `[-1,-3
159124
x = mediumNegative.x;
160125
for ( i = 0; i < x.length; i++ ) {
161126
y = erf( x[i] );
162-
if ( y === expected[i] ) {
163-
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
164-
} else {
165-
delta = abs( y - expected[ i ] );
166-
tol = EPS * abs( expected[ i ] );
167-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
168-
}
127+
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
169128
}
170129
t.end();
171130
});
172131

173132
tape( 'the function evaluates the error function for `x` on the interval `[1,3]`', function test( t ) {
174133
var expected;
175-
var delta;
176-
var tol;
177134
var x;
178135
var y;
179136
var i;
@@ -182,13 +139,7 @@ tape( 'the function evaluates the error function for `x` on the interval `[1,3]`
182139
x = mediumPositive.x;
183140
for ( i = 0; i < x.length; i++ ) {
184141
y = erf( x[i] );
185-
if ( y === expected[i] ) {
186-
t.strictEqual( y, expected[i], 'x: '+x[i]+', y: '+y+', expected: '+expected[i] );
187-
} else {
188-
delta = abs( y - expected[ i ] );
189-
tol = EPS * abs( expected[ i ] );
190-
t.ok( delta <= tol, 'within tolerance. x: '+x[i]+'. y: '+y+'. E: '+expected[i]+'. Δ: '+delta+'. tol: '+tol );
191-
}
142+
t.strictEqual( isAlmostSameValue( y, expected[ i ], 1 ), true, 'returns expected value' );
192143
}
193144
t.end();
194145
});

0 commit comments

Comments
 (0)