[libcxx-commits] [libcxx] [libc++][math] Mathematical Special Functions: Hermite Polynomial (PR #89982)
Mark de Wever via libcxx-commits
libcxx-commits at lists.llvm.org
Fri Apr 26 09:16:31 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 >
----------------
mordante wrote:
Correct due to C++03 compatibility we do not change spaces. Closing elements like `>>` are not allowed in C++03. There `> >` is required.
https://github.com/llvm/llvm-project/pull/89982
More information about the libcxx-commits
mailing list