GCC Code Coverage Report


Directory: include/polyfloat/
File: include/polyfloat/module/math/expm1.hpp
Date: 2026-11-09 15:28:50
Exec Total Coverage
Lines: 5 5 100.0%
Functions: 44 44 100.0%
Branches: 0 0 -%

Line Branch Exec Source
1 //======================================================================================================================
2 /*
3 POLYFLOAT - Extended precision floating points
4 Copyright : POLYFLOAT Contributors & Maintainers
5 SPDX-License-Identifier: BSL-1.0
6 */
7 //======================================================================================================================
8 #pragma once
9
10 #include <polyfloat/details/callable.hpp>
11 #include <polyfloat/types/concepts.hpp>
12 #include <polyfloat/types/traits.hpp>
13 #include <type_traits>
14
15 namespace plf
16 {
17
18 template<typename Options>
19 struct expm1_t : plf::elementwise_callable<expm1_t, eve::expm1_t, Options, raw_option, pedantic_option>
20 {
21 258 template<concepts::polyfloat_like Z> POLYFLOAT_ABI constexpr Z operator()(Z z) const noexcept
22 {
23 258 return POLYFLOAT_CALL(z);
24 }
25
26 248 POLYFLOAT_CALLABLE_OBJECT(expm1_t, expm1_);
27 };
28 //======================================================================================================================
29 //! @addtogroup math
30 //! @{
31 //! @var expm1
32 //! @brief return the the exponential minus one value.
33 //!
34 //! @groupheader{Header file}
35 //!
36 //! @code
37 //! #include <polyfloat/core.hpp>
38 //! @endcode
39 //!
40 //! @groupheader{Callable Signatures}
41 //!
42 //! @code
43 //! namespace polyfloat
44 //! {
45 //! template<polyfloat::concepts::polyfloat_like T> constexpr auto expm1(T z) noexcept;
46 //! }
47 //! @endcode
48 //!
49 //! **Parameters**
50 //!
51 //! * `z`: Value to process.
52 //!
53 //! **Return value**
54 //!
55 //! Returns the exponential minus one value of z.
56 //!
57 //! @groupheader{Example}
58 //!
59 //! @godbolt{doc/math/expm1.cpp}
60 //======================================================================================================================
61
62 inline constexpr auto expm1 = eve::functor<expm1_t>;
63 //======================================================================================================================
64 //! @}
65 //======================================================================================================================
66 }
67
68 namespace plf::_
69 {
70
71 248 template<typename T, eve::callable_options O> constexpr auto expm1_(POLYFLOAT_DELAY(), O const&, T xx) noexcept
72 {
73 248 return plf::dec(plf::exp(xx));
74 }
75 }
76