<commit_before>//===--- FloatingPointParsing.swift -----------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

// This test verifies the performance of parsing a floating point value
// from a String.

import TestsUtils

public let FloatingPointParsing = [
  BenchmarkInfo(
    name: "ParseFloat.Float.small",
    runFunction: run_ParseFloatSmall,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Double.small",
    runFunction: run_ParseDoubleSmall,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Float80.small",
    runFunction: run_ParseFloat80Small,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Float.uniform",
    runFunction: run_ParseFloatUniform,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Double.uniform",
    runFunction: run_ParseDoubleUniform,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Float80.uniform",
    runFunction: run_ParseFloat80Uniform,
    tags: [.validation, .api, .runtime, .String]),
]

// Mirroring the FloatingPointPrinting test, use a "small" test
// and a "uniform" test to exercise both standard and scientific
// notation.

let smallWorkload = [
  "0.009900990099009901", "0.019801980198019802", "0.0297029702970297", "0.039603960396039604", "0.04950495049504951",
  "0.0594059405940594", "0.06930693069306931", "0.07920792079207921", "0.0891089108910891", "0.09900990099009901", 
  "0.10891089108910891", "0.1188118811881188", "0.12871287128712872", "0.13861386138613863", "0.1485148514851485",
  "0.15841584158415842", "0.16831683168316833", "0.1782178217821782", "0.18811881188118812", "0.19801980198019803",
  "0.2079207920792079", "0.21782178217821782", "0.22772277227722773", "0.2376237623762376", "0.24752475247524752", 
  "0.25742574257425743", "0.26732673267326734", "0.27722772277227725", "0.2871287128712871", "0.297029702970297", 
  "0.3069306930693069", "0.31683168316831684", "0.32673267326732675", "0.33663366336633666", "0.3465346534653465", 
  "0.3564356435643564", "0.36633663366336633", "0.37623762376237624", "0.38613861386138615", "0.39603960396039606", 
  "0.40594059405940597", "0.4158415841584158", "0.42574257425742573", "0.43564356435643564", "0.44554455445544555", 
  "0.45544554455445546", "0.46534653465346537", "0.4752475247524752", "0.48514851485148514", "0.49504950495049505",
  "0.504950495049505", "0.5148514851485149", "0.5247524752475248", "0.5346534653465347", "0.5445544554455446", 
  "0.5544554455445545", "0.5643564356435643", "0.5742574257425742", "0.5841584158415841", "0.594059405940594", 
  "0.6039603960396039", "0.6138613861386139", "0.6237623762376238", "0.6336633663366337", "0.6435643564356436", 
  "0.6534653465346535", "0.6633663366336634", "0.6732673267326733", "0.6831683168316832", "0.693069306930693", 
  "0.7029702970297029", "0.7128712871287128", "0.7227722772277227", "0.7326732673267327", "0.7425742574257426", 
  "0.7524752475247525", "0.7623762376237624", "0.7722772277227723", "0.7821782178217822", "0.7920792079207921", 
  "0.801980198019802", "0.8118811881188119", "0.8217821782178217", "0.8316831683168316", "0.8415841584158416",
  "0.8514851485148515", "0.8613861386138614", "0.8712871287128713", "0.8811881188118812", "0.8910891089108911", 
  "0.900990099009901", "0.9108910891089109", "0.9207920792079208", "0.9306930693069307", "0.9405940594059405", 
  "0.9504950495049505", "0.9603960396039604", "0.9702970297029703", "0.9801980198019802", "0.9900990099009901"
  ]

