**3.1. Cost function**

The cost function was in fact a little bit complex decision function. The cost function used for chaos synthesis, comparing with other problems is quite a complex structure which cannot be easily described by a few simple mathematical equations. Instead, it is described by the following algorithm procedure:


More brief and simple description of above algorithmically defined cost function can be also done as in Equation 9.

$$\begin{cases} \text{Data}[f\_{\text{syn},1}, \dots, f\_{\text{syn},500}] := f\_{\text{syn},k+1} = f\_{\text{syn},k}(\text{x}\_{\text{start}}), k \in [1, 500] \\ \text{if } \text{Data}[f\_{\text{syn},1}] \ne \text{Data}[f\_{\text{syn},2}] \ne \dots \ne \text{Data}[f\_{\text{syn},500}] \\ \text{then } \{\text{calculate }\lambda \text{ for } \text{Data}[f\_{\text{syn},300}, \dots, f\_{\text{syn},500}], \text{ if } \lambda > 0 \text{ write all to file} \\ \text{else penalize individual} \end{cases} \tag{9}$$

The input to this cost function is a synthesized function and the output is the fitness (quality) of the synthesized function (i.e., the individual in the population). In the cost function, it was tested twice to see if the behavior of the just-synthesized formula is really chaotic. The first test was done in step 2 (unique appearance in the data series) and the second one, in step 4, where the Lyapunov exponent was tested numerically [5].

The reason why in step 5) the sum of the non-unique data appearances was returned is based on the fact that the evolution is searching for minimal values. In this case, the value 2 means that some data element appears in the 500-data series twice, and 1 would means that there is no periodicity and thus synthesized system is possible candidate for chaos.

To make sure that the results so obtained are correct, all written synthesized functions were used for automatic generation of bifurcation diagrams and Lyapunov exponents, as further discussed below.
