text:
const TMIN = 25.000000
const TMAX = 1000.000000
const MOLPARAM = MolParam[
  MolParam(
    #1, molecule number
    1,
    #2, molecule formula
    "H2O",
    #3, molecule name
    "Water",
    #4, global isotopologue numbers
    Int64[1, 2, 3, 4, 5, 6, 129],
    #5, isotopologue formulae
    String["H216O", "H218O", "H217O", "HD16O", "HD18O", "HD17O", "D216O"],
    #6, AFGL code
    Int64[161, 181, 171, 162, 182, 172, 262],
    #7, abundance fractions
    Float64[0.997317, 0.002, 0.000371884, 0.000310693, 6.23003e-07, 1.15853e-07, 2.4197e-08],
    #8, molecular masses [kg/mole]
    Float64[0.018010565, 0.020014811, 0.01901478, 0.019016739999999997, 0.021020985, 0.020020956000000003, 0.020022915000000002],
    #9, Qref
    Float64[174.58, 176.05, 1052.14, 864.74, 875.57, 5226.79, 1027.8],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[7, 7, 7, 10, 10, 10, 10],
    #12, maximum relative errors of interpolation
    Float64[0.0028, 0.0028, 0.0029, 0.0037, 0.0037, 0.0037, 0.0039],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[2.8854493216841015, 3.4632621262928915, 0.6001640690631624, 0.016178811904860996, 0.015211044164822699, -0.004364096635145624, 0.0012395758566148274],
      Float64[2.8871644108577477, 3.465944358793127, 0.6012775643496776, 0.01626203386609267, 0.015073634800670662, -0.004421502003156756, 0.0012358242435368538],
      Float64[2.8843598005839284, 3.4613544216657774, 0.5988802292683817, 0.015592997489868013, 0.015071636079156958, -0.0043773144167319105, 0.0012344781178038982],
      Float64[2.988921904030038, 3.6309314816590654, 0.6832415090001678, 0.03776198745247402, 0.016920233959921198, -0.0046017833063662535, 0.001597150134327337, -0.0005357674221390477, 0.0002446660205366571, -9.939387855932107e-05],
      Float64[2.9952588111537017, 3.6413820817818277, 0.6888242012361889, 0.03940075532067593, 0.016961801336376117, -0.004715878117187216, 0.0015960400803608622, -0.0005261120756627768, 0.00024145143452890415, -9.985418491472349e-05],
      Float64[3.0019860833990797, 3.651242577544236, 0.6917457652665069, 0.0388184384654454, 0.016658684292262606, -0.004656954238858725, 0.0015602612450032656, -0.0005263203677607168, 0.00025330716720459477, -0.00010623441693821987],
      Float64[3.151188745971535, 3.8905847177336264, 0.8073262714241332, 0.0666446899456802, 0.01801612299675138, -0.004453058046032323, 0.0018351950421819179, -0.0007127298639566762, 0.00025814890087261233, -7.228390630922534e-05]
    ]
  ),
  MolParam(
    #1, molecule number
    2,
    #2, molecule formula
    "CO2",
    #3, molecule name
    "Carbon Dioxide",
    #4, global isotopologue numbers
    Int64[7, 8, 9, 10, 11, 12, 13, 14, 121, 15, 120, 122],
    #5, isotopologue formulae
    String["12C16O2", "13C16O2", "16O12C18O", "16O12C17O", "16O13C18O", "16O13C17O", "12C18O2", "17O12C18O", "12C17O2", "13C18O2", "18O13C17O", "13C17O2"],
    #6, AFGL code
    Int64[626, 636, 628, 627, 638, 637, 828, 827, 727, 838, 837, 737],
    #7, abundance fractions
    Float64[0.984204, 0.011057, 0.003947, 0.000733989, 4.43446e-05, 8.24623e-06, 3.95734e-06, 1.4717999999999998e-06, 1.36847e-07, 4.4459999999999996e-08, 1.65354e-08, 1.5375000000000001e-09],
    #8, molecular masses [kg/mole]
    Float64[0.04398983, 0.044993185, 0.045994076, 0.044994044999999996, 0.046997431, 0.0459974, 0.047998322, 0.046998291000000005, 0.045998262, 0.049001675, 0.048001646, 0.047001618237800004],
    #9, Qref
    Float64[286.09, 576.64, 607.81, 3542.61, 1225.46, 7141.32, 323.42, 3766.58, 10971.57, 652.24, 7595.04, 22120.47],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true, true, true, true, true, true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8],
    #12, maximum relative errors of interpolation
    Float64[0.0034, 0.0039, 0.0035, 0.0035, 0.0039, 0.0039, 0.0036, 0.0035, 0.0035, 0.004, 0.004, 0.004],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[3.6298870246619876, 4.648077553468222, 1.3582277649322294, 0.26945464835013333, 0.011900245644899665, 0.004542081807634395, -6.209345166549188e-06, -0.0004752238895428767],
      Float64[3.717801545880473, 4.787290510986056, 1.4199248280411096, 0.2817589065717478, 0.013710906872833892, 0.00477966232081111, -0.0001995588188335213, -0.000391128990711666],
      Float64[3.6790225428769694, 4.7266120402186305, 1.3952914588168883, 0.2780768698588704, 0.012746853993450356, 0.0046323737303634515, -1.551257021554469e-05, -0.0004739795515997157],
      Float64[3.655380926012236, 4.688826592046679, 1.3774472871792003, 0.27391859034455385, 0.012341179085048568, 0.004588522606770974, -1.1817776328574123e-05, -0.000474009745068774],
      Float64[3.770045485425529, 4.870844665576281, 1.459430061926422, 0.2910311203979194, 0.014665700664960455, 0.004870131819521133, -0.00021246617172719442, -0.0003867261432411847],
      Float64[3.7448305604671037, 4.830527136620638, 1.4403750612643773, 0.2865632567343331, 0.014208090735032724, 0.0048255971891489734, -0.00020664360529463823, -0.00038841931079096933],
      Float64[3.731119067943029, 4.8098120451757875, 1.4344713206791861, 0.2871620471387386, 0.013649728163299044, 0.004734242961893541, -2.78850125882611e-05, -0.00047319211891557904],
      Float64[3.7060019713201555, 4.7697084127159695, 1.4155932416871606, 0.2827874605235401, 0.013216307542341457, 0.004684478353035283, -2.2082916579283358e-05, -0.0004732857662507988],
      Float64[3.6816756930839234, 4.730839151559549, 1.3972597845488168, 0.278522702341032, 0.012793882038556565, 0.004638410118760079, -1.6855900186994533e-05, -0.00047368167971332094],
      Float64[3.8252285476604095, 4.95906903220672, 1.5010919194659793, 0.30078887384621206, 0.015682932898276634, 0.004971790447661765, -0.00022852421208036894, -0.00038264480183260375],
      Float64[3.7986184589181176, 4.91653191675655, 1.481011099045036, 0.29608920656611487, 0.01519412048134207, 0.004922144198267578, -0.00022093639178675874, -0.00038433353243481704],
      Float64[3.772765354644736, 4.875189532457545, 1.461466960820582, 0.29150042276666943, 0.014717957550310563, 0.00487599867447029, -0.0002139925478082156, -0.00038624704797156947]
    ]
  ),
  MolParam(
    #1, molecule number
    3,
    #2, molecule formula
    "O3",
    #3, molecule name
    "Ozone",
    #4, global isotopologue numbers
    Int64[16, 17, 18, 19, 20],
    #5, isotopologue formulae
    String["16O3", "16O16O18O", "16O18O16O", "16O16O17O", "16O17O16O"],
    #6, AFGL code
    Int64[666, 668, 686, 667, 676],
    #7, abundance fractions
    Float64[0.992901, 0.003982, 0.001991, 0.000740475, 0.00037023700000000004],
    #8, molecular masses [kg/mole]
    Float64[0.047984744999999995, 0.049988990999999997, 0.049988990999999997, 0.04898896, 0.04898896],
    #9, Qref
    Float64[3483.71, 7465.68, 3647.08, 43330.85, 21404.96],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9, 9, 9, 9, 9],
    #12, maximum relative errors of interpolation
    Float64[0.0029, 0.003, 0.0027, 0.0029, 0.0028],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[5.198808958492407, 7.1836405748650565, 2.430406548621109, 0.47945547586240234, 0.04866502320701871, -0.0037922137873949158, 0.0030754817127724987, -0.0014318613737858144, 0.00042219395972864504],
      Float64[5.28943392689267, 7.32840034905892, 2.499782267555468, 0.49609104436359086, 0.050209186756711155, -0.003554993249046845, 0.0030343706770941115, -0.0014403957907420661, 0.00044944594062590326],
      Float64[5.321633407246284, 7.38079465761942, 2.5271755966750162, 0.5040411484003071, 0.050910827708915196, -0.0035226973283397633, 0.0030860500442946304, -0.0014815585197429648, 0.000456766800435382],
      Float64[5.2456806295597165, 7.258512461022507, 2.4662970637191286, 0.4880657432867612, 0.04946663466919743, -0.0036628050721492222, 0.003052960371109137, -0.0014401103840264717, 0.0004366386635861197],
      Float64[5.262051815730485, 7.28516747895303, 2.4802683032094466, 0.4921367762062032, 0.04981398046944863, -0.0036584371137031724, 0.0030831520850984617, -0.0014556331538027045, 0.00044118468106235653]
    ]
  ),
  MolParam(
    #1, molecule number
    4,
    #2, molecule formula
    "N2O",
    #3, molecule name
    "Nitrogen oxide",
    #4, global isotopologue numbers
    Int64[21, 22, 23, 24, 25],
    #5, isotopologue formulae
    String["14N216O", "14N15N16O", "15N14N16O", "14N218O", "14N217O"],
    #6, AFGL code
    Int64[446, 456, 546, 448, 447],
    #7, abundance fractions
    Float64[0.990333, 0.003641, 0.003641, 0.001986, 0.00036928000000000004],
    #8, molecular masses [kg/mole]
    Float64[0.044001062, 0.044998095999999994, 0.044998095999999994, 0.046005308, 0.045005277999999996],
    #9, Qref
    Float64[4984.9, 3362.01, 3458.58, 5314.74, 30971.79],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9, 9, 9, 9, 9],
    #12, maximum relative errors of interpolation
    Float64[0.0023, 0.0025, 0.0024, 0.0023, 0.0023],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[4.0629440915859245, 5.334280954948177, 1.6635722909410475, 0.3307993406262514, 0.020132897398261296, 0.005904047428510251, -0.0010276873615799875, -0.0004387763917725884, 0.0004011792070941489],
      Float64[4.157593713564243, 5.484256498792366, 1.7293116589367077, 0.34327423887745945, 0.021591680613661346, 0.005908120731160205, -0.0011448783286163167, -0.00034825188880871494, 0.00037664220146149674],
      Float64[4.108559401688254, 5.406708945974097, 1.6957234550721223, 0.33697743320520734, 0.020518721593685285, 0.005812096641922171, -0.0010434701382618927, -0.0004114661236052086, 0.00039380962331403424],
      Float64[4.1319506584836665, 5.443998768090708, 1.713201638944748, 0.3408677812866022, 0.020757880548003094, 0.005849080894502312, -0.0010319097838041857, -0.00042451537249332816, 0.0003914627819971983],
      Float64[4.103577501835682, 5.398601273708497, 1.6917315909746131, 0.3358246725502433, 0.020239859129805193, 0.005802227803157645, -0.0010326203698437508, -0.00042070975324870474, 0.0003988368781944196]
    ]
  ),
  MolParam(
    #1, molecule number
    5,
    #2, molecule formula
    "CO",
    #3, molecule name
    "Carbon Monoxide",
    #4, global isotopologue numbers
    Int64[26, 27, 28, 29, 30, 31],
    #5, isotopologue formulae
    String["12C16O", "13C16O", "12C18O", "12C17O", "13C18O", "13C17O"],
    #6, AFGL code
    Int64[26, 36, 28, 27, 38, 37],
    #7, abundance fractions
    Float64[0.986544, 0.011084, 0.001978, 0.000367867, 2.2225000000000005e-05, 4.13292e-06],
    #8, molecular masses [kg/mole]
    Float64[0.027994915, 0.028998270000000003, 0.029999161, 0.02899913, 0.031002516, 0.030002485],
    #9, Qref
    Float64[107.42, 224.69, 112.77, 661.17, 236.44, 1384.66],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[5, 5, 5, 5, 5, 5],
    #12, maximum relative errors of interpolation
    Float64[0.0016, 0.0018, 0.0018, 0.0017, 0.0021, 0.0019],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.773043529507186, 1.7146481592365566, 0.039790323608284606, 0.011834851375992272, 0.0009639964469945195],
      Float64[1.77658062058471, 1.720398412608859, 0.04251350454823921, 0.012389361657908604, 0.000879060144544308],
      Float64[1.7769294159859919, 1.7209378348471076, 0.04275057361893542, 0.012436865871168545, 0.0008713538374777174],
      Float64[1.7750211290077504, 1.7178723821588289, 0.04132353789281673, 0.012149404976098621, 0.0009171038996810266],
      Float64[1.7807844514488496, 1.7272436087887892, 0.04575916883263387, 0.01302578302308699, 0.0007682770286162599],
      Float64[1.7787264319243625, 1.7239125143443128, 0.044193522385092665, 0.012721930212473476, 0.0008228923099313779]
    ]
  ),
  MolParam(
    #1, molecule number
    6,
    #2, molecule formula
    "CH4",
    #3, molecule name
    "Methane",
    #4, global isotopologue numbers
    Int64[32, 33, 34, 35],
    #5, isotopologue formulae
    String["12CH4", "13CH4", "12CH3D", "13CH3D"],
    #6, AFGL code
    Int64[211, 311, 212, 312],
    #7, abundance fractions
    Float64[0.988274, 0.011103, 0.0006157510000000001, 6.917849999999999e-06],
    #8, molecular masses [kg/mole]
    Float64[0.016031300000000002, 0.017034655, 0.017037475, 0.01804083],
    #9, Qref
    Float64[590.48, 1180.82, 4794.73, 9599.16],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[12, 12, 11, 11],
    #12, maximum relative errors of interpolation
    Float64[0.0043, 0.0043, 0.0037, 0.0036],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[4.559318256722827, 6.246158709376632, 2.1585086647588803, 0.5637513022260879, 0.12015258675708881, 0.006114623435813121, 0.004877075554691122, -0.0004631387701917834, 3.2082263404685887e-06, -8.580368970195258e-05, 0.00022013448064551642, -0.00013177745873769388],
      Float64[4.527690394747123, 6.19234066761174, 2.1256501209071925, 0.5495624945497365, 0.11577157801204593, 0.005075801715339348, 0.004687064724554368, -0.0004786791829904632, -1.0840486708296737e-06, -9.070080328318656e-05, 0.00021278251993547573, -0.0001382385542505269],
      Float64[5.030714079674475, 7.023859707555667, 2.5828236618496936, 0.7082627678068676, 0.1496029978792051, 0.011298623257254193, 0.005630201519777334, -0.0005744204554537724, 8.132559852569443e-06, -1.008152594152989e-05, 3.984541337018754e-05],
      Float64[5.038508808052837, 7.036309689834381, 2.5888277806666435, 0.7097167893980824, 0.14971995998250964, 0.01132534370521725, 0.0056312147684236535, -0.0005802514512139645, 1.510528738961625e-05, 7.554671427101312e-07, 4.638742711300381e-05]
    ]
  ),
  MolParam(
    #1, molecule number
    7,
    #2, molecule formula
    "O2",
    #3, molecule name
    "Oxygen",
    #4, global isotopologue numbers
    Int64[36, 37, 38],
    #5, isotopologue formulae
    String["16O2", "16O18O", "16O17O"],
    #6, AFGL code
    Int64[66, 68, 67],
    #7, abundance fractions
    Float64[0.995262, 0.003991, 0.000742235],
    #8, molecular masses [kg/mole]
    Float64[0.031989830000000004, 0.033994076, 0.032994045],
    #9, Qref
    Float64[215.73, 455.23, 2658.12],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[4, 4, 4],
    #12, maximum relative errors of interpolation
    Float64[0.0041, 0.0046, 0.0049],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.8169911476436258, 1.7787349638684251, 0.06038173512650354, 0.010527289874679694],
      Float64[1.8579285870104456, 1.8479587879352657, 0.09662133281030434, 0.021907776219117842],
      Float64[1.8534855385966251, 1.841048066429084, 0.09392781106403698, 0.021584982116504392]
    ]
  ),
  MolParam(
    #1, molecule number
    8,
    #2, molecule formula
    "NO",
    #3, molecule name
    "Nitric Oxide",
    #4, global isotopologue numbers
    Int64[39, 40, 41],
    #5, isotopologue formulae
    String["14N16O", "15N16O", "14N18O"],
    #6, AFGL code
    Int64[46, 56, 48],
    #7, abundance fractions
    Float64[0.993974, 0.003654, 0.001993],
    #8, molecular masses [kg/mole]
    Float64[0.029997989, 0.030995023, 0.032002234000000004],
    #9, Qref
    Float64[1142.13, 789.26, 1204.44],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[11, 11, 11],
    #12, maximum relative errors of interpolation
    Float64[0.0047, 0.0048, 0.0049],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[2.0228617203013437, 2.123808787681188, 0.12399317754390338, -0.009285426750579282, 0.014938038177346801, -0.007877695170878773, 0.0029907831495439964, -0.0008495755786342235, -7.700263518739537e-06, 0.0003631999172291955, -0.00023090583042275625],
      Float64[2.027288363412638, 2.130926128698579, 0.12723509417896658, -0.008662085796672145, 0.014795251836390966, -0.007896735230544395, 0.0030190034021215784, -0.0008496460744263495, -9.05477004271571e-06, 0.00035326813471066033, -0.0002282222087712782],
      Float64[2.0294746752460266, 2.134436456376444, 0.12882368410052597, -0.008361269968350283, 0.014722449076834976, -0.007907461308109731, 0.0030258779561753934, -0.0008562521453153616, -9.548910359735708e-06, 0.0003514699897698037, -0.00022449009781091433]
    ]
  ),
  MolParam(
    #1, molecule number
    9,
    #2, molecule formula
    "SO2",
    #3, molecule name
    "Sulfur Dioxide",
    #4, global isotopologue numbers
    Int64[42, 43, 137, 138],
    #5, isotopologue formulae
    String["32S16O2", "34S16O2", "33S16O2", "16O32S18O"],
    #6, AFGL code
    Int64[626, 646, 636, 628],
    #7, abundance fractions
    Float64[0.945678, 0.04195, 0.007464, 0.003792],
    #8, molecular masses [kg/mole]
    Float64[0.063961901, 0.065957695, 0.06496128799999999, 0.06596614599999999],
    #9, Qref
    Float64[6340.3, 6368.98, 25607.0, 13681.0],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10, 10, 10, 10],
    #12, maximum relative errors of interpolation
    Float64[0.0034, 0.0034, 0.0034, 0.0034],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[5.322902450496674, 7.361792471876283, 2.4685215957284274, 0.45937692472363917, 0.04691105678419613, -0.002224847163239988, 0.0015740682191353174, -0.0007824519000630106, 0.0005222665584207044, -0.00023424790805590432],
      Float64[5.322096399367941, 7.3604972890118585, 2.4678970553437716, 0.45922376811076504, 0.04689940269565957, -0.002214548734757531, 0.0015847261015241958, -0.0007793555143435308, 0.0005243249599655226, -0.00023125478623045283],
      Float64[5.322902450496674, 7.361792471876283, 2.4685215957284274, 0.45937692472363917, 0.04691105678419613, -0.002224847163239988, 0.0015740682191353174, -0.0007824519000630106, 0.0005222665584207044, -0.00023424790805590432],
      Float64[5.322902450496674, 7.361792471876283, 2.4685215957284274, 0.45937692472363917, 0.04691105678419613, -0.002224847163239988, 0.0015740682191353174, -0.0007824519000630106, 0.0005222665584207044, -0.00023424790805590432]
    ]
  ),
  MolParam(
    #1, molecule number
    10,
    #2, molecule formula
    "NO2",
    #3, molecule name
    "Nitrogen Dioxide",
    #4, global isotopologue numbers
    Int64[44, 130],
    #5, isotopologue formulae
    String["14N16O2", "15N16O2"],
    #6, AFGL code
    Int64[646, 656],
    #7, abundance fractions
    Float64[0.991616, 0.003646],
    #8, molecular masses [kg/mole]
    Float64[0.045992904, 0.046989938],
    #9, Qref
    Float64[13577.48, 9324.7],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9, 9],
    #12, maximum relative errors of interpolation
    Float64[0.0045, 0.0045],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[4.281578270527676, 5.705704705046051, 1.6937108718917067, 0.28625226444175256, 0.03206564022789404, -0.004729613219174644, 0.0024284327600710975, -0.0010643385363242608, 0.0003438810788911617],
      Float64[4.281578270527676, 5.705704705046051, 1.6937108718917067, 0.28625226444175256, 0.03206564022789404, -0.004729613219174644, 0.0024284327600710975, -0.0010643385363242608, 0.0003438810788911617]
    ]
  ),
  MolParam(
    #1, molecule number
    11,
    #2, molecule formula
    "NH3",
    #3, molecule name
    "Ammonia",
    #4, global isotopologue numbers
    Int64[45, 46],
    #5, isotopologue formulae
    String["14NH3", "15NH3"],
    #6, AFGL code
    Int64[4111, 5111],
    #7, abundance fractions
    Float64[0.995872, 0.003661],
    #8, molecular masses [kg/mole]
    Float64[0.017026549, 0.018023583],
    #9, Qref
    Float64[1725.22, 1153.3],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10, 10],
    #12, maximum relative errors of interpolation
    Float64[0.0048, 0.0049],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[3.855591675477866, 5.040297950800816, 1.4109571556819138, 0.24724164273549498, 0.0404824884895332, -0.003837819178592855, 0.00274161959990001, -0.0008397174279161214, 0.0002842215766515703, -9.538079574393048e-05],
      Float64[3.7706752947933304, 4.891545843108654, 1.3123182726479727, 0.20004310796047356, 0.02602529374406419, -0.005803287729129423, 0.002881408465129878, -0.0008384235882645067, 0.000262233601041828, -9.027712275590084e-05]
    ]
  ),
  MolParam(
    #1, molecule number
    12,
    #2, molecule formula
    "HNO3",
    #3, molecule name
    "Nitric Acid",
    #4, global isotopologue numbers
    Int64[47, 117],
    #5, isotopologue formulae
    String["H14N16O3", "H15N16O3"],
    #6, AFGL code
    Int64[146, 156],
    #7, abundance fractions
    Float64[0.98911, 0.003636],
    #8, molecular masses [kg/mole]
    Float64[0.062995644, 0.06399268],
    #9, Qref
    Float64[214000.0, 143000.0],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10, 10],
    #12, maximum relative errors of interpolation
    Float64[0.0012, 0.0011],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[23.230965722324772, 37.71303890031967, 20.728900773442167, 8.121736782288389, 2.3056057087704795, 0.48249675878044523, 0.07599190875234917, 0.007170208101601677, 0.0015437903784503407, -0.0003346047938398063],
      Float64[23.63526908163912, 38.4016971180013, 21.152181460961224, 8.308598641037342, 2.365544635033066, 0.4966519421994341, 0.07835079784044217, 0.00746613036503321, 0.0015847088618020028, -0.0003411120227004479]
    ]
  ),
  MolParam(
    #1, molecule number
    13,
    #2, molecule formula
    "OH",
    #3, molecule name
    "Hydroxyl",
    #4, global isotopologue numbers
    Int64[48, 49, 50],
    #5, isotopologue formulae
    String["16OH", "18OH", "16OD"],
    #6, AFGL code
    Int64[61, 81, 62],
    #7, abundance fractions
    Float64[0.997473, 0.002, 0.000155371],
    #8, molecular masses [kg/mole]
    Float64[0.01700274, 0.019006986, 0.018008914999999997],
    #9, Qref
    Float64[80.35, 80.88, 209.32],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10, 10, 9],
    #12, maximum relative errors of interpolation
    Float64[0.004, 0.004, 0.0035],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.834807699790532, 1.7542158506193597, 0.05918300129003103, -0.025535821611335593, 0.01660385937064153, -0.008770847784745137, 0.0049464532324263975, -0.0029297528713569327, 0.001918600504296819, -0.0008068085634964146],
      Float64[1.8505495173949784, 1.7811566293461203, 0.07404462471957508, -0.020177666230856126, 0.017128440057766738, -0.009082441743639279, 0.004880250375284723, -0.002893062370460232, 0.0019305502417128967, -0.0008199772998792475],
      Float64[1.8980921463630622, 1.8878520591683938, 0.06346196319417785, -0.025355936682187996, 0.015067903990359843, -0.006987647959284804, 0.0034016035420552163, -0.001801661991090442, 0.0006584008732725133]
    ]
  ),
  MolParam(
    #1, molecule number
    14,
    #2, molecule formula
    "HF",
    #3, molecule name
    "Hydrogen Fluoride",
    #4, global isotopologue numbers
    Int64[51, 110],
    #5, isotopologue formulae
    String["H19F", "D19F"],
    #6, AFGL code
    Int64[19, 29],
    #7, abundance fractions
    Float64[0.999844, 0.000155741],
    #8, molecular masses [kg/mole]
    Float64[0.020006229, 0.021012404],
    #9, Qref
    Float64[41.47, 115.91],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[11, 5],
    #12, maximum relative errors of interpolation
    Float64[0.0044, 0.0042],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.715866106467208, 1.6032194829274484, 0.007299911580028637, 0.00021270524618407024, 0.0014736491828451158, -0.000691803820669179, 0.0005950950055248816, -0.0005115493507733042, 0.000432250092018175, -0.0003887096103401433, 0.0001878224927269301],
      Float64[1.7368403260573089, 1.6473106337738368, 0.016506244352682442, 0.0048783490576704835, 0.0013992237406428298]
    ]
  ),
  MolParam(
    #1, molecule number
    15,
    #2, molecule formula
    "HCl",
    #3, molecule name
    "Hydrogen Chloride",
    #4, global isotopologue numbers
    Int64[52, 53, 107, 108],
    #5, isotopologue formulae
    String["H35Cl", "H37Cl", "D35Cl", "D37Cl"],
    #6, AFGL code
    Int64[15, 17, 25, 27],
    #7, abundance fractions
    Float64[0.757587, 0.242257, 0.000118005, 3.7735000000000004e-05],
    #8, molecular masses [kg/mole]
    Float64[0.035976678, 0.037973729, 0.036982852999999996, 0.038979903999999996],
    #9, Qref
    Float64[160.65, 160.89, 462.78, 464.13],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[5, 5, 5, 5],
    #12, maximum relative errors of interpolation
    Float64[0.0039, 0.0039, 0.0026, 0.0026],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.7375983914285524, 1.6489920556861586, 0.016823417474485014, 0.005063282004473035, 0.0013948733254093293],
      Float64[1.7376331110433485, 1.6490831195871285, 0.016862589474273326, 0.005077735655584004, 0.0013952808982525822],
      Float64[1.7768723597953755, 1.7178039346047251, 0.04533967044480802, 0.01258329042660733, 0.0009602762553437838],
      Float64[1.7771074708173151, 1.7182037930898164, 0.04551988946651975, 0.012618788945389259, 0.0009532205879037026]
    ]
  ),
  MolParam(
    #1, molecule number
    16,
    #2, molecule formula
    "HBr",
    #3, molecule name
    "Hydrogen Bromide",
    #4, global isotopologue numbers
    Int64[54, 55, 111, 112],
    #5, isotopologue formulae
    String["H79Br", "H81Br", "D79Br", "D81Br"],
    #6, AFGL code
    Int64[19, 11, 29, 21],
    #7, abundance fractions
    Float64[0.506781, 0.493063, 7.893840000000001e-05, 7.68016e-05],
    #8, molecular masses [kg/mole]
    Float64[0.07992616, 0.081924115, 0.08093233600000001, 0.082930289],
    #9, Qref
    Float64[200.17, 200.23, 586.4, 586.76],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[5, 5, 5, 5],
    #12, maximum relative errors of interpolation
    Float64[0.0027, 0.0027, 0.0037, 0.0037],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.7489415676985471, 1.6697011639118742, 0.02487800894026626, 0.007632927110756582, 0.0014226924324763912],
      Float64[1.7489672551037023, 1.6697393346012621, 0.024889932204011145, 0.0076363833231246625, 0.001422640889859439],
      Float64[1.802608899273341, 1.7598990794019587, 0.06396052146849618, 0.016012772576213474, 0.00022887393756276797],
      Float64[1.8026670029559415, 1.7599999492901444, 0.06400859427205308, 0.016020689471871075, 0.0002266796824972328]
    ]
  ),
  MolParam(
    #1, molecule number
    17,
    #2, molecule formula
    "HI",
    #3, molecule name
    "Hydrogen Iodide",
    #4, global isotopologue numbers
    Int64[56, 113],
    #5, isotopologue formulae
    String["H127I", "D127I"],
    #6, AFGL code
    Int64[17, 27],
    #7, abundance fractions
    Float64[0.999844, 0.000155741],
    #8, molecular masses [kg/mole]
    Float64[0.127912297, 0.128918472],
    #9, Qref
    Float64[388.99, 1147.06],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[5, 6],
    #12, maximum relative errors of interpolation
    Float64[0.0024, 0.00064],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.766659088785702, 1.7004059633251671, 0.038069170148886666, 0.011007106419556378, 0.0012134876398732786],
      Float64[1.8401790913145128, 1.8196615883291023, 0.08922254408092398, 0.020921928694058088, -0.0006416838671816194, -0.001079698565538223]
    ]
  ),
  MolParam(
    #1, molecule number
    18,
    #2, molecule formula
    "ClO",
    #3, molecule name
    "Chlorine Monoxide",
    #4, global isotopologue numbers
    Int64[57, 58],
    #5, isotopologue formulae
    String["35Cl16O", "37Cl16O"],
    #6, AFGL code
    Int64[56, 76],
    #7, abundance fractions
    Float64[0.755908, 0.24172],
    #8, molecular masses [kg/mole]
    Float64[0.050963768, 0.052960819],
    #9, Qref
    Float64[3274.61, 3332.29],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[8, 8],
    #12, maximum relative errors of interpolation
    Float64[0.0037, 0.0037],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[2.7260616314921466, 3.1747867433148107, 0.5334798791695794, 0.00836642707003647, -0.002807320602827282, 0.0020683557284296556, -0.001967990419858369, 0.0009746270164081901],
      Float64[2.730896498075507, 3.182160192019903, 0.5362283212961244, 0.008478793456867117, -0.002899205443632755, 0.0021025307630773782, -0.001969737338626741, 0.0009731739581840973]
    ]
  ),
  MolParam(
    #1, molecule number
    19,
    #2, molecule formula
    "OCS",
    #3, molecule name
    "Carbonyl Sulfide",
    #4, global isotopologue numbers
    Int64[59, 60, 61, 62, 63, 135],
    #5, isotopologue formulae
    String["16O12C32S", "16O12C34S", "16O13C32S", "16O12C33S", "18O12C32S", "16O13C34S"],
    #6, AFGL code
    Int64[622, 624, 632, 623, 822, 634],
    #7, abundance fractions
    Float64[0.937395, 0.041583, 0.010531, 0.007399, 0.00188, 0.00046750800000000005],
    #8, molecular masses [kg/mole]
    Float64[0.059966986, 0.06196278, 0.060970341, 0.060966371000000005, 0.061971231, 0.06296613599999999],
    #9, Qref
    Float64[1221.01, 1253.48, 2484.15, 4950.11, 1313.78, 2546.53],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9, 9, 9, 9, 9, 9],
    #12, maximum relative errors of interpolation
    Float64[0.003, 0.003, 0.0032, 0.003, 0.0031, 0.003],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[5.126154650347022, 7.0349015478067916, 2.4654845821859195, 0.5193140422343834, 0.0415904273396297, 0.007845836021571406, -0.0013802884179430208, -0.00030264439838711965, 0.00036767836478324156],
      Float64[5.156754047054393, 7.0838804972912985, 2.488833141096497, 0.5249499039477812, 0.04222895146714656, 0.00792945202534967, -0.0013852595504590948, -0.00030347183034296066, 0.0003718252009550227],
      Float64[5.272351164439764, 7.269437084668869, 2.575618800941011, 0.5457176854925214, 0.04568633991913407, 0.008027037219687339, -0.0014922967269828114, -0.00018933510686069965, 0.0003146098679889242],
      Float64[5.141809859117419, 7.059960367292879, 2.4774280183000963, 0.5221943332330361, 0.04191749976873238, 0.007889174743685334, -0.0013842897677303068, -0.0003053926904241777, 0.0003683902900597502],
      Float64[5.243208286004439, 7.222698653493085, 2.5543969231929204, 0.5409098590110422, 0.04470344825847583, 0.008039560707986615, -0.001458502616291213, -0.00024498441490239387, 0.0003421909108873855],
      Float64[5.126154650347022, 7.0349015478067916, 2.4654845821859195, 0.5193140422343834, 0.0415904273396297, 0.007845836021571406, -0.0013802884179430208, -0.00030264439838711965, 0.00036767836478324156]
    ]
  ),
  MolParam(
    #1, molecule number
    20,
    #2, molecule formula
    "H2CO",
    #3, molecule name
    "Formaldehyde",
    #4, global isotopologue numbers
    Int64[64, 65, 66],
    #5, isotopologue formulae
    String["H212C16O", "H213C16O", "H212C18O"],
    #6, AFGL code
    Int64[126, 136, 128],
    #7, abundance fractions
    Float64[0.986237, 0.01108, 0.001978],
    #8, molecular masses [kg/mole]
    Float64[0.030010565, 0.03101392, 0.032014811000000004],
    #9, Qref
    Float64[2844.53, 5837.69, 2986.44],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[8, 10, 10],
    #12, maximum relative errors of interpolation
    Float64[0.0034, 0.0041, 0.0041],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[4.099336583667851, 5.46261014241019, 1.6761052498473152, 0.3605769509576546, 0.066083987393368, -0.002526802856162469, 0.0030734169268912736, -0.0006225584434668617],
      Float64[4.096546519737826, 5.458390476530129, 1.6744847680072221, 0.3606074937132809, 0.06619179802204028, -0.0028048674938283926, 0.00311614057239451, -0.0006038523720989354, 5.309493828183539e-05, 4.4005358065627815e-06],
      Float64[4.096642303624424, 5.458547658259904, 1.6745413383456678, 0.3606172807540205, 0.06619508985508284, -0.0028053743042998533, 0.0031163858029129698, -0.0006039340319933868, 5.312375630239785e-05, 4.294182737396568e-06]
    ]
  ),
  MolParam(
    #1, molecule number
    21,
    #2, molecule formula
    "HOCl",
    #3, molecule name
    "Hypochlorous Acid",
    #4, global isotopologue numbers
    Int64[67, 68],
    #5, isotopologue formulae
    String["H16O35Cl", "H16O37Cl"],
    #6, AFGL code
    Int64[165, 167],
    #7, abundance fractions
    Float64[0.75579, 0.241683],
    #8, molecular masses [kg/mole]
    Float64[0.051971592999999996, 0.053968643999999996],
    #9, Qref
    Float64[19274.79, 19616.2],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9, 9],
    #12, maximum relative errors of interpolation
    Float64[0.0041, 0.0041],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[4.143619456416505, 5.464534302985132, 1.535937117235669, 0.21748079463269954, 0.01850070265914905, -0.003603611521264982, 0.0025436888861178897, -0.0012872390879090645, 0.0004250820383528975],
      Float64[4.143652887452801, 5.46458889118496, 1.5359558687538701, 0.21748297167936315, 0.018501348337276458, -0.0036037772770924903, 0.0025437650379011023, -0.0012874828201296928, 0.0004249718859172802]
    ]
  ),
  MolParam(
    #1, molecule number
    22,
    #2, molecule formula
    "N2",
    #3, molecule name
    "Nitrogen",
    #4, global isotopologue numbers
    Int64[69, 118],
    #5, isotopologue formulae
    String["14N2", "14N15N"],
    #6, AFGL code
    Int64[44, 45],
    #7, abundance fractions
    Float64[0.992687, 0.007478],
    #8, molecular masses [kg/mole]
    Float64[0.028006147999999998, 0.029003182],
    #9, Qref
    Float64[467.1, 644.1],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[5, 5],
    #12, maximum relative errors of interpolation
    Float64[0.00088, 0.001],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.7616677162332879, 1.6961204860220254, 0.030515125543457478, 0.009813018580843269, 0.001178065951792484],
      Float64[1.763736771622995, 1.6995564171968764, 0.032202315260056125, 0.010204551596788902, 0.0011463346353464132]
    ]
  ),
  MolParam(
    #1, molecule number
    23,
    #2, molecule formula
    "HCN",
    #3, molecule name
    "Hydrogen Cyanide",
    #4, global isotopologue numbers
    Int64[70, 71, 72],
    #5, isotopologue formulae
    String["H12C14N", "H13C14N", "H12C15N"],
    #6, AFGL code
    Int64[124, 134, 125],
    #7, abundance fractions
    Float64[0.985114, 0.011068, 0.003622],
    #8, molecular masses [kg/mole]
    Float64[0.027010898999999998, 0.028014254000000002, 0.028007933000000002],
    #9, Qref
    Float64[892.2, 1830.97, 615.28],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[8, 8, 8],
    #12, maximum relative errors of interpolation
    Float64[0.0031, 0.0031, 0.0027],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[3.1500891301785336, 3.8719208338842863, 0.974007334754491, 0.16642156093148136, -0.000901306292183625, 0.004265657181131667, 0.00012656294624692675, -0.0006192714544204543],
      Float64[3.167598930060715, 3.9002377082325483, 0.9880115128816052, 0.17009087099321946, -0.0005618434324988129, 0.004213089337671886, 0.00011516887524238533, -0.0006109842813375772],
      Float64[3.318013482972087, 4.141018504586868, 1.1036729796164717, 0.19575735583591328, -0.001607424924923622, 0.00361416589684652, 0.0005690006278758883, -0.0006750754029713083]
    ]
  ),
  MolParam(
    #1, molecule number
    24,
    #2, molecule formula
    "CH3Cl",
    #3, molecule name
    "Methyl Chloride",
    #4, global isotopologue numbers
    Int64[73, 74],
    #5, isotopologue formulae
    String["12CH335Cl", "12CH337Cl"],
    #6, AFGL code
    Int64[215, 217],
    #7, abundance fractions
    Float64[0.748937, 0.239491],
    #8, molecular masses [kg/mole]
    Float64[0.049992328, 0.051989379],
    #9, Qref
    Float64[57916.12, 58833.9],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9, 9],
    #12, maximum relative errors of interpolation
    Float64[0.0044, 0.0044],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[7.299682451846195, 10.763009645686108, 4.61880914039895, 1.4061531155120282, 0.30523214716140457, 0.04121154110498626, 0.009297828369966954, -0.0008824639341193929, 0.0003455799191502962],
      Float64[7.299822550950729, 10.763243516931173, 4.61893392818788, 1.406197795585583, 0.3052444042496276, 0.041213756119593326, 0.00929818303771679, -0.000882393019061567, 0.00034556328582624474]
    ]
  ),
  MolParam(
    #1, molecule number
    25,
    #2, molecule formula
    "H2O2",
    #3, molecule name
    "Hydrogen Peroxide",
    #4, global isotopologue numbers
    Int64[75],
    #5, isotopologue formulae
    String["H216O2"],
    #6, AFGL code
    Int64[1661],
    #7, abundance fractions
    Float64[0.994952],
    #8, molecular masses [kg/mole]
    Float64[0.03400548],
    #9, Qref
    Float64[9847.99],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[12],
    #12, maximum relative errors of interpolation
    Float64[0.0036],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[6.659148885387041, 9.4834374888027, 3.4240503155836035, 0.6560617611309382, 0.07013381350597489, 0.00018469613049765433, 0.0004970018451052321, -0.0002701202869977689, 3.406773332689542e-05, -0.00011337398134743508, 0.00016267470485460805, -8.729256228111704e-05]
    ]
  ),
  MolParam(
    #1, molecule number
    26,
    #2, molecule formula
    "C2H2",
    #3, molecule name
    "Acetylene",
    #4, global isotopologue numbers
    Int64[76, 77, 105],
    #5, isotopologue formulae
    String["12C2H2", "H12C13CH", "H12C12CD"],
    #6, AFGL code
    Int64[1221, 1231, 1222],
    #7, abundance fractions
    Float64[0.977599, 0.021966, 0.00030455],
    #8, molecular masses [kg/mole]
    Float64[0.02601565, 0.027019005, 0.027021825],
    #9, Qref
    Float64[412.45, 1656.18, 1581.84],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9, 9, 9],
    #12, maximum relative errors of interpolation
    Float64[0.0024, 0.0024, 0.005],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[6.6062732635607775, 9.502138551613516, 3.8798604463554094, 1.0421746716980893, 0.15414612855511933, 0.025250875484856827, 0.0008296976295085745, -0.0009777610585555152, 0.0007258500065931983],
      Float64[6.691339983695894, 9.64246368313129, 3.9555205875619954, 1.067286553219111, 0.1589929605189031, 0.02568275068109993, 0.0008507894207236966, -0.000984865450512018, 0.0007258796260667388],
      Float64[8.312818087515264, 12.296135611243283, 5.334539240450019, 1.5041555942106484, 0.25556636740202876, 0.040809216146493243, -5.996404029051661e-05, -0.0008823053560504945, 0.001325829564092551]
    ]
  ),
  MolParam(
    #1, molecule number
    27,
    #2, molecule formula
    "C2H6",
    #3, molecule name
    "Ethane",
    #4, global isotopologue numbers
    Int64[78, 106],
    #5, isotopologue formulae
    String["12C2H6", "12CH313CH3"],
    #6, AFGL code
    Int64[1221, 1231],
    #7, abundance fractions
    Float64[0.97699, 0.021953],
    #8, molecular masses [kg/mole]
    Float64[0.03004695, 0.031050305],
    #9, Qref
    Float64[70882.52, 36191.8],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[12, 12],
    #12, maximum relative errors of interpolation
    Float64[0.0026, 0.0026],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[29.306415047891516, 48.87647479969876, 29.27765229962159, 13.421162879355931, 4.868376146859683, 1.4265997316192462, 0.3502909687509446, 0.0711781061405994, 0.012131884304878326, 0.0018118992454803488, 0.0003465781276294034, -6.113387932383706e-05],
      Float64[29.31971329391903, 48.8997796011982, 29.293303768783712, 13.429316433822438, 4.871766054220967, 1.4277452263920856, 0.35061046733124096, 0.07125320986663458, 0.01214670834658126, 0.001814368336609236, 0.0003469487072710432, -6.108984944252039e-05]
    ]
  ),
  MolParam(
    #1, molecule number
    28,
    #2, molecule formula
    "PH3",
    #3, molecule name
    "Phosphine",
    #4, global isotopologue numbers
    Int64[79],
    #5, isotopologue formulae
    String["31PH3"],
    #6, AFGL code
    Int64[1111],
    #7, abundance fractions
    Float64[0.999533],
    #8, molecular masses [kg/mole]
    Float64[0.033997238000000006],
    #9, Qref
    Float64[3249.44],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9],
    #12, maximum relative errors of interpolation
    Float64[0.0041],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[4.777531278689518, 6.56151542381243, 2.2412042085255277, 0.5262959504358187, 0.09233791547557679, 0.002795746752918049, 0.003791067666482295, -0.0010742753416073114, 0.00021650667278283464]
    ]
  ),
  MolParam(
    #1, molecule number
    29,
    #2, molecule formula
    "COF2",
    #3, molecule name
    "Carbonyl Fluoride",
    #4, global isotopologue numbers
    Int64[80, 119],
    #5, isotopologue formulae
    String["12C16O19F2", "13C16O19F2"],
    #6, AFGL code
    Int64[269, 369],
    #7, abundance fractions
    Float64[0.986544, 0.011083],
    #8, molecular masses [kg/mole]
    Float64[0.065991722, 0.066995083],
    #9, Qref
    Float64[70028.43, 140000.0],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9, 9],
    #12, maximum relative errors of interpolation
    Float64[0.0037, 0.0037],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[11.629931174695397, 17.881640555690623, 8.45377717908021, 2.6794696985587407, 0.5645965476906625, 0.07777414142631045, 0.00947097051224155, -0.001480514566241098, 0.0007799374263299796],
      Float64[11.635249499599023, 17.889802343475637, 8.457586722083246, 2.6806408754837325, 0.5648398483725394, 0.07780705463459148, 0.009474014430588262, -0.0014807057725274575, 0.0007800005503160179]
    ]
  ),
  MolParam(
    #1, molecule number
    30,
    #2, molecule formula
    "SF6",
    #3, molecule name
    "Sulfur Hexafluoride",
    #4, global isotopologue numbers
    Int64[126],
    #5, isotopologue formulae
    String["32S19F6"],
    #6, AFGL code
    Int64[29],
    #7, abundance fractions
    Float64[0.95018],
    #8, molecular masses [kg/mole]
    Float64[0.145962492],
    #9, Qref
    Float64[1620000.0],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[14],
    #12, maximum relative errors of interpolation
    Float64[0.00024],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1870.7117266249759, 3396.573083307492, 2545.0085260475485, 1579.432604203472, 815.1045425222118, 351.0061028885553, 126.3795862864786, 38.05037645536903, 9.559459105261725, 1.9936675698906514, 0.3424948763082424, 0.04771635428971002, 0.005364060141101408, 0.00045015125453154236]
    ]
  ),
  MolParam(
    #1, molecule number
    31,
    #2, molecule formula
    "H2S",
    #3, molecule name
    "Hydrogen Sulfide",
    #4, global isotopologue numbers
    Int64[81, 82, 83],
    #5, isotopologue formulae
    String["H232S", "H234S", "H233S"],
    #6, AFGL code
    Int64[121, 141, 131],
    #7, abundance fractions
    Float64[0.949884, 0.042137, 0.007498],
    #8, molecular masses [kg/mole]
    Float64[0.033987721, 0.035983514999999994, 0.034987105],
    #9, Qref
    Float64[505.79, 504.35, 2014.94],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9, 9, 9],
    #12, maximum relative errors of interpolation
    Float64[0.0026, 0.005, 0.005],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[3.1609996075096554, 3.907930607272193, 0.8188453764539809, 0.07184076058678146, 0.018980480391111332, -0.00456000987154237, 0.001779447782383592, -0.0006836389736124548, 0.00018936018932769194],
      Float64[3.1362203991020112, 3.8686105340240093, 0.8013718107492362, 0.06815344239305832, 0.018302610578901923, -0.004755006583306187, 0.0018461918942571098, -0.0007311369795930389, 0.00020215214471175358],
      Float64[3.136184932528794, 3.8685623402750853, 0.8013606514677021, 0.06815282762122732, 0.018302261193013036, -0.004754901905018594, 0.0018460343301177073, -0.0007312889497939068, 0.00020205534691974947]
    ]
  ),
  MolParam(
    #1, molecule number
    32,
    #2, molecule formula
    "HCOOH",
    #3, molecule name
    "Formic Acid",
    #4, global isotopologue numbers
    Int64[84],
    #5, isotopologue formulae
    String["H12C16O16OH"],
    #6, AFGL code
    Int64[126],
    #7, abundance fractions
    Float64[0.983898],
    #8, molecular masses [kg/mole]
    Float64[0.04600548],
    #9, Qref
    Float64[39132.76],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9],
    #12, maximum relative errors of interpolation
    Float64[0.0038],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[11.020149393914501, 16.9755902316461, 8.167574402236214, 2.7594738274122346, 0.6634809411963838, 0.11285962933776061, 0.01800084865083562, -5.6527863588229366e-05, 0.000655575724366031]
    ]
  ),
  MolParam(
    #1, molecule number
    33,
    #2, molecule formula
    "HO2",
    #3, molecule name
    "Hydroperoxyl",
    #4, global isotopologue numbers
    Int64[85],
    #5, isotopologue formulae
    String["H16O2"],
    #6, AFGL code
    Int64[166],
    #7, abundance fractions
    Float64[0.995107],
    #8, molecular masses [kg/mole]
    Float64[0.032997655],
    #9, Qref
    Float64[4300.39],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10],
    #12, maximum relative errors of interpolation
    Float64[0.0037],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[3.4589272117108383, 4.387835891105378, 1.0536730184200118, 0.12775292760736148, 0.017964172698180784, -0.006227214226034131, 0.002705468130732728, -0.0007687201824949517, 0.00016184918654873727, -2.049552086723515e-05]
    ]
  ),
  MolParam(
    #1, molecule number
    34,
    #2, molecule formula
    "O",
    #3, molecule name
    "Oxygen Atom",
    #4, global isotopologue numbers
    Int64[86],
    #5, isotopologue formulae
    String["16O"],
    #6, AFGL code
    Int64[6],
    #7, abundance fractions
    Float64[0.997628],
    #8, molecular masses [kg/mole]
    Float64[0.015994915000000002],
    #9, Qref
    Float64[6.72],
    #10, has interpolating chebyshev expansion?
    Bool[false],
    #11, lengths of interpolating chebyshev expansion
    Int64[0],
    #12, maximum relative errors of interpolation
    Float64[0],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[]
    ]
  ),
  MolParam(
    #1, molecule number
    35,
    #2, molecule formula
    "ClONO2",
    #3, molecule name
    "Chlorine Nitrate",
    #4, global isotopologue numbers
    Int64[127, 128],
    #5, isotopologue formulae
    String["35Cl16O14N16O2", "37Cl16O14N16O2"],
    #6, AFGL code
    Int64[5646, 7646],
    #7, abundance fractions
    Float64[0.74957, 0.239694],
    #8, molecular masses [kg/mole]
    Float64[0.096956672, 0.098953723],
    #9, Qref
    Float64[4790000.0, 4910000.0],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10, 10],
    #12, maximum relative errors of interpolation
    Float64[0.0016, 0.0015],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[112.41039753461149, 192.5969283401371, 121.68354064743774, 57.30328926867914, 20.284701556330944, 5.410076429365737, 1.0808835468204576, 0.15853736954761644, 0.016535623193792363, 0.001150132727673281],
      Float64[112.45459127185921, 192.67265280226152, 121.7313921905935, 57.32582857162725, 20.292682333281764, 5.412206013024527, 1.081309309033366, 0.15859843363539816, 0.016538546940485805, 0.0011482640850822969]
    ]
  ),
  MolParam(
    #1, molecule number
    36,
    #2, molecule formula
    "NO+",
    #3, molecule name
    "Nitric Oxide Cation",
    #4, global isotopologue numbers
    Int64[87],
    #5, isotopologue formulae
    String["14N16O+"],
    #6, AFGL code
    Int64[46],
    #7, abundance fractions
    Float64[0.993974],
    #8, molecular masses [kg/mole]
    Float64[0.029997989],
    #9, Qref
    Float64[311.69],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[5],
    #12, maximum relative errors of interpolation
    Float64[0.00084],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.7606279087501284, 1.694427862247025, 0.02961633237632444, 0.009556962418508008, 0.0011640170788154158]
    ]
  ),
  MolParam(
    #1, molecule number
    37,
    #2, molecule formula
    "HOBr",
    #3, molecule name
    "Hypobromous Acid",
    #4, global isotopologue numbers
    Int64[88, 89],
    #5, isotopologue formulae
    String["H16O79Br", "H16O81Br"],
    #6, AFGL code
    Int64[169, 161],
    #7, abundance fractions
    Float64[0.505579, 0.491894],
    #8, molecular masses [kg/mole]
    Float64[0.095921076, 0.097919027],
    #9, Qref
    Float64[28339.38, 28237.98],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10, 10],
    #12, maximum relative errors of interpolation
    Float64[0.0021, 0.0022],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[4.483051772959935, 5.99504975544242, 1.76474434415191, 0.2533631856049266, 0.016939626390401825, -0.0028115499157905354, 0.0022536690902106057, -0.001141431127502991, 0.0005431331089648476, -0.0002007191526314974],
      Float64[4.48627425227846, 6.000093066772231, 1.7669120853452576, 0.25370808850309956, 0.016950558318751252, -0.0027908353859292414, 0.0022574477605871047, -0.001134064610015923, 0.0005521299823843467, -0.0001956440954408044]
    ]
  ),
  MolParam(
    #1, molecule number
    38,
    #2, molecule formula
    "C2H4",
    #3, molecule name
    "Ethylene",
    #4, global isotopologue numbers
    Int64[90, 91],
    #5, isotopologue formulae
    String["12C2H4", "12CH213CH2"],
    #6, AFGL code
    Int64[221, 231],
    #7, abundance fractions
    Float64[0.977294, 0.021959],
    #8, molecular masses [kg/mole]
    Float64[0.028031300000000002, 0.029034655],
    #9, Qref
    Float64[11041.54, 45196.89],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[8, 8],
    #12, maximum relative errors of interpolation
    Float64[0.0049, 0.0049],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[10.306660502082568, 15.910061008016038, 7.822173122474318, 2.8344558298646803, 0.7606658986769856, 0.1505730140624887, 0.03087140600244303, 0.0017324789997549114],
      Float64[10.306848546175095, 15.910377703973438, 7.822340024458749, 2.8345174648988842, 0.7606843046977063, 0.15057613054786195, 0.030872516995219916, 0.0017326771144823283]
    ]
  ),
  MolParam(
    #1, molecule number
    39,
    #2, molecule formula
    "CH3OH",
    #3, molecule name
    "Methanol",
    #4, global isotopologue numbers
    Int64[92],
    #5, isotopologue formulae
    String["12CH316OH"],
    #6, AFGL code
    Int64[2161],
    #7, abundance fractions
    Float64[0.98593],
    #8, molecular masses [kg/mole]
    Float64[0.032026215000000004],
    #9, Qref
    Float64[70569.92],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[12],
    #12, maximum relative errors of interpolation
    Float64[0.003],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[13.749331299014557, 21.61345783697811, 10.9555767086557, 3.9774037500079205, 1.0933135946637227, 0.22262663083491602, 0.03813660667593465, 0.005433796179322007, 0.00010166766497735321, 8.430815333649765e-05, 0.00016669694173933956, -0.00010908619244596387]
    ]
  ),
  MolParam(
    #1, molecule number
    40,
    #2, molecule formula
    "CH3Br",
    #3, molecule name
    "Methyl Bromide",
    #4, global isotopologue numbers
    Int64[93, 94],
    #5, isotopologue formulae
    String["12CH379Br", "12CH381Br"],
    #6, AFGL code
    Int64[219, 211],
    #7, abundance fractions
    Float64[0.500995, 0.487433],
    #8, molecular masses [kg/mole]
    Float64[0.093941811, 0.095939764],
    #9, Qref
    Float64[83051.98, 83395.21],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10, 10],
    #12, maximum relative errors of interpolation
    Float64[0.0033, 0.0033],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[8.32247546006258, 12.445798492510754, 5.528508434396181, 1.7163745453571535, 0.3780599351897853, 0.05548248238163916, 0.01043433268517122, -0.00067791147717047, 0.0005066021475157198, -0.0001201026659584967],
      Float64[8.329458620837947, 12.457244056407344, 5.53458518159973, 1.7183860198316045, 0.3785413171252424, 0.05557659379988536, 0.01043811080420672, -0.000674658224026656, 0.0005073387147176175, -0.00012089167973133246]
    ]
  ),
  MolParam(
    #1, molecule number
    41,
    #2, molecule formula
    "CH3CN",
    #3, molecule name
    "Acetonitrile",
    #4, global isotopologue numbers
    Int64[95],
    #5, isotopologue formulae
    String["12CH312C14N"],
    #6, AFGL code
    Int64[2124],
    #7, abundance fractions
    Float64[0.973866],
    #8, molecular masses [kg/mole]
    Float64[0.041026549],
    #9, Qref
    Float64[88672.19],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[12],
    #12, maximum relative errors of interpolation
    Float64[0.0019],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[23.087630871585702, 37.50816410367981, 20.677523295870827, 8.221772572200008, 2.455476443495565, 0.5636035610361577, 0.10207472331300957, 0.014591934333672573, 0.0017056301022093253, -7.405340601125813e-05, 0.0002713232811531312, -0.00013372238211027045]
    ]
  ),
  MolParam(
    #1, molecule number
    42,
    #2, molecule formula
    "CF4",
    #3, molecule name
    "PFC-14",
    #4, global isotopologue numbers
    Int64[96],
    #5, isotopologue formulae
    String["12C19F4"],
    #6, AFGL code
    Int64[29],
    #7, abundance fractions
    Float64[0.98889],
    #8, molecular masses [kg/mole]
    Float64[0.087993616],
    #9, Qref
    Float64[121000.0],
    #10, has interpolating chebyshev expansion?
    Bool[false],
    #11, lengths of interpolating chebyshev expansion
    Int64[0],
    #12, maximum relative errors of interpolation
    Float64[0],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[]
    ]
  ),
  MolParam(
    #1, molecule number
    43,
    #2, molecule formula
    "C4H2",
    #3, molecule name
    "Diacetylene",
    #4, global isotopologue numbers
    Int64[116],
    #5, isotopologue formulae
    String["12C4H2"],
    #6, AFGL code
    Int64[2211],
    #7, abundance fractions
    Float64[0.955998],
    #8, molecular masses [kg/mole]
    Float64[0.05001565],
    #9, Qref
    Float64[9818.97],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10],
    #12, maximum relative errors of interpolation
    Float64[0.0044],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[139.66835957434776, 241.85305800353672, 157.95302972883783, 78.74096208726291, 30.283942023964958, 9.074668301483646, 2.130903025224642, 0.3944094168400372, 0.05767338336487329, 0.006565583269182045]
    ]
  ),
  MolParam(
    #1, molecule number
    44,
    #2, molecule formula
    "HC3N",
    #3, molecule name
    "Cyanoacetylene",
    #4, global isotopologue numbers
    Int64[109],
    #5, isotopologue formulae
    String["H12C314N"],
    #6, AFGL code
    Int64[1224],
    #7, abundance fractions
    Float64[0.963346],
    #8, molecular masses [kg/mole]
    Float64[0.051010899000000005],
    #9, Qref
    Float64[24786.84],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[10],
    #12, maximum relative errors of interpolation
    Float64[0.0023],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[54.679869334904495, 91.66794896944785, 54.566307506979925, 23.482103375708576, 7.394345288945617, 1.724935855236013, 0.2979841161680494, 0.03854093781559224, 0.003196027999441261, 0.00036284289966993636]
    ]
  ),
  MolParam(
    #1, molecule number
    45,
    #2, molecule formula
    "H2",
    #3, molecule name
    "Hydrogen",
    #4, global isotopologue numbers
    Int64[103, 115],
    #5, isotopologue formulae
    String["H2", "HD"],
    #6, AFGL code
    Int64[11, 12],
    #7, abundance fractions
    Float64[0.999688, 0.00031143200000000005],
    #8, molecular masses [kg/mole]
    Float64[0.00201565, 0.003021825],
    #9, Qref
    Float64[7.67, 29.87],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[16, 13],
    #12, maximum relative errors of interpolation
    Float64[0.0049, 0.0035],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.6647896118139234, 1.5411590831966309, -0.009595769842080017, 0.010563823373637416, -0.0015805235376820663, -0.0038369114517827836, 0.0066032722736639425, -0.00681431440555866, 0.005546288495992816, -0.0038079408994718526, 0.002231211008340465, -0.001072686361636233, 0.0003402752802726135, 6.641130836167278e-05, -0.0002591373307623712, 0.00015726796472203357],
      Float64[1.702137809916646, 1.5472029176539899, 0.02093169476040493, -0.005217305163005126, 0.006489575993513952, -0.004442932287756728, 0.0034291059854125727, -0.0026516556123562414, 0.0020167369613963457, -0.001546610394607265, 0.0012269546474057945, -0.001040597657931593, 0.0004896148721469373]
    ]
  ),
  MolParam(
    #1, molecule number
    46,
    #2, molecule formula
    "CS",
    #3, molecule name
    "Carbon Monosulfide",
    #4, global isotopologue numbers
    Int64[97, 98, 99, 100],
    #5, isotopologue formulae
    String["12C32S", "12C34S", "13C32S", "12C33S"],
    #6, AFGL code
    Int64[22, 24, 32, 23],
    #7, abundance fractions
    Float64[0.939624, 0.041682, 0.010556, 0.007417],
    #8, molecular masses [kg/mole]
    Float64[0.043971036, 0.045966786999999995, 0.044974368, 0.044970399],
    #9, Qref
    Float64[253.62, 257.77, 537.5, 1022.97],
    #10, has interpolating chebyshev expansion?
    Bool[true, true, true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[6, 6, 6, 6],
    #12, maximum relative errors of interpolation
    Float64[0.0024, 0.0025, 0.0028, 0.0025],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[1.9278542774524976, 1.9568371650992353, 0.14160447059424688, 0.024947041733687992, -0.00315260105518238, -0.0006884533434512008],
      Float64[1.9313327965262457, 1.9621852558078985, 0.1436891225625492, 0.02506737459094268, -0.0032505337452713333, -0.0006617160178034708],
      Float64[1.9405919704042176, 1.9763456394868477, 0.14914336978190204, 0.025364584356044273, -0.003505572744258778, -0.0005886610521940838],
      Float64[1.9296484507052951, 1.959587446598863, 0.14267218810373006, 0.025009263811682635, -0.0032028934205973413, -0.0006748260933123973]
    ]
  ),
  MolParam(
    #1, molecule number
    47,
    #2, molecule formula
    "SO3",
    #3, molecule name
    "Sulfur trioxide",
    #4, global isotopologue numbers
    Int64[114],
    #5, isotopologue formulae
    String["32S16O3"],
    #6, AFGL code
    Int64[26],
    #7, abundance fractions
    Float64[0.9434],
    #8, molecular masses [kg/mole]
    Float64[0.07995682],
    #9, Qref
    Float64[7783.3],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[11],
    #12, maximum relative errors of interpolation
    Float64[0.0021],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[15.308344227049204, 24.002742640459463, 11.897738943959506, 3.9481377000507316, 0.8793553351846028, 0.12898828813118968, 0.01123876482403432, -0.00037136652099363233, 0.0014493406999065428, -0.0005177746279400707, -0.00017698430986285986]
    ]
  ),
  MolParam(
    #1, molecule number
    48,
    #2, molecule formula
    "C2N2",
    #3, molecule name
    "Cyanogen",
    #4, global isotopologue numbers
    Int64[123],
    #5, isotopologue formulae
    String["12C214N2"],
    #6, AFGL code
    Int64[4224],
    #7, abundance fractions
    Float64[0.970752],
    #8, molecular masses [kg/mole]
    Float64[0.052006148],
    #9, Qref
    Float64[15582.44],
    #10, has interpolating chebyshev expansion?
    Bool[true],
    #11, lengths of interpolating chebyshev expansion
    Int64[9],
    #12, maximum relative errors of interpolation
    Float64[0.0033],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[23.898242652068163, 38.307617292348255, 20.017346435809728, 6.959242334293699, 1.6165209098503635, 0.256265540529653, 0.025549534895654702, 0.00221218018862146, -0.000284544817120036]
    ]
  ),
  MolParam(
    #1, molecule number
    49,
    #2, molecule formula
    "COCl2",
    #3, molecule name
    "Phosgene",
    #4, global isotopologue numbers
    Int64[124, 125],
    #5, isotopologue formulae
    String["12C16O35Cl2", "12C16O35Cl37Cl"],
    #6, AFGL code
    Int64[2655, 2657],
    #7, abundance fractions
    Float64[0.566392, 0.362235],
    #8, molecular masses [kg/mole]
    Float64[0.09793261997960001, 0.0999296698896],
    #9, Qref
    Float64[1480000.0, 3040000.0],
    #10, has interpolating chebyshev expansion?
    Bool[true, true],
    #11, lengths of interpolating chebyshev expansion
    Int64[11, 11],
    #12, maximum relative errors of interpolation
    Float64[0.0029, 0.0029],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[28.33468074801008, 45.91334087133245, 24.711824316986792, 9.013421682376832, 2.2233955866609585, 0.3666538352173916, 0.03832364724279458, 0.001623316227237126, 0.00042513692236951784, -0.0002819342485111065, 0.00011813871078913962],
      Float64[28.382894257045525, 45.99286010035263, 24.75674554582853, 9.03095914196701, 2.2280787587771362, 0.36749244821060645, 0.03842001247747575, 0.0016301774251942902, 0.0004274789426332859, -0.00028160100148681976, 0.00011832061291556783]
    ]
  ),
  MolParam(), #no molecule has been assigned the number 50
  MolParam(), #no molecule has been assigned the number 51
  MolParam(), #no molecule has been assigned the number 52
  MolParam(
    #1, molecule number
    53,
    #2, molecule formula
    "CS2",
    #3, molecule name
    "Carbon disulfide",
    #4, global isotopologue numbers
    Int64[131, 132, 133, 134],
    #5, isotopologue formulae
    String["12C32S2", "32S12C34S", "32S12C33S", "13C32S2"],
    #6, AFGL code
    Int64[222, 224, 223, 232],
    #7, abundance fractions
    Float64[0.892811, 0.07926, 0.014094, 0.01031],
    #8, molecular masses [kg/mole]
    Float64[0.07594414000000001, 0.07793994000000001, 0.076943256, 0.076947495],
    #9, Qref
    Float64[1352.6, 2798.0, 1107.0, 2739.7],
    #10, has interpolating chebyshev expansion?
    Bool[false, false, false, false],
    #11, lengths of interpolating chebyshev expansion
    Int64[0, 0, 0, 0],
    #12, maximum relative errors of interpolation
    Float64[0, 0, 0, 0],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[],
      Float64[],
      Float64[],
      Float64[]
    ]
  ),
  MolParam(), #no molecule has been assigned the number 54
  MolParam(
    #1, molecule number
    55,
    #2, molecule formula
    "NF3",
    #3, molecule name
    "Nitrogen trifluoride",
    #4, global isotopologue numbers
    Int64[136],
    #5, isotopologue formulae
    String["14N19F3"],
    #6, AFGL code
    Int64[4999],
    #7, abundance fractions
    Float64[0.996337],
    #8, molecular masses [kg/mole]
    Float64[0.070998284],
    #9, Qref
    Float64[346000.0],
    #10, has interpolating chebyshev expansion?
    Bool[false],
    #11, lengths of interpolating chebyshev expansion
    Int64[0],
    #12, maximum relative errors of interpolation
    Float64[0],
    #13, chebyshev expansion coefficients
    Vector{Float64}[
      Float64[]
    ]
  )
]


