The function val_root() is finished and related tests have been passed.