E.V.E
v2023.02.15

◆ bernouilli

eve::bernouilli = {}
inlineconstexpr

Computes the nth Bernouilli number \(b_n\) as a double.

Defined in header

#include <eve/module/combinatorial.hpp>

Callable Signatures

namespace eve
{
template< eve::unsigned_value N >
eve::as_wide_as<double, N> bernouilli(N n) noexcept;
}
constexpr callable_bernouilli_ bernouilli
Computes the nth Bernouilli number as a double.
Definition: bernouilli.hpp:57
Definition: abi.hpp:18

Parameters

  • n : unsigned argument.

Return value

The value of the nth Bernouilli number is returned. The result's element type is double to avoid overflow and its cardinal is the same as 'n'.

Example

#include <eve/module/combinatorial.hpp>
#include <eve/wide.hpp>
#include <iomanip>
#include <iostream>
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;
}
Wrapper for SIMD registers.
Definition: wide.hpp:65