- Added constants.h

- Finished Exponential Tests
 - Fixed HTML labeling
This commit is contained in:
2025-06-30 20:01:53 -04:00
parent f38cf5fb51
commit 516d9f4977
24 changed files with 613 additions and 44 deletions

View File

@@ -106,6 +106,7 @@ add_library(fennec STATIC
include/fennec/lang/detail/__int.h include/fennec/lang/detail/__int.h
include/fennec/lang/detail/__stdlib.h include/fennec/lang/detail/__stdlib.h
include/fennec/math/detail/__matrix.h include/fennec/math/detail/__matrix.h
include/fennec/math/ext/constants.h
) )
# add metaprogramming templates as a dependency and also force documentation to be generated when fennec is compiled # add metaprogramming templates as a dependency and also force documentation to be generated when fennec is compiled

View File

@@ -41,7 +41,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_lang_bits"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_bits">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::bit_cast "ToT bit_cast(const FromT& x)" /// \ref fennec::bit_cast "ToT bit_cast(const FromT& x)"
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">

View File

@@ -43,7 +43,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_lang_conditional_types"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_conditional_types">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::conditional "typename conditional<bool_t B, TrueT, FalseT>::type"<br> /// \ref fennec::conditional "typename conditional<bool_t B, TrueT, FalseT>::type"<br>
/// \ref fennec::conditional_t "conditional_t<bool_t B, TrueT, FalseT>" /// \ref fennec::conditional_t "conditional_t<bool_t B, TrueT, FalseT>"

View File

@@ -43,7 +43,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_lang_constants"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_constants">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::integral_constant "integral_constant<IntT, IntT ValueV>::type"<br> /// \ref fennec::integral_constant "integral_constant<IntT, IntT ValueV>::type"<br>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">

View File

@@ -39,7 +39,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_lang_intrinsics"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_intrinsics">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// `FENNEC_HAS_BUILTIN_BIT_CAST` <br> /// `FENNEC_HAS_BUILTIN_BIT_CAST` <br>
/// `Y FENNEC_BUILTIN_BIT_CAST(X)` /// `Y FENNEC_BUILTIN_BIT_CAST(X)`

View File

@@ -45,9 +45,7 @@
/// <table width="100%" class="fieldtable" id="table_fennec_lang_limits"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_limits">
/// <tr><th style="vertical-align: top">Member /// <tr><th style="vertical-align: top">Member
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><th colspan=2 style="text-align: center;">Traits /// <tr><th colspan=2 style="text-align: center;">Traits
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// <tt>\ref fennec::numeric_limits::is_specialized "is_specialized"</tt> /// <tt>\ref fennec::numeric_limits::is_specialized "is_specialized"</tt>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">
@@ -109,7 +107,6 @@
/// \copybrief fennec::numeric_limits::traps /// \copybrief fennec::numeric_limits::traps
/// ///
/// <tr><th colspan=2 style="text-align: center;">Binary /// <tr><th colspan=2 style="text-align: center;">Binary
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// <tt>\ref fennec::numeric_limits::radix "radix"</tt> /// <tt>\ref fennec::numeric_limits::radix "radix"</tt>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">
@@ -151,7 +148,6 @@
/// \copybrief fennec::numeric_limits::max_exponent10 /// \copybrief fennec::numeric_limits::max_exponent10
/// ///
/// <tr><th colspan=2 style="text-align: center;">Limits /// <tr><th colspan=2 style="text-align: center;">Limits
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// <tt>\ref fennec::numeric_limits::min "min()"</tt> /// <tt>\ref fennec::numeric_limits::min "min()"</tt>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">

View File

@@ -40,7 +40,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_lang_numeric_transforms"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_numeric_transforms">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::make_signed "typename make_signed<TypeT>::type"<br> /// \ref fennec::make_signed "typename make_signed<TypeT>::type"<br>
/// \ref fennec::make_signed_t "make_signed_t<TypeT>" /// \ref fennec::make_signed_t "make_signed_t<TypeT>"

View File

@@ -38,7 +38,7 @@
/// ///
/// \code #include <fennec/lang/sequences.h> \endcode /// \code #include <fennec/lang/sequences.h> \endcode
/// ///
/// <table width="100%" class="fieldtable" id="table_fennec_lang_constants"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_sequences">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
/// ///

View File

