ducy 0.6.0

A performant analysis library for poker.
Documentation
//! The fitted Omaha starting-hand ranking model, per hand size (4, 5 or 6
//! cards). Generated from ducy.cards' fit (scripts/fit-omaha-rank.mjs,
//! src/omaha-rank-model.js); don't edit by hand.
//!
//! Each variant's score is a linear model over the hand features in
//! [`FEATURE_NAMES`](crate::games::omaha_analysis::FEATURE_NAMES), plus a term for
//! blocking the nut flush; `cutoffs[i]` is the score at the top (i / 400 *
//! 100)% of hands.
#![allow(clippy::excessive_precision, clippy::unreadable_literal)]

/// One hand size's model.
pub struct OmahaRankModel {
    /// What it was fitted to.
    pub note: &'static str,
    /// Weights, in feature order.
    pub weights: &'static [f64],
    /// Nut-flush blocking: weight, mean, sd, and the score's sd.
    pub blocker: (f64, f64, f64, f64),
    /// Scores at each 0.25% step, best first.
    pub cutoffs: &'static [f64],
}

/// PLO4.
pub const PLO4: OmahaRankModel = OmahaRankModel {
    note: "PLO4: from an earlier fit: 0.5 x raw preflop equity (3-way) + 0.5 x favorable-flop rate, favorable flops >= 0.5 vs opponents with >= 0.7, flops measured with threebet=0.15; vs re-measurement 0.843 (measurement vs measurement 0.744)",
    weights: &[
        -2.113546, 0.742878, 0.319167, 0.162559, 0.143353, 0.110306, 0.018395, 0.504359, 0.558695,
        0.612262, 1.649923, 0.166649, 0.088818, -0.05137, -0.358878, 0.484724, 0.301255, -0.010704,
        0.177742, 0.097139, -0.057316, 0.106389, 0.151654, 0.193368, -0.016878, 0.008319,
        -0.007886, -0.001938, -0.086323, -0.013393, 0.440614, -0.035673, 0.036451, 0.128301,
        0.310794, 0.24324, 0.014184, 0.267018, -0.004071, 0.025904, -0.01451, -0.071481, 0.004771,
    ],
    blocker: (0.15, 0.0316, 0.041347, 0.775141),
    cutoffs: &[
        6.08292, 4.55999, 4.26977, 4.11531, 4.01357, 3.91741, 3.79361, 3.65206, 3.46919, 3.2421,
        2.86147, 1.91398, 1.72236, 1.59148, 1.50457, 1.42158, 1.3506, 1.30624, 1.25889, 1.22435,
        1.19492, 1.15735, 1.12189, 1.08507, 1.05071, 1.02805, 1.01082, 0.98923, 0.9705, 0.95437,
        0.93298, 0.91147, 0.89414, 0.86887, 0.84863, 0.83399, 0.81659, 0.79898, 0.78601, 0.77008,
        0.76114, 0.74971, 0.73711, 0.72437, 0.71355, 0.70265, 0.6905, 0.67548, 0.66819, 0.66027,
        0.65019, 0.6414, 0.62936, 0.62291, 0.60925, 0.59653, 0.58593, 0.57521, 0.56223, 0.55032,
        0.5429, 0.53321, 0.52535, 0.5161, 0.50934, 0.50253, 0.49452, 0.48653, 0.47851, 0.47118,
        0.46692, 0.45823, 0.45171, 0.44563, 0.43954, 0.43421, 0.42914, 0.42279, 0.40964, 0.40526,
        0.39999, 0.3938, 0.38917, 0.38323, 0.37694, 0.37057, 0.36586, 0.36047, 0.35417, 0.34903,
        0.34423, 0.3388, 0.33425, 0.32753, 0.32255, 0.31664, 0.30958, 0.30677, 0.30157, 0.29424,
        0.28989, 0.2842, 0.27831, 0.27499, 0.2687, 0.26544, 0.261, 0.25448, 0.24969, 0.24567,
        0.23992, 0.23516, 0.22856, 0.2228, 0.21922, 0.21307, 0.20899, 0.20276, 0.1989, 0.19477,
        0.18972, 0.18407, 0.18149, 0.17655, 0.17202, 0.16819, 0.1631, 0.15853, 0.15515, 0.15009,
        0.14523, 0.14146, 0.13826, 0.1354, 0.13166, 0.12634, 0.12214, 0.11894, 0.11244, 0.10859,
        0.10335, 0.09674, 0.09447, 0.09054, 0.08566, 0.08147, 0.07734, 0.07041, 0.06664, 0.0627,
        0.0605, 0.05543, 0.05263, 0.04961, 0.04649, 0.04282, 0.03846, 0.03533, 0.03189, 0.02744,
        0.0245, 0.01911, 0.0161, 0.01095, 0.00712, 0.00523, 0.00125, -0.00224, -0.00814, -0.01216,
        -0.01624, -0.01965, -0.02185, -0.02661, -0.03019, -0.03412, -0.03727, -0.04031, -0.04443,
        -0.04982, -0.05387, -0.05816, -0.06351, -0.06711, -0.07198, -0.07633, -0.08063, -0.0844,
        -0.08839, -0.09164, -0.09465, -0.099, -0.10224, -0.10546, -0.10947, -0.11254, -0.11598,
        -0.11823, -0.12112, -0.12377, -0.12745, -0.12964, -0.1336, -0.13649, -0.13835, -0.14095,
        -0.14439, -0.14718, -0.15102, -0.15698, -0.16017, -0.16285, -0.1672, -0.17054, -0.17398,
        -0.17705, -0.18075, -0.18387, -0.188, -0.1919, -0.19524, -0.19929, -0.20266, -0.20624,
        -0.21094, -0.21388, -0.21783, -0.22174, -0.22514, -0.23001, -0.23561, -0.23806, -0.24173,
        -0.24594, -0.24949, -0.25292, -0.25541, -0.25767, -0.26172, -0.26562, -0.26979, -0.27427,
        -0.27815, -0.2837, -0.28731, -0.29138, -0.29454, -0.29728, -0.29949, -0.30341, -0.30633,
        -0.30785, -0.3109, -0.31309, -0.31698, -0.3198, -0.32289, -0.32671, -0.3296, -0.33287,
        -0.33611, -0.33858, -0.34143, -0.34498, -0.35075, -0.35337, -0.35874, -0.36282, -0.36731,
        -0.37133, -0.37436, -0.37687, -0.38013, -0.38373, -0.38832, -0.39209, -0.39519, -0.40087,
        -0.40446, -0.40924, -0.41351, -0.41805, -0.42145, -0.42325, -0.42637, -0.42941, -0.43236,
        -0.43594, -0.43907, -0.44143, -0.44565, -0.44979, -0.45611, -0.45972, -0.46547, -0.46879,
        -0.47304, -0.47774, -0.47938, -0.48352, -0.48651, -0.48874, -0.49204, -0.49443, -0.4978,
        -0.50337, -0.5048, -0.50944, -0.5117, -0.51433, -0.517, -0.52248, -0.52493, -0.52888,
        -0.53369, -0.53724, -0.54208, -0.54698, -0.55049, -0.55426, -0.55747, -0.56003, -0.56424,
        -0.56886, -0.57359, -0.57862, -0.58229, -0.58727, -0.59347, -0.59816, -0.60195, -0.60618,
        -0.61122, -0.61534, -0.61808, -0.62155, -0.62608, -0.63009, -0.63376, -0.63739, -0.6404,
        -0.64702, -0.65187, -0.65659, -0.66182, -0.66562, -0.67047, -0.67594, -0.67934, -0.68199,
        -0.68653, -0.69278, -0.6965, -0.70167, -0.70813, -0.71498, -0.7212, -0.7281, -0.73665,
        -0.73861, -0.74491, -0.74989, -0.75623, -0.75972, -0.76905, -0.77903, -0.78511, -0.79422,
        -0.79907, -0.80682, -0.81382, -0.81988, -0.82543, -0.83012, -0.83966, -0.84956, -0.8599,
        -0.86528, -0.87285, -0.88535, -0.89564, -0.90554, -0.91508, -0.92475, -0.93709, -0.95009,
        -0.96884, -0.98475, -1.0012, -1.01379, -1.03239, -1.05631, -1.08412, -1.10919, -1.14866,
        -1.18725, -1.23246, -1.31421, -1.4397, -1.75763, -2.86939,
    ],
};

