Skip to content

Commit aeb0be2

Browse files
feat: add math/base/special/expf
1 parent 1994f2e commit aeb0be2

File tree

4 files changed

+62
-14
lines changed

4 files changed

+62
-14
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@stdlib/math/base/special/expf",
33
"version": "0.0.0",
4-
"description": "Natural exponential function (single-precision).",
4+
"description": "Evaluates the natural exponential function as a single-precision floating-point number.",
55
"license": "Apache-2.0",
66
"author": {
77
"name": "The Stdlib Authors",

lib/node_modules/@stdlib/math/base/special/expf/test/test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ tape( 'the function accurately computes the natural exponential function for neg
6060
for ( i = 0; i < x.length; i++ ) {
6161
v = expf( x[ i ] );
6262
delta = absf( v - expected[ i ] );
63-
tol = EPS * 50 * absf( expected[ i ] );
63+
tol = 50 * EPS * absf( expected[ i ] );
6464
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
6565
}
6666
t.end();
@@ -80,7 +80,7 @@ tape( 'the function accurately computes the natural exponential function for pos
8080
for ( i = 0; i < x.length; i++ ) {
8181
v = expf( x[ i ] );
8282
delta = absf( v - expected[ i ] );
83-
tol = EPS * 50 * absf( expected[ i ] );
83+
tol = 50 * EPS * absf( expected[ i ] );
8484
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
8585
}
8686
t.end();
@@ -100,7 +100,7 @@ tape( 'the function accurately computes the natural exponential function for neg
100100
for ( i = 0; i < x.length; i++ ) {
101101
v = expf( x[ i ] );
102102
delta = absf( v - expected[ i ] );
103-
tol = EPS * 50 * absf( expected[ i ] );
103+
tol = 50 * EPS * absf( expected[ i ] );
104104
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
105105
}
106106
t.end();
@@ -120,7 +120,7 @@ tape( 'the function accurately computes the natural exponential function for pos
120120
for ( i = 0; i < x.length; i++ ) {
121121
v = expf( x[ i ] );
122122
delta = absf( v - expected[ i ] );
123-
tol = EPS * 50 * absf( expected[ i ] );
123+
tol = 50 * EPS * absf( expected[ i ] );
124124
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
125125
}
126126
t.end();
@@ -140,7 +140,7 @@ tape( 'the function accurately computes the natural exponential function for ver
140140
for ( i = 0; i < x.length; i++ ) {
141141
v = expf( x[ i ] );
142142
delta = absf( v - expected[ i ] );
143-
tol = EPS * 50 * absf( expected[ i ] );
143+
tol = 50 * EPS * absf( expected[ i ] );
144144
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
145145
}
146146
t.end();

lib/node_modules/@stdlib/math/base/special/expf/test/test.native.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ tape( 'the function accurately computes the natural exponential function for neg
6969
for ( i = 0; i < x.length; i++ ) {
7070
v = expf( x[ i ] );
7171
delta = absf( v - expected[ i ] );
72-
tol = EPS * 50 * absf( expected[ i ] );
72+
tol = 10 * EPS * absf( expected[ i ] );
7373
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
7474
}
7575
t.end();
@@ -89,7 +89,7 @@ tape( 'the function accurately computes the natural exponential function for pos
8989
for ( i = 0; i < x.length; i++ ) {
9090
v = expf( x[ i ] );
9191
delta = absf( v - expected[ i ] );
92-
tol = EPS * 50 * absf( expected[ i ] );
92+
tol = 10 * EPS * absf( expected[ i ] );
9393
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
9494
}
9595
t.end();
@@ -109,7 +109,7 @@ tape( 'the function accurately computes the natural exponential function for neg
109109
for ( i = 0; i < x.length; i++ ) {
110110
v = expf( x[ i ] );
111111
delta = absf( v - expected[ i ] );
112-
tol = EPS * 50 * absf( expected[ i ] );
112+
tol = 10 * EPS * absf( expected[ i ] );
113113
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
114114
}
115115
t.end();
@@ -129,7 +129,7 @@ tape( 'the function accurately computes the natural exponential function for pos
129129
for ( i = 0; i < x.length; i++ ) {
130130
v = expf( x[ i ] );
131131
delta = absf( v - expected[ i ] );
132-
tol = EPS * 50 * absf( expected[ i ] );
132+
tol = 10 * EPS * absf( expected[ i ] );
133133
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
134134
}
135135
t.end();
@@ -149,26 +149,26 @@ tape( 'the function accurately computes the natural exponential function for ver
149149
for ( i = 0; i < x.length; i++ ) {
150150
v = expf( x[ i ] );
151151
delta = absf( v - expected[ i ] );
152-
tol = EPS * 50 * absf( expected[ i ] );
152+
tol = 10 * EPS * absf( expected[ i ] );
153153
t.ok( delta <= tol, 'within tolerance. x: ' + x[ i ] + '. Value: ' + v + '. Expected: ' + expected[ i ] + '. Tolerance: ' + tol + '.' );
154154
}
155155
t.end();
156156
});
157157

158158
tape( 'the function returns `0` if provided a `-infinity`', opts, function test( t ) {
159159
var val = expf( NINF );
160-
t.equal( val, 0.0, 'returns 0' );
160+
t.equal( val, 0.0, 'returns expected value' );
161161
t.end();
162162
});
163163

164164
tape( 'the function returns `+infinity` if provided a `+infinity`', opts, function test( t ) {
165165
var val = expf( PINF );
166-
t.equal( val, PINF, 'returns +infinity' );
166+
t.equal( val, PINF, 'returns expected value' );
167167
t.end();
168168
});
169169

170170
tape( 'the function returns `NaN` if provided a `NaN`', opts, function test( t ) {
171171
var val = expf( NaN );
172-
t.equal( isnan( val ), true, 'returns NaN' );
172+
t.equal( isnan( val ), true, 'returns expected value' );
173173
t.end();
174174
});

tsconfig.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"compilerOptions": {
3+
"allowJs": true,
4+
"allowSyntheticDefaultImports": false,
5+
"allowUnreachableCode": false,
6+
"allowUnusedLabels": false,
7+
"alwaysStrict": true,
8+
"baseUrl": "lib/node_modules",
9+
"checkJs": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"keyofStringsOnly": false,
12+
"lib": [
13+
"es6"
14+
],
15+
"module": "commonjs",
16+
"moduleResolution": "node",
17+
"newLine": "lf",
18+
"noEmit": true,
19+
"noFallthroughCasesInSwitch": true,
20+
"noImplicitAny": true,
21+
"noImplicitReturns": false,
22+
"noImplicitThis": true,
23+
"noStrictGenericChecks": false,
24+
"noUnusedLocals": true,
25+
"noUnusedParameters": true,
26+
"paths": {},
27+
"pretty": true,
28+
"strictBindCallApply": true,
29+
"strictFunctionTypes": true,
30+
"strictNullChecks": true,
31+
"suppressExcessPropertyErrors": false,
32+
"suppressImplicitAnyIndexErrors": false,
33+
"typeRoots": [ "." ],
34+
"types": []
35+
},
36+
"include": [
37+
"docs/types/index.d.ts",
38+
"docs/types/test.ts",
39+
"lib/node_modules/**/docs/types/index.d.ts",
40+
"lib/node_modules/**/docs/types/test.ts",
41+
"lib/node_modules/**/@stdlib/types/index.d.ts",
42+
"lib/node_modules/**/@stdlib/types/test.ts"
43+
],
44+
"exclude": [
45+
"node_modules"
46+
]
47+
}
48+

0 commit comments

Comments
 (0)