tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
lgamma.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_CMATH_LGAMMA_HPP
5#define TETL_CMATH_LGAMMA_HPP
6
7#include <etl/_3rd_party/gcem/gcem.hpp>
8#include <etl/_concepts/integral.hpp>
9
10namespace etl {
11
12/// Computes the natural logarithm of the absolute value of the gamma function of arg.
13/// \details https://en.cppreference.com/w/cpp/numeric/math/lgamma
14/// \ingroup cmath
15[[nodiscard]] constexpr auto lgamma(float arg) noexcept -> float
16{
17 return etl::detail::gcem::lgamma(arg);
18}
19
20/// Computes the natural logarithm of the absolute value of the gamma function of arg.
21/// \details https://en.cppreference.com/w/cpp/numeric/math/lgamma
22/// \ingroup cmath
23[[nodiscard]] constexpr auto lgammaf(float arg) noexcept -> float
24{
25 return etl::detail::gcem::lgamma(arg);
26}
27
28/// Computes the natural logarithm of the absolute value of the gamma function of arg.
29/// \details https://en.cppreference.com/w/cpp/numeric/math/lgamma
30/// \ingroup cmath
31[[nodiscard]] constexpr auto lgamma(double arg) noexcept -> double
32{
33 return etl::detail::gcem::lgamma(arg);
34}
35
36/// Computes the natural logarithm of the absolute value of the gamma function of arg.
37/// \details https://en.cppreference.com/w/cpp/numeric/math/lgamma
38/// \ingroup cmath
39[[nodiscard]] constexpr auto lgamma(long double arg) noexcept -> long double
40{
41 return etl::detail::gcem::lgamma(arg);
42}
43
44/// Computes the natural logarithm of the absolute value of the gamma function of arg.
45/// \details https://en.cppreference.com/w/cpp/numeric/math/lgamma
46/// \ingroup cmath
47[[nodiscard]] constexpr auto lgammal(long double arg) noexcept -> long double
48{
49 return etl::detail::gcem::lgamma(arg);
50}
51
52/// Computes the natural logarithm of the absolute value of the gamma function of arg.
53/// \details https://en.cppreference.com/w/cpp/numeric/math/lgamma
54/// \ingroup cmath
55template <integral T>
56[[nodiscard]] constexpr auto lgamma(T arg) noexcept -> double
57{
58 return etl::detail::gcem::lgamma(static_cast<double>(arg));
59}
60
61} // namespace etl
62
63#endif // TETL_CMATH_LGAMMA_HPP
constexpr auto lgamma(long double arg) noexcept -> long double
Computes the natural logarithm of the absolute value of the gamma function of arg.
Definition lgamma.hpp:39
constexpr auto lgamma(double arg) noexcept -> double
Computes the natural logarithm of the absolute value of the gamma function of arg.
Definition lgamma.hpp:31
constexpr auto lgamma(T arg) noexcept -> double
Computes the natural logarithm of the absolute value of the gamma function of arg.
Definition lgamma.hpp:56
constexpr auto lgamma(float arg) noexcept -> float
Computes the natural logarithm of the absolute value of the gamma function of arg.
Definition lgamma.hpp:15
constexpr auto lgammaf(float arg) noexcept -> float
Computes the natural logarithm of the absolute value of the gamma function of arg.
Definition lgamma.hpp:23
constexpr auto lgammal(long double arg) noexcept -> long double
Computes the natural logarithm of the absolute value of the gamma function of arg.
Definition lgamma.hpp:47
Definition adjacent_find.hpp:9