Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
214 changes: 214 additions & 0 deletions lib/node_modules/@stdlib/math/base/special/acschf/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
<!--

@license Apache-2.0

Copyright (c) 2026 The Stdlib Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

-->

# acschf

> Computes the [hyperbolic arccosecant][inverse-hyperbolic-functions] of a single-precision floating-point number.

<section class="usage">

## Usage

```javascript
var acschf = require( '@stdlib/math/base/special/acschf' );
```

#### acschf( x )

Computes the [hyperbolic arccosecant][inverse-hyperbolic-functions] of `x`.

```javascript
var v = acschf( 0.0 );
// returns Infinity

v = acschf( -0.0 );
// returns -Infinity

v = acschf( 1.0 );
// returns ~0.881

v = acschf( -1.0 );
// returns ~-0.881

v = acschf( NaN );
// returns NaN

v = acschf( -Infinity );
// returns -0.0

v = acschf( Infinity );
// returns 0.0
```

</section>

<!-- /.usage -->

<section class="examples">

## Examples

<!-- eslint no-undef: "error" -->

```javascript
var uniform = require( '@stdlib/random/array/uniform' );
var logEachMap = require( '@stdlib/console/log-each-map' );
var acschf = require( '@stdlib/math/base/special/acschf' );

var x = uniform( 100, 1.0, 5.0, {
'dtype': 'float32'
});

logEachMap( 'acschf(%0.4f) = %0.4f', x, acschf );
```

</section>

<!-- /.examples -->

<!-- C interface documentation. -->

* * *

<section class="c">

## C APIs

<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->

<section class="intro">

</section>

<!-- /.intro -->

<!-- C usage documentation. -->

<section class="usage">

### Usage

```c
#include "stdlib/math/base/special/acschf.h"
```

#### stdlib_base_acschf( x )

> Compute the [hyperbolic arccosecant][inverse-hyperbolic-functions] of a single-precision floating-point number.

```c
float out = stdlib_base_acschf( 1.0 );
// returns ~0.881
```

The function accepts the following arguments:

- **x**: `[in] float` input value.

```c
float stdlib_base_acschf( const float x );
```

</section>

<!-- /.usage -->

<!-- C API usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="notes">

</section>

<!-- /.notes -->

<!-- C API usage examples. -->

<section class="examples">

### Examples

```c
#include "stdlib/math/base/special/acschf.h"
#include <stdio.h>

int main( void ) {
const float x[] = { -5.0f, -3.89f, -2.78f, -1.67f, -0.55f, 0.55f, 1.67f, 2.78f, 3.89f, 5.0f };

float v;
int i;
for ( i = 0; i < 10; i++ ) {
v = stdlib_base_acschf( x[ i ] );
printf( "acsch(%f) = %f\n", x[ i ], v );
}
}
```

</section>

<!-- /.examples -->

</section>

<!-- /.c -->

<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->

<section class="related">

* * *

## See Also

- <span class="package-name">[`@stdlib/math/base/special/acothf`][@stdlib/math/base/special/acothf]</span><span class="delimiter">: </span><span class="description">compute the inverse hyperbolic cotangent of a single-precision floating-point number.</span>
- <span class="package-name">[`@stdlib/math/base/special/acscf`][@stdlib/math/base/special/acscf]</span><span class="delimiter">: </span><span class="description">compute the arccosecant of a single-precision floating-point number.</span>
- <span class="package-name">[`@stdlib/math/base/special/asechf`][@stdlib/math/base/special/asechf]</span><span class="delimiter">: </span><span class="description">compute the hyperbolic arcsecant of a single-precision floating-point number.</span>
- <span class="package-name">[`@stdlib/math/base/special/asinhf`][@stdlib/math/base/special/asinhf]</span><span class="delimiter">: </span><span class="description">compute the hyperbolic arcsine of a single-precision floating-point number.</span>
- <span class="package-name">[`@stdlib/math/base/special/cscf`][@stdlib/math/base/special/cscf]</span><span class="delimiter">: </span><span class="description">compute the cosecant of a single-precision floating-point number.</span>
- <span class="package-name">[`@stdlib/math/base/special/cschf`][@stdlib/math/base/special/cschf]</span><span class="delimiter">: </span><span class="description">compute the hyperbolic cosecant of a single-precision floating-point number.</span>

</section>

<!-- /.related -->

<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->

<section class="links">

[inverse-hyperbolic-functions]: https://en.wikipedia.org/wiki/Inverse_hyperbolic_functions

<!-- <related-links> -->

[@stdlib/math/base/special/acothf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/acothf

[@stdlib/math/base/special/acscf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/acscf

[@stdlib/math/base/special/asechf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/asechf

[@stdlib/math/base/special/asinhf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/asinhf

[@stdlib/math/base/special/cscf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/cscf

[@stdlib/math/base/special/cschf]: https://github.com/stdlib-js/stdlib/tree/develop/lib/node_modules/%40stdlib/math/base/special/cschf

<!-- </related-links> -->

</section>

<!-- /.links -->
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var bench = require( '@stdlib/bench' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var pkg = require( './../package.json' ).name;
var acschf = require( './../lib' );


// MAIN //

bench( pkg, function benchmark( b ) {
var x;
var i;

x = f32( 1.234567 );
i = 0;

b.tic();
while ( i < b.iterations ) {
x = acschf( x );
i += 1;
}
b.toc();

if ( x !== x ) {
b.fail( 'unexpected NaN' );
}
b.pass( 'benchmark finished' );
b.end();
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/**
* @license Apache-2.0
*
* Copyright (c) 2026 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

'use strict';

// MODULES //

var resolve = require( 'path' ).resolve;
var bench = require( '@stdlib/bench' );
var tryRequire = require( '@stdlib/utils/try-require' );
var f32 = require( '@stdlib/number/float64/base/to-float32' );
var pkg = require( './../package.json' ).name;


// VARIABLES //

var acschf = tryRequire( resolve( __dirname, './../lib/native.js' ) );
var opts = {
'skip': ( acschf instanceof Error )
};


// MAIN //

bench( pkg+'::native', opts, function benchmark( b ) {

Check warning on line 40 in lib/node_modules/@stdlib/math/base/special/acschf/benchmark/benchmark.native.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

Use `@stdlib/string/format` instead of string concatenation for benchmark descriptions
var x;
var i;

x = f32( 1.234567 );
i = 0;

b.tic();
while ( i < b.iterations ) {
x = acschf( x );
i += 1;
}
b.toc();

if ( x !== x ) {
b.fail( 'unexpected NaN' );
}
b.pass( 'benchmark finished' );
b.end();
});
Loading