E.V.E
v2023.02.15
 
Loading...
Searching...
No Matches

◆ bernouilli

eve::bernouilli = functor<bernouilli_t>
inlineconstexpr

Header file

#include <eve/module/combinatorial.hpp>

Callable Signatures

namespace eve
{
// Regular overload
template<unsigned_value N, floating_value T>
constexpr as_wide_as_t<T,N> bernouilli(unsigned_value auto n) noexcept; // 1
// Lanes masking
constexpr auto bernouilli[conditional_expr auto c](unsigned_value auto n) noexcept; // 2
constexpr auto bernouilli[logical_value auto m](unsigned_value auto n) noexcept; // 2
}
Specifies that a type is a Conditional Expression.
Definition: conditional.hpp:27
The concept logical_value<T> is satisfied if and only if T satisfies eve::value and the element type ...
Definition: value.hpp:107
The concept unsigned_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition: value.hpp:71
constexpr auto bernouilli
elementwise_callable object computing the nth Bernouilli number as a double.
Definition: bernouilli.hpp:75
EVE Main Namespace.
Definition: abi.hpp:18

Parameters

  • n: unsigned argument.
  • c: Conditional expression masking the operation.
  • m: Logical value masking the operation.

Return value The result's element type is double to avoid overflow as possible and its cardinal is the same as n.

  1. The value of the nth Bernouilli number is returned.
  2. The operation is performed conditionnaly.

External references

Example

// revision 1
#include <eve/module/combinatorial.hpp>
#include <iostream>
eve::wide<std::uint32_t> wu([](auto i, auto )->std::uint32_t{ return i;});
eve::wide n{90u, 25u, 32u, 180u, 8u, 10u, 12u, 14u};
int main(){
std::cout << "<- wu = " << wu << "\n";
std::cout << "<- n = " << n << "\n";
std::cout << "-> bernouilli(wu) = " << eve::bernouilli(wu) << "\n";
std::cout << "-> bernouilli[ignore_last(2)](wu)= " << eve::bernouilli[eve::ignore_last(2)](wu) << "\n";
std::cout << "-> bernouilli[wu != 2u](wu) = " << eve::bernouilli[wu != 2u](wu) << "\n";
std::cout << "-> bernouilli(n) = " << eve::bernouilli(n) << "\n";
}
Conditional expression ignoring the k last lanes from a eve::simd_value.
Definition: conditional.hpp:304
Wrapper for SIMD registers.
Definition: wide.hpp:71