@@ -38,10 +38,9 @@
/// ///
/// \code #include <fennec/lang/type_sequences.h> \endcode /// \code #include <fennec/lang/type_sequences.h> \endcode
/// ///
/// <table width="100%" class="fieldtable" id="table_fennec_lang_constants"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_type_sequences">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::first_element "typename first_element<ValueT, Values...>::type"<br> /// \ref fennec::first_element "typename first_element<ValueT, Values...>::type"<br>
/// \ref fennec::first_element_t "first_element_t<ValueT, Values...>" /// \ref fennec::first_element_t "first_element_t<ValueT, Values...>"
@@ -52,7 +51,6 @@
/// \ref fennec::replace_first_element "typename replace_first_element<ClassT, SubT, OriginT, RestT...>::type"<br> /// \ref fennec::replace_first_element "typename replace_first_element<ClassT, SubT, OriginT, RestT...>::type"<br>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">
/// \copydoc fennec::replace_first_element /// \copydoc fennec::replace_first_element
///
/// </table> /// </table>
/// ///

View File

@@ -40,10 +40,9 @@
/// \code #include <fennec/lang/type_traits.h> \endcode /// \code #include <fennec/lang/type_traits.h> \endcode
/// ///
/// ///
/// <table width="100%" class="fieldtable" id="table_fennec_lang_constants"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_type_traits">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::is_void "is_void<TypeT>::value"<br> /// \ref fennec::is_void "is_void<TypeT>::value"<br>
/// \ref fennec::is_void_v "is_void_v<TypeT>" /// \ref fennec::is_void_v "is_void_v<TypeT>"

View File

@@ -40,10 +40,9 @@
/// \code #include <fennec/lang/type_transforms.h> \endcode /// \code #include <fennec/lang/type_transforms.h> \endcode
/// ///
/// ///
/// <table width="100%" class="fieldtable" id="table_fennec_lang_constants"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_type_transforms">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::type_transform "type_transform<TypeT>::type"<br> /// \ref fennec::type_transform "type_transform<TypeT>::type"<br>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">

View File

@@ -39,9 +39,7 @@
/// <table width="100%" class="fieldtable" id="table_fennec_lang_types"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_types">
/// <tr><th style="vertical-align: top">Type /// <tr><th style="vertical-align: top">Type
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><th colspan=2 style="text-align: center;">Basic Types /// <tr><th colspan=2 style="text-align: center;">Basic Types
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// <tt>\ref fennec::bool_t "bool_t"</tt> /// <tt>\ref fennec::bool_t "bool_t"</tt>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">
@@ -113,7 +111,6 @@
/// \copybrief fennec::double_t /// \copybrief fennec::double_t
/// ///
/// <tr><th colspan=2 style="text-align: center;">Sized Arithmetic Types /// <tr><th colspan=2 style="text-align: center;">Sized Arithmetic Types
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// <tt>\ref fennec::int8_t "int8_t"</tt> /// <tt>\ref fennec::int8_t "int8_t"</tt>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">
@@ -168,8 +165,6 @@
/// ///
/// ///
/// <tr><th colspan=2 style="text-align: center;">Special Types /// <tr><th colspan=2 style="text-align: center;">Special Types
///
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// <tt>\ref fennec::nullptr_t "nullptr_t"</tt> /// <tt>\ref fennec::nullptr_t "nullptr_t"</tt>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">

View File

@@ -38,10 +38,9 @@
/// ///
/// \code #include <fennec/lang/utility.h> \endcode /// \code #include <fennec/lang/utility.h> \endcode
/// ///
/// <table width="100%" class="fieldtable" id="table_fennec_lang_constants"> /// <table width="100%" class="fieldtable" id="table_fennec_lang_utility">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::forward "T&& forward(x)"<br> /// \ref fennec::forward "T&& forward(x)"<br>
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">

View File

