fund the bug in function approximation generator