From $ROOTSYS/tutorials/quadp