let uniformWorkload = [
  "0.0", "2.3975646884872965e-296", "5.164702537149895e-284", "1.1120690549967682e-271", "2.3934345283193818e-259", 
  "5.1488004017107686e-247", "1.1070724447745072e-234", "2.3791490050117677e-222", "5.110134130201389e-210", "1.0969748939128968e-197", 
  "2.3534373682645347e-185", "5.045881915716338e-173", "1.0811498557495414e-160", "2.3149085788054597e-148", "4.9529556965870615e-136", 
  "1.05891185171661e-123", "2.262041165004329e-111", "4.827978740776327e-99", "1.0295115178936053e-86", "2.1931722769033432e-74", 
  "4.6672614583958535e-62", "9.921302603862224e-50", "2.1064858766735377e-37", "4.466775307786346e-25", "9.458744898438446e-13",
  "1.9999999999999991", "4310085580881.918", "9.284550294640347e+24", "1.9991589056605124e+37", "4.302660820302176e+49", 
  "9.255963134931779e+61", "1.9901765337663709e+74", "4.2769798331241623e+86", "9.186453044088644e+98", "1.9720242359035308e+111", 
  "4.230758200257588e+123", "9.070947279209167e+135", "1.9435756734383326e+148", "4.161495259952453e+160", "8.903894453031755e+172", 
  "1.9035985662552913e+185", "4.066455873104235e+197", "8.679224237554806e+209", "1.8507457879790152e+222", "3.9426507457594914e+234", 
  "8.3903038823657e+246", "1.7835457579854725e+259", "3.786815199180443e+271", "8.029891305780016e+283", "1.7003920768336733e+296", 
  "nan", "-2.3975646884872943e-296", "-5.1647025371498904e-284", "-1.1120690549967671e-271", "-2.3934345283193795e-259", 
  "-5.1488004017107635e-247", "-1.107072444774506e-234", "-2.3791490050117653e-222", "-5.1101341302013833e-210", "-1.0969748939128956e-197", 
  "-2.353437368264532e-185", "-5.045881915716332e-173", "-1.0811498557495401e-160", "-2.314908578805457e-148", "-4.952955696587055e-136", 
  "-1.0589118517166087e-123", "-2.262041165004326e-111", "-4.827978740776321e-99", "-1.0295115178936038e-86", "-2.19317227690334e-74", 
  "-4.667261458395847e-62", "-9.921302603862209e-50", "-2.1064858766735344e-37", "-4.466775307786339e-25", "-9.45874489843843e-13", 
  "-1.9999999999999973", "-4310085580881.914", "-9.284550294640339e+24", "-1.9991589056605105e+37", "-4.3026608203021716e+49", 
  "-9.255963134931769e+61", "-1.9901765337663689e+74", "-4.276979833124158e+86", "-9.186453044088634e+98", "-1.9720242359035287e+111", 
  "-4.230758200257583e+123", "-9.070947279209156e+135", "-1.9435756734383303e+148", "-4.161495259952448e+160", "-8.903894453031744e+172", 
  "-1.903598566255289e+185", "-4.0664558731042297e+197", "-8.679224237554795e+209", "-1.8507457879790126e+222", "-3.942650745759486e+234", 
  "-8.390303882365688e+246", "-1.7835457579854698e+259", "-3.786815199180437e+271", "-8.029891305780003e+283", "-1.7003920768336704e+296"
  ]


@inline(never)
public func run_ParseFloatSmall(_ N: Int) {
  for _ in 0..<N {
    for element in smallWorkload {
      let f = Float(element)
      blackHole(f)
    }
  }
}

@inline(never)
public func run_ParseDoubleSmall(_ N: Int) {
  for _ in 0..<N {
    for element in smallWorkload {
      let f = Double(element)
      blackHole(f)
    }
  }
}

@inline(never)
public func run_ParseFloat80Small(_ N: Int) {
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(Linux)
// On Darwin, long double is Float80 on x86, and Double otherwise.
// On Linux, Float80 is at aleast available on x86.
#if arch(x86_64) || arch(i386)
  for _ in 0..<N {
    for element in smallWorkload {
      let f = Float80(element)
      blackHole(f)
    }
  }
#endif // x86
#endif // Darwin/Linux
}

