<commit_before>#include "kernel/log.h"
#include "normalize.h"
#include "../reinterpret.h"
#include <math.h>

static double _finite(int64_t i)
{
    const double ln2[] = { 0x1.62e42fefa4p-1, -0x1.8432a1b0e2634p-43 };

    int64_t exponent = (i - 0x3FE6A09E667F3BCD) >> 52;
    double x = reinterpret(double, i - (exponent << 52)) - 1;
    double z = x / (x + 2);
    double h = 0.5 * x * x;

    return z * (h + _kernel_log(z)) + exponent * ln2[1] - h + x + exponent * ln2[0];
}

double log(double x)<commit_msg>Reorder terms by expected size, though this does not affect calculation<commit_after>#include "kernel/log.h"
#include "normalize.h"
#include "../reinterpret.h"
#include <math.h>

static double _finite(int64_t i)
{
    const double ln2[] = { 0x1.62e42fefa4p-1, -0x1.8432a1b0e2634p-43 };

    int64_t exponent = (i - 0x3FE6A09E667F3BCD) >> 52;
    double x = reinterpret(double, i - (exponent << 52)) - 1;
    double z = x / (x + 2);
    double h = 0.5 * x * x;

    return exponent * ln2[1] + z * (h + _kernel_log(z)) - h + x + exponent * ln2[0];
}

double log(double x)
{'fraction_non_alphanumeric': 0.16203703703703703, 'fraction_numerical': 0.08888888888888889, 'mean_word_length': 3.1737451737451736, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6473024', 'n_tokens_mistral': 503, 'n_tokens_neox': 447, 'n_words': 113}