E.V.E  0.1-beta

◆ bernouilli

eve::bernouilli = {}
inlineconstexpr

Callable object computing bernouilli numbers sequence.

Required header: #include <eve/function/bernouilli.hpp>

Members Functions

Member Effect
operator() bernouilli numbers sequence

auto operator()( unsigned_value auto n ) const noexcept;
Definition: value.hpp:63

Parameters

n: unsigned value.

Return value

The result element type is always double to try to avoid overflow and its cardinal is the same as the entry in case of an simd call.

Warning
this function will overflow as soon as the input is even and greater than 260 But all odd index values are properly computed as they are all 0 except \(b_1 = -1/2\).

Supported decorators

no decorators are supported

Example

See it live on Compiler Explorer

#include <eve/function/bernouilli.hpp>
#include <eve/wide.hpp>
#include <iostream>
#include <iomanip>
int main()
{
w32_t pi32 = {93, 25, 32, 180, 1, 2, 3, 4};
std::cout << "---- simd" << std::setprecision(17) << '\n'
<< " <- pi32 = " << pi32 << '\n'
<< " -> bernouilli(pi32) = " << eve::bernouilli(pi32) << '\n';
std::uint32_t xi = 18;
std::cout << "---- scalar" << '\n'
<< " xi = " << xi << '\n'
<< " -> bernouilli(xi) = " << eve::bernouilli(xi) << '\n';
return 0;
}
constexpr callable_bernouilli_ bernouilli
Callable object computing bernouilli numbers sequence.
Definition: bernouilli.hpp:64
Wrapper for SIMD registers.
Definition: wide.hpp:65