fix for math operation with result of functions

Time: 388 ms, Memory: 24.75Mb
OK (413 tests, 419 assertions)

Change-Id: I462f5a052441e4614383c33754f214b28fd10d8c