# Sum of complex numbers

## Inputs

• 1. complex issue - the real number (a from "a+bi")
• 1. complex number - imaginary unit (b from "a+bi")
• 2. complex issue - the real number (a from "a+bi")
• 2. complex number - imaginary unit (b from "a+bi")

## Outputs

• real number (a from "a+bi")
• imaginary unit (b from "a+bi")

## Neuron type

Best algorithm has been found - locked

## Patterns

Pattern Input Output
1
 1. complex issue - the real number (a from "a+bi"): 5 1. complex number - imaginary unit (b from "a+bi"): 8 2. complex issue - the real number (a from "a+bi"): 7 2. complex number - imaginary unit (b from "a+bi"): 2
 real number (a from "a+bi"): 12 imaginary unit (b from "a+bi"): 10
2
 1. complex issue - the real number (a from "a+bi"): 1 1. complex number - imaginary unit (b from "a+bi"): 1 2. complex issue - the real number (a from "a+bi"): 1 2. complex number - imaginary unit (b from "a+bi"): 1
 real number (a from "a+bi"): 2 imaginary unit (b from "a+bi"): 2
3.
 1. complex issue - the real number (a from "a+bi"): 1 1. complex number - imaginary unit (b from "a+bi"): 2 2. complex issue - the real number (a from "a+bi"): 3 2. complex number - imaginary unit (b from "a+bi"): 4
 real number (a from "a+bi"): 4 imaginary unit (b from "a+bi"): 6

## Applicable neurons

• Plus (x + y)

## Algorithm

### Test

```/**
* Plus (x + y): The addition of two whole numbers is the total amount of those quantities combined.
*
* @param x1 first number
* @param x2 second number
* @return {Array}
*/
function neuron1(x1, x2)
{
math.config({number: 'BigNumber', precision: 64}); return [math.eval(Number(x1) + '+'+Number(x2)).toString()];
}

/**
* Sum of complex numbers:
*
* @param x1 1. complex issue - the real number (a from "a+bi")
* @param x2 1. complex number - imaginary unit (b from "a+bi")
* @param x3 2. complex issue - the real number (a from "a+bi")
* @param x4 2. complex number - imaginary unit (b from "a+bi")
* @return {Array}
*/
function neuron4(x1, x2, x3, x4)
{
var outputs = [];
outputs = x1;
outputs = x2;
outputs = x3;
outputs = x4;

arr = neuron1(outputs, outputs);
outputs = arr;

arr = neuron1(outputs, outputs);
outputs = arr;

return[outputs, outputs];
}

``` 