← Back to news
v1.0.4May 11, 2026
DeFiMath v1.0.4 released - CLZ-based ln, sqrt and sqrtTime
A round of low-level optimizations on the core math primitives:
ln— rewritten using CLZ (count-leading-zeros)sqrt— rewritten using CLZsqrtTime— rewritten using CLZ
Every higher-level function that depends on these primitives — option pricing, Greeks, implied volatility — gets the gas savings transitively.
On the primitives themselves, ln dropped from 508 → 375 gas and
sqrt from 344 → 245 gas.
These rewrites are made possible by the new CLZ opcode introduced in
EIP-7939, part of the Osaka
hard fork — DeFiMath's EVM target has been bumped accordingly.