Compute a^x or a^x - 1, depending on cfg.
fn proc1(comptime cfg: Config, x: f128) f128
fn proc1(comptime cfg: Config, x: f128) f128 {
// Argument reduction: x = r * 2^(j / size + m)
// with r in [-log_a(2) / 2 / size, log_a(2) / 2 / size].
//
// r computed as r_hi + r_lo to simulate higher precision.
const n = @round(x * cfg.inv_log_size);
const ni: i32 = @intFromFloat(n);
const n2 = @mod(ni, size);
const n1 = ni - n2;
const m = @divExact(n1, size);
const j: usize = @intCast(n2);
const r_hi = x - n * cfg.log_size_hi;
const r_lo = n * cfg.neg_log_size_lo;
const pr = cfg.poly(r_hi, r_lo);
return cfg.finalize(pr, j, m);
}