time-to-botec

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

README.md (2880B)


      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 # erfcinv
     22 
     23 > [Inverse complementary error function][erfcinv].
     24 
     25 <section class="intro">
     26 
     27 The [inverse complementary error function][erfcinv] is defined as
     28 
     29 <!-- <equation class="equation" label="eq:inverse_complementary_error_function" align="center" raw="\operatorname{erfc}^{-1}(1-z) = \operatorname{erf}^{-1}(z)" alt="Inverse complementary error function."> -->
     30 
     31 <div class="equation" align="center" data-raw-text="\operatorname{erfc}^{-1}(1-z) = \operatorname{erf}^{-1}(z)" data-equation="eq:inverse_complementary_error_function">
     32     <img src="https://cdn.jsdelivr.net/gh/stdlib-js/stdlib@bb29798906e119fcb2af99e94b60407a270c9b32/lib/node_modules/@stdlib/math/base/special/erfcinv/docs/img/equation_inverse_complementary_error_function.svg" alt="Inverse complementary error function.">
     33     <br>
     34 </div>
     35 
     36 <!-- </equation> -->
     37 
     38 where `erf^{-1}(z)` is the [inverse error function][@stdlib/math/base/special/erfinv].
     39 
     40 </section>
     41 
     42 <!-- /.intro -->
     43 
     44 <section class="usage">
     45 
     46 ## Usage
     47 
     48 ```javascript
     49 var erfcinv = require( '@stdlib/math/base/special/erfcinv' );
     50 ```
     51 
     52 #### erfcinv( x )
     53 
     54 Evaluates the [inverse complementary error function][erfcinv].
     55 
     56 ```javascript
     57 var y = erfcinv( 0.5 );
     58 // returns ~0.4769
     59 
     60 y = erfcinv( 0.8 );
     61 // returns ~0.1791
     62 
     63 y = erfcinv( 0.0 );
     64 // returns Infinity
     65 
     66 y = erfcinv( 2.0 );
     67 // returns -Infinity
     68 ```
     69 
     70 The domain of `x` is restricted to `[0,2]`. If `x` is outside this interval, the function returns `NaN`.
     71 
     72 ```javascript
     73 var y = erfcinv( -3.14 );
     74 // returns NaN
     75 ```
     76 
     77 If provided `NaN`, the function returns `NaN`.
     78 
     79 ```javascript
     80 var y = erfcinv( NaN );
     81 // returns NaN
     82 ```
     83 
     84 </section>
     85 
     86 <!-- /.usage -->
     87 
     88 <section class="examples">
     89 
     90 ## Examples
     91 
     92 <!-- eslint no-undef: "error" -->
     93 
     94 ```javascript
     95 var linspace = require( '@stdlib/array/linspace' );
     96 var erfcinv = require( '@stdlib/math/base/special/erfcinv' );
     97 
     98 var x = linspace( 0.0, 2.0, 100 );
     99 var y;
    100 var i;
    101 
    102 for ( i = 0; i < x.length; i++ ) {
    103     y = erfcinv( x[ i ] );
    104     console.log( 'x: %d, erfcinv(x): %d', x[ i ], y );
    105 }
    106 ```
    107 
    108 </section>
    109 
    110 <!-- /.examples -->
    111 
    112 <section class="links">
    113 
    114 [erfcinv]: https://en.wikipedia.org/wiki/Error_function#Inverse_functions
    115 
    116 [@stdlib/math/base/special/erfinv]: https://www.npmjs.com/package/@stdlib/math/tree/main/base/special/erfinv
    117 
    118 </section>
    119 
    120 <!-- /.links -->