time-to-botec/js/node_modules/@stdlib/math/base/tools/hermitepoly
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

Physicist's Hermite Polynomial

Evaluate a physicist's Hermite polynomial.

The physicist's Hermite polynomials are given by

Equation for physicist's Hermite polynomials.

Usage

var hermitepoly = require( '@stdlib/math/base/tools/hermitepoly' );

hermitepoly( n, x )

Evaluates a physicist's Hermite polynomial of degree n.

var v = hermitepoly( 1, 1.0 );
// returns 2.0

v = hermitepoly( 1, 0.5 );
// returns ~1.0

v = hermitepoly( -1, 0.5 );
// returns NaN

v = hermitepoly( 0, 0.5 );
// returns 1.0

v = hermitepoly( 2, 0.5 );
// returns -1.0

hermitepoly.factory( n )

Returns a function for evaluating a physicist's Hermite polynomial of degree n.

var polyval = hermitepoly.factory( 2 );

var v = polyval( 0.5 );
// returns -1.0

Examples

var randu = require( '@stdlib/random/base/randu');
var hermitepoly = require( '@stdlib/math/base/tools/hermitepoly' );

var x;
var y;
var i;
var j;

for ( i = 0; i < 100; i++ ) {
    x = (randu()*100.0) - 50.0;
    for ( j = 1; j < 3; j++ ) {
        y = hermitepoly( j, x );
        console.log( 'H_%d( %d ) = %d', j, x.toFixed( 3 ), y.toFixed( 3 ) );
    }
}