@@ -49,7 +49,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_common_sign_functions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_common_sign_functions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::abs(fennec::genType) "genIType abs(genIType x)" <br> /// \ref fennec::abs(fennec::genType) "genIType abs(genIType x)" <br>
/// \ref fennec::abs(fennec::genType) "genFType abs(genFType x)" <br> /// \ref fennec::abs(fennec::genType) "genFType abs(genFType x)" <br>
@@ -73,7 +72,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_common_rounding_functions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_common_rounding_functions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::floor(fennec::genType) "genFType floor(genFType x)" <br> /// \ref fennec::floor(fennec::genType) "genFType floor(genFType x)" <br>
/// \ref fennec::floor(fennec::genType) "genDType floor(genDType x)" /// \ref fennec::floor(fennec::genType) "genDType floor(genDType x)"
@@ -116,7 +114,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_common_decimal_functions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_common_decimal_functions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::fract(fennec::genType) "genFType fract(genFType x)" <br> /// \ref fennec::fract(fennec::genType) "genFType fract(genFType x)" <br>
/// \ref fennec::fract(fennec::genType) "genDType fract(genDType x)" /// \ref fennec::fract(fennec::genType) "genDType fract(genDType x)"
@@ -169,7 +166,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_common_bit_conversions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_common_bit_conversions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::floatBitsToInt(fennec::genType) "genIType floatBitsToInt(genType value)" <br> /// \ref fennec::floatBitsToInt(fennec::genType) "genIType floatBitsToInt(genType value)" <br>
/// \ref fennec::floatBitsToUint(fennec::genType) "genUType floatBitsToUint(genType value)" /// \ref fennec::floatBitsToUint(fennec::genType) "genUType floatBitsToUint(genType value)"
@@ -235,7 +231,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_curve_functions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_curve_functions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::step "step(float edge, genFType x)" <br> /// \ref fennec::step "step(float edge, genFType x)" <br>
/// \ref fennec::step "step(genFType edge, genFType x)" <br> /// \ref fennec::step "step(genFType edge, genFType x)" <br>
@@ -324,7 +319,7 @@ constexpr vector<genType, i...> abs(const vector<genType, i...>& x)
/// \param x input value /// \param x input value
template<typename genType> template<typename genType>
constexpr genType sign(genType x) constexpr genType sign(genType x)
{ return (x < 0 ? -1 : 1) * static_cast<genType>(x != 0); } { return (x < genType(0) ? genType(-1) : genType(1)) * static_cast<genType>(x != 0); } // reduces to cmove
// Vector Specializations ---------------------------------------------------------------------------------------------- // Vector Specializations ----------------------------------------------------------------------------------------------
@@ -869,7 +864,7 @@ constexpr vector<genType, i...> clamp(const vector<genType, i...>& x, const vect
/// \param x The coordinate of the sample location /// \param x The coordinate of the sample location
template<typename genType> requires(is_floating_point_v<genType>) template<typename genType> requires(is_floating_point_v<genType>)
constexpr genType step(genType edge, genType x) constexpr genType step(genType edge, genType x)
{ return x < edge ? 0.0 : 1.0; } { return static_cast<genType>(not(x < edge)); }
// Vector Specializations ---------------------------------------------------------------------------------------------- // Vector Specializations ----------------------------------------------------------------------------------------------

View File

@@ -114,7 +114,7 @@ constexpr matrix<scalar, rows, cols...> inverse(const matrix<scalar, rows, cols.
// Should check for 0 determinant // Should check for 0 determinant
scalar invdet = (s0 * c5 - s1 * c4 + s2 * c3 + s3 * c2 - s4 * c1 + s5 * c0); scalar invdet = (s0 * c5 - s1 * c4 + s2 * c3 + s3 * c2 - s4 * c1 + s5 * c0);
invdet = invdet ? 1.0 / invdet : 0; invdet = invdet ? 1.0 / invdet : 0; // this will get reduced to cmov, div still happens
matrix<scalar, rows, cols...> i( matrix<scalar, rows, cols...> i(
( m[1][1] * c5 - m[1][2] * c4 + m[1][3] * c3) * invdet ( m[1][1] * c5 - m[1][2] * c4 + m[1][3] * c3) * invdet

View File

@@ -47,7 +47,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_exponential_functions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_exponential_functions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::pow(fennec::genType, fennec::genType) "genFType pow(genFType x, genFType y)" /// \ref fennec::pow(fennec::genType, fennec::genType) "genFType pow(genFType x, genFType y)"
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">

View File

@@ -0,0 +1,580 @@
// =====================================================================================================================
// fennec, a free and open source game engine
// Copyright © 2025 Medusa Slockbower
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// =====================================================================================================================
///
/// \file constants.h
/// \brief \ref fennec_math_ext_constants
///
///
/// \details
/// \author Medusa Slockbower
///
/// \copyright Copyright © 2025 Medusa Slockbower ([GPLv3](https://www.gnu.org/licenses/gpl-3.0.en.html))
///
///
#ifndef FENNEC_MATH_EXT_CONSTANTS_H
#define FENNEC_MATH_EXT_CONSTANTS_H
///
///
///
/// \page fennec_math_ext_constants Constants
///
/// \brief Common constants used in mathematics
///
/// \code #include <fennec/math/ext/constants.h> \endcode
///
///
///
/// \section section_rational_constants Rational Constants
///
/// <table width="100%" class="fieldtable" id="table_fennec_math_ext_constants_rational">
/// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::zero "genType zero<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::zero
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one "genType one<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_half "genType one_half<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_half
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::three_over_two "genType three_over_two<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::three_over_two
///
/// </table>
///
///
///
/// \section section_irrational_constants Irrational Constants
///
/// <table width="100%" class="fieldtable" id="table_fennec_math_ext_constants_irrational">
/// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::two_thirds "genType two_thirds<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::two_thirds
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sqrt_two "genType sqrt_two<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::sqrt_two
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sqrt_three "genType sqrt_three<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::sqrt_three
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sqrt_five "genType sqrt_five<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::sqrt_five
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sqrt_seven "genType sqrt_seven<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::sqrt_seven
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sqrt_ten "genType sqrt_ten<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::sqrt_ten
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_sqrt_two "genType one_over_sqrt_two<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_sqrt_two
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_sqrt_three "genType one_over_sqrt_three<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_sqrt_three
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_sqrt_five "genType one_over_sqrt_five<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_sqrt_five
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::cbrt_two "genType cbrt_two<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::cbrt_two
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::qdrt_two "genType qdrt_two<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::qdrt_two
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::two_raised_sqrt_two "genType two_raised_sqrt_two<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::two_raised_sqrt_two
/// </table>
///
///
///
/// \section section_pi_constants π
///
/// <table width="100%" class="fieldtable" id="table_fennec_math_ext_constants_pi">
/// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description
/// <tr><th colspan=2 style="text-align: center;">π & τ
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::pi "genType pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::tau "genType tau<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::tau
///
/// <tr><th colspan=2 style="text-align: center;">Multiples of π
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::two_pi "genType two_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::two_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::three_pi "genType three_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::three_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::four_pi "genType four_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::four_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::half_pi "genType half_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::half_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::third_pi "genType third_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::third_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::quarter_pi "genType quarter_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::quarter_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::fifth_pi "genType fifth_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::fifth_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sixth_pi "genType sixth_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::sixth_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::two_thirds_pi "genType two_thirds_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::two_thirds_pi
///
/// <tr><th colspan=2 style="text-align: center;">Reciprocals of π
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_pi "genType one_over_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::two_over_pi "genType two_over_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::two_over_pi
///
/// <tr><th colspan=2 style="text-align: center;">Exponentiations of π
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::pi_sq "genType pi_sq<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::pi_sq
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::pi_cb "genType pi_cb<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::pi_cb
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sqrt_pi "genType sqrt_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::sqrt_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_sqrt_pi "genType one_over_sqrt_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_sqrt_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sqrt_two_pi "genType sqrt_two_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::sqrt_two_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_sqrt_two_pi "genType one_over_sqrt_two_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_sqrt_two_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::cbrt_pi "genType cbrt_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::cbrt_pi
///
/// </table>
///
///
///
/// \section section_e_constants e
///
/// <table width="100%" class="fieldtable" id="table_fennec_math_ext_constants_e">
/// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description
/// <tr><th colspan=2 style="text-align: center;">Multiples of e
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e "genType e<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::half_e "genType half_e<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::half_e
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::two_e "genType two_e<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::two_e
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_e "genType one_over_e<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_e
///
/// <tr><th colspan=2 style="text-align: center;">Exponentiations
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_sq "genType e_sq<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_sq
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_cb "genType e_cb<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_cb
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sqrt_e "genType sqrt_e<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::sqrt_e
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_sqrt_e "genType one_over_sqrt_e<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_sqrt_e
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_raised_e "genType e_raised_e<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_raised_e
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_raised_neg_e "genType e_raised_neg_e<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_raised_neg_e
///
/// <tr><th colspan=2 style="text-align: center;">Exponentiations by π
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_raised_pi "genType e_raised_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_raised_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_raised_neg_pi "genType e_raised_neg_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_raised_neg_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_raised_half_pi "genType e_raised_half_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_raised_half_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_raised_neg_half_pi "genType e_raised_neg_half_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_raised_neg_half_pi
///
/// <tr><th colspan=2 style="text-align: center;">Exponentiations by γ
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_raised_gamma "genType e_raised_gamma<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_raised_gamma
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::e_raised_neg_gamma "genType e_raised_neg_gamma<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::e_raised_neg_gamma
///
/// </table>
///
///
///
/// \section section_catalans_constants Catalan's Constant
///
/// <table width="100%" class="fieldtable" id="table_fennec_math_ext_constants_catalan">
/// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::G "genType G<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::G
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_G "genType one_over_G<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_G
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::G_over_pi "genType G_over_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::G_over_pi
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::pi_over_G "genType pi_over_G<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::pi_over_G
/// </table>
///
///
///
/// \section section_gamma_constants γ
///
/// <table width="100%" class="fieldtable" id="table_fennec_math_common_sign_functions">
/// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::y "genType y<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::y
///
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_y "genType one_over_y<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_y
/// </table>
///
///
///
/// \section section_log_constants Logarithms
///
/// <table width="100%" class="fieldtable" id="table_fennec_math_common_sign_functions">
/// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_two "genType log_two<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_two
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_three "genType log_three<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_three
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_five "genType log_five<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_five
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_seven "genType log_seven<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_seven
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_ten "genType log_ten<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_ten
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::one_over_log_ten "genType one_over_log_ten<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::one_over_log_ten
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_two_over_log_three "genType log_two_over_log_three<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_two_over_log_three
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_log_two "genType log_log_two<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_log_two
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_pi "genType log_pi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_pi
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_sqrt_two "genType log_sqrt_two<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_sqrt_two
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_gamma "genType log_gamma<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_gamma
/// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::log_phi "genType log_phi<genType>()"
/// <td width="50%" style="vertical-align: top">
/// \copydetails fennec::log_phi
///
///
/// </table>
///
namespace fennec
{
// http://numbers.computation.free.fr/Constants/Miscellaneous/digits.html
// 50 digits is sufficient for 128-bit floats
// Rational Constants ==================================================================================================
template<typename genType> constexpr genType zero() { return genType(0); } ///< \returns The value of \f$0\f$
template<typename genType> constexpr genType one() { return genType(1); } ///< \returns The value of \f$1\f$
template<typename genType> constexpr genType one_half() { return genType(0.5); } ///< \returns The value of \f$\frac{1}{2}\f$
template<typename genType> constexpr genType three_over_two() { return genType(1.5); } ///< \returns The value of \f$\frac{3}{2}\f$
// Irrational Constants ================================================================================================
template<typename genType> constexpr genType one_third() { return 0.33333333333333333333333333333333333333333333333333; } ///< \returns The value of \f$\frac{1}{3}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType two_thirds() { return 0.66666666666666666666666666666666666666666666666666; } ///< \returns The value of \f$\frac{2}{3}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType sqrt_two() { return 1.41421356237309504880168872420969807856967187537694; } ///< \returns The value of \f$\sqrt{2}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType sqrt_three() { return 1.73205080756887729352744634150587236694280525381038; } ///< \returns The value of \f$\sqrt{3}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType sqrt_five() { return 2.23606797749978969640917366873127623544061835961152; } ///< \returns The value of \f$\sqrt{5}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType sqrt_seven() { return 2.64575131106459059050161575363926042571025918308245; } ///< \returns The value of \f$\sqrt{7}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType sqrt_ten() { return 3.16227766016837933199889354443271853371955513932521; } ///< \returns The value of \f$\sqrt{10}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_sqrt_two() { return 0.70710678118654752440084436210484903928483593768847; } ///< \returns The value of \f$\frac{1}{\sqrt{2}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_sqrt_three() { return 0.57735026918962576450914878050195745564760175127012; } ///< \returns The value of \f$\frac{1}{\sqrt{3}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_sqrt_five() { return 0.44721359549995793928183473374625524708812367192230; } ///< \returns The value of \f$\frac{1}{\sqrt{5}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType cbrt_two() { return 1.25992104989487316476721060727822835057025146470150; } ///< \returns The value of \f$\sqrt[3]{2}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType qdrt_two() { return 1.18920711500272106671749997056047591529297209246381; } ///< \returns The value of \f$\sqrt[4]{2}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType two_raised_sqrt_two() { return 2.66514414269022518865029724987313984827421131371465; } ///< \returns The value of \f${2}^{\sqrt{2}}\f$ with the highest precision for \f$genType\f$
// Pi ==================================================================================================================
// Pi & Tau
template<typename genType> constexpr genType pi() { return 3.14159265358979323846264338327950288419716939937510; } ///< \returns The value of \f$\pi\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType tau() { return 6.28318530717958647692528676655900576839433879875021; } ///< \returns The value of \f$\tau\f$ with the highest precision for \f$genType\f$
// Multiples of Pi
template<typename genType> constexpr genType two_pi() { return 6.28318530717958647692528676655900576839433879875021; } ///< \returns The value of \f$2\pi\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType three_pi() { return 9.42477796076937971538793014983850865259150819812531; } ///< \returns The value of \f$3\pi\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType four_pi() { return 12.56637061435917295385057353311801153678867759750042; } ///< \returns The value of \f$4\pi\f$ with the highest precision for \f$genType\f$
// Fractions of Pi
template<typename genType> constexpr genType half_pi() { return 1.57079632679489661923132169163975144209858469968755; } ///< \returns The value of \f$\frac{\pi}{2}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType third_pi() { return 1.04719755119659774615421446109316762806572313312503; } ///< \returns The value of \f$\frac{\pi}{3}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType quarter_pi() { return 0.78539816339744830961566084581987572104929234984377; } ///< \returns The value of \f$\frac{\pi}{4}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType fifth_pi() { return 0.62831853071795864769252867665590057683943387987502; } ///< \returns The value of \f$\frac{\pi}{5}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType sixth_pi() { return 0.52359877559829887307710723054658381403286156656251; } ///< \returns The value of \f$\frac{\pi}{6}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType two_thirds_pi() { return 2.09439510239319549230842892218633525613144626625007; } ///< \returns The value of \f$\frac{2\pi}{3}\f$ with the highest precision for \f$genType\f$
// Reciprocals of Pi
template<typename genType> constexpr genType one_over_pi() { return 0.31830988618379067153776752674502872406891929148091; } ///< \returns The value of \f$\frac{1}{\pi}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType two_over_pi() { return 0.63661977236758134307553505349005744813783858296182; } ///< \returns The value of \f$\frac{2}{\pi}\f$ with the highest precision for \f$genType\f$
// Exponentiations Pi
template<typename genType> constexpr genType pi_sq() { return 9.86960440108935861883449099987615113531369940724079; } ///< \returns The value of \f${\pi}^{2}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType pi_cb() { return 31.00627668029982017547631506710139520222528856588510; } ///< \returns The value of \f${\pi}^{2}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType sqrt_pi() { return 1.77245385090551602729816748334114518279754945612238; } ///< \returns The value of \f$\sqrt{\pi}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_sqrt_pi() { return 0.56418958354775628694807945156077258584405062932899; } ///< \returns The value of \f$\frac{1}{\sqrt{\pi}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType sqrt_two_pi() { return 1.77245385090551602729816748334114518279754945612238; } ///< \returns The value of \f$\sqrt{2\pi}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_sqrt_two_pi() { return 0.39894228040143267793994605993438186847585863116493; } ///< \returns The value of \f$\frac{1}{\sqrt{2\pi}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType cbrt_pi() { return 1.46459188756152326302014252726379039173859685562793; } ///< \returns The value of \f$\sqrt[3]{\pi}\f$ with the highest precision for \f$genType\f$
// e ===================================================================================================================
// Multiples and Reciprocal
template<typename genType> constexpr genType e() { return 2.71828182845904523536028747135266249775724709369995; } ///< \returns The value of \f$e\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType half_e() { return 1.35914091422952261768014373567633124887862354684997; } ///< \returns The value of \f$\frac{e}{2}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType two_e() { return 5.43656365691809047072057494270532499551449418739991; } ///< \returns The value of \f$2e\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_e() { return 0.36787944117144232159552377016146086744581113103176; } ///< \returns The value of \f$\frac{1}{e}\f$ with the highest precision for \f$genType\f$
// Exponentiations of e
template<typename genType> constexpr genType e_sq() { return 7.38905609893065022723042746057500781318031557055184; } ///< \returns The value of \f$e^2\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType e_cb() { return 20.08553692318766774092852965458171789698790783855415; } ///< \returns The value of \f$e^3\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType sqrt_e() { return 1.64872127070012814684865078781416357165377610071014; } ///< \returns The value of \f$\sqrt{e}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_sqrt_e() { return 0.60653065971263342360379953499118045344191813548718; } ///< \returns The value of \f$\frac{1}{\sqrt{e}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType e_raised_e() { return 15.15426224147926418976043027262991190552854853685613; } ///< \returns The value of \f$e^e\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType e_raised_neg_e() { return 0.065988035845312537076790187596846424938577048252796; } ///< \returns The value of \f$e^-e\f$ with the highest precision for \f$genType\f$
// Exponentiations of e by Pi
template<typename genType> constexpr genType e_raised_pi() { return 23.14069263277926900572908636794854738026610624260021; } ///< \returns The value of \f${e}^{ \pi}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType e_raised_neg_pi() { return 0.04321391826377224977441773717172801127572810981063; } ///< \returns The value of \f${e}^{-\pi}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType e_raised_half_pi() { return 4.81047738096535165547303566670383312639017087466453; } ///< \returns The value of \f${e}^{\frac{ \pi}{2}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType e_raised_neg_half_pi() { return 0.20787957635076190854695561983497877003387784163176; } ///< \returns The value of \f${e}^{\frac{-\pi}{2}}\f$ with the highest precision for \f$genType\f$
// Exponentiations of e by Gamma
template<typename genType> constexpr genType e_raised_gamma() { return 1.78107241799019798523650410310717954916964521430343; } ///< \returns The value of \f${e}^{ \gamma}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType e_raised_neg_gamma() { return 0.56145948356688516982414321479088078676571038692515; } ///< \returns The value of \f${e}^{-\gamma}\f$ with the highest precision for \f$genType\f$
// Catalan's Constant ==================================================================================================
template<typename genType> constexpr genType G() { return 0.91596559417721901505460351493238411077414937428167; } ///< \returns The value of \f$G\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_G() { return 1.09174406370390610145415947333389232498605012140824; } ///< \returns The value of \f$\frac{1}{G}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType G_over_pi() { return 0.29156090403081878013838445646839491886406615398583; } ///< \returns The value of \f$\frac{G}{\pi}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType pi_over_G() { return 3.42981513013245864263455323784799901211670795530093; } ///< \returns The value of \f$\frac{\pi}{G}\f$ with the highest precision for \f$genType\f$
// Gamma ===============================================================================================================
template<typename genType> constexpr genType y() { return 0.57721566490153286060651209008240243104215933593992; } ///< \returns The value of \f$\gamma\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_y() { return 1.73245471460063347358302531586082968115577655226680; } ///< \returns The value of \f$\frac{1}{\gamma}\f$ with the highest precision for \f$genType\f$
// Logarithms ==========================================================================================================
template<typename genType> constexpr genType log_two() { return 0.69314718055994530941723212145817656807550013436025; } ///< \returns The value of \f$\log{2}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_three() { return 1.09861228866810969139524523692252570464749055782274; } ///< \returns The value of \f$\log{3}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_five() { return 1.60943791243410037460075933322618763952560135426851; } ///< \returns The value of \f$\log{5}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_seven() { return 1.94591014905531330510535274344317972963708472958186; } ///< \returns The value of \f$\log{7}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_ten() { return 2.30258509299404568401799145468436420760110148862877; } ///< \returns The value of \f$\log{10}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType one_over_log_ten() { return 0.43429448190325182765112891891660508229439700580366; } ///< \returns The value of \f$\frac{1}{\log{10}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_two_over_log_three() { return 0.63092975357145743709952711434276085429958564013188; } ///< \returns The value of \f$\frac{\log{2}}{\log{3}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_log_two() { return -0.36651292058166432701243915823266946945426344783711; } ///< \returns The value of \f$\log{\log{2}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_pi() { return 1.14472988584940017414342735135305871164729481291531; } ///< \returns The value of \f$\log{\pi}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_sqrt_two() { return 0.91893853320467274178032973640561763986139747363778; } ///< \returns The value of \f$\log{\sqrt{2}}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_gamma() { return -0.54953931298164482233766176880290778833069898126306; } ///< \returns The value of \f$\log{\gamma}\f$ with the highest precision for \f$genType\f$
template<typename genType> constexpr genType log_phi() { return 0.48121182505960344749775891342436842313518433438566; } ///< \returns The value of \f$\log{\phi}\f$ with the highest precision for \f$genType\f$
}
#endif // FENNEC_MATH_EXT_CONSTANTS_H

View File

@@ -48,7 +48,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_geometric_functions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_geometric_functions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::dot "float dot(genFType x, genFType y)" <br> /// \ref fennec::dot "float dot(genFType x, genFType y)" <br>
/// \ref fennec::dot "double dot(genDType x, genDType x)" /// \ref fennec::dot "double dot(genDType x, genDType x)"
@@ -237,7 +236,7 @@ constexpr vector<genType, i...> normalize(const vector<genType, i...>& x)
/// \param Nref the reference /// \param Nref the reference
template<typename genType, size_t...i> template<typename genType, size_t...i>
constexpr vector<genType, i...> faceforward(const vector<genType, i...>& N, const vector<genType, i...>& I, const vector<genType, i...>& Nref) constexpr vector<genType, i...> faceforward(const vector<genType, i...>& N, const vector<genType, i...>& I, const vector<genType, i...>& Nref)
{ return fennec::dot(Nref, I) < 0 ? N : -N; } { return fennec::sign(fennec::dot(Nref, I)) * N; }
// reflect ------------------------------------------------------------------------------------------------------------- // reflect -------------------------------------------------------------------------------------------------------------

View File

@@ -66,6 +66,8 @@
/// - \ref fennec_math_geometric /// - \ref fennec_math_geometric
/// - \ref fennec_math_relational /// - \ref fennec_math_relational
/// - \ref fennec_math_trigonometric /// - \ref fennec_math_trigonometric
/// - \subpage fennec_math_extensions "Extensions"
/// - \ref fennec_math_ext_constants
/// ///
/// ///
@@ -91,6 +93,11 @@
/// - \subpage fennec_math_trigonometric /// - \subpage fennec_math_trigonometric
/// ///
///
/// \page fennec_math_extensions Extensions
/// - \subpage fennec_math_ext_constants
///
/// ///
/// ///
/// ///

View File

@@ -41,7 +41,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_relational_functions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_relational_functions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::lessThan "bvec lessThan(vec x, vec y)"<br> /// \ref fennec::lessThan "bvec lessThan(vec x, vec y)"<br>
/// \ref fennec::lessThan "bvec lessThan(dvec x, dvec y)"<br> /// \ref fennec::lessThan "bvec lessThan(dvec x, dvec y)"<br>

View File

@@ -47,7 +47,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_trigonometry_angle_conversions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_trigonometry_angle_conversions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::degrees "genFType degrees(genFType x)" /// \ref fennec::degrees "genFType degrees(genFType x)"
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">
@@ -67,7 +66,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_trigonometry_functions"> /// <table width="100%" class="fieldtable" id="table_fennec_math_trigonometry_functions">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sin "genFType sin(genFType x)" /// \ref fennec::sin "genFType sin(genFType x)"
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">
@@ -108,7 +106,6 @@
/// <table width="100%" class="fieldtable" id="table_fennec_math_trigonometry_hyperbolic"> /// <table width="100%" class="fieldtable" id="table_fennec_math_trigonometry_hyperbolic">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::sinh "genFType sinh(genFType x)" /// \ref fennec::sinh "genFType sinh(genFType x)"
/// <td width="50%" style="vertical-align: top"> /// <td width="50%" style="vertical-align: top">

View File

@@ -97,6 +97,9 @@
/// then \f$V.xy = (0, 1)\f$ /// then \f$V.xy = (0, 1)\f$
/// and \f$V.zy = (2, 1)\f$ /// and \f$V.zy = (2, 1)\f$
/// ///
/// \section section_vectors_more More Info
/// - \subpage fennec_math_vector_traits
///
/// ///
/// ///

View File

@@ -39,10 +39,9 @@
/// \code #include <fennec/math/vector_traits.h> \endcode /// \code #include <fennec/math/vector_traits.h> \endcode
/// ///
/// ///
/// <table width="100%" class="fieldtable" id="table_fennec_lang_constants"> /// <table width="100%" class="fieldtable" id="table_fennec_math_ext_constants">
/// <tr><th style="vertical-align: top">Syntax /// <tr><th style="vertical-align: top">Syntax
/// <th style="vertical-align: top">Description /// <th style="vertical-align: top">Description
///
/// <tr><td width="50%" style="vertical-align: top"> <br> /// <tr><td width="50%" style="vertical-align: top"> <br>
/// \ref fennec::is_vector "is_vector<TypeT>::value"<br> /// \ref fennec::is_vector "is_vector<TypeT>::value"<br>
/// \ref fennec::is_vector_v "is_vector_v<TypeT>" /// \ref fennec::is_vector_v "is_vector_v<TypeT>"

View File

@@ -19,7 +19,10 @@
#ifndef FENNEC_TEST_MATH_EXPONENTIAL_H #ifndef FENNEC_TEST_MATH_EXPONENTIAL_H
#define FENNEC_TEST_MATH_EXPONENTIAL_H #define FENNEC_TEST_MATH_EXPONENTIAL_H
#include "../../test.h"
#include <fennec/math/exponential.h> #include <fennec/math/exponential.h>
#include <fennec/math/ext/constants.h>
namespace fennec namespace fennec
{ {
@@ -33,12 +36,15 @@ inline void fennec_test_math_exponential()
fennec_test_run(fennec::pow(1.0f, 2.0f), 1.0f); fennec_test_run(fennec::pow(1.0f, 2.0f), 1.0f);
fennec_test_run(fennec::pow(2.0f, 0.0f), 1.0f); fennec_test_run(fennec::pow(2.0f, 0.0f), 1.0f);
fennec_test_run(fennec::pow(2.0f, 1.0f), 1.0f); fennec_test_run(fennec::pow(2.0f, 1.0f), 2.0f);
fennec_test_run(fennec::pow(2.0f, 2.0f), 4.0f); fennec_test_run(fennec::pow(2.0f, 2.0f), 4.0f);
fennec_test_spacer(1); fennec_test_spacer(1);
//fennec_test_run(fennec::exp()) fennec_test_run(fennec::exp(-1.0f), fennec::one_over_e<float>());
fennec_test_run(fennec::exp( 0.0f), 1.0f);
fennec_test_run(fennec::exp( 1.0f), fennec::e<float>());
fennec_test_run(fennec::exp( 2.0f), fennec::e_sq<float>());
fennec_test_spacer(1); fennec_test_spacer(1);
@@ -49,7 +55,10 @@ inline void fennec_test_math_exponential()
fennec_test_spacer(1); fennec_test_spacer(1);
//fennec_test_run(fennec::log()) fennec_test_run(fennec::log(fennec::one_over_e<float>()), -1.0f);
fennec_test_run(fennec::log(1.0f), 0.0f);
fennec_test_run(fennec::log(fennec::e<float>()), 1.0f);
fennec_test_run(fennec::log(fennec::e_sq<float>()), 2.0f);
fennec_test_spacer(1); fennec_test_spacer(1);