Skip to content

Conversation

@blattms
Copy link
Member

@blattms blattms commented Mar 7, 2025

std::pow may throw for negative base and non-integer exponent, g++ doesn't. Here we add an explicit throw.

@blattms
Copy link
Member Author

blattms commented Mar 7, 2025

jenkins build this please

@totto82
Copy link
Member

totto82 commented Mar 10, 2025

The safeguard added here is fine. I will add a fix that make sure it never is thrown. I suggest we merge that fix first.

@totto82
Copy link
Member

totto82 commented Mar 12, 2025

jenkins build this please

Evaluation exponent = 0;
Evaluation critTemp = criticalTemperature();
Evaluation Tred = T/criticalTemperature();

Copy link
Member

Choose a reason for hiding this comment

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

Maybe use critTemp here since you just copied it.

// this is on page 1524 of the reference
Evaluation exponent = 0;
Evaluation critTemp = criticalTemperature();
Evaluation Tred = T/criticalTemperature();
Copy link
Member

Choose a reason for hiding this comment

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

critTemp is Scalar

for (int i = 0; i < 4; ++i)
exponent += a[i]*pow(1 - Tred, t[i]);
exponent += a[i]*pow(1 - T/critTemp, t[i]);
exponent *= 1.0/Tred;
Copy link
Member

Choose a reason for hiding this comment

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

why not just use Tred here?

@totto82
Copy link
Member

totto82 commented Mar 14, 2025

This can be merged when the small nitpicks have been fixed.

@blattms
Copy link
Member Author

blattms commented Apr 2, 2025

It seems to me that the solution actually goes to zero when we approach zero from the positive side. Maybe we should just use 0 values <=0?

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