-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!
Description
Describe the bug
The elliptic integral of second kind std::ellint_2 produces wrong result for k=1 and angles less than -pi/2 or larger than pi/2
https://godbolt.org/z/Mq9v36TWh
Command-line test case
C:\Temp>type main.cpp
#include <type_traits>
#include <iostream>
#include <cmath>
int main() {
double res = std::ellint_2(1, 6.2831853071795862);
std::cout << res << std::endl;
}
C:\Temp>cl /EHsc /W4 /WX /std:c++17 .\main.cpp
Microsoft (R) C/C++ Optimizing Compiler Version 19.34.31721 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
main.cpp
Microsoft (R) Incremental Linker Version 14.34.31721.0
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
main.obj
C:\Temp>.\main.exe
-2.44929e-16
Expected behavior
4
STL version
Microsoft Visual Studio Community 2022 Preview
Version 17.4.0 Preview 1.0
Additional context
DevCom-10133797 .
Also the issue is fixed in boost: boostorg/math#321
So probably just updating boost-math submodule will fix the issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!