/// PLO5.
pub const PLO5: OmahaRankModel = OmahaRankModel {
    note: "PLO5: 0.5 x 3-way equity + 0.5 x favorable flops (>= 0.55 vs opponents with >= 0.6) + 0.4 x nut rate - 0.2 x big-hand losses; vs re-measurement 0.901 (measurement vs measurement 0.850)",
    weights: &[
        -3.786083, 1.16648, 0.129585, 0.137164, 0.148449, 0.369563, -0.051279, 0.74663, 0.281425,
        0.04486, 0.560575, 0.140052, -0.03291, -0.333205, -0.464418, 0.388661, 0.213477, 0.0,
        0.933894, 0.337792, -0.142949, 0.147782, 0.209623, 0.233832, -0.06024, 0.056139, 0.031788,
        -0.000422, 0.043592, -0.015439, 0.423908, -0.103422, -0.004714, 0.317519, 0.186566, 0.0,
        0.288221, 0.226008, -0.013159, 0.108704, -0.024175, 0.075427, 0.0,
    ],
    blocker: (0.15, 0.039672, 0.046015, 1.139665),
    cutoffs: &[
        6.83167, 5.07974, 4.68795, 4.47413, 4.26677, 4.08536, 3.87715, 3.69036, 3.51587, 3.3809,
        3.22594, 3.10943, 2.99391, 2.88225, 2.78517, 2.71068, 2.61798, 2.53518, 2.44701, 2.38499,
        2.31158, 2.24891, 2.18243, 2.10924, 2.05053, 1.98958, 1.94108, 1.88973, 1.84617, 1.80971,
        1.77375, 1.74179, 1.70791, 1.68101, 1.65121, 1.6198, 1.59034, 1.56505, 1.53651, 1.51078,
        1.49036, 1.46492, 1.44041, 1.41718, 1.39496, 1.37139, 1.35174, 1.33151, 1.31168, 1.29479,
        1.27673, 1.25816, 1.24172, 1.22432, 1.2068, 1.18967, 1.17112, 1.1528, 1.1386, 1.12111,
        1.10585, 1.09142, 1.07722, 1.06128, 1.04937, 1.03447, 1.02084, 1.00867, 0.99565, 0.98127,
        0.96495, 0.95127, 0.93824, 0.92685, 0.91159, 0.9011, 0.88797, 0.87373, 0.86195, 0.85012,
        0.83964, 0.82709, 0.81525, 0.80525, 0.79427, 0.78347, 0.77151, 0.76128, 0.75053, 0.73906,
        0.72719, 0.7168, 0.70562, 0.69687, 0.68642, 0.67657, 0.66713, 0.65651, 0.64852, 0.63646,
        0.62706, 0.61762, 0.60772, 0.59881, 0.58664, 0.57627, 0.56656, 0.55761, 0.54846, 0.53738,
        0.52899, 0.52038, 0.51271, 0.5043, 0.49535, 0.48706, 0.47795, 0.46998, 0.46091, 0.45227,
        0.44471, 0.43816, 0.43045, 0.42251, 0.41397, 0.40477, 0.39486, 0.38606, 0.37716, 0.36789,
        0.35837, 0.34863, 0.34019, 0.3316, 0.32379, 0.31464, 0.30553, 0.29768, 0.28924, 0.28111,
        0.27435, 0.26862, 0.26044, 0.25377, 0.24635, 0.23893, 0.23246, 0.22629, 0.21845, 0.21058,
        0.20328, 0.19493, 0.18552, 0.17595, 0.1676, 0.15876, 0.14962, 0.14186, 0.1333, 0.12601,
        0.11798, 0.10962, 0.10094, 0.0935, 0.08684, 0.07957, 0.07184, 0.06292, 0.05534, 0.04691,
        0.04001, 0.03303, 0.02495, 0.01769, 0.01079, 0.00257, -0.00414, -0.012, -0.02148, -0.0275,
        -0.03414, -0.04159, -0.04974, -0.05587, -0.06289, -0.07109, -0.07945, -0.08538, -0.093,
        -0.10058, -0.10798, -0.11529, -0.12248, -0.13116, -0.13868, -0.14776, -0.15528, -0.1625,
        -0.16988, -0.17729, -0.18291, -0.18983, -0.19782, -0.20376, -0.2123, -0.21917, -0.22507,
        -0.23314, -0.23876, -0.24629, -0.25124, -0.25889, -0.26703, -0.27447, -0.28352, -0.29009,
        -0.2973, -0.305, -0.3114, -0.3181, -0.32384, -0.33237, -0.33998, -0.34624, -0.35334,
        -0.35971, -0.36564, -0.37245, -0.37929, -0.38583, -0.39203, -0.39878, -0.40601, -0.41272,
        -0.41979, -0.42719, -0.43338, -0.43983, -0.44601, -0.45225, -0.4602, -0.46704, -0.47505,
        -0.48152, -0.48857, -0.49598, -0.50222, -0.5098, -0.51857, -0.52634, -0.53367, -0.54106,
        -0.54726, -0.55444, -0.56028, -0.56704, -0.57313, -0.57951, -0.58506, -0.58968, -0.59626,
        -0.60278, -0.60903, -0.61504, -0.6214, -0.62803, -0.63369, -0.63962, -0.64678, -0.6534,
        -0.6611, -0.66789, -0.67314, -0.67926, -0.6855, -0.69182, -0.69908, -0.70592, -0.71419,
        -0.7212, -0.72827, -0.73535, -0.74084, -0.74827, -0.75606, -0.76219, -0.76919, -0.77539,
        -0.78217, -0.79014, -0.79556, -0.80245, -0.80794, -0.81487, -0.8218, -0.82771, -0.83376,
        -0.84018, -0.84564, -0.8522, -0.85897, -0.8663, -0.87298, -0.88, -0.88619, -0.8929,
        -0.90035, -0.90884, -0.91602, -0.9235, -0.92979, -0.93614, -0.94154, -0.94837, -0.95645,
        -0.96422, -0.97024, -0.97842, -0.98495, -0.99206, -0.99915, -1.00591, -1.01297, -1.02068,
        -1.02796, -1.03559, -1.04467, -1.05184, -1.05828, -1.0647, -1.07187, -1.07945, -1.08705,
        -1.09486, -1.10259, -1.10971, -1.11789, -1.1266, -1.13379, -1.14034, -1.14796, -1.15709,
        -1.16653, -1.17494, -1.18487, -1.19475, -1.20283, -1.21175, -1.22261, -1.23114, -1.23996,
        -1.24841, -1.25597, -1.26481, -1.27266, -1.28172, -1.29406, -1.30287, -1.30974, -1.31897,
        -1.33099, -1.34172, -1.35201, -1.36129, -1.3747, -1.38605, -1.39698, -1.40928, -1.42179,
        -1.43106, -1.44251, -1.45303, -1.46715, -1.48097, -1.49447, -1.50974, -1.52297, -1.53977,
        -1.55363, -1.56955, -1.58712, -1.60401, -1.62386, -1.64438, -1.66263, -1.68101, -1.6986,
        -1.72172, -1.74899, -1.77689, -1.81202, -1.84193, -1.87902, -1.91588, -1.99043, -2.08473,
        -2.28156, -2.64113, -2.97213, -3.26626, -4.78474,
    ],
};

