PartyPlanner; chain.json

This commit is contained in:
tim
2025-09-20 16:04:31 -04:00
parent 9fe0179e6a
commit 10d432070d
12 changed files with 1133 additions and 317 deletions

View File

@@ -183,9 +183,6 @@ library LMSRStabilizedBalancedPair {
// Now compute a two-tier approximation using Horner-style evaluation to reduce mul/divs.
// Primary tier (cheap quadratic): accurate for small u = a/b.
// Secondary tier (cubic correction): used when u is moderate but still within U_MAX.
int128 one = ONE;
int128 HALF = ABDKMath64x64.divu(1, 2); // 0.5
int128 THIRD = ABDKMath64x64.divu(1, 3); // ~0.333...
// Precomputed thresholds
int128 U_TIER1 = ABDKMath64x64.divu(1, 10); // 0.1 -> cheap quadratic tier
@@ -194,7 +191,7 @@ library LMSRStabilizedBalancedPair {
// u is already computed above
// Compute X = u*(1 + delta) - u^2/2
int128 u2 = u.mul(u);
int128 X = u.mul(one.add(delta)).sub(u2.div(ABDKMath64x64.fromUInt(2)));
int128 X = u.mul(ONE.add(delta)).sub(u2.div(ABDKMath64x64.fromUInt(2)));
// Compute X^2 once
int128 X2 = X.mul(X);