time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

README.md (2773B)


      1 <!--
      2 
      3 @license Apache-2.0
      4 
      5 Copyright (c) 2018 The Stdlib Authors.
      6 
      7 Licensed under the Apache License, Version 2.0 (the "License");
      8 you may not use this file except in compliance with the License.
      9 You may obtain a copy of the License at
     10 
     11    http://www.apache.org/licenses/LICENSE-2.0
     12 
     13 Unless required by applicable law or agreed to in writing, software
     14 distributed under the License is distributed on an "AS IS" BASIS,
     15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 See the License for the specific language governing permissions and
     17 limitations under the License.
     18 
     19 -->
     20 
     21 # y1
     22 
     23 > Compute the [Bessel function of the second kind][bessel-second-kind] of order one.
     24 
     25 <section class="intro">
     26 
     27 The [Bessel function of the second kind][bessel-second-kind] of order one is defined as
     28 
     29 <!-- <equation class="equation" label="eq:bessel_second_kind_order_one" align="center" raw="Y_1(x) = \frac{1}{\pi} \int_0^\pi \sin(x \sin\theta - \theta) \, d\theta -\frac{1}{\pi} \int_0^\infty  \left[ e^t - e^{-t} \right]  e^{-x \sinh t} \, dt" alt="Bessel function of the second kind of order one"> -->
     30 
     31 <div class="equation" align="center" data-raw-text="Y_1(x) = \frac{1}{\pi} \int_0^\pi \sin(x \sin\theta - \theta) \, d\theta -\frac{1}{\pi} \int_0^\infty  \left[ e^t - e^{-t} \right]  e^{-x \sinh t} \, dt" data-equation="eq:bessel_second_kind_order_one">
     32     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@591cf9d5c3a0cd3c1ceec961e5c49d73a68374cb/lib/node_modules/@stdlib/math/base/special/bessely1/docs/img/equation_bessel_second_kind_order_one.svg" alt="Bessel function of the second kind of order one">
     33     <br>
     34 </div>
     35 
     36 <!-- </equation> -->
     37 
     38 </section>
     39 
     40 <!-- ./intro -->
     41 
     42 <section class="usage">
     43 
     44 ## Usage
     45 
     46 ```javascript
     47 var y1 = require( '@stdlib/math/base/special/bessely1' );
     48 ```
     49 
     50 #### y1( x )
     51 
     52 Computes the [Bessel function of the second kind][bessel-second-kind] of order one at `x`.
     53 
     54 ```javascript
     55 var v = y1( 0.0 );
     56 // returns -Infinity
     57 
     58 v = y1( 1.0 );
     59 // returns ~-0.781
     60 
     61 v = y1( Infinity );
     62 // returns 0.0
     63 ```
     64 
     65 If `x < 0` or `x` is `NaN`, the function returns `NaN`.
     66 
     67 ```javascript
     68 var v = y1( -1.0 );
     69 // returns NaN
     70 
     71 v = y1( -Infinity );
     72 // returns NaN
     73 
     74 v = y1( NaN );
     75 // returns NaN
     76 
     77 ```
     78 
     79 </section>
     80 
     81 <!-- /.usage -->
     82 
     83 <section class="examples">
     84 
     85 ## Examples
     86 
     87 <!-- eslint no-undef: "error" -->
     88 
     89 ```javascript
     90 var randu = require( '@stdlib/random/base/randu' );
     91 var y1 = require( '@stdlib/math/base/special/bessely1' );
     92 
     93 var x;
     94 var i;
     95 
     96 for ( i = 0; i < 100; i++ ) {
     97     x = randu() * 10.0;
     98     console.log( 'y1(%d) = %d', x, y1( x ) );
     99 }
    100 ```
    101 
    102 </section>
    103 
    104 <!-- /.examples -->
    105 
    106 <section class="links">
    107 
    108 [bessel-second-kind]: https://en.wikipedia.org/wiki/Bessel_function#Bessel_functions_of_the_second_kind:_Y.CE.B1
    109 
    110 </section>
    111 
    112 <!-- /.links -->