time-to-botec

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

README.md (2486B)


      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 # Archavercosine
     22 
     23 > Compute the [inverse half-value versed cosine][archavercosine].
     24 
     25 <section class="intro">
     26 
     27 The [inverse half-value versed cosine][archavercosine] is defined as
     28 
     29 <!-- <equation class="equation" label="eq:archavercosine" align="center" raw="\operatorname{ahavercos}(\theta) = 2 \cdot \arccos(\sqrt{\theta})" alt="Inverse half-value versed cosine."> -->
     30 
     31 <div class="equation" align="center" data-raw-text="\operatorname{ahavercos}(\theta) = 2 \cdot \arccos(\sqrt{\theta})" data-equation="eq:archavercosine">
     32     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/ahavercos/docs/img/equation_archavercosine.svg" alt="Inverse half-value versed cosine.">
     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 ahavercos = require( '@stdlib/math/base/special/ahavercos' );
     48 ```
     49 
     50 #### ahavercos( x )
     51 
     52 Computes the [inverse half-value versed cosine][archavercosine].
     53 
     54 ```javascript
     55 var v = ahavercos( 0.0 );
     56 // returns ~3.1416
     57 
     58 v = ahavercos( 1.0 );
     59 // returns 0.0
     60 
     61 v = ahavercos( 0.5 );
     62 // returns ~1.5708
     63 ```
     64 
     65 If `x < 0`, `x > 1`, or `x` is `NaN`, the function returns `NaN`.
     66 
     67 ```javascript
     68 var v = ahavercos( 1.5 );
     69 // returns NaN
     70 
     71 v = ahavercos( -3.14 );
     72 // returns NaN
     73 
     74 v = ahavercos( NaN );
     75 // returns NaN
     76 ```
     77 
     78 </section>
     79 
     80 <!-- /.usage -->
     81 
     82 <section class="examples">
     83 
     84 ## Examples
     85 
     86 <!-- eslint no-undef: "error" -->
     87 
     88 ```javascript
     89 var linspace = require( '@stdlib/array/linspace' );
     90 var ahavercos = require( '@stdlib/math/base/special/ahavercos' );
     91 
     92 var x = linspace( 0.0, 1.0, 100 );
     93 var i;
     94 
     95 for ( i = 0; i < x.length; i++ ) {
     96     console.log( ahavercos( x[ i ] ) );
     97 }
     98 ```
     99 
    100 </section>
    101 
    102 <!-- /.examples -->
    103 
    104 <section class="links">
    105 
    106 [archavercosine]: https://en.wikipedia.org/wiki/Versine
    107 
    108 </section>
    109 
    110 <!-- /.links -->