added matlab/java version
2^h approx.