error_budget_with_target

Function error_budget_with_target 

Source
pub fn error_budget_with_target(
    base: &ResolvedSolveRequestV1,
    sources: &[(InputAxis, f64)],
    ranges_m: &[f64],
    target: Option<TargetGeometryV1>,
) -> Result<ErrorBudgetReportV1, KernelError>
Expand description

As error_budget, but additionally reports hit probability over target when it is Some: each row’s ErrorBudgetRowV1::p_hit, and each of its sources’ SourceContributionV1::p_hit_gain_if_perfect – the hit-probability gain if that source alone were measured perfectly, the value-of-information number this ticket exists to answer. error_budget is a thin wrapper passing None. Validation, ranking, unavailable-source handling, and cost are otherwise IDENTICAL to error_budget and documented on it and this module’s top-level doc comment; this doc comment covers only what target adds.

§Hit probability

When target is Some, each row’s p_hit is p_hit_bivariate evaluated at that row’s own impact covariance (sigma_drop_m, sigma_windage_m, covariance_m2 – the same numbers the row already reports, not a separately recomputed covariance). Each source’s p_hit_gain_if_perfect is the SAME row’s p_hit if that one source’s sigma were zero instead (every other declared source unchanged) minus the row’s actual p_hit, clamped to >= 0.0 after a debug_assert! that the unclamped value is not more than a small tolerance below zero – see SourceContributionV1::p_hit_gain_if_perfect’s own doc for why a systematically negative raw value must fail loudly rather than be silently clamped away. ErrorBudgetReportV1::method gains a "_gl20_panelled_pm6sigma" suffix and ErrorBudgetReportV1::assumptions gains one more entry naming the quadrature and the target-centred-on-aim-point assumption – see the_report_names_the_quadrature_and_the_aim_point_assumption_only_when_a_target_is_supplied in this module’s tests.