Skip to content

Replace inconsistent norm threshold with explicit zero check#326

Merged
marvinfriede merged 2 commits intofix-fp-underflowfrom
copilot/sub-pr-324
Dec 9, 2025
Merged

Replace inconsistent norm threshold with explicit zero check#326
marvinfriede merged 2 commits intofix-fp-underflowfrom
copilot/sub-pr-324

Conversation

Copy link
Copy Markdown

Copilot AI commented Dec 9, 2025

Addresses review feedback on #324 regarding the norm < 1e-7_wp threshold being inconsistent with eps_norm (~1e-154 for double precision).

After the norm inversion guard, norm is either 0.0 or an inverted value (1.0/norm). The condition norm < 1e-7_wp only catches the zero case, making it redundant.

Changes:

  • Replace norm < 1e-7_wp with norm == 0.0_wp in d4.f90 (lines 302, 320)
  • Replace norm < 1e-7_wp with norm == 0.0_wp in d4s.f90 (lines 304, 317)
! Before
if (is_exceptional(gwk) .or. norm < 1e-7_wp) then

! After
if (is_exceptional(gwk) .or. norm == 0.0_wp) then

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Address feedback on FP underflow guard implementation Replace inconsistent norm threshold with explicit zero check Dec 9, 2025
Copilot AI requested a review from marvinfriede December 9, 2025 17:40
@marvinfriede marvinfriede marked this pull request as ready for review December 9, 2025 21:51
@marvinfriede marvinfriede merged commit 5b591a3 into fix-fp-underflow Dec 9, 2025
95 of 96 checks passed
@marvinfriede marvinfriede deleted the copilot/sub-pr-324 branch December 9, 2025 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants