GCC Code Coverage Report


Directory: include/polyfloat/
File: include/polyfloat/module/math/constants/four_pio_3.hpp
Date: 2026-11-09 15:28:50
Exec Total Coverage
Lines: 7 7 100.0%
Functions: 10 10 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
14 namespace plf
15 {
16 template<typename Options>
17 struct four_pio_3_t : plf::constant_callable<four_pio_3_t, eve::four_pio_3_t, Options, lower_option, upper_option>
18 {
19 16 template<typename T> POLYFLOAT_ABI static constexpr auto value(eve::as<T> const&, auto const&)
20 {
21 using u_t = eve::underlying_type_t<T>;
22
23 if constexpr (plf::dimension_v<T> == 2)
24 {
25 if constexpr (std::same_as<u_t, float>)
26 4 return plf::_::from_pair<u_t>(0x1.0c15240000000p+2, -0x1.f4a3260000000p-24);
27 else if constexpr (std::same_as<u_t, double>)
28 4 return plf::_::from_pair<u_t>(0x1.0c152382d7366p+2, -0x1.ee6913347c2a6p-52);
29 }
30 else if constexpr (plf::dimension_v<T> == 3)
31 {
32 if constexpr (std::same_as<u_t, float>)
33 4 return plf::_::from_triple<u_t>(0x1.0c15240000000p+2, -0x1.f4a3260000000p-24, -0x1.3dcd220000000p-49);
34 else if constexpr (std::same_as<u_t, double>)
35 4 return plf::_::from_triple<u_t>(0x1.0c152382d7366p+2, -0x1.ee6913347c2a6p-52, -0x1.4bba47a9e5fd2p-108);
36 }
37 }
38
39 24 template<concepts::polyfloat_like T> POLYFLOAT_ABI constexpr T operator()(as<T> const& v) const
40 {
41 24 return POLYFLOAT_CALL(v);
42 }
43
44 POLYFLOAT_CALLABLE_OBJECT(four_pio_3_t, four_pio_3_);
45 };
46 //======================================================================================================================
47 //! @addtogroup constants
48 //! @{
49 //! @var four_pio_3
50 //! @brief return the four_pio_3 value.
51 //!
52 //! @groupheader{Header file}
53 //!
54 //! @code
55 //! #include <polyfloat/core.hpp>
56 //! @endcode
57 //!
58 //! @groupheader{Callable Signatures}
59 //!
60 //! @code
61 //! namespace polyfloat
62 //! {
63 //! template<polyfloat::concepts::polyfloat_like T> constexpr auto four_pio_3(T z) noexcept;
64 //! }
65 //! @endcode
66 //!
67 //! **Parameters**
68 //!
69 //! * `z`: Value to process.
70 //!
71 //! **Return value**
72 //!
73 //! Returns the four_pio_3 value as T.
74 //!
75 //! @groupheader{Example}
76 //!
77 //! @godbolt_todo{doc/four_pio_3.cpp}
78 //======================================================================================================================
79
80 inline constexpr auto four_pio_3 = eve::functor<four_pio_3_t>;
81 //======================================================================================================================
82 //! @}
83 //======================================================================================================================
84 }
85