Hello everyone. I am new on the forum, and also quite new to c++. Currently I develop some computational program, and have a problem with implementation of the formula(s). Let me explain this. I want to obtain s_{mix}:

Attachment 12511

wherein s_{k}:

Attachment 12512

k = 0 - 4

xis the 5 element vector, that has x0 - x4 elements

dis the 11 element coefficient vector, that has d0 - d10 elements

in the formulabis 10 element vector, whose indexing begins from 1 (this is in the document from which the above formulas come), in the program indexing begins from 0, so b_{i}element from the formula is b[i-1] in my program.

I could simply implement this, no big deal - unless x_{k}would not equal 0... When x_{k}= 0, the natural logarithm cannot be computed, so i must add some checking if x_{k}= 0, if yes the program should skip computing ln(x_{k}) (s_{k}should not be taken into account in that situation as well).

I have tried to implement for/if combination, but it seems to surpass me... So I am kindly asking you - people of good will :) - to help me resolve the problem. I am stuck with this for a few hours and because of that kinda frustrated. I will be very, very very grateful for help. Thanks in advance.