xflouris / libpll

Phylogenetic Likelihood Library
GNU Affero General Public License v3.0
26 stars 6 forks source link

Significant figures in tree output #88

Closed matsen closed 6 years ago

matsen commented 8 years ago

A very minor suggestion.

RAxML reports many significant figures for branch lengths. libpll reports 6.

While we can debate whether it makes epistemological sense to report 20 significant figures for a branch length, it would be nice to be able to test side-by-side with RAxML. What about using the RAxML standard for formatting branch lengths? If you agree I can make a PR.

Much ❤️ for the great code, folks.

xflouris commented 8 years ago

Hello @matsen , I believe the number of significiant digits is 17 according to the IEEE standard. At least according to GCC:

gcc -dM -E - < /dev/null | grep -i DBL_DECIMAL_DIG

the limit is set to 17.

We could change this in PLL to be a user-specified number and add a check such that the specified value is less or equal to __DBL_DECIMAL_DIG__. Which functions do you have in mind? I guess pll_utree_export_newick and pll_rtree_export_newick ?