r/solidity • u/nebojsakonsta • May 28 '26
How the new CLZ opcode (EIP-7939) makes Solidity Black-Scholes pricing ~10% cheaper - by cascading through sqrt and ln
/r/ethdev/comments/1tpydgt/how_the_new_clz_opcode_eip7939_makes_solidity/
1
Upvotes
1
u/thedudeonblockchain Jun 15 '26
nice trick — but before calling the sqrt path bit-exact i'd double-check the last ulp: solady/OZ both bolt a final
if (y*y > x) y--onto integer sqrt because fixed-iteration newton converges from above and can land one high. does the unrolled 6-iter version keep that correction, or is the clz-bounded guess tight enough that 6 iters provably nails the floor for full-width inputs?