MorphIQ Labs

MorphIQ Labs ·

The Boundary Is Part of the Algorithm

A numerical method needs a justified domain. The threshold that selects it deserves the same scrutiny as the formula itself.

Numerical software often uses several methods to evaluate the same quantity. A series expansion works well in one region. Another formulation handles the tails. A third avoids cancellation near a limiting case.

The formulas and the constants that choose between them belong to the same accuracy contract.

Yet a threshold makes a mathematical claim: this method remains suitable on this side of the boundary. That claim depends on approximation error, floating-point behavior, and the accuracy required by the caller.

At MorphIQ Labs, we treat those boundaries as part of the numerical method.

Qualifying an implied-volatility boundary

MorphIQ Risk's implied-volatility calculations illustrate why a switching threshold needs its own evidence. A series expansion and an alternative evaluation path each have a region where they meet the caller's accuracy requirements. Selecting between them is a numerical decision in its own right.

Qualification compares both candidate paths with an independent high-precision reference, including inputs immediately on either side of the proposed switch. The comparison establishes which choices satisfy the error budget on the cases examined and where a mathematical bound is needed to support a broader claim.

Coverage and numerical evidence serve complementary purposes: one exercises the execution paths; the other evaluates the suitability of the selected method.

Establish the reference first

A high-precision calculation is useful only if its formulation is suitable for the region being tested.

For example, evaluating a very small normal-tail probability by subtracting nearly equal quantities can lose significant digits. Increasing precision may help, but it does not remove the need to examine cancellation and numerical conditioning. A formulation based on the complementary error function can avoid that subtraction.

The reference itself needs checks: agreement as precision increases, comparison with another formulation where practical, and deliberate examination of extreme inputs.

Independence also requires more than choosing another programming language. Reimplementing the same approximation can reproduce the same error.

Measure the transition

Once the reference is credible, compare the candidate methods across the region where the implementation changes behavior.

The useful questions are specific:

  • Where does each method satisfy the required error budget?
  • What happens immediately before and after the switching point?
  • How sensitive is the result to nearby inputs?
  • What computational cost accompanies each valid choice?

This produces a defensible basis for selecting the threshold. Accuracy requirements determine which methods are acceptable; performance measurements help choose among them.

A measured sweep establishes behavior for the cases examined. A mathematical bound can establish a broader domain. The evidence should state which kind of conclusion it supports.

Make the result reproducible

Qualification leaves a reproducible numerical decision.

A threshold needs a recorded criterion, a reference calculation, and test cases that exercise the transition. Those cases establish whether a candidate choice satisfies the stated accuracy requirement.

The evidence also needs its context: the implementation revision, input domain, precision, error metric, and commands required to reproduce the comparison.

This gives future maintainers something concrete to evaluate when an approximation changes, a vectorized path is introduced, or a performance optimization moves a boundary. They can revisit the numerical decision against its original requirements—and update the evidence alongside the code.