26 std::complex<Real>
expm1(
const std::complex<Real>& z) {
27 if (std::abs(z) < 1.0) {
28 const Real a = z.real(),
b = z.imag();
29 const Real exp_1 = std::expm1(a);
32 return std::complex<Real>(
33 exp_1*cos_1 + exp_1 + cos_1,
34 std::sin(
b)*std::exp(a)
38 return std::exp(z)-1.0;
42 std::complex<Real>
log1p(
const std::complex<Real>& z) {
43 const Real a = z.real(),
b = z.imag();
44 if (std::abs(a) < 0.5 && std::abs(
b) < 0.5) {
45 return std::complex<Real>(
46 0.5*std::log1p(a*a + 2*a +
b*
b),
51 return std::log(1.0+z);
complex versions of expm1 and logp1
ext::function< Real(Real)> b
functionals and combinators not included in the STL
std::complex< Real > log1p(const std::complex< Real > &z)
std::complex< Real > expm1(const std::complex< Real > &z)