@inline(never)
public func run_ParseFloatUniform(_ N: Int) {
  for _ in 0..<N {
    for element in uniformWorkload {
      let f = Float(element)
      blackHole(f)
    }
  }
}

@inline(never)
public func run_ParseDoubleUniform(_ N: Int) {
  for _ in 0..<N {
    for element in uniformWorkload {
      let f = Double(element)
      blackHole(f)
    }
  }
}

@inline(never)
public func run_ParseFloat80Uniform(_ N: Int) {
#if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(Linux)
// On Darwin, long double is Float80 on x86, and Double otherwise.
// On Linux, Float80 is at aleast available on x86.
#if arch(x86_64) || arch(i386)
  for _ in 0..<N {
    for element in uniformWorkload {
      let f = Float80(element)
      blackHole(f)
    }
  }
#endif // x86
#endif // Darwin/Linux
}
<commit_msg>Float to String benchmark: Use better workloads.<commit_after>//===--- FloatingPointParsing.swift -----------------------------------===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2019 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

// This test verifies the performance of parsing a floating point value
// from a String.

import TestsUtils

public let FloatingPointParsing = [
  BenchmarkInfo(
    name: "ParseFloat.Float.Exp",
    runFunction: run_ParseFloatExp,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Double.Exp",
    runFunction: run_ParseDoubleExp,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Float80.Exp",
    runFunction: run_ParseFloat80Exp,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Float.Uniform",
    runFunction: run_ParseFloatUniform,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Double.Uniform",
    runFunction: run_ParseDoubleUniform,
    tags: [.validation, .api, .runtime, .String]),

  BenchmarkInfo(
    name: "ParseFloat.Float80.Uniform",
    runFunction: run_ParseFloat80Uniform,
    tags: [.validation, .api, .runtime, .String]),
]

/// The 'Exp' test:

/// Generates values following a truncated exponential distribution on 0...1000, 
/// each rounded to a number of significant digits uniformly selected from 
/// 1...6 (Float), 1...15 (Double) and 1...18 (Float80). 
/// This is a good representative sample of "well-scaled" values humans actually
/// write in programs; in particular, it includes good coverage for integer values
/// and values with short decimal parts.

// func genExpDistributedFloat(significantDigits: Int) -> String {
//     let value = exp(Float80.random(in: 0...log(1000.0)))
//     return String(format: "%.\(significantDigits)f", Double(value))
// }

/// Each workload contains 100 elements generated from the above function.

let floatExpWorkload = [
  "840.23812", "15.9082", "319.784", "13.14857", "5.42759",
  "901.771", "339.6", "7.27", "126.88", "326.08923", "18.2804",
  "189.8467", "330.628", "8.272461", "19.337", "12.0082",
  "29.6085", "27.4508", "5.14013", "725.388972", "124.102",
  "13.315556", "21.288", "45.4670", "88.7246", "6.16",
  "1.506155", "2.16918", "779.120", "22.89751", "15.33395",
  "59.575817", "2.73305", "203.04", "321.08", "148.419",
  "249.675", "579.453", "222.2", "153.62548", "305.501",
  "96.3", "28.55095", "145.377249", "2.53048", "1.0",
  "293.2052", "2.1", "814.091552", "157.45375", "15.0",
  "1.304", "8.88", "799.458180", "11.3", "1.5645",
  "25.69062", "569.28", "2.6464", "173.792970", "6.25",
  "344.54", "2.09610", "3.547", "409.860",
  "65.866038", "3.64", "2.7", "62.304", "67.7729",
  "19.0638", "2.8", "8.89508", "20.04", "1.054648",
  "3.5479", "5.203191", "52.11968", "326.39", "43.027",
  "82.15620", "178.519010", "1.3", "5.40", "387.41",
  "500.5", "5.96", "1.7740", "96.48818", "889.583",
  "96.92098", "6.760", "199.441", "510.905", "307.726",
  "87.9055", "11.7", "6.487537", "119.1", "5.8"
]

