[libcxx-commits] [PATCH] D60234: Added std::assoc_legendre and std::legendre [sf.cmath]

Andre Brand via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon May 13 07:47:23 PDT 2019


thebrandre updated this revision to Diff 199266.
thebrandre edited the summary of this revision.
thebrandre added a comment.

After a vivid discussion with myself, I went with "errno + floating-point exception".
In fact, the C11 Standard has a clear definition of a domain error in 7.12.1.
I added cmath.cpp with a definition of a function that sets the domain error as specified (similar to the comment above, just minus the bugs). It is not inline to avoid an include of cfenv and cerrno.

Note: the tests on invalid arguments only check for errno because clang doesn't support the STDC FENV_ACCESS pragma.

Also some minor changes:

- Moved the tests for consistency with the latest changes in cmath (lerp).
- Simplification of the tests: now using only one set of reference values generated by boost with multiprecision floats (256bit rounded to 128bit). I am pretty optimistic that every digit is correct, so that the comparison to other implementations no longer serves any purpose.
- Rebased against current master branch.




CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60234/new/

https://reviews.llvm.org/D60234

Files:
  libcxx/include/cmath
  libcxx/src/CMakeLists.txt
  libcxx/src/cmath.cpp
  libcxx/test/std/numerics/c.math/c.math.legendre/assoc_legendre_basic.pass.cpp
  libcxx/test/std/numerics/c.math/c.math.legendre/assoc_legendre_comparisons.pass.cpp
  libcxx/test/std/numerics/c.math/c.math.legendre/assoc_legendre_exceptions.pass.cpp
  libcxx/test/std/numerics/c.math/c.math.legendre/legendre_basic.pass.cpp
  libcxx/test/std/numerics/c.math/c.math.legendre/legendre_comparisons.pass.cpp
  libcxx/test/std/numerics/c.math/c.math.legendre/legendre_exceptions.pass.cpp
  libcxx/test/std/numerics/c.math/cmath.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60234.199266.patch
Type: text/x-patch
Size: 53924 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190513/b94ba7f7/attachment-0001.bin>


More information about the libcxx-commits mailing list