time-to-botec

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

main.js (1589B)


      1 /**
      2 * @license Apache-2.0
      3 *
      4 * Copyright (c) 2020 The Stdlib Authors.
      5 *
      6 * Licensed under the Apache License, Version 2.0 (the "License");
      7 * you may not use this file except in compliance with the License.
      8 * You may obtain a copy of the License at
      9 *
     10 *    http://www.apache.org/licenses/LICENSE-2.0
     11 *
     12 * Unless required by applicable law or agreed to in writing, software
     13 * distributed under the License is distributed on an "AS IS" BASIS,
     14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     15 * See the License for the specific language governing permissions and
     16 * limitations under the License.
     17 */
     18 
     19 'use strict';
     20 
     21 // MODULES //
     22 
     23 var iterMap = require( './../../../../iter/tools/map' );
     24 var log1pexp = require( './../../../../base/special/log1pexp' );
     25 
     26 
     27 // MAIN //
     28 
     29 /**
     30 * Returns an iterator which iteratively evaluates the natural logarithm of \\( 1+\exp(x) \\).
     31 *
     32 * ## Notes
     33 *
     34 * -   If an environment supports `Symbol.iterator` **and** a provided iterator is iterable, the returned iterator is iterable.
     35 *
     36 * @param {Iterator} iterator - input iterator
     37 * @throws {TypeError} must provide an iterator protocol-compliant object
     38 * @returns {Iterator} iterator
     39 *
     40 * @example
     41 * var uniform = require( '@stdlib/random/iter/uniform' );
     42 *
     43 * var iter = iterLog1pexp( uniform( 0.0, 1.0 ) );
     44 *
     45 * var r = iter.next().value;
     46 * // returns <number>
     47 *
     48 * r = iter.next().value;
     49 * // returns <number>
     50 *
     51 * r = iter.next().value;
     52 * // returns <number>
     53 *
     54 * // ...
     55 */
     56 function iterLog1pexp( iterator ) {
     57 	return iterMap( iterator, log1pexp );
     58 }
     59 
     60 
     61 // EXPORTS //
     62 
     63 module.exports = iterLog1pexp;