<commit_before>(function(define) {
'use strict';
define(function(require) {

   var Rational, log1p;

   Rational = require('../rational');

   /**
    * Computes $$\textrm{log1p}(x) = \ln(1+x)$$ with reasonable precision near $x = 0$.
    *
    * Based on:  *Computation of the Incomplete Gamma Function Ratios
    * and their Inverse*, by DiDonato and Morris, 1986
    * @fullName log1p(x)
    * @memberof basicFunc
    */
   log1p = (function() {
      var R;

      R = Rational.new([
         -0.0178874546012214,
          0.405303492862024,
         -1.29418923021993,
          1
         ], [
         -0.0845104217945565,
          0.747811014037616,
         -1.62752256355323,
          1
         ]);
      return function(x) {
         var t;

         if (Math.abs(x) > 0.375) { return Math.log(1 + x); }
         t = x / (x + 2);
         return 2 * t * R.evalAt(t * t);
      };
   }());

   return { log1p: log1p };

});  // end define

}(typeof define === 'function' && define.amd ? define : function(factory) {
   'use strict';
   module.exports = factory(require);
}));<commit_msg>Add log10, log2.  Close #115<commit_after>(function(define) {
'use strict';
define(function(require) {

   var Rational, log1p, log2, log10;

   Rational = require('../rational');

   /**
    * Computes $$\textrm{log1p}(x) = \ln(1+x)$$ with reasonable precision near $x = 0$.
    *
    * Based on:  *Computation of the Incomplete Gamma Function Ratios
    * and their Inverse*, by DiDonato and Morris, 1986
    * @fullName log1p(x)
    * @memberof basicFunc
    */
   log1p = (function() {
      var R;

      R = Rational.new([
         -0.0178874546012214,
          0.405303492862024,
         -1.29418923021993,
          1
         ], [
         -0.0845104217945565,
          0.747811014037616,
         -1.62752256355323,
          1
         ]);
      return function(x) {
         var t;

         if (Math.abs(x) > 0.375) { return Math.log(1 + x); }
         t = x / (x + 2);
         return 2 * t * R.evalAt(t * t);
      };
   }());

   log2 = typeof Math.log2 !== 'undefined' ? function(x) { return Math.log2(x); }
                                           : function(x) { return Math.log(x) * Math.LOG2E; };

   log10 = typeof Math.log10 !== 'undefined' ? function(x) { return Math.log10(x); }
                                             : function(x) { return Math.log(x) * Math.LOG10E; };

   return {
      log1p: log1p,
      log2: log2,
      log10: log10
   };

});  // end define

}(typeof define === 'function' && define.amd ? define : function(factory) {
   'use strict';
   module.exports = factory(require);
}));
{'fraction_non_alphanumeric': 0.15259371450208253, 'fraction_numerical': 0.09882620219613783, 'mean_word_length': 1.8593073593073592, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3803674', 'n_tokens_mistral': 1055, 'n_tokens_neox': 896, 'n_words': 206}