bench: capture T0 baseline; expose pi/tau accessors; fix div panic
- Promotes Gaussian::pi and Gaussian::tau to public so benches/gaussian.rs compiles, then captures baseline numbers for the T0 acceptance gate. - Fixes the divide bench: g1/g2 panicked (g1 has lower precision than g2; cavity requires pi_num >= pi_den). Swapped to g2/g1 (well-defined). Baseline on Apple M5 Pro: Batch::iteration 29.840 µs Gaussian::mul 1.568 ns (vs ~220 ps for add/sub — hot path) Gaussian::div 1.572 ns
This commit is contained in:
@@ -13,7 +13,7 @@ impl Gaussian {
|
||||
Gaussian { mu, sigma }
|
||||
}
|
||||
|
||||
fn pi(&self) -> f64 {
|
||||
pub fn pi(&self) -> f64 {
|
||||
if self.sigma > 0.0 {
|
||||
self.sigma.powi(-2)
|
||||
} else {
|
||||
@@ -21,7 +21,7 @@ impl Gaussian {
|
||||
}
|
||||
}
|
||||
|
||||
fn tau(&self) -> f64 {
|
||||
pub fn tau(&self) -> f64 {
|
||||
if self.sigma > 0.0 {
|
||||
self.mu * self.pi()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user