1#ifndef VIENNASHE_MATH_BERNOULLI_HPP
2#define VIENNASHE_MATH_BERNOULLI_HPP
33 template <
typename NumericT>
41 return x/(exp(x) - 1.0);
43 return 1.0 / (1.0 + x / 2.0 + x*x / 6.0 + x*x*x/24.0);
48 template <
typename NumericT>
53 double exp_x = exp(x);
54 return (exp_x - 1.0 - x * exp_x) / (exp_x - 1.0) / (exp_x - 1.0);
57 return -0.5 + x / 6.0;
NumericT Bernoulli_dx(NumericT x)
Derivative of the Bernoulli function. f'(x) = [exp(x) - 1 - x exp(x)] / (exp(x) - 1)^2....
NumericT Bernoulli(NumericT x)
The Bernoulli function f(x) = x / (exp(x) - 1). Avoids round-off errors near zero.
The main ViennaSHE namespace. All functionality resides inside this namespace.