[PLAT-6852] Simplified formulas, added piecewise function test