/// PLO6.
pub const PLO6: OmahaRankModel = OmahaRankModel {
    note: "PLO6: 0.5 x 3-way equity + 0.5 x favorable flops (>= 0.55 vs opponents with >= 0.6) + 0.4 x nut rate - 0.2 x big-hand losses; vs re-measurement 0.915 (measurement vs measurement 0.876)",
    weights: &[
        -4.376282, 1.130713, 0.045126, 0.111037, 0.107435, 0.284659, -0.069931, 0.627637, 0.328637,
        -0.006433, 0.511486, 0.06283, 0.077466, -0.23295, -0.484737, 0.41937, 0.288772, 0.0,
        0.925791, 0.37611, -0.221158, 0.149525, 0.180795, 0.213136, -0.040184, 0.045319, 0.027174,
        0.002674, 0.101473, -0.024465, 0.260602, -0.186908, 0.023817, 0.365351, -0.106951, 0.0,
        0.345321, 0.04811, 0.044294, -0.024346, -0.028076, 0.0, 0.0,
    ],
    blocker: (0.15, 0.047438, 0.050058, 1.169106),
    cutoffs: &[
        6.90856, 4.56049, 4.20087, 3.97612, 3.78416, 3.63947, 3.51822, 3.39912, 3.3119, 3.21174,
        3.12273, 3.03516, 2.96026, 2.87546, 2.80221, 2.73223, 2.66046, 2.5918, 2.52948, 2.45969,
        2.39389, 2.33564, 2.28125, 2.22843, 2.17786, 2.1328, 2.09047, 2.04947, 2.01069, 1.96702,
        1.9304, 1.89646, 1.86358, 1.82968, 1.79678, 1.76539, 1.73121, 1.70165, 1.67357, 1.64453,
        1.62081, 1.59353, 1.56855, 1.54381, 1.5213, 1.49727, 1.47531, 1.45391, 1.43285, 1.41295,
        1.3926, 1.3721, 1.35067, 1.33097, 1.31144, 1.29297, 1.27478, 1.25794, 1.23837, 1.21994,
        1.20402, 1.18683, 1.17013, 1.15514, 1.1396, 1.12557, 1.11021, 1.09483, 1.0787, 1.06512,
        1.05169, 1.03567, 1.02076, 1.0071, 0.9945, 0.98102, 0.96946, 0.95479, 0.9426, 0.93013,
        0.91702, 0.9065, 0.89471, 0.88064, 0.86909, 0.85601, 0.84587, 0.83408, 0.8222, 0.81025,
        0.79975, 0.78939, 0.77972, 0.76879, 0.75739, 0.74785, 0.73648, 0.72497, 0.71364, 0.70373,
        0.69276, 0.68271, 0.67198, 0.66052, 0.65025, 0.64094, 0.6322, 0.62308, 0.61259, 0.60334,
        0.5942, 0.58492, 0.57574, 0.56675, 0.55703, 0.54834, 0.53683, 0.5274, 0.51856, 0.50832,
        0.49873, 0.48947, 0.47974, 0.47105, 0.46186, 0.45312, 0.44497, 0.43675, 0.42879, 0.42152,
        0.41357, 0.40485, 0.39641, 0.38689, 0.37902, 0.37107, 0.36264, 0.35467, 0.3454, 0.33643,
        0.32818, 0.31973, 0.31086, 0.30218, 0.29276, 0.28505, 0.27681, 0.26935, 0.26138, 0.25389,
        0.24699, 0.23895, 0.23063, 0.22278, 0.21575, 0.20847, 0.20137, 0.19314, 0.1848, 0.17796,
        0.17031, 0.16211, 0.15414, 0.14559, 0.13799, 0.13045, 0.12273, 0.11501, 0.10694, 0.09878,
        0.0914, 0.0846, 0.07723, 0.07047, 0.06311, 0.05568, 0.04911, 0.04193, 0.0349, 0.02811,
        0.02113, 0.01337, 0.0057, -0.00131, -0.00883, -0.01632, -0.02383, -0.03241, -0.03957,
        -0.04718, -0.05465, -0.06222, -0.06864, -0.07565, -0.08328, -0.08991, -0.0966, -0.10361,
        -0.11078, -0.11695, -0.12426, -0.13095, -0.13817, -0.14433, -0.15068, -0.15782, -0.16447,
        -0.17149, -0.17924, -0.1868, -0.19413, -0.20074, -0.20827, -0.21583, -0.22294, -0.23064,
        -0.23728, -0.24513, -0.25238, -0.25977, -0.26673, -0.27402, -0.28175, -0.28787, -0.29401,
        -0.30105, -0.30736, -0.31505, -0.32247, -0.32949, -0.33615, -0.34269, -0.34995, -0.35644,
        -0.3632, -0.37163, -0.37841, -0.3854, -0.39122, -0.39929, -0.40624, -0.41356, -0.42091,
        -0.42832, -0.43629, -0.44388, -0.45079, -0.4583, -0.46541, -0.47309, -0.48073, -0.48794,
        -0.49531, -0.50327, -0.51061, -0.5168, -0.52318, -0.53027, -0.53798, -0.54531, -0.55202,
        -0.55951, -0.567, -0.57438, -0.58081, -0.58862, -0.59574, -0.60319, -0.61006, -0.61658,
        -0.62377, -0.63134, -0.63947, -0.64733, -0.65595, -0.66426, -0.67157, -0.67933, -0.68591,
        -0.69345, -0.70071, -0.70855, -0.71534, -0.72353, -0.73182, -0.7393, -0.7459, -0.75382,
        -0.76153, -0.76971, -0.77614, -0.78309, -0.79143, -0.79992, -0.80673, -0.81392, -0.82153,
        -0.82953, -0.83785, -0.84494, -0.85205, -0.86066, -0.8684, -0.87703, -0.88568, -0.89402,
        -0.90275, -0.91124, -0.91974, -0.92798, -0.93542, -0.94333, -0.95198, -0.96057, -0.96857,
        -0.97734, -0.98546, -0.99352, -1.00182, -1.0113, -1.01967, -1.02793, -1.03641, -1.04476,
        -1.05323, -1.0619, -1.07106, -1.08105, -1.08943, -1.09812, -1.10609, -1.11679, -1.12626,
        -1.13626, -1.14591, -1.15579, -1.16506, -1.17341, -1.1835, -1.19344, -1.20436, -1.21612,
        -1.22595, -1.2357, -1.24501, -1.25524, -1.26667, -1.2775, -1.28819, -1.29861, -1.31154,
        -1.32279, -1.33299, -1.34374, -1.3554, -1.36691, -1.37804, -1.39129, -1.40385, -1.41712,
        -1.42904, -1.44173, -1.45457, -1.46881, -1.48265, -1.49623, -1.50907, -1.52277, -1.53871,
        -1.5547, -1.57084, -1.58673, -1.60318, -1.6219, -1.64141, -1.6598, -1.67713, -1.69589,
        -1.71412, -1.73639, -1.76234, -1.78615, -1.81169, -1.83642, -1.86253, -1.89205, -1.924,
        -1.96194, -2.00066, -2.04581, -2.09592, -2.1581, -2.23729, -2.33547, -2.47527, -2.65542,
        -2.84301, -3.02873, -3.24113, -3.49484, -5.12957,
    ],
};