defi_precision
DeFi Precision Tests
Precision validation tests for power and exponential functions across DeFi-typical value ranges.
Test Coverage
- Rates: 0.01% to 500% (0.0001 to 5.0) - Values: Small (1e-8) to Large (1e8)
Gas Benchmarks
Approximate L2 gas costs for f128 (64.64 fixed-point):
| Function | Typical Gas | Notes |
|---|---|---|
| exp() | ~176,000 | General exponential |
| exp2() | ~17,500 | Fast for integer exponents |
| ln() | ~40,000 | Natural logarithm |
| log2() | ~190,000 | Base-2 logarithm |
| log10() | ~201,000 | Base-10 logarithm |
| pow() | ~75,000 | Integer exponent |
| pow() | ~362,000 | Fractional exponent |
| sqrt() | ~33,000 | Square root |
| cbrt() | ~217,000 | Cube root (1.0 input) |
| cbrt() | ~363,000 | Cube root (general case) |
This module contains tests only - no runtime functions are exported.
Fully qualified path: cairo_fp::f128::math::defi_precision