text:
int_rules_4_1_11 = @theory begin

    #= ::Subsection::Closed:: =#
    #= 4.1.11*(e*x)^m*(a+b*x^n)^p*sin =#
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~(p') * sin(~(c') + ~(d') * ~x), ~x) => Antiderivative(ExpandIntegrand(sin(~c + ~d * ~x), (~a + ~b * (~x) ^ ~n) ^ ~p, ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~n], ~x) && IGtQ(~p, 0)
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~(p') * cos(~(c') + ~(d') * ~x), ~x) => Antiderivative(ExpandIntegrand(cos(~c + ~d * ~x), (~a + ~b * (~x) ^ ~n) ^ ~p, ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~n], ~x) && IGtQ(~p, 0)
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~p * sin(~(c') + ~(d') * ~x), ~x) => (((~x) ^ (-(~n) + 1) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * sin(~c + ~d * ~x)) / (~b * ~n * (~p + 1)) - ((-(~n) + 1) / (~b * ~n * (~p + 1))) * Antiderivative((~x) ^ -(~n) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * sin(~c + ~d * ~x), ~x)) - (~d / (~b * ~n * (~p + 1))) * Antiderivative((~x) ^ (-(~n) + 1) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * cos(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d], ~x) && (ILtQ(~p, -1) && IGtQ(~n, 2))
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~p * cos(~(c') + ~(d') * ~x), ~x) => (((~x) ^ (-(~n) + 1) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * cos(~c + ~d * ~x)) / (~b * ~n * (~p + 1)) - ((-(~n) + 1) / (~b * ~n * (~p + 1))) * Antiderivative((~x) ^ -(~n) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * cos(~c + ~d * ~x), ~x)) + (~d / (~b * ~n * (~p + 1))) * Antiderivative((~x) ^ (-(~n) + 1) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * sin(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d], ~x) && (ILtQ(~p, -1) && IGtQ(~n, 2))
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~p * sin(~(c') + ~(d') * ~x), ~x) => Antiderivative(ExpandIntegrand(sin(~c + ~d * ~x), (~a + ~b * (~x) ^ ~n) ^ ~p, ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d], ~x) && (ILtQ(~p, 0) && (IGtQ(~n, 0) && (EqQ(~n, 2) || EqQ(~p, -1))))
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~p * cos(~(c') + ~(d') * ~x), ~x) => Antiderivative(ExpandIntegrand(cos(~c + ~d * ~x), (~a + ~b * (~x) ^ ~n) ^ ~p, ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d], ~x) && (ILtQ(~p, 0) && (IGtQ(~n, 0) && (EqQ(~n, 2) || EqQ(~p, -1))))
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~p * sin(~(c') + ~(d') * ~x), ~x) => Antiderivative((~x) ^ (~n * ~p) * (~b + ~a * (~x) ^ -(~n)) ^ ~p * sin(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d], ~x) && (ILtQ(~p, 0) && ILtQ(~n, 0))
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~p * cos(~(c') + ~(d') * ~x), ~x) => Antiderivative((~x) ^ (~n * ~p) * (~b + ~a * (~x) ^ -(~n)) ^ ~p * cos(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d], ~x) && (ILtQ(~p, 0) && ILtQ(~n, 0))
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~p * sin(~(c') + ~(d') * ~x), ~x) => Unintegrable((~a + ~b * (~x) ^ ~n) ^ ~p * sin(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~n, ~p], ~x)
    @apply_utils Antiderivative((~a + ~(b') * (~x) ^ ~n) ^ ~p * cos(~(c') + ~(d') * ~x), ~x) => Unintegrable((~a + ~b * (~x) ^ ~n) ^ ~p * cos(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~n, ~p], ~x)
    @apply_utils Antiderivative((~(e') * ~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~(p') * sin(~(c') + ~(d') * ~x), ~x) => Antiderivative(ExpandIntegrand(sin(~c + ~d * ~x), (~e * ~x) ^ ~m * (~a + ~b * (~x) ^ ~n) ^ ~p, ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~m, ~n], ~x) && IGtQ(~p, 0)
    @apply_utils Antiderivative((~(e') * ~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~(p') * cos(~(c') + ~(d') * ~x), ~x) => Antiderivative(ExpandIntegrand(cos(~c + ~d * ~x), (~e * ~x) ^ ~m * (~a + ~b * (~x) ^ ~n) ^ ~p, ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~m, ~n], ~x) && IGtQ(~p, 0)
    @apply_utils Antiderivative((~(e') * ~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~p * sin(~(c') + ~(d') * ~x), ~x) => ((~e) ^ ~m * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * sin(~c + ~d * ~x)) / (~b * ~n * (~p + 1)) - ((~d * (~e) ^ ~m) / (~b * ~n * (~p + 1))) * Antiderivative((~a + ~b * (~x) ^ ~n) ^ (~p + 1) * cos(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~m, ~n], ~x) && (ILtQ(~p, -1) && (EqQ(~m, ~n - 1) && (IntegerQ(~n) || GtQ(~e, 0))))
    @apply_utils Antiderivative((~(e') * ~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~p * cos(~(c') + ~(d') * ~x), ~x) => ((~e) ^ ~m * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * cos(~c + ~d * ~x)) / (~b * ~n * (~p + 1)) + ((~d * (~e) ^ ~m) / (~b * ~n * (~p + 1))) * Antiderivative((~a + ~b * (~x) ^ ~n) ^ (~p + 1) * sin(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~m, ~n], ~x) && (ILtQ(~p, -1) && (EqQ(~m, ~n - 1) && (IntegerQ(~n) || GtQ(~e, 0))))
    @apply_utils Antiderivative((~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~p * sin(~(c') + ~(d') * ~x), ~x) => (((~x) ^ ((~m - ~n) + 1) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * sin(~c + ~d * ~x)) / (~b * ~n * (~p + 1)) - (((~m - ~n) + 1) / (~b * ~n * (~p + 1))) * Antiderivative((~x) ^ (~m - ~n) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * sin(~c + ~d * ~x), ~x)) - (~d / (~b * ~n * (~p + 1))) * Antiderivative((~x) ^ ((~m - ~n) + 1) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * cos(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m], ~x) && (ILtQ(~p, -1) && (IGtQ(~n, 0) && ((GtQ((~m - ~n) + 1, 0) || GtQ(~n, 2)) && RationalQ(~m))))
    @apply_utils Antiderivative((~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~p * cos(~(c') + ~(d') * ~x), ~x) => (((~x) ^ ((~m - ~n) + 1) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * cos(~c + ~d * ~x)) / (~b * ~n * (~p + 1)) - (((~m - ~n) + 1) / (~b * ~n * (~p + 1))) * Antiderivative((~x) ^ (~m - ~n) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * cos(~c + ~d * ~x), ~x)) + (~d / (~b * ~n * (~p + 1))) * Antiderivative((~x) ^ ((~m - ~n) + 1) * (~a + ~b * (~x) ^ ~n) ^ (~p + 1) * sin(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m], ~x) && (ILtQ(~p, -1) && (IGtQ(~n, 0) && ((GtQ((~m - ~n) + 1, 0) || GtQ(~n, 2)) && RationalQ(~m))))
    @apply_utils Antiderivative((~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~p * sin(~(c') + ~(d') * ~x), ~x) => Antiderivative(ExpandIntegrand(sin(~c + ~d * ~x), (~x) ^ ~m * (~a + ~b * (~x) ^ ~n) ^ ~p, ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m], ~x) && (ILtQ(~p, 0) && (IGtQ(~n, 0) && ((EqQ(~n, 2) || EqQ(~p, -1)) && IntegerQ(~m))))
    @apply_utils Antiderivative((~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~p * cos(~(c') + ~(d') * ~x), ~x) => Antiderivative(ExpandIntegrand(cos(~c + ~d * ~x), (~x) ^ ~m * (~a + ~b * (~x) ^ ~n) ^ ~p, ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m], ~x) && (ILtQ(~p, 0) && (IGtQ(~n, 0) && ((EqQ(~n, 2) || EqQ(~p, -1)) && IntegerQ(~m))))
    @apply_utils Antiderivative((~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~p * sin(~(c') + ~(d') * ~x), ~x) => Antiderivative((~x) ^ (~m + ~n * ~p) * (~b + ~a * (~x) ^ -(~n)) ^ ~p * sin(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m], ~x) && (ILtQ(~p, 0) && ILtQ(~n, 0))
    @apply_utils Antiderivative((~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~p * cos(~(c') + ~(d') * ~x), ~x) => Antiderivative((~x) ^ (~m + ~n * ~p) * (~b + ~a * (~x) ^ -(~n)) ^ ~p * cos(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~m], ~x) && (ILtQ(~p, 0) && ILtQ(~n, 0))
    @apply_utils Antiderivative((~(e') * ~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~(p') * sin(~(c') + ~(d') * ~x), ~x) => Unintegrable((~e * ~x) ^ ~m * (~a + ~b * (~x) ^ ~n) ^ ~p * sin(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~m, ~n, ~p], ~x)
    @apply_utils Antiderivative((~(e') * ~x) ^ ~(m') * (~a + ~(b') * (~x) ^ ~n) ^ ~(p') * cos(~(c') + ~(d') * ~x), ~x) => Unintegrable((~e * ~x) ^ ~m * (~a + ~b * (~x) ^ ~n) ^ ~p * cos(~c + ~d * ~x), ~x) <-- FreeQ([~a, ~b, ~c, ~d, ~e, ~m, ~n, ~p], ~x)
end

ext: jl

max_stars_repo_path: src/rules/4 Trig functions/4.1 Sine/4.1.11 (e x)^m (a+b x^n)^p sin.jl


text:
using ValueOrientedRiskManagementInsurance
using Distributions
using DataFrames
using LinearAlgebra

include("S2Life_Input.jl")
include("Life_Input.jl")
#################################################################
println("Start S2Life.jl")

t_0 = 0
cap_mkt = CapMkt(deepcopy(proc_stock), deepcopy(proc_rfr))

invs_par = Array{Any}(undef, 0)
push!(invs_par, mv_total_0, allocs, λ_invest)
invs = InvPort(t_0, T, cap_mkt, invs_par...)
product = Product(rfr_price, prob_price, β, λ_price)
liab_ins =
  LiabIns(t_0, prob_be, λ_be, cost_infl_be, product, df_portfolio)
liab_other = LiabOther(t_0, df_sub_debt)
dyn = Dynamic(T, bonus_factor, quota_surp)
proj = Projection(tax_rate, tax_credit_0,
                  cap_mkt, invs, liab_ins, liab_other, dyn)
param =
  ProjParam(t_0, T, cap_mkt, invs_par,
            liab_ins, liab_other, dyn, tax_rate, tax_credit_0)

s2 = S2(param,
        eq2type,
        ds2_mkt_all,
        ds2_def_all,
        ds2_life_all,
        s2_op,
        ds2_op,
        ds2)
s2.mds[1].scr
invs.igs[:IGStock].mv

println("Initial balance sheet:")
println(proj.val_0)
println("Modified Assets      : $(round(s2.invest_mod,
                                        digits = 2))")
println("Modified Liabilities : $(round(s2.liabs_mod,
                                        digits = 2))")
println("Risk Margin          : $(round(s2.risk_margin,
                                        digits = 2))")
println("Available capital    : $(round(s2.invest_mod -
                                        s2.liabs_mod -
                                        s2.risk_margin,
                                        digits = 2))")
println("SCR:                 : $(round(s2.scr, digits = 2))")
println("SCR-Ratio            : $(round(100 *s2.scr_ratio,
                                        digits = 1))%")

println("End S2Life.jl")


text:
# by lazarusA # HIDE
# using GLMakie # HIDE
using CairoMakie, Random
CairoMakie.activate!() # HIDE
let
    Random.seed!(123)
    x = 0.001:0.05:10
    y = x.^2 .+ abs.(2*randn(length(x)))
    lines(x, y, color = :navy, figure = (resolution = (700,450),),
        axis = (xscale = log10, yscale = log10, xlabel = "x", ylabel = "y",
        xgridstyle=:dash, ygridstyle=:dash, xminorticksvisible = true,
        xminorticks = IntervalsBetween(9), yminorticksvisible = true,
        yminorticks = IntervalsBetween(9)))
    current_figure()
    save(joinpath(@__DIR__, "output", "LineLogxy.png"), current_figure(), px_per_unit = 2.0) # HIDE
end
using Pkg # HIDE
Pkg.status(["CairoMakie", "Random"]) # HIDE

max_stars_repo_name: MisterBiggs/BeautifulMakie

max_issues_repo_name: MisterBiggs/BeautifulMakie

max_forks_repo_name: MisterBiggs/BeautifulMakie


text:
if Sys.isunix()
    cd(joinpath(dirname(@__FILE__), "src", "gcvspline"))

    suffix = @static Sys.isapple() ? "dylib" : "so"
    try
       run(`make FC=ifort SUFFIX=$suffix`)
    catch
       run(`make FC=gfortran SUFFIX=$suffix`)
    end
else # windows
	warn("Windows automatic compilation of GCVSPL.F not implemented. Please see the installation page of the documentation for details.")
end

# Windows example from Dierckx.jl... Don't have windows so I can't really work on this for GCVSPL

#@windows_only begin
#    # these binaries were cross-compiled from Cygwin via the following steps:
#    # mkdir -p bin32 && mkdir -p bin64
#    # i686-w64-mingw32-gfortran -o bin32/libddierckx.dll -O3 -shared \
#    #   -static-libgfortran -static-libgcc src/ddierckx/*.f
#    # x86_64-w64-mingw32-gfortran -o bin64/libddierckx.dll -O3 -shared \
#    #   -static-libgfortran -static-libgcc src/ddierckx/*.f
#    url = "https://cache.julialang.org/https://bintray.com/artifact/download/tkelman/generic/ddierckx.7z"
#    try
#        run(`curl -LO $url`)
#    catch
#        run(`powershell -Command "(new-object net.webclient).DownloadFile(\"$url\", \"ddierckx.7z\")"`)
#    end
#    run(`7z x -y ddierckx.7z`)
#end

max_stars_repo_name: charlesll/gcvspl

max_issues_repo_name: charlesll/gcvspl

max_forks_repo_name: charlesll/gcvspl


text:
module TestUtils
    using Test, DataFrames, Statistics, StatsBase, Random
    #
    # make_unique(df::AbstractDataFrame, makeunique::Bool)
    #
    @testset "make_unique" begin
        @test DataFrames.make_unique([:x, :x, :x_1, :x2], makeunique=true) == [:x, :x_2, :x_1, :x2]
        # TODO uncomment this line after deprecation period when makeunique=false throws error
        #@test_throws ArgumentError DataFrames.make_unique([:x, :x, :x_1, :x2], makeunique=false)
        @test DataFrames.make_unique([:x, :x_1, :x2], makeunique=false) == [:x, :x_1, :x2]
    end
    #
    # repeat(df::AbstractDataFrame, count::Integer)
    #
    @testset "count" begin
        df = DataFrame(a = 1:2, b = 3:4)
        ref = DataFrame(a = repeat(1:2, 2),
                        b = repeat(3:4, 2))
        @test repeat(df, 2) == ref
        @test repeat(view(df, 1:2), 2) == ref
    end
    #
    # repeat(df::AbstractDataFrame; inner::Integer = 1, outer::Integer = 1)
    #
    @testset "inner_outer" begin
        df = DataFrame(a = 1:2, b = 3:4)
        ref = DataFrame(a = repeat(1:2, inner = 2, outer = 3),
                        b = repeat(3:4, inner = 2, outer = 3))
        @test repeat(df, inner = 2, outer = 3) == ref
        @test repeat(view(df, 1:2), inner = 2, outer = 3) == ref
    end
end


text:
import StatsBase

function bootstrap_samples_ids(train_x::PlainXData, n_samples::Int
                               #, rand_gen::AbstractRNG
                               )
    n_instances = num_examples(train_x)
    ids = 1:n_instances
    return [StatsBase.sample(
        #rand_gen,
        ids, n_instances, replace=true) for i in 1:n_samples]
end

function train_bagging(# pcs::Vector{<:ProbΔ},
                        train_x::XBatches{Bool},
                        n_components::Int64;
                        init_models=nothing,
                        mixture_weights,
                        learn_base_estimator,
                        base_estimator_params,
                        logs)

    @assert length(logs) == n_components "Dimension not match in train bagging."
    # bootstrapping samples
    bagging_samples = init_bagging_samples(train_x, n_components)

    # weights
    weights = nothing
    if mixture_weights == "uniform"
        weights = ones(Float64, n_components) ./ n_components
    else
        throw(DomainError(mixture_weights, "Unrecognized mixture weight mode"))
    end

    if issomething(init_models)
        @assert length(init_models) == n_components "Dimension not match in train bagging."
        for i in 1 : n_components
            learn_base_estimator(bagging_samples[i], init_models[i]; log=logs[i], base_estimator_params...)
        end

    else
        for i in 1 : n_components
            learn_base_estimator(bagging_samples[i]; log=logs[i], base_estimator_params...)
        end
    end
end

function init_bagging_samples(train_x::XBatches{Bool}, num_bags::Int64)::Vector{XBatches{Bool}}
    batch_size = max_batch_size(train_x)

    unbatched = unbatch(train_x)
    m = feature_matrix(unbatched)
    bagging_samples = Vector{XBatches{Bool}}()

    bootstrapped_ids = bootstrap_samples_ids(unbatched, num_bags)

    for i in 1 : num_bags
        new_examples = PlainXData(m[bootstrapped_ids[i], :])
        push!(bagging_samples, batch(new_examples, batch_size))
    end
    bagging_samples
end


text:
function pauliX(vec::Int, pos::Int64)
    mask = 1<<(pos-1)
    return 1, xor(vec-1, mask)+1
end
function pauliY(vec::Int64, pos::Int64)
    mask = 1<<(pos-1)
    if ((vec-1) & mask) == 0
        sign = -1im
    else
        sign = 1im
    end
    return sign, xor(vec-1,mask)+1
end
function pauliZ(vec::Int64, pos::Int64)
    mask = 1<<(pos-1)
    if  ((vec-1) & mask) == 0
        sign = -1
    else
        sign = 1
    end
    return sign, vec
end

const pauli = [pauliX,pauliY,pauliZ]

function changeBit(vector::Int64, spin::Int64)
    v = vector - 1
    s = spin - 1
    return xor(v,(1<<s))+1
end
function invert(vector::Int64, spin1::Int64, spin2::Int64)
    v = vector - 1
    s1 = spin1 - 1
    s2 = spin2 - 1
    return xor(v,((1<<s1) + (1<<s2)))+1
end
function getSign(vector::Int64, spin1::Int64, spin2::Int64)
    v = vector - 1
    s1 = spin1 - 1
    s2 = spin2 - 1
    bit1 = (v >> s1) & 1
    bit2 = (v >> s2) & 1
    return 1 - (xor(bit1,bit2)<<1)
end


text:
# using Pkg; for p in ("Knet","ArgParse"); haskey(Pkg.installed(),p) || Pkg.add(p); end

"""

julia rnnlm-batch.jl # to use with default options on CPU
julia rnnlm-batch.jl --usegpu # to use with default options on GPU
julia rnnlm-batch.jl -h # to see all options with default values

This example implements a standard RNN language model on top of LSTM cells.
This example is originally implemented for dynet-benchmark repo.

* Benchmark repo: https://github.com/neulab/dynet-benchmark

"""
module RNNLM
using Knet, CUDA, ArgParse, Dates, Printf, Random

const SOS = "<s>"
include(Knet.dir("data","mikolovptb.jl"))
t00 = now()

function main(args=ARGS)
    s = ArgParseSettings()
    s.description = "RNN Language Model in Knet"
    s.exc_handler=ArgParse.debug_handler

    @add_arg_table s begin
        ("--usegpu"; action=:store_true; help="use GPU or not")
        ("--batchsize"; arg_type=Int; help="minibatch_size"; default=64)
        ("--embed"; arg_type=Int; help="word embedding size"; default=256)
        ("--hidden"; arg_type=Int; help="lstm hidden size"; default=128)
        ("--sparse"; arg_type=Int; help="sparse update 0/1"; default=0)
        ("--timeout"; arg_type=Int; default=600; help="max timeout (in seconds)")
        ("--epochs"; arg_type=Int; default=100; help="number of training epochs")
        ("--seed"; arg_type=Int; default=-1; help="random seed")
    end

    isa(args, AbstractString) && (args=split(args))
    o = parse_args(args, s; as_symbols=true)
    o[:seed] > 0 && Knet.setseed(o[:seed])
    atype = o[:usegpu] ? KnetArray{Float32} : Array{Float32}
    datadir = abspath(joinpath(@__DIR__, "../data/text"))

    trn = dev = nothing; vocabsize = 0;
    if isdir(datadir)
        w2i = Dict()
        trnfile = abspath(joinpath(datadir, "train.txt"))
        devfile = abspath(joinpath(datadir, "dev.txt"))
        trn = read_data(trnfile, w2i)
        dev = read_data(devfile, w2i)
        vocabsize = length(w2i)+1
    else
        trn, dev, _, i2w = mikolovptb()
        vocabsize = length(i2w)+1
        sort!(trn, by=length, rev=true)
        sort!(dev, by=length, rev=true)
    end
    trn, dev = map(s->make_batches(s, vocabsize, o[:batchsize]), [trn, dev])

    # build model
    w,srnn = initweights(atype, o[:hidden], vocabsize, o[:embed], o[:usegpu])
    opt = optimizers(w, Adam)

    # train language model
    println("startup time: ", Int((now()-t00).value)*0.001); flush(stdout)
    t0 = now()
    all_time = dev_time = all_tagged = this_words = this_loss = 0
    o[:timeout] = o[:timeout] <= 0 ? Inf : o[:timeout]
    for epoch = 1:o[:epochs]
        shuffle!(trn)
        for k = 1:length(trn)
            iter = (epoch-1)*length(trn) + k
            if iter % div(500, o[:batchsize]) == 0
                @printf("%f\n", this_loss/this_words); flush(stdout)
                all_tagged += this_words
                this_loss = this_words = 0
                all_time = Int((now()-t0).value)*0.001
            end

            if iter % div(10000, o[:batchsize]) == 0
                dev_start = now()
                dev_loss = dev_words = 0
                for i = 1:length(dev)
                    x, y, nwords = dev[i]
                    dev_loss += loss(w,x,y,srnn)*nwords
                    dev_words += nwords
                end
                dev_time += Int((now()-dev_start).value)*0.001
                train_time = Int((now()-t0).value)*0.001-dev_time

                @printf(
                    "nll=%.4f, ppl=%.4f, words=%d, time=%.4f, word_per_sec=%.4f\n",
                    dev_loss/dev_words, exp(dev_loss/dev_words), dev_words,
                    train_time, all_tagged/train_time); flush(stdout)

                if all_time > o[:timeout]
                    return
                end
            end

            # train on minibatch
            x, y, batch_words = trn[k]
            batch_loss = train!(w,x,y,opt,srnn)
            this_loss += batch_loss*batch_words
            this_words += batch_words
        end
        @printf("epoch %d finished\n", epoch-1); flush(stdout)
    end
end

# build vocabulary, training and test data
function read_data(file, w2i)
    get_tokens(line) = split(line, " ")[2:end-1]
    data = open(file, "r") do f
        data = []
        for ln in readlines(f)
            words = get_tokens(ln)
            senvec = []
            for word in words
                if !haskey(w2i, word)
                    w2i[word] = length(w2i)+1
                end
                push!(senvec, w2i[word])
            end
            push!(data, senvec)
        end
        data
    end
    sort!(data, by=length, rev=true)
end

# make minibatches
function make_batches(data, vocabsize, batchsize)
    batches = []
    for k = 1:batchsize:length(data)
        samples = data[k:min(k+batchsize-1, length(data))]
        lengths = map(length, samples)
        longest = reduce(max, lengths)
        nwords = sum(lengths)
        nsamples = length(samples)
        pad = vocabsize
        seq = pad*ones(nsamples,longest+1)
        for i = 1:nsamples
            for t = 1:length(samples[i])
                seq[i,t] = samples[i][t]
            end
        end
        x = seq[:,1:end-1]
        x = convert(Array{Int64}, x)
        y = seq[:,2:end]
        y = convert(Array{Int64}, y)
        push!(batches, (x, y, nwords))
    end
    return batches
end

# initialize all weights of the language model
# w[1:2] => weight/bias params for LSTM network
# w[3:4] => weight/bias params for softmax layer
# w[5]   => word embeddings
function initweights(atype, hidden, vocab, embed, usegpu, winit=0.01)
    w = Array{Any}(undef,4)
    input = embed

    # rnn
    # w[1] = winit*randn(4*hidden, hidden+input)
    # w[2] = zeros(4*hidden, 1)
    # w[2][1:hidden] = 1 # forget gate bias
    srnn,wrnn = rnninit(input,hidden; usegpu=usegpu)
    w[1] = wrnn

    # softmax
    w[2] = convert(atype, winit*randn(vocab+1, hidden))
    w[3] = convert(atype, zeros(vocab+1, 1))

    # embed
    w[4] = convert(atype, winit*randn(embed, vocab+1))
    return w, srnn
end

function predict(ws,xs,srnn,hx=nothing,cx=nothing)
    wx = ws[4]; r = srnn; wr = ws[1]; wy = ws[2]; by = ws[3]
    x = wx[:,xs]
    y, hy, cy = rnnforw(r,wr,x,hx,cx)
    y2 = reshape(y,size(y,1),size(y,2)*size(y,3))
    return wy*y2.+by, hy, cy
end

function loss(w,x,y,srnn,h=nothing,c=nothing)
    py,hy,cy = predict(w,x,srnn,h,c)
    return nll(py,y; average=true)
end

lossgradient = gradloss(loss)

function train!(w,x,y,opt,srnn,h=nothing,c=nothing)
    gloss,lossval = lossgradient(w,x,y,srnn,h,c)
    update!(w, gloss, opt)
    return lossval
end

splitdir(PROGRAM_FILE)[end] == "rnnlm-batch.jl" && main(ARGS)
end # module


text:
module FIX

using DataStructures
using Dates
using DandelionWebSockets
using Printf

import Base: length, collect, close, parse, join

global const TAGS_INT_STRING = Dict{Int64, String}()
global const TAGS_STRING_INT = Dict{String, Int64}()

include("parse.jl")
include("management.jl")

abstract type MessageHandler<:DandelionWebSockets.WebSocketHandler end

export TAGS_INT_STRING, TAGS_STRING_INT

export MessageHandler, Client, send_message, start, close, checksum, join

export on_message

function on_message(fix::MessageHandler, x::Any)
    T = typeof(fix)
    X = typeof(x)
    throw(ErrorException("Method `on_message` is not implemented by $T for argument type $X"))
end

function __init__()
    global TAGS_INT_STRING
    global TAGS_STRING_INT

    fid = open(joinpath(@__DIR__, "../data/tags.csv"), "r");
    line_number = 0
    while !eof(fid)
        line_number += 1
        line = readline(fid)
        data = split(line, ",")

        if length(data) ≠ 2
            close(fid)
            throw(ErrorException("Invalid data in `etc/tags.csv` file on line $line_number: $line"))
        end

        tag = parse(Int64, String(data[1]))
        val = String(data[2])

        TAGS_INT_STRING[tag] = val
        TAGS_STRING_INT[val] = tag
    end
    close(fid)

    return nothing
end

mutable struct ClientTasks
    read::Union{Task, Nothing}
    function ClientTasks()
        return new(Union{Task, Nothing}())
    end
end

struct Client{T<:IO, H<:MessageHandler}
    stream::T
    handler::H
    delimiter::Char
    m_head::Dict{Int64, String}
    m_tasks::ClientTasks
    m_messages::MessageManagement
    m_lock::ReentrantLock
    m_intmap::Dict{Int64, String}

    function Client(stream::T, handler::H, header::Dict{Int64, String},
                    ratelimit::RateLimit; delimiter::Char=Char(1)) where {T<:IO, H<:MessageHandler}
        m_intmap = Dict{Int64, String}()
        [m_intmap[id] = string(id) for id = 1:9999]
        return new{T, H}(stream, handler, delimiter, header,
                         ClientTasks(), MessageManagement(ratelimit), ReentrantLock(), m_intmap)
    end
end

checksum(fix::String)::Int64 = sum([Int(x) for x in fix]) % 256

function join(fix::OrderedDict{Int64, String}, delimiter::Char)::String
    join([string(k) * "=" * v for (k, v) in fix], delimiter) * delimiter
end

function join(fix::OrderedDict{Int64, String}, delimiter::Char, IntMap::Dict{Int64, String})::String
    join([IntMap[k] * "=" * v for (k, v) in fix], delimiter) * delimiter
end

function message(fix::Client, msg::Dict{Int64, String})::OrderedDict{Int64, String}
    ordered = OrderedDict{Int64, String}()

    ordered[8] = fix.m_head[8]
    ordered[9] = ""
    ordered[35] = msg[35]
    ordered[49] = fix.m_head[49]
    ordered[56] = fix.m_head[56]
    ordered[34] = get_next_outgoing_message_num(fix)
    ordered[52] = ""

    body_length = 0
    for (k, v) in msg
        if k ≠ 8 && k ≠ 9 && k ≠ 10
            ordered[k] = v
        end
    end

    for (k, v) in ordered
        if k ≠ 8 && k ≠ 9
            body_length += length(string(k)) + 1 + length(v) + 1
        end
    end

    ordered[9] = string(body_length)

    msg = join(ordered, fix.delimiter, fix.m_intmap)
    c = checksum(msg)
    c_str = string(c)
    while length(c_str) < 3
        c_str = '0' * c_str
    end

    ordered[10] = c_str

    return ordered
end

function send_message(fix::Client, msg::Dict{Int64, String})
    lock(fix.m_lock)
    msg = message(fix, msg)
    msg_str = join(msg, fix.delimiter, fix.m_intmap)
    write(fix.stream, msg_str)
    on_sent(fix.m_messages, msg)
    unlock(fix.m_lock)
    return (msg, msg_str)
end

function start(fix::Client)
    function f()
        @async begin
            while true
                incoming = readavailable(fix.stream)
                if isempty(incoming)
                    @printf("[%ls] Empty FIX message\n", now())
                    break
                end

                for (_, msg) in parse(incoming)
                    on_get(fix, msg)
                    on_message(fix.handler, msg)
                end
            end
            @printf("[%ls] FIX: read task done\n", now())
        end
    end

    fix.m_tasks.read = Union{Task(f()), Nothing}
    return fix.m_tasks
end

function close(fix::Client)
    close(fix.stream)
end

function on_get(fix::Client, msg::MessageDictionnary)
    on_get(fix.m_messages, msg)
end

function get_open_orders(fix::Client)::Vector{Dict{Int64, String}}
    return get_open_orders(fix.m_messages)
end

function get_next_outgoing_message_num(fix::Client)
    return get_next_outgoing_message_num(fix.m_messages)
end

function get_position(fix::Client, instrument::String)
    return get_position(fix.m_messages, instrument)
end

function get_positions(fix::Client)
    return get_positions(fix.m_messages)
end

function messages_to_send(fix::Client)
    return messages_remaining(fix.m_messages.outgoing.ratelimit, now())
end

end # module


text:
using DynamicIterators
struct Squares
end
Base.iterate(S::Squares, state=1) = (state*state, state+1)

using DynamicIterators
# Assign iterate number as key
T = TimeLift(Squares())
# Create NextKey control slot
C = attach(NextKeys, T)
# Bind iterator [1;4:2:8] to the control slot and collect
collect(bind([1; 4:2:8], C))


text:
using PolynomialFactors

## utils
@testset "Testing utils.jl" begin

    ## XXX TODO: add more tests here
end


text:
"""
SamplerState for stochastic gradient Hamiltonian Monte Carlo following

Chen, T., Fox, E., & Guestrin, C. (2014). Stochastic Gradient Hamiltonian Monte Carlo. In Proceedings of The 31st International Conference on Machine Learning (pp. 1683–1691).

Fields:

    - x: the current state
    - p: current momentum
    - t: iterations counter
    - stepsize: s.stepsize(s.t) gives the stepsize to be used in iteration s.t
    - mass: mass matrix
    - D: friction parameters
"""

type SGHMCState <: SamplerState
    x::Array{Float64}
    p::Array{Float64}

    t::Int64
    stepsize::Function
    mass::Array{Float64,1}
    D::Array{Float64,1}
    """
    Constructs an SGHMCState given an initial state, a momentum and a fixed stepsize
    """
    function SGHMCState(x::Array{Float64,1}, p::Array{Float64,1}, stepsize::Float64;  mass=ones(length(x)), D=[1.])
    # momentum, mass and state need to have the same size.
    @assert size(x) == size(p)
    @assert size(mass) == size(x)
    # D matrix should be scalar or have the same size as x
    @assert size(x) == size(D) || length(D) == 1

    # stepsize is used as a function
    s(niters) = stepsize
    new(x,p,0,s,mass,D)
    end
    """
    Constructs an SGHMCState given an initial state and a fixed stepsize
    """
    function SGHMCState(x::Array{Float64,1}, stepsize::Float64;  mass=ones(length(x)), D=[1.])
    # mass and
    @assert size(mass) == size(x)
    # D matrix should be scalar or have the same size as x
    @assert size(x) == size(D) || length(D) == 1
    #stepsize is used as a function
    s(niters) = stepsize
    new(x,sqrt(mass).*randn(length(x)),0,s,mass,D)
    end
    """
    Constructs an SGHMCState given an initial state, a momentum and a stepsize function
    """
    function SGHMCState(x::Array{Float64,1}, p::Array{Float64,1}, stepsize::Function;  mass=ones(length(x)), D=[1.])
    # momentum, mass and state need to have the same size.
    @assert size(x) == size(p)
    @assert size(mass) == size(x)
    # D matrix should be scalar or have the same size as x
    @assert size(x) == size(D) || length(D) == 1

    new(x,p,0,stepsize,mass,D)
    end
    """
    Constructs an SGHMCState given an initial state and a stepsize function
    """
    function SGHMCState(x::Array{Float64,1}, stepsize::Function;  mass=ones(length(x)), D=[1.])
    # mass and
    @assert size(mass) == size(x)
    # D matrix should be scalar or have the same size as x
    @assert size(x) == size(D) || length(D) == 1
    #stepsize is used as a function
    new(x,sqrt(mass).*randn(length(x)),0,stepsize,mass,D)
    end
end

"""
sample! performs one SGHMC update and returns the updated SGHMCState.
"""
function sample!(s::SGHMCState, grad)
    #increase iteration counter
    s.t += 1

    # improve readability
    x = s.x
    p = s.p
    D = s.D
    t = s.t
    stepsize = s.stepsize(t)
    m = s.mass

    # inplace updates
    add_inplace!(stepsize,-D.*p./m,p)
    add_inplace!(stepsize,grad(x),p)
    add_inplace!(sqrt(2*stepsize),sqrt(D).*randn(length(x)),p)
    add_inplace!(stepsize,p ./ m,x)
    s
end