Skip to content

Commit bf8cda6

Browse files
committed
docs: fix function description
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: passed - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: passed - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: passed - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent da9c442 commit bf8cda6

File tree

17 files changed

+53
-53
lines changed

17 files changed

+53
-53
lines changed

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/README.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# Alpha Max Plus Beta Minf
2222

23-
> Compute the [hypotenuse][hypotenuse] of a single-precision floating point number using the [alpha max plus beta min algorithm][alpha-max-plus-beta-min].
23+
> Compute the [hypotenuse][hypotenuse] using the [alpha max plus beta min algorithm][alpha-max-plus-beta-min] (single-precision).
2424
2525
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
2626

@@ -42,7 +42,7 @@ var ampbmf = require( '@stdlib/math/base/special/fast/alpha-max-plus-beta-minf'
4242

4343
#### ampbmf( x, y )
4444

45-
Computes the [hypotenuse][hypotenuse] of a single-precision floating point number using the [alpha max plus beta min algorithm][alpha-max-plus-beta-min].
45+
Computes the [hypotenuse][hypotenuse] using the [alpha max plus beta min algorithm][alpha-max-plus-beta-min] (single-precision).
4646

4747
```javascript
4848
var h = ampbmf( -5.0, 12.0 );
@@ -51,7 +51,7 @@ var h = ampbmf( -5.0, 12.0 );
5151

5252
#### ampbmf.factory( alpha, beta, \[nonnegative\[, ints]] )
5353

54-
Returns a function for computing the [hypotenuse][hypotenuse] using coefficients `alpha` and `beta`.
54+
Returns a function for computing the [hypotenuse][hypotenuse] using coefficients `alpha` and `beta` (single-precision).
5555

5656
```javascript
5757
var hypotf = ampbmf.factory( 1.0, 0.5 );
@@ -97,7 +97,7 @@ var h = hypotf( 5.0, 12.0 );
9797

9898
## Notes
9999

100-
- The algorithm computes only an **approximation**. For precise results, use [`hypot`][@stdlib/math/base/special/hypot].
100+
- The algorithm computes only an **approximation**. For precise results, use [`hypotf`][@stdlib/math/base/special/hypotf].
101101

102102
</section>
103103

@@ -122,7 +122,7 @@ var opts = {
122122
var x = discreteUniform( 100, -50, 50, opts );
123123
var y = discreteUniform( 100, -50, 50, opts );
124124

125-
logEachMap( 'hypotf(%f,%f) = %0.4f', x, y, ampbmf );
125+
logEachMap( 'hypotf(%d,%d) = %0.4f', x, y, ampbmf );
126126
```
127127

128128
</section>
@@ -157,11 +157,11 @@ logEachMap( 'hypotf(%f,%f) = %0.4f', x, y, ampbmf );
157157

158158
#### stdlib_base_fast_ampbmf( x, y )
159159

160-
Computes the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
160+
Computes the hypotenuse using the alpha max plus beta min algorithm (single-precision).
161161

162162
```c
163163
float h = stdlib_base_fast_ampbmf( -5.0f, 12.0f );
164-
// returns ~13.5
164+
// returns ~13.5f
165165
```
166166

167167
</section>
@@ -222,12 +222,6 @@ int main( void ) {
222222
223223
<section class="related">
224224
225-
* * *
226-
227-
## See Also
228-
229-
- <span class="package-name">[`@stdlib/math/base/special/hypot`][@stdlib/math/base/special/hypot]</span><span class="delimiter">: </span><span class="description">compute the hypotenuse avoiding overflow and underflow.</span>
230-
231225
</section>
232226
233227
<!-- /.related -->
@@ -240,7 +234,7 @@ int main( void ) {
240234
241235
[alpha-max-plus-beta-min]: https://en.wikipedia.org/wiki/Alpha_max_plus_beta_min_algorithm
242236
243-
[@stdlib/math/base/special/hypot]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/hypot
237+
[@stdlib/math/base/special/hypotf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/hypotf
244238
245239
<!-- <related-links> -->
246240

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/docs/repl.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
{{alias}}( x, y )
3-
Computes the hypotenuse using the alpha max plus beta min algorithm.
3+
Computes the hypotenuse using the alpha max plus beta min algorithm
4+
(single-precision).
45

56
The algorithm computes only an approximation.
67

@@ -25,7 +26,7 @@
2526

2627
{{alias}}.factory( alpha, beta, [nonnegative[, ints]] )
2728
Returns a function to compute a hypotenuse using the alpha max plus beta min
28-
algorithm.
29+
algorithm (single-precision).
2930

3031
Parameters
3132
----------

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
// TypeScript Version: 4.1
2020

2121
/**
22-
* Computes the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
22+
* Computes the hypotenuse using the alpha max plus beta min algorithm (single-precision).
2323
*
2424
* @param x - number
2525
* @param y - number
@@ -28,11 +28,11 @@
2828
type HypotFunctionF32 = ( x: number, y: number ) => number;
2929

3030
/**
31-
* Interface for computing the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
31+
* Interface for computing the hypotenuse using the alpha max plus beta min algorithm (single-precision).
3232
*/
3333
interface HypotF32 {
3434
/**
35-
* Computes the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
35+
* Computes the hypotenuse using the alpha max plus beta min algorithm (single-precision).
3636
*
3737
* @param x - number
3838
* @param y - number
@@ -45,13 +45,13 @@ interface HypotF32 {
4545
( x: number, y: number ): number;
4646

4747
/**
48-
* Returns a function to compute a hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
48+
* Returns a function to compute a hypotenuse using the alpha max plus beta min algorithm (single-precision).
4949
*
5050
* @param alpha - alpha
5151
* @param beta - beta
5252
* @param nonnegative - boolean indicating whether input values are always nonnegative
5353
* @param ints - boolean indicating whether input values are always 32-bit integers
54-
* @returns function to compute a hypotenuse of a single-precision floating point number
54+
* @returns function to compute a hypotenuse
5555
*
5656
* @example
5757
* var fcn = hypotf.factory( 1.0, 0.5 );
@@ -64,7 +64,7 @@ interface HypotF32 {
6464
}
6565

6666
/**
67-
* Computes the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
67+
* Computes the hypotenuse using the alpha max plus beta min algorithm (single-precision).
6868
*
6969
* @param x - number
7070
* @param y - number

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ var opts = {
2828
var x = discreteUniform( 100, -50, 50, opts );
2929
var y = discreteUniform( 100, -50, 50, opts );
3030

31-
logEachMap( 'hypotf(%f,%f) = %0.4f', x, y, ampbmf );
31+
logEachMap( 'hypotf(%d,%d) = %0.4f', x, y, ampbmf );

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/include/stdlib/math/base/special/fast/alpha_max_plus_beta_minf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ extern "C" {
2727
#endif
2828

2929
/**
30-
* Computes the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
30+
* Computes the hypotenuse using the alpha max plus beta min algorithm (single-precision).
3131
*/
3232
float stdlib_base_fast_ampbmf( const float x, const float y );
3333

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/lib/closuref1a.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var f32 = require( '@stdlib/number/float64/base/to-float32' );
2424

2525
/**
26-
* Returns a function to compute the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
26+
* Returns a function to compute the hypotenuse using the alpha max plus beta min algorithm (single-precision).
2727
*
2828
* @private
2929
* @param {number} alpha - alpha
@@ -41,7 +41,7 @@ function wrapf( alpha, beta ) {
4141
return hypotf;
4242

4343
/**
44-
* Computes the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
44+
* Computes the hypotenuse using the alpha max plus beta min algorithm (single-precision).
4545
*
4646
* @private
4747
* @param {NonNegativeNumber} x - number

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/lib/closuref1b.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' );
2727
// MAIN //
2828

2929
/**
30-
* Returns a function to compute the hypotenuse using the alpha max plus beta min algorithm.
30+
* Returns a function to compute the hypotenuse using the alpha max plus beta min algorithm (single-precision).
3131
*
3232
* @private
3333
* @param {number} alpha - alpha
@@ -45,7 +45,7 @@ function wrapf( alpha, beta ) {
4545
return hypotf;
4646

4747
/**
48-
* Computes the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm.
48+
* Computes the hypotenuse using the alpha max plus beta min algorithm (single-precision).
4949
*
5050
* @private
5151
* @param {number} x - number

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/lib/factory.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,17 @@ var closuref1a = require( './closuref1a.js' );
2929
var closuref1b = require( './closuref1b.js' );
3030

3131

32+
// VARIABLES //
33+
34+
var ONE = f32( 1.0 );
35+
var HALF = f32( 0.5 );
36+
var QUARTER = f32( 0.25 );
37+
38+
3239
// MAIN //
3340

3441
/**
35-
* Returns a function to compute a hypotenuse using the alpha max plus beta min algorithm.
42+
* Returns a function to compute a hypotenuse using the alpha max plus beta min algorithm (single-precision).
3643
*
3744
* @param {number} alpha - alpha
3845
* @param {number} beta - beta
@@ -48,13 +55,13 @@ function factory( alpha, beta, nonnegative, ints ) {
4855
alpha = f32( alpha );
4956
beta = f32( beta );
5057
if ( ints ) {
51-
if ( alpha === 1.0 && beta === 0.5 ) {
58+
if ( alpha === ONE && beta === HALF ) {
5259
if ( nonnegative ) {
5360
return hypotf1a;
5461
}
5562
return hypotf1b;
5663
}
57-
if ( alpha === 1.0 && beta === 0.25 ) {
64+
if ( alpha === ONE && beta === QUARTER ) {
5865
if ( nonnegative ) {
5966
return hypotf2a;
6067
}

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/lib/hypotf1a.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
var f32 = require( '@stdlib/number/float64/base/to-float32' );
2424

2525
/**
26-
* Computes the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm, where `alpha = 1` and `beta = 1/2`.
26+
* Computes the hypotenuse using the alpha max plus beta min algorithm (single-precision), where `alpha = 1` and `beta = 1/2`.
2727
*
2828
* @private
2929
* @param {uinteger32} x - integer
@@ -32,7 +32,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' );
3232
*
3333
* @example
3434
* var h = hypotf( 5.0, 12.0 );
35-
* // returns <number>
35+
* // returns 14.0
3636
*/
3737
function hypotf( x, y ) {
3838
if ( x > y ) {

lib/node_modules/@stdlib/math/base/special/fast/alpha-max-plus-beta-minf/lib/hypotf1b.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' );
2727
// MAIN //
2828

2929
/**
30-
* Computes the hypotenuse of a single-precision floating point number using the alpha max plus beta min algorithm, where `alpha = 1` and `beta = 1/2`.
30+
* Computes the hypotenuse using the alpha max plus beta min algorithm (single-precision), where `alpha = 1` and `beta = 1/2`.
3131
*
3232
* @private
3333
* @param {integer32} x - integer
@@ -36,7 +36,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' );
3636
*
3737
* @example
3838
* var h = hypotf( 5.0, 12.0 );
39-
* // returns <number>
39+
* // returns 14.0
4040
*/
4141
function hypotf( x, y ) {
4242
x = abs( x );

0 commit comments

Comments
 (0)