cf: move code into math-scala

Signed-off-by: Anand Avati <avati@redhat.com>