time-to-botec

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

README.md (1814B)


      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][hyperbolic-arctangent] of a number.
     24 
     25 <section class="usage">
     26 
     27 ## Usage
     28 
     29 ```javascript
     30 var atanh = require( '@stdlib/math/base/special/atanh' );
     31 ```
     32 
     33 #### atanh( x )
     34 
     35 Computes the [hyperbolic arctangent][hyperbolic-arctangent] 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="examples">
     69 
     70 ## Examples
     71 
     72 <!-- eslint no-undef: "error" -->
     73 
     74 ```javascript
     75 var linspace = require( '@stdlib/array/linspace' );
     76 var atanh = require( '@stdlib/math/base/special/atanh' );
     77 
     78 var x = linspace( -1.0, 1.0, 103 );
     79 var i;
     80 
     81 for ( i = 0; i < x.length; i++ ) {
     82     console.log( atanh( x[ i ] ) );
     83 }
     84 ```
     85 
     86 </section>
     87 
     88 <!-- /.examples -->
     89 
     90 <section class="links">
     91 
     92 [hyperbolic-arctangent]: https://en.wikipedia.org/wiki/Inverse_hyperbolic_function
     93 
     94 </section>
     95 
     96 <!-- /.links -->