GithubHelp home page GithubHelp logo

stdlib-js / math-base-special-xlogy Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 0.0 1.51 MB

Compute `x * ln(y)` so that the result is `0` if `x = 0`.

Home Page: https://github.com/stdlib-js/stdlib

License: Apache License 2.0

Makefile 50.21% JavaScript 34.36% Python 15.43%
nodejs javascript stdlib node node-js mathematics math natural logarithm log ln special

math-base-special-xlogy's Introduction

xlogy

NPM version Build Status Coverage Status

Compute x * ln(y) so that the result is 0 if x = 0.

Installation

npm install @stdlib/math-base-special-xlogy

Alternatively,

The branches.md file summarizes the available branches and displays a diagram illustrating their relationships.

Usage

var xlogy = require( '@stdlib/math-base-special-xlogy' );

xlogy( x, y )

Computes x * ln(y) so that the result is 0 if x = 0.

var out = xlogy( 3.0, 2.0 );
// returns ~2.079

out = xlogy( 1.5, 5.9 );
// returns ~2.662

out = xlogy( 0.9, 1.0 );
// returns 0.0

out = xlogy( 0.0, -2.0 );
// returns 0.0

out = xlogy( 1.5, NaN );
// returns NaN

out = xlogy( 0.0, NaN );
// returns NaN

out = xlogy( NaN, 2.3 );
// returns NaN

Examples

var randu = require( '@stdlib/random-base-randu' );
var xlogy = require( '@stdlib/math-base-special-xlogy' );

var x;
var y;
var i;

for ( i = 0; i < 100; i++ ) {
    x = randu();
    if ( x < 0.5 ) {
        x = 0.0;
    }
    y = ( randu() * 20.0 ) - 5.0;
    console.log( 'xlogy(%d, %d) = %d', x, y, xlogy( x, y ) );
}

See Also


Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2023. The Stdlib Authors.

math-base-special-xlogy's People

Contributors

stdlib-bot avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.