time-to-botec

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

README.md (2031B)


      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 # atanh
     22 
     23 > Compute the [hyperbolic arctangent][inverse-hyperbolic] of a number.
     24 
     25 <section class="usage">
     26 
     27 ## Usage
     28 
     29 ```javascript
     30 var atanh = require( '@stdlib/math/base/special/fast/atanh' );
     31 ```
     32 
     33 #### atanh( x )
     34 
     35 Computes the [hyperbolic arctangent][inverse-hyperbolic] of a `number` (in radians).
     36 
     37 ```javascript
     38 var v = atanh( 0.0 );
     39 // returns 0.0
     40 
     41 v = atanh( -0.0 );
     42 // returns -0.0
     43 
     44 v = atanh( 0.5 );
     45 // returns ~0.549
     46 
     47 v = atanh( 0.9 );
     48 // returns ~1.472
     49 
     50 v = atanh( 1.0 );
     51 // returns Infinity
     52 
     53 v = atanh( -1.0 );
     54 // returns -Infinity
     55 ```
     56 
     57 The domain of `x` is restricted to `[-1,1]`. If `|x| > 1`, the function returns `NaN`.
     58 
     59 ```javascript
     60 var v = atanh( -3.14 );
     61 // returns NaN
     62 ```
     63 
     64 </section>
     65 
     66 <!-- /.usage -->
     67 
     68 <section class="notes">
     69 
     70 ## Notes
     71 
     72 -   For small `x`, the function will underflow.
     73 
     74     ```javascript
     75     var v = atanh( 1.0e-17 );
     76     // returns 0.0
     77     // (expected 1.0e-17)
     78     ```
     79 
     80 </section>
     81 
     82 <!-- /.notes -->
     83 
     84 <section class="examples">
     85 
     86 ## Examples
     87 
     88 <!-- eslint no-undef: "error" -->
     89 
     90 ```javascript
     91 var linspace = require( '@stdlib/array/linspace' );
     92 var atanh = require( '@stdlib/math/base/special/fast/atanh' );
     93 
     94 var x = linspace( -1.0, 1.0, 103 );
     95 var i;
     96 
     97 for ( i = 0; i < x.length; i++ ) {
     98     console.log( atanh( x[ i ] ) );
     99 }
    100 ```
    101 
    102 </section>
    103 
    104 <!-- /.examples -->
    105 
    106 <section class="links">
    107 
    108 [inverse-hyperbolic]: https://en.wikipedia.org/wiki/Inverse_hyperbolic_function
    109 
    110 </section>
    111 
    112 <!-- /.links -->