4#ifndef TETL_CMATH_FMA_HPP
5#define TETL_CMATH_FMA_HPP
7#include <etl/_config/all.hpp>
9#include <etl/_type_traits/is_constant_evaluated.hpp>
10#include <etl/_type_traits/is_same.hpp>
16inline constexpr struct fma {
17 template <
typename Float>
18 [[nodiscard]]
constexpr auto operator()(Float x, Float y, Float z)
const noexcept -> Float
21#if __has_builtin(__builtin_fmaf)
22 if constexpr (is_same_v<Float,
float>) {
23 return __builtin_fmaf(x, y, z);
26#if __has_builtin(__builtin_fma)
27 if constexpr (is_same_v<Float,
double>) {
28 return __builtin_fma(x, y, z);
45[[
nodiscard]]
constexpr auto fma(
float x,
float y,
float z)
noexcept ->
float
47 return etl::detail::fma(x, y, z);
49[[
nodiscard]]
constexpr auto fmaf(
float x,
float y,
float z)
noexcept ->
float
51 return etl::detail::fma(x, y, z);
53[[
nodiscard]]
constexpr auto fma(
double x,
double y,
double z)
noexcept ->
double
55 return etl::detail::fma(x, y, z);
57[[
nodiscard]]
constexpr auto fma(
long double x,
long double y,
long double z)
noexcept ->
long double
59 return etl::detail::fma(x, y, z);
61[[
nodiscard]]
constexpr auto fmal(
long double x,
long double y,
long double z)
noexcept ->
long double
63 return etl::detail::fma(x, y, z);
constexpr auto fma(float x, float y, float z) noexcept -> float
Definition fma.hpp:45
constexpr auto fmal(long double x, long double y, long double z) noexcept -> long double
Definition fma.hpp:61
constexpr auto fma(long double x, long double y, long double z) noexcept -> long double
Definition fma.hpp:57
constexpr auto fma(double x, double y, double z) noexcept -> double
Definition fma.hpp:53
constexpr auto fmaf(float x, float y, float z) noexcept -> float
Definition fma.hpp:49
Definition adjacent_find.hpp:9
constexpr auto is_constant_evaluated() noexcept -> bool
Detects whether the function call occurs within a constant-evaluated context. Returns true if the eva...
Definition is_constant_evaluated.hpp:17