Switching processes in polynomiography

Mandelbrot and Julia sets are examples of fractal patterns generated in the complex plane. In the literature, we can find many generalizations of those sets. One of such generalizations is the use of switching process. In this paper, we introduce some switching processes to another type of complex fractals, namely polynomiographs. Polynomiograph is an image presenting the visualization of the complex polynomial’s root finding process. The proposed switching processes will be divided into four groups, i.e., switching of: the root finding methods, the iterations, the polynomials and the convergence tests. All the proposed switching processes change the dynamics of the root finding process and allow us to obtain new and diverse fractal patterns.

Another example of fractal pattern that is generated in the complex plane is polynomiograph [11]. This method is based on iteration of a given root finding method. In this paper, we introduce into polynomiography several switching processes and show some examples of fractal pattern obtained with their help.
The remainder of this paper is outlined as follows. In Sect. 2, some basic information about polynomiography is presented, starting from the root finding methods, going through the different iteration process and convergence tests and ending up with the basic polynomiograph's generation algorithm. Sect. 3 is devoted to the introduction into polynomiography of the different switching processes. Next, in Sect. 4 some polynomiographs obtained with the help of the proposed switching processes and their generation times are presented. Finally, in Sect. 5, we give some concluding remarks.

Polynomiography
Polynomiography is defined as the art and science of visualization in approximation of the zeros of complex polynomials, via fractal and non-fractal images created using the mathematical convergence properties of iteration functions [11]. A single image created using the mentioned methods is called a polynomiograph.
The main element of polynomiograph's generation algorithm is the root finding method. In the literature, we can find many different methods of finding the roots of a polynomial, e.g., Newton's method [10], harmonic mean Newton's method [1], Whittaker's method [17], Traub-Ostrowski method [17]. Let us recall some of the methods that later will be used in the examples.
Let p ∈ C[Z ], deg p ≥ 2 be a polynomial of the form: p(z) = a n z n + a n−1 z n−1 + . . . + a 1 z + a 0 .
Define a sequence of functions D m : C → C in the following way [12]: D 0 (z) = 1 and for m > 0 let Using the D m sequence, we define a family of root finding methods, the so-called parametric basic family of iterations [12], in the following way: where m = 2, 3, . . . and λ ∈ C.
Let us see how the first three elements of the parametric basic family of iterations look like: One can easily see that B 2,λ is the relaxed Newton's method [10], whereas B 3,λ is the relaxed Halley's method [15]. Now, let us draw our attention to the Euler-Schröder family of iterations [12]. The initial elements of this family have the following form: One can easily see that E 2 is the Newton's method.
The detailed construction of the other elements of the family can be found in [12].
Let us notice that for certain values of the parameters some of the iterations reduce to the others, e.g., Noor iteration reduces to Mann iteration for β n = γ n = 0.
When generating Mandelbrot or Julia sets, we stop the iteration process when the escape criterion is meet. In polynomiography, we stop iterating when we have found the root. The two standard tests (convergence tests) that are usually used have the following form: where ε > 0 is the accuracy of computations. In [7] convergence tests that are based on metric and nonmetric conditions were introduced, and they were used to obtain new artistic fractal patterns. Examples of such tests are the following: The pseudocode of polynomiograph's generation method is presented in Algorithm 1. Iteration I q in the algorithm is one of the iteration methods from fixed point theory, and q is the vector of its parameters. The iteration takes three arguments: the root finding method R, the polynomial p for which we are looking the roots and the point z n from the previous iteration. Convergence test T t is one of the standard convergence tests or the ones from [7], and t is the vector of its parameters, e.g., ε, constants in (25) or (26).

Algorithm 1: Polynomiograph generation
maximum number of iterations, I q -iteration method, q ∈ C N -parameters of the iteration I q , R -root finding method, T t -convergence test, t ∈ R M -parameters of the convergence test T t . Output: Polynomiograph for the area A. To generate polynomiographs, we can also use other generation algorithms. For instance, in [8] we can find methods that are based on the well-known generation algorithms of Mandelbrot and Julia sets.

