tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
log1p.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_LOG1P_HPP
5#define TETL_CMATH_LOG1P_HPP
6
7#include <etl/_3rd_party/gcem/gcem.hpp>
8#include <etl/_concepts/integral.hpp>
9
10namespace etl {
11
12/// \ingroup cmath
13/// @{
14
15/// Computes the natural (base e) logarithm of 1+arg. This function is
16/// more precise than the expression etl::log(1+arg) if arg is close to zero.
17/// \details https://en.cppreference.com/w/cpp/numeric/math/log1p
18[[nodiscard]] constexpr auto log1p(float v) noexcept -> float
19{
20 return etl::detail::gcem::log1p(v);
21}
22[[nodiscard]] constexpr auto log1pf(float v) noexcept -> float
23{
24 return etl::detail::gcem::log1p(v);
25}
26[[nodiscard]] constexpr auto log1p(double v) noexcept -> double
27{
28 return etl::detail::gcem::log1p(v);
29}
30[[nodiscard]] constexpr auto log1p(long double v) noexcept -> long double
31{
32 return etl::detail::gcem::log1p(v);
33}
34[[nodiscard]] constexpr auto log1pl(long double v) noexcept -> long double
35{
36 return etl::detail::gcem::log1p(v);
37}
38[[nodiscard]] constexpr auto log1p(integral auto arg) noexcept -> double
39{
40 return etl::detail::gcem::log1p(double(arg));
41}
42
43/// @}
44
45} // namespace etl
46
47#endif // TETL_CMATH_LOG1P_HPP
constexpr auto log1p(long double v) noexcept -> long double
Definition log1p.hpp:30
constexpr auto log1pf(float v) noexcept -> float
Definition log1p.hpp:22
constexpr auto log1pl(long double v) noexcept -> long double
Definition log1p.hpp:34
constexpr auto log1p(double v) noexcept -> double
Definition log1p.hpp:26
constexpr auto log1p(float v) noexcept -> float
Definition log1p.hpp:18
Definition adjacent_find.hpp:9