time-to-botec

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

README.md (3965B)


      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 # Dirichlet Eta Function
     22 
     23 > [Dirichlet eta][eta-function] function.
     24 
     25 <section class="intro">
     26 
     27 The [Dirichlet eta][eta-function] function is defined by the [Dirichlet series][dirichlet-series]
     28 
     29 <!-- <equation class="equation" label="eq:dirichlet_eta_function" align="center" raw="\eta(s) = \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n^s} = \frac{1}{1^s} - \frac{1}{2^s} + \frac{1}{3^s} - \frac{1}{4^s} + \cdots" alt="Dirichlet eta function"> -->
     30 
     31 <div class="equation" align="center" data-raw-text="\eta(s) = \sum_{n=1}^{\infty} \frac{(-1)^{n-1}}{n^s} = \frac{1}{1^s} - \frac{1}{2^s} + \frac{1}{3^s} - \frac{1}{4^s} + \cdots" data-equation="eq:dirichlet_eta_function">
     32     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@591cf9d5c3a0cd3c1ceec961e5c49d73a68374cb/lib/node_modules/@stdlib/math/base/special/dirichlet-eta/docs/img/equation_dirichlet_eta_function.svg" alt="Dirichlet eta function">
     33     <br>
     34 </div>
     35 
     36 <!-- </equation> -->
     37 
     38 where `s` is a complex variable equal to `σ + ti`. The series is convergent for all complex numbers having a real part greater than `0`.
     39 
     40 Note that the [Dirichlet eta][eta-function] function is also known as the **alternating zeta function** and denoted `ζ*(s)`. The series is an alternating sum corresponding to the Dirichlet series expansion of the [Riemann zeta][@stdlib/math/base/special/riemann-zeta] function. Accordingly, the following relation holds:
     41 
     42 <!-- <equation class="equation" label="eq:dirichlet_riemann_relation" align="center" raw="\eta(s) = (1-2^{1-s})\zeta(s)" alt="Dirichlet-Riemann zeta relation"> -->
     43 
     44 <div class="equation" align="center" data-raw-text="\eta(s) = (1-2^{1-s})\zeta(s)" data-equation="eq:dirichlet_riemann_relation">
     45     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/dirichlet-eta/docs/img/equation_dirichlet_riemann_relation.svg" alt="Dirichlet-Riemann zeta relation">
     46     <br>
     47 </div>
     48 
     49 <!-- </equation> -->
     50 
     51 where `ζ(s)` is the [Riemann zeta][@stdlib/math/base/special/riemann-zeta] function.
     52 
     53 </section>
     54 
     55 <!-- /.intro -->
     56 
     57 <section class="usage">
     58 
     59 ## Usage
     60 
     61 ```javascript
     62 var eta = require( '@stdlib/math/base/special/dirichlet-eta' );
     63 ```
     64 
     65 #### eta( s )
     66 
     67 Evaluates the [Dirichlet eta][eta-function] function as a function of a real variable `s`.
     68 
     69 ```javascript
     70 var v = eta( 0.0 ); // Abel sum of 1-1+1-1+...
     71 // returns 0.5
     72 
     73 v = eta( -1.0 ); // Abel sum of 1-2+3-4+...
     74 // returns 0.25
     75 
     76 v = eta( 1.0 ); // alternating harmonic series => ln(2)
     77 // returns 0.6931471805599453
     78 
     79 v = eta( 3.14 );
     80 // returns ~0.9096
     81 
     82 v = eta( NaN );
     83 // returns NaN
     84 ```
     85 
     86 </section>
     87 
     88 <!-- /.usage -->
     89 
     90 <section class="examples">
     91 
     92 ## Examples
     93 
     94 <!-- eslint no-undef: "error" -->
     95 
     96 ```javascript
     97 var linspace = require( '@stdlib/array/linspace' );
     98 var eta = require( '@stdlib/math/base/special/dirichlet-eta' );
     99 
    100 var s = linspace( -50.0, 50.0, 200 );
    101 var v;
    102 var i;
    103 
    104 for ( i = 0; i < s.length; i++ ) {
    105     v = eta( s[ i ] );
    106     console.log( 's: %d, η(s): %d', s[ i ], v );
    107 }
    108 ```
    109 
    110 </section>
    111 
    112 <!-- /.examples -->
    113 
    114 <section class="links">
    115 
    116 [eta-function]: https://en.wikipedia.org/wiki/Dirichlet_eta_function
    117 
    118 [dirichlet-series]: https://en.wikipedia.org/wiki/Dirichlet_series
    119 
    120 [@stdlib/math/base/special/riemann-zeta]: https://www.npmjs.com/package/@stdlib/math/tree/main/base/special/riemann-zeta
    121 
    122 </section>
    123 
    124 <!-- /.links -->