Switching processes in polynomiography
In the introduction, we have seen several switching processes that were used in the generation of Mandelbrot and Julia sets. In polynomiography, we can also introduce similar switching processes and propose new ones. We can divide the switching processes into four groups: 1. switching of the root finding methods, 2. switching of the iterations, 3. switching of the polynomials, 4. switching of the convergence tests.
In the first group in the polynomiograph's generation algorithm, we fix all the parameters except the root finding method. Depending on the switching method, we choose two or more root finding methods R 0 , R 1 , . . . , R m−1 (m ≥ 2). We define the switching processes of the root finding methods as follows: if n mod m = 0, -switching using |z| z n+1 = I q (R 0 , p, z n ), if |z n | ≤ r, where r > 0, -switching using | p(z)| where r > 0.
The first two types of switching processes are very similar to the switching processes used in the generation of Mandelbrot and Julia sets. In the third process, we switch between two root finding methods depending on the distance from a root. If the distance of polynomial's value in the approximation point (from the previous iteration) to 0 is smaller than r , then we use one root finding method and the second one otherwise.
In the second group of switching processes in the polynomiograph's generation algorithm, we fix all the parameters except the iteration process. We choose two or more iteration processes I 0 q 0 , I 1 q 1 , . . . , I m−1 q m−1 (m ≥ 2), but the choice cannot be completely arbitrary. In Sect. 2, we noticed that for certain values of the parameters some of the iterations reduce to the others. If we choose two such iteration, then there will be no switching process. Thus, we need to choose iterations processes that do not reduce to each other for any possible combination of the parameters. In Fig. 1, we see diagram of dependencies between iterations presented in [9]. Two iterations from this diagram reduce to each other if there is a path in the diagram from one iteration to the other. So, two iterations do not reduce if there is no path in the diagram between them. When we have chosen the iteration processes, then we can define the switching processes between them as follows: -switching modulo m -switching using |z| where r > 0, -switching using | p(z)| where r > 0.
In the third group of switching processes in the polynomiograph's generation algorithm, we also fix all the parameters except one. This time we will switch between two polynomials p 1 , p 2 . Similarly like in the case of iterations, we cannot use arbitrary polynomials for the switching process. If we use polynomials for which the roots of one polynomial are distant from the roots of the other, then the root finding method in one iteration will try to converge to roots of one of the polynomials and in the other iteration to the roots of the other polynomial and in consequence it might happen that the method will not converge to any root. Therefore, we propose following way of choosing the polynomials. The first polynomial p 1 is chosen arbitrarily. Let S 1 = {r 1 , r 2 , . . . , r k } be the set of roots of Then, polynomial p 2 is defined as follows: Having polynomials p 1 and p 2 , we define the switching processes in the following way: -switching modulo 2 -switching using |z| where r > 0, -switching using | p(z)| where r > 0 and p is the polynomial with greater degree. Of course we can change the order of p 1 and p 2 in (36).
The last group of switching processes is the switching between convergence tests. Similarly like in the other groups in the polynomiograph's generation algorithm, we fix all the parameters except the convergence test. Depending on the switching method, we choose two or more convergence test . Now, we define a convergence test that consists of switching process in the following way: -switching using |z| where where r > 0.

