defi_precision
DeFi Precision Tests (f64)
Precision validation tests for 32.32 fixed-point power and exponential functions.
Test Coverage
- Rates: 0.01% to 500% (0.0001 to 5.0) - Values: Small (1e-4) to Large (1e4)
Gas Benchmarks
Approximate L2 gas costs for f64 (32.32 fixed-point):
| Function | Typical Gas | Notes |
|---|---|---|
| exp() | ~97,000 | General exponential |
| exp2() | ~14,000 | Fast for integer exponents |
| ln() | ~51,000 | Natural logarithm |
| log2() | ~84,000 | Base-2 logarithm |
| log10() | ~87,000 | Base-10 logarithm |
| pow() | ~54,000 | Compound interest (int) |
| pow() | ~118,000 | Fractional exponent |
| sqrt() | ~39,000 | Square root |
| cbrt() | ~107,000 | Cube root (1.0 input) |
| cbrt() | ~172,000 | Cube root (general case) |
This module contains tests only - no runtime functions are exported.
Fully qualified path: cairo_fp::f64::math::defi_precision