x to the 3 (x³)

Description

x to the power of 3

Inputs

  • Number X

Outputs

  • X to the 3

Neuron type

Best algorithm has been found - locked

Patterns

Pattern Input Output
1
Number X: 1
X to the 3: 1
2
Number X: 2
X to the 3: 8
3
Number X: 3
X to the 3: 27

Applicable neurons

  • Multiple (x × y)

Algorithm

Test

Code made by AI:
/**
 * Multiple (x × y): 
 *
 * @param x1 Number X
 * @param x2 Number Y
 * @return {Array}
 */
function neuron3(x1, x2)
{
math.config({number: 'BigNumber', precision: 64}); return [math.eval(Number(x1) + '*'+Number(x2)).toString()];
}

/**
 * x to the 3 (x³): x to the power of 3
 * 
 * @param x1 Number X
 * @return {Array}
 */
function neuron8(x1)
{
  var outputs = [];
  outputs[0] = x1;

  arr = neuron3(outputs[0], outputs[0]);
  outputs[1] = arr[0];

  arr = neuron3(outputs[0], outputs[1]);
  outputs[2] = arr[0];

  return[outputs[2]];
}


Code made by AI:

Create your family tree for free