Examples
In this section, we present some examples of polynomiographs obtained with the help of the switching processes introduced in Sect. 3. Moreover, we present generation times of those polynomiographs. The software for polynomiographs' generation has been implemented in Processing, a programming language based on Java, and it has been run on a computer with the following specification: Intel Core i5-4570 processor, 16 GB RAM, 64-bit version of Windows 10. All the presented polynomiographs have been generated in 600 × 600 pixels resolution. Moreover, each polynomiograph has been generated 30 times to decrease the influence of other processes and the virtual Java machine running on the computer. Then, the worst and the best times have been rejected to obtain the average generation time.
We start with examples of the first group of switching processes, namely switching of the root finding methods. Fig. 2 presents polynomiographs obtained with the relaxed Newton's method with λ = 0.75 + 0.5i, the relaxed Halley's method with λ = 0.5 and the E 3 method. The common parameters used to generate these polynomiographs were as follows: p(z) = z 4 +4, A = [−2.5, 2.5] 2 , K = 40, Picard's iteration, convergence test (23) with ε = 0.001. The generation times of these polynomiographs are presented in Table 1. The result of switching the three root finding methods from Fig. 2 using the modulo switching (27) is presented in Fig. 3, and the generation times are given in Table 2. From the images, we see that the polynomiographs obtained with the help of this switching process differ in a significant way from the original polynomiographs. The change in shape is equivalent to the change of the dynamics of the corresponding dynamical system. In each pattern obtained with this switching process, we can find some features of the original patterns, e.g., swirls from the Newton method, the shape of the central part of the E 3 method. Looking at the times from Tables 1 and 2, we see that the generation times for polynomiographs obtained using this type of switching are between the times obtained for the original root finding methods used in the switching process.
In the next example, we used switching process of the root finding methods using the |z|, i.e., Eq. (28). The original polynomiographs obtained with the help of the relaxed Newton (λ = 0.75) and the relaxed Hal-   Table 3 shows generation times of the polynomiographs. The result of switching the two root finding methods using (28) where R 0 is Halley's method and R 1 is Newton's method is presented in Fig. 5. The values of r were as follows: (a) 0.5, (b) 1.0, (c) 1.5, (d) 2.0. The generation times of the polynomiographs are presented in Table 4. From the polynomiographs, we can observe that for different values of r we obtain patterns that differ from the original ones. Moreover, we see that for low values of r the pattern is very similar to the pattern obtained with the help of R 1 method. When we increase the value of r , then the pattern is more similar to the pattern obtained with the help of R 0 method. Comparing the times from Tables 3 and 4, we see that similar to the previous case the times for polynomiographs obtained with the switching process are between the times obtained for the original root finding methods. Moreover, the greater the value of r the lower the time, which gets closer to the time for the relaxed Halley method.  In the last example of the first group, we used the switching process of root finding methods given by (29). In the switching process, we used the same root finding methods and their parameters that were used in Fig. 4. The results of switching Newton's method (R 0 ) and Halley's method (R 1 ) for different values of r are presented in Fig. 6. The values of r were as follows:  Table 5. Similar to the previous example, the shape of polynomiograph changes with the change of r . The lower the value of The change of the polynomiograph has different character than in the example with the switching process using |z|, whereas the generation times starting from r = 3.0 are greater than both times obtained for the original root finding methods (Table 3). Moreover, we see that the greater the value of r the greater the time.
The second group of examples presents polynomiographs generated by using the switching processes of iteration methods. In all the examples in this group, we use the same two iterations. The first iteration is Noor's iteration with α n = 0.15, β n = 0.6 and γ n = 0.4, and the second iteration is CR iteration with α n = 0.8, β n = 0.8, γ n = 0.8. The other parameters used to generate the polynomiographs from     Table 6. The first switching process of iteration methods is the switching using modulo (30). The results of switching iterations from Fig. 7 using this switching process and their generation times are presented in Fig. 8 and Table 7, respectively. In Fig. 8a we see switching of Noor iteration (in even steps) and CR iteration (in odd steps), and in Fig. 8b switching in the reversed order, namely CR iteration (in even steps) and Noor iteration (in odd steps). From the images, we see that in both cases the shape of polynomiograph has changed in a significant way forming new patterns. And from the tables with the times, we see that the generation times are much lower than the time for the CR iteration and are greater than for the Noor iteration.  In the next example, we used switching process given by (31). As the iteration I 0 q 0 , we took the Noor iteration and as the iteration I 1 q 1 we took the CR iteration, both with the parameters used to generate polynomiographs in Fig. 7. The values of r used to generate the images were as follows: (a) 0.2, (b) 0.8, (c) 1.4, (d) 2.0. The generation times are given in Table 8. The polynomiographs change their shape from shape very similar to the one obtained with the I 1 q 1 iteration (for low values of r ) to a shape remaining the one obtained with the I 0 q 0 iteration (for high values of r ). The generation times are between the times obtained for the original iterations that were used in the switching process. Moreover, the greater the value of r the greater the time. This was to be expected looking at the polynomiographs, because the greater the value of r the more closely the pattern resembles the pattern obtained for the Noor iteration for which the time was high.   Table 9. From the obtained images, we clearly see that using different values of r we obtain various shapes of polynomiographs. The shapes are different from the original ones and from the ones obtained with the switching process that used |z|. The generation times in this case also are between the times obtained for the original iterations.
The third group of examples consists of polynomiographs obtained with the switching of polynomi-  als. As in the previous groups, we start with the switching using modulo-equation (34). Figure 11 presents polynomiographs obtained for two different polynomials: (a) p 1 (z) = z 8 + 3z 4 − 4, (b) p 2 (z) = z 4 + 4, and Table 10 presents the times of their generation. The sets of roots for both the polynomials were as follows: We clearly see that S 2 S 1 . The other common parameters used to generate the polynomiographs were as follows: A = [−4, 4] 2 , K = 35, Picard's iteration, relaxed Newton's method with λ = 1, convergence test (23) with ε = 0.001. Figure 12 presents the result of switching polynomials p 1 and p 2 using (34) and Table 11 times of its generation. In Fig. 12a we see polynomiograph obtained using p 1 in the even steps and p 2 in the odd steps of the switching process, and in Fig. 12b the order of the polynomials was reversed, i.e., p 2 was used in the even steps and p 1 in the odd steps. The overall shape of both the polynomiographs reminds the shape of polynomiograph obtained for the polynomial with the lower degree, i.e., p 2 . However, the polynomiographs obtained with the switching reveal much more details, what makes them more interesting. The generation times are between the times obtained for the original polynomials, and they are closer to the time for p 1 .  For the next example, we used switching process of the polynomials given by (35). The original polynomiographs obtained for p 1 (z) = z 4 − 1 and p 2 (z) = z 2 − 1 are presented in Fig. 13, and in Table 12 their generation times are given. The sets of roots for these polynomials are the following: S 1 = {−1, −i, 1, i}, S 2 = {−1, 1}. We see that S 2 S 1 . The other common parameters used to generate the polynomiographs were as follows: A = [−4, 4] 2 , K = 35, Picard's iteration, relaxed Newton's method with λ = 1, convergence test (23) with ε = 0.001. Figure 14 presents polynomiographs obtained with the switching of p 1 and p 2 for the following values of r : (a) 0.5, (b) 1.2999999523, (c) 2.0999999046, (d) 2.5. The generation times of the polynomiographs are presented in Table 13. The pattern from Fig. 14a is similar to the original pattern from Fig. 13b, and the only difference is in the central part of the polynomiograph. When we increase the value of r , we observe that the pattern changes and is more similar to the original pattern from Fig. 13a. Comparing the times from Tables 12 and 13, we see that the generation times of the polynomiographs obtained with the switching process are between the times obtained for the original polynomials and that the greater the value of r the greater the time.
In the last example of the third group, we used switching process of polynomials given by (36). We used the same polynomials and common parameters as in Fig. 13, but this time we changed the order of the   Table 14 presents times of their generation. From the obtained images, we see that the polynomiographs differ from the original ones in a significant way. We can observe that the most noticeable change of the shape is in the central part of the polynomiograph. Moreover, we can notice that for high values of r the change of its value does not affect the shape in a significant way like in the case of the low values. Looking at the tables with the times (Tables 12 and 14), we see that the times obtained for polynomiographs with switching are greater than the times obtained for the original polynomials. Moreover, we see that the greater the value of r the lower the time. The last group of examples presents polynomiographs obtained using the switching of convergence tests. We start with switching using (37). For this type of switching, we used the following convergence tests: Polynomiographs obtained for these two convergence tests and the following common parameters: p(z) = z 5 − 1, A = [−2.5, 2.5] 2 , K = 15, Picard's iteration, the relaxed Newton's method with λ = 1 are presented in Fig. 16, whereas their generation times are presented in Table 15. The result of switching between (40) and (41) and between (41) and (40) using (37) are presented in Fig. 17a and b, respectively. Both polynomiographs are different from the original ones. Moreover, they reveal features of both of the original patterns, but are more similar to the pattern from Fig. 16a. When we look at the generation times, we see that the times for polynomiographs obtained with the considered switching process are between the times obtained for the original convergence tests (Table 16).
In the example with switching using (38), for the generation of polynomiographs, we used the same parameters as in the example for (37), but with other convergence tests: where (z), (z) are the real and the imaginary part of z, respectively. The polynomiographs and the generation times obtained for these two convergence tests are presented in Fig. 18 and Table 17, respectively, whereas  Table 18. From the polynomiographs, we can observe that the shape changes in the areas where the root finding method converges to some root. Moreover, we see that this type of switching is very sensitive to the change of r , i.e., very small change of the value causes that the shape changes in a significant way. The generation times of polynomiographs obtained using the switching process are greater than the times obtained for the original con-    switching process. The tests were as follows: |0.01(z n+1 − z n )| + |0.029|z n+1 | 2 −0.03|z n | 2 | < 0.001, (44) ||z n+1 | 2 − |z n | 2 | < 0.001.
Fig. 20 presents polynomiographs obtained with these two convergence tests and Table 19 theirs generation times. The result of using switching process given by (39), where test (44) is T 0 and test (45) is T 1 , is presented in Fig. 21. The values of r used to generate these polynomiographs were as follows: (a) 0.000000001, (b) 0.0001, (c) 0.0099999998, (d) 0.1000000015. The generation times of the polynomiographs are given in Table 20. Similar to the previous example, we see that the shape of polynomiograph changes in the areas where the root finding method converges to a root. Also we can observe that this type of switching is very sensitive to the change of r . From Tables 19, 20 we see that the generation times of polynomiographs obtained with the use of switching are greater than the times obtained for the original convergence tests used in the switching process.

Conclusions
In this paper, we presented some modifications of the polynomiograph's generation algorithm. The modifications rely on the use of different switching processes, i.e., switching of root finding methods, iterations, polynomials and convergence tests. The obtained polynomiographs look quite different in comparison with those obtained with the help of the standard polynomio-graph's generation algorithm. The results of this paper can further extend the possibilities of the existing polynomiographs' generation software and therefore can be used to create paintings, in carpet or tapestry design [11].
Recently, García-Morales introduced the notion of digit function [6]. This function is a building block for other two notions. In [6] García-Morales has shown that using the digit function we can decompose any real or complex valued function (single or multivariable) into a finite set of fractal discontinuous functions. This type of decomposition is called the pλn decomposition. In [5] we find a definition of a generalized bitwise operator. To define this type of operators, the author uses the digit function. Both these notions, pλn decomposition and generalized bitwise operators, probably might extend the possibilities of generating new and diverse polynomiographs. For instance, we could use the pλn decomposition to decompose, e.g., polynomials or convergence tests, that are complex valued functions, and use switching of the parts of these decompositions.