Function bhattacharyya