Styxis
Company
Knowledge

Rescaling complex sqrt on Windows: a correct real part does not validate the imaginary part

Check both components when restoring scale for large complex inputs.

Approve the components separately

Check both components when restoring scale for large complex inputs. A correct real part cannot validate the entire result. Build the Truthound component reference independently of the same sqrt output, separating a small explanatory identity from the platform test at the large-input boundary. [1, 2, 3]

The path selected by the platform

NumPy #33122 reports the imaginary component remaining half-sized after rescaling large purely imaginary sqrt inputs in the Windows npymath path. The source distinguishes platforms without C99 csqrt from macOS and glibc controls. It does not establish the same path on every platform or a released correction. [1]

Fix branch and precision

Record platform, input dtype and scale, deriving component references from independent complex identities. Hold results with an out-of-policy imaginary part and compare a verified platform path. Fix the branch and reference precision, extracting real and imaginary components separately and retaining a squared residual. [1, 3]

An independent identity for 8i

The illustrative input is 8i with principal root 2+2i. Since (2+2i)^2=8i, expected imaginary component is 2. Observed 2 meets only this component condition; 1 fails. The small identity does not reproduce the large-overflow branch, which needs a separate platform test. [1, 3]

Compare component references

Truthound Core Python SDK 3.3.2 can compare prepared reference_imaginary_component and observed_imaginary_component through ColumnPairValidator with relationship="==". The operator provides an independent precision reference; operational float tolerance is separate. The SDK does not run npymath sqrt or rescaling, and one matching component does not establish branch or full-residual correctness. [1, 2, 3]

Return to the actual large-input boundary

Choose a verified complex-calculation path or safe prescaling, checking squared residual, branch and both components together. Reuse evidence for an already verified platform boundary. A control on another platform becomes an operational alternative only after its version and input scope are checked. [1, 3]

Application conditions

Fix complex branch, platform, dtype and reference precision, extracting both components separately.

Alternatives

Use a verified complex path or safe prescaling, checking the squared residual and branch together.

Limitations

  • Core compares prepared components, does not run sqrt or rescaling and cannot prove a branch or full residual from one component.

Evidence

Event checked
Subject checked
Modified