Skip to content

Commit

Permalink
Auto-generated commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stdlib-bot committed Apr 19, 2024
1 parent 5f61956 commit 651fc0a
Show file tree
Hide file tree
Showing 10 changed files with 166 additions and 175 deletions.
8 changes: 3 additions & 5 deletions base/special/rcbrt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ limitations under the License.
-->

# Reciprocal Cube Root
# rcbrt

> Compute the reciprocal of the principal [cube root][cube-root] of a double-precision floating-point number.
Expand Down Expand Up @@ -86,15 +86,13 @@ v = rcbrt( Infinity );
<!-- eslint no-undef: "error" -->

```javascript
var randu = require( '@stdlib/random/base/randu' );
var round = require( '@stdlib/math/base/special/round' );
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var rcbrt = require( '@stdlib/math/base/special/rcbrt' );

var x;
var i;

for ( i = 0; i < 100; i++ ) {
x = round( randu() * 100.0 );
x = discreteUniform( 0.0, 100.0 );
console.log( 'rcbrt(%d) = %d', x, rcbrt( x ) );
}
```
Expand Down
4 changes: 2 additions & 2 deletions base/special/rcbrt/benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ bench( pkg, function benchmark( b ) {

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*100000.0 ) - 0.0;
x = ( randu() * 100000.0 ) - 0.0;
y = rcbrt( x );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
Expand All @@ -64,7 +64,7 @@ bench( pkg+'::built-in', opts, function benchmark( b ) {

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*100000.0 ) - 0.0;
x = ( randu() * 100000.0 ) - 0.0;
y = 1.0 / Math.cbrt( x ); // eslint-disable-line stdlib/no-builtin-math
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
Expand Down
2 changes: 1 addition & 1 deletion base/special/rcbrt/benchmark/benchmark.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ bench( pkg+'::native', opts, function benchmark( b ) {

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
x = ( randu()*100000.0 ) - 0.0;
x = ( randu() * 100000.0 ) - 0.0;
y = rcbrt( x );
if ( isnan( y ) ) {
b.fail( 'should not return NaN' );
Expand Down
2 changes: 1 addition & 1 deletion base/special/rcbrt/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
0.1
> y = {{alias}}( 0.0 )
Infinity
> y = {{alias}}( Infinity )
> y = {{alias}}( {{alias:@stdlib/constants/float64/pinf}} )
0.0
> y = {{alias}}( -8.0 )
-0.5
Expand Down
6 changes: 2 additions & 4 deletions base/special/rcbrt/examples/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@

'use strict';

var randu = require( '@stdlib/random/base/randu' );
var round = require( './../../../../base/special/round' );
var discreteUniform = require( '@stdlib/random/base/discrete-uniform' );
var rcbrt = require( './../lib' );

var x;
var i;

for ( i = 0; i < 100; i++ ) {
x = round( randu() * 100.0 );
x = discreteUniform( 0.0, 100.0 );
console.log( 'rcbrt(%d) = %d', x, rcbrt( x ) );
}
18 changes: 6 additions & 12 deletions base/special/rcbrt/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,12 @@
{
"task": "build",
"src": [
"./src/rcbrt.c"
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/napi/unary",
Expand All @@ -45,14 +43,12 @@
{
"task": "benchmark",
"src": [
"./src/rcbrt.c"
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/special/cbrt"
Expand All @@ -61,14 +57,12 @@
{
"task": "examples",
"src": [
"./src/rcbrt.c"
"./src/main.c"
],
"include": [
"./include"
],
"libraries": [
"-lm"
],
"libraries": [],
"libpath": [],
"dependencies": [
"@stdlib/math/base/special/cbrt"
Expand Down
1 change: 1 addition & 0 deletions base/special/rcbrt/src/addon.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@
#include "stdlib/math/base/special/rcbrt.h"
#include "stdlib/math/base/napi/unary.h"

// cppcheck-suppress shadowFunction
STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_rcbrt )
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
/**
* Computes the reciprocal cube root of a double-precision floating-point number.
*
* @param x number
* @return reciprocal cube root
* @param x number
* @return reciprocal cube root
*
* @example
* double y = stdlib_base_rcbrt( 8.0 );
Expand Down
Loading

0 comments on commit 651fc0a

Please sign in to comment.