Skip to content

Fix LogCauchy quantile overflow/underflow in exp() step #1396

Description

@synesenom

Goal

As a user, calling .q(p) on a LogCauchy distribution for p very close to 0 or 1 should return a finite, correct quantile value (matching cdf(q(p))p) instead of silently returning exactly 0 or Infinity long before the true answer becomes unrepresentable in float64.

Scope

src/dist/log-cauchy.js — the closed-form _q(p) implementation (LogCauchy = exp(Cauchy quantile)).

Acceptance Criteria

  • new dist.LogCauchy(0,2).q(1e-6) returns a finite nonzero value such that cdf(value) is close to 1e-6.
  • .q(0.9999) (and similarly close-to-1 p) returns a finite value rather than Infinity, consistent with the demonstrated true finite quantile pattern seen at .q(0.999).
  • Round-trip |cdf(q(p)) - p| stays within the precision-gate tolerance across the extended tail range this harness sweeps ([1e-6, 1e-1] ∪ [1-1e-1, 1-1e-6]).
  • No regression in existing LogCauchy precision-gate / test/dist-cases-continuous.js reference values.

Out of Scope

Broader closed-form quantile numerical-stability review of other log-transformed distributions — only LogCauchy is in scope here.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions