Skip to content

Conversation

@The9Cat
Copy link
Member

@The9Cat The9Cat commented Jan 17, 2025

Summary

Previous version of the code used the minimum floating number not the minimum epsilon such that 1+epsilon != 1, which it should have used.

Fix

Use additive machine constants from C++ limits to set epsilon in Legendre functions on CPU and GPU. The assumption here is that both are use IEEE 754 standard for FP arithmetic. On the GPU side, the constant is set to float or double based on the value of cuREAL in cudaUtil.cuH.

Details

The gaff was discovered in positional quiet starts that happened to have |cos(\theta)| = 1. This resulted in inf for Legendre function derivatives owing to divide by zero rather than cancellation. This has been rechecked with the fix enabled on the same previously failing ICs.

Copy link
Member

@michael-petersen michael-petersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this; no issues on my end. Let's go ahead and merge!

@The9Cat The9Cat merged commit 6997a97 into main Feb 7, 2025
8 checks passed
@The9Cat The9Cat deleted the FixEPS branch February 7, 2025 16:12
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.

3 participants