improve math library