Apply machin-like formula with printf formatting