The Mossolov problem – the phi function.
The Mossolov problem – the phi function
if (x <= 0) return 0;
if (
n == 1)
return x/(
c+
r);
if (
r == 0)
return pow(x/
c,1/
n);
for (size_t i = 0; true; ++i) {
if (fabs(ry) <= tol && fabs(dy) <= tol) break;
if (y+dy > 0) {
y += dy;
} else {
y /= 2;
check_macro (1+y != y,
"phi: machine precision problem");
}
}
return y;
}
return 1/(
r +
n*
c*
pow(phi_x,-1+
n));
}
protected:
};
see the Float page for the full documentation
check_macro(expr1.have_homogeneous_space(Xh1), "dual(expr1,expr2); expr1 should have homogeneous space. HINT: use dual(interpolate(Xh, expr1),expr2)")
space_mult_list< T, M > pow(const space_basic< T, M > &X, size_t n)
phi(Float n1=2, Float c1=1, Float r1=0)
Float derivative(const Float &x) const
static const size_t max_iter
Float df_dy(Float y) const
Float operator()(const Float &x) const