Phylogenetic tree generation

How to generate random phylogenetic tree topologies following the Yule-Harding model?

The following awk one-liner returns $ntree NEWICK-formatted rooted phylogenetic tree topologies (i.e. without branch length) on $ntax leaves generated following the Yule-Harding model of speciation (e.g. Harding 1971, Steel and McKenzie 2001) from the integer seed $seed:

[181209ac]

How to generate random phylogenetic trees following the Yule-Harding model?

The following awk one-liner returns $ntree NEWICK-formatted rooted phylogenetic trees on $ntax leaves with topologies generated following the Yule-Harding model of speciation (e.g. Harding 1971, Steel and McKenzie 2001) and branch lengths randomly drawn from 0 to $maxlgt from the integer seed $seed:

[181209ac]