[libcxx-commits] [libcxx] [libc++][math] Mathematical Special Functions: Hermite Polynomial (PR #89982)
Hristo Hristov via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Apr 26 07:28:53 PDT 2024
================
@@ -0,0 +1,45 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef _LIBCPP_EXPERIMENTAL_MATH
+#define _LIBCPP_EXPERIMENTAL_MATH
+
+#include <experimental/__config>
+
+#if _LIBCPP_STD_VER >= 17
+
+# include <experimental/__math/hermite.h>
+# include <type_traits> // enable_if_t, is_integral_v
+
+_LIBCPP_BEGIN_NAMESPACE_EXPERIMENTAL
+
+inline _LIBCPP_HIDE_FROM_ABI double hermite(unsigned __n, double __x) { return __libcpp_hermite(__n, __x); }
+
+inline _LIBCPP_HIDE_FROM_ABI float hermite(unsigned __n, float __x) {
+ // use double internally -- float is too prone to overflow!
+ return static_cast<float>(hermite(__n, static_cast<double>(__x)));
+}
+
+inline _LIBCPP_HIDE_FROM_ABI long double hermite(unsigned __n, long double __x) { return __libcpp_hermite(__n, __x); }
+
+inline _LIBCPP_HIDE_FROM_ABI float hermitef(unsigned __n, float __x) { return hermite(__n, __x); }
+
+inline _LIBCPP_HIDE_FROM_ABI long double hermitel(unsigned __n, long double __x) { return hermite(__n, __x); }
+
+template < class _Integer >
----------------
Zingam wrote:
```suggestion
template <class _Integer>
```
Please note that templates are untouched by the formatter but this is how you should format "modern" templates.
https://github.com/llvm/llvm-project/pull/89982
More information about the libcxx-commits
mailing list