let doubleExpWorkload = [
  "339.91", "662.95264138", "590.3312546", "44.58449489426322", "1.61025794592574",
  "266.29744353690", "34.14542", "144.968532801343116", "1.790721486700", "609.0086620368", 
  "1.79655054299720", "138.906589772754131", "1.3663343399933", "3.018134440821", "14.7117491216652", 
  "97.0", "28.630149748915", "5.4", "29.7639", "4.520193", 
  "43.574150740143", "21.26131766279", "8.332799002305356", "70.267", "792.71364", 
  "987.54396679201125", "301.4300850", "707.7375522552", "3.350899864", "41.99", 
  "78.051", "2.5251720", "28.171984464058", "6.115905648", "31.7", 
  "2.90316715974825", "3.49235954808", "13.76", "3.2", "32.465845", 
  "460.84828154", "1.0268532933", "79.607954332859777", "173.25041830", "49.0888", 
  "23.2264", "130.018100263319411", "301.8", "1.707", "2.220651", 
  "11.9744168", "13.50610", "83.276270711070708", "1.207", "11.507359", 
  "887.81742700364475", "46.8051834077896", "174.367548608815781", "19.8671230", "5.0432", 
  "3.927758869", "1.6393532610", "232.5", "17.77417107", "94.1453702714822", 
  "746.2908548477199", "28.9832376533851", "1.7432454399", "96.15", "484.00318952955", 
  "14.90238658606421", "243.704906310113", "29.5307828313724", "19.200405681021813", "24.1717308", 
  "2.7453085963749", "2.856", "677.940804020", "221.57146165", "31.5891",
  "350.74206", "3.06588790579", "171.404", "46.106851", "590.3917781324", 
  "829.052362588", "2.32566173", "7.0098461186", "306.11702882946065", "17.4345632593715", 
  "899.3720935006996", "108.31212", "3.703786329", "48.81100281168", "27.41503", 
  "169.15383", "1.978568", "3.68994208914", "29.4322212731893", "4.8719352"
]

let float80ExpWorkload = [
  "6.77555058241", "147.74", "6.03", "507.6033533228630859", "100.7", 
  "11.46", "3.264282911002", "85.7858847516568", "34.4300032", "4.9957", 
  "198.3958760", "87.67549428326", "205.373035358974988", "27.93", "831.999235134615", 
  "46.886425395152", "5.77789", "89.564807063568139256", "3.85398054", "1.021", 
  "592.504", "1.802084399", "486.4972328197284", "5.22490700277", "29.917340694598", 
  "181.48302719", "75.74373681671689", "30.48161373580532", "1.24544077730", "1.2", 
  "10.426", "55.37308819", "1.87502584", "3.1486", "9.2794677633", 
  "24.59858334079387632", "20.2896643", "4.6", "9.017375215972097", "163.1", 
  "5.50921892286", "9.93079", "13.320762298", "3.194056167117689693", "211.6671712762052380", 
  "347.0356", "209.66", "13.170751077618", "34.568", "330.5",
  "41.388619513", "625.5176", "7.3199072376", "2.40", "334.210711370", 
  "10.790469414612726240", "2.051865559526", "374.34104357856199", "1.444672057", "182.15138835680261", 
  "1.549898719", "2.2", "3.5960392119", "220.3919", "128.45273", 
  "955.052925", "441.738166", "21.365", "28.5534801613", "124.1", 
  "449.252220495138", "608.587461250119532", "107.88473705800", "2.085422", "2.5", 
  "121.0005042322", "5.4402224803576962", "90.46", "40.646406742621564945", "70.79133", 
  "4.59801271236", "1.893481804014", "17.52333", "1.3195086968", "46.70781", 
  "14.59891931096853", "402.75", "158.0343", "7.152603207", "7.3637945245", 
  "15.6", "545.740720800777012", "242.172569", "1.73940415531105", "151.14631658", 
  "26.5256384449273490", "135.236", "12.886101", "47.596174", "1.831407510"
]

/// The 'Uniform' test:

/// Generates values made up of uniform decimal significands with 9, 17 and 21 
/// digits and exponents uniform on the valid range. This is a stress test 
/// for rounding, and covers all the worst cases for tables generated by programs.
/// The exponent range is -45...38 for Floats, -324...308 for Doubles, and 
/// -4951...4932 for Float80.
// func genUniformFloat(significandDigits: Int, exponentRange: ClosedRange<Int>) -> String {
//     let afterDecimalPoint = (0..<significandDigits).map { _ in String(Int.random(in: 0...9)) }.joined()
//     let sign = ["", "-", "+"].randomElement()!
//     return "\(sign)\(Int.random(in: 1...9)).\(afterDecimalPoint)e\(exponentRange.randomElement()!)"
// }

/// Each workload contains 100 elements generated from the above function,
/// along with five inf/nan/invalid tests.

let floatUniformWorkload = [
  "+1.253892113e-32", "+5.834995733e-41", "5.262096122e-17", "+4.917053817e-37", "8.535406338e-34", 
  "2.152837278e10", "-5.212739043e-16", "+9.799669278e-27", "+8.678995824e-6", "-5.965172043e26", 
  "-8.420371743e-10", "1.968856825e-8", "1.521071839e-19", "+1.048728457e-15", "-5.657219736e10", 
  "-7.664702071e-34", "+3.282753652e15", "-5.032906928e26", "-3.024685077e29", "+7.972511327e-22",
  "-3.941547478e-19", "-2.424139629e4", "+1.222228289e2", "+9.872675983e4", "+8.505353502e-43", 
  "7.315998745e12", "-2.879924852e-38", "5.567658036e21", "5.751274848e-39", "-2.098314138e8", 
  "-2.295512125e-13", "-9.261977483e3", "-7.717209557e26", "+6.563403126e38", "-6.988491389e-45", 
  "3.318738022e21", "5.534799334e16", "7.236228752e0", "+6.134225015e-26", "-1.801539431e-3", 
  "-8.763001980e37", "-4.810306387e-30", "-8.902359860e5", "-4.654434339e17", "4.103749478e11", 
  "+1.624005001e0", "+6.810516979e-8", "+4.509584369e0", "7.115062319e15", "-3.275835669e24", 
  "-2.225975117e17", "+9.765601399e-27", "9.271660327e13", "-7.957489335e4", "+1.279815043e-30", 
  "-6.140235958e-3", "+2.925804509e-11", "-2.902478935e-36", "+2.870673595e-37", "+8.788759496e-20", 
  "+7.279719040e13", "-9.516217056e20", "2.306171183e21", "-2.655002939e22", "-8.678845371e32", 
  "6.086700440e20", "+6.768130785e12", "1.675300343e11", "+8.156722194e-16", "-6.040145895e35", 
  "-6.928961416e-26", "-5.119323586e27", "-4.566748978e-5", "-3.394147506e-7", "6.171944831e-19", 
  "+8.883811091e-11", "-3.390953266e-44", "-1.912771939e-7", "+8.506344503e-23", "-3.437927939e21", 
  "-3.515331652e1", "8.610555796e9", "2.340195107e-20", "+9.018470750e-42", "+8.321248518e27", 
  "-6.959418594e32", "-5.342372027e21", "+2.744186726e-24", "9.948785682e-37", "+6.310898794e-6", 
  "-2.477472268e16", "8.590689853e1", "+7.811554461e-24", "+1.508151084e17", "3.071428780e-7",
  "4.545415458e-9", "7.075010280e11", "+8.616159616e-29", "4.613265893e-10", "7.770003218e-33",
  "+inf", "Invalid", "nan", "NAN", "snan"
]

let doubleUniformWorkload = [
  "-5.099347166e-78", "3.584151187e-255", "-7.555973282e17", "+6.217083912e-164", "-6.063585254e8", 
  "-5.374097872e-252", "2.688487062e208", "+1.030241589e-272", "2.120162986e-50", "-2.617585299e-69",
  "8.560348373e282", "4.323584117e-168", "5.899559411e215", "+3.630548207e220", "-8.420738030e-73", 
  "-6.832994185e-129", "-9.751163985e90", "-3.923652856e222", "-5.337925604e-12", "+4.360166940e-75", 
  "+6.207675792e-164", "-8.275068142e-195", "+3.318047866e-71", "-9.162983038e197", "+9.330784575e-147", 
  "9.208831616e-322", "-5.688921689e270", "+2.871328480e-258", "-8.071161900e261", "-4.191368176e222", 
  "+5.792498976e-167", "5.835667380e235", "+9.402094050e6", "2.079961640e180", "+4.037655106e86", 
  "-1.267141442e106", "+2.361395667e138", "+2.101128051e142", "5.301258292e42", "-8.822348131e-280", 
  "-3.775817054e208", "-5.080405399e93", "+9.686534601e-77", "4.586641905e-175", "3.135576124e77", 
  "4.688137331e138", "+6.893752397e-189", "6.812711913e278", "3.812796443e115", "+3.744289703e7", 
  "+5.932500106e157", "+4.846313692e16", "-8.881077959e-290", "+1.535288334e-275", "7.250519901e-75",
  "2.787321374e41", "+3.519991812e-183", "+7.589975072e79", "5.848655303e122", "-3.328972789e161", 
  "-2.190752323e104", "8.864042297e147", "+8.584292050e-239", "-7.972816817e219", "9.352363266e-99", 
  "+9.435082870e83", "+4.297178676e-122", "+8.699490866e-300", "+5.562137865e-57", "+9.063928579e-92", 
  "2.743744209e82", "+9.960619645e-39", "-1.962409303e90", "-4.371512402e-287", "4.790326011e-137", 
  "+1.295921853e-273", "9.137852847e-96", "2.934099551e35", "-8.176544555e-65", "-7.098452895e-220", 
  "+6.665950037e103", "+9.297850239e-254", "-8.529931750e-216", "-9.541329616e-324", "-4.761545594e148", 
  "3.507981964e-314", "-3.745430665e-89", "8.799599593e137", "8.736852803e181", "+8.328604940e291", 
  "-2.207530122e-202", "-4.259268955e-271", "+1.633874531e-225", "+6.167040542e211", "-2.632062534e-52", 
  "-2.296105107e69", "4.935681094e205", "+4.696549581e-117", "+5.032486364e-105", "6.718199716e48",
  "-inf", "Invalid", "nan", "NAN", "snan"
]

let float80UniformWorkload = [
  "-4.252484660e-718", "+7.789429046e-2371", "-2.914666745e-2986", "8.287524889e4854", "+4.792668657e-3693", 
  "-5.187192176e-756", "+2.452045856e-2309", "+7.133017664e-1055", "-6.749416450e-3803", "+6.808813002e-1771", 
  "+7.355881301e3600", "-9.209599679e4848", "+4.142753329e-3268", "3.950199398e-863", "-3.170838470e-4779", 
  "9.354087375e718", "2.769339314e-3567", "+1.889983496e3717", "+9.912545495e-2419", "-6.284830753e2041", 
  "+9.061812480e3682", "6.551587084e1912", "+6.485690673e-1591", "-3.522511676e-2344", "-6.846303741e-2830", 
  "-7.995042826e896", "6.268882688e937", "-3.776199447e-4134", "-2.353057456e801", "5.875638854e-3889", 
  "1.245553459e814", "4.593376472e-2139", "-8.277421726e1497", "+1.606488487e1221", "6.433878090e-2220", 
  "-2.515502287e2543", "-4.347251565e-1330", "1.101969004e-4525", "-7.602718782e-4037", "-7.289917475e-4547", 
  "+1.920523398e2160", "-8.279745071e4493", "+6.383586105e-3771", "-3.784311609e-1828", "-1.193395125e1296", 
  "-2.012225848e1954", "+2.238968379e-1455", "6.331805949e-2127", "-7.584066626e-717", "-9.040205012e1614", 
  "+1.953864302e4255", "+5.103307458e528", "9.491061048e531", "+2.165292603e54", "-6.471469370e654", 
  "-9.275772875e4856", "-4.070772582e1488", "+2.063335882e-2112", "+4.853853159e-3841", "-9.058842001e3955", 
  "2.897215261e3511", "1.389094534e-384", "-9.749518987e1602", "+3.103609399e-3559", "-7.156672429e3879",
  "9.385923023e2310", "7.593508637e-2100", "-2.656332678e2833", "6.143253335e-340", "5.794793573e2972", 
  "3.869110366e2609", "+2.884288161e-1513", "-5.316488863e4336", "4.948197725e-3829", "3.755250612e-3011", 
  "+1.550352355e-767", "-1.625440305e-4354", "+3.086601758e-929", "6.042347288e-357", "-6.176954358e3288", 
  "1.594019881e480", "-8.613112966e4863", "+9.864076072e2498", "3.540199292e-821", "+3.770221960e4915", 
  "-4.115310178e-3958", "-8.343495037e-4238", "1.165941010e-317", "6.039736339e-693", "6.912425733e1200", 
  "-9.307038635e335", "-4.656175810e-637", "-6.342156592e-3848", "-1.221105578e1780", "+6.097066301e-2159", 
  "-5.823123345e1389", "+5.404800369e1379", "2.988649766e-736", "-3.733572715e2405", "-1.597565079e-377",
  "+inf", "Invalid", "nan", "NAN", "snan"
]

@inline(__always)
public func parseFloatWorkload<T : LosslessStringConvertible>(_ N: Int, workload: [String], type: T.Type) {
  for _ in 0..<N {
    for element in workload {
      let f = T(element)
      blackHole(f)
    }
  }
}

@inline(never)
public func run_ParseFloatExp(_ N: Int) {
  parseFloatWorkload(N, workload: floatExpWorkload, type: Float.self)
}

@inline(never)
public func run_ParseDoubleExp(_ N: Int) {
  parseFloatWorkload(N, workload: doubleExpWorkload, type: Double.self)
}

@inline(never)
public func run_ParseFloat80Exp(_ N: Int) {
  #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(Linux)
// On Darwin, long double is Float80 on x86, and Double otherwise.
// On Linux, Float80 is at aleast available on x86.
#if arch(x86_64) || arch(i386)
  parseFloatWorkload(N, workload: float80ExpWorkload, type: Float80.self)
#endif // x86
#endif // Darwin/Linux
}

@inline(never)
public func run_ParseFloatUniform(_ N: Int) {
  parseFloatWorkload(N, workload: floatUniformWorkload, type: Float.self)
}

@inline(never)
public func run_ParseDoubleUniform(_ N: Int) {
  parseFloatWorkload(N, workload: doubleUniformWorkload, type: Double.self)
}

@inline(never)
public func run_ParseFloat80Uniform(_ N: Int) {
  #if os(macOS) || os(iOS) || os(watchOS) || os(tvOS) || os(Linux)
// On Darwin, long double is Float80 on x86, and Double otherwise.
// On Linux, Float80 is at aleast available on x86.
#if arch(x86_64) || arch(i386)
  parseFloatWorkload(N, workload: float80UniformWorkload, type: Float80.self)
#endif // x86
#endif // Darwin/Linux
}

{'fraction_non_alphanumeric': 0.21158213474640425, 'fraction_numerical': 0.43111279333838004, 'mean_word_length': 4.373785310734463, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '4036942', 'n_tokens_mistral': 16354, 'n_tokens_neox': 10747, 'n_words': 1599}