// File: /workspace/github_c_makefile_star2_O0/olcaytaner[P]Isell/rbf.c
// Function: rbf_backward_propagation
Rbfweights rbf_backward_propagation(Rbfnetworkptr network, Instanceptr inst, double* p, double* y, Rbf_parameterptr params)
{
	/*!Last Changed 19.08.2007*/
	int i, h, j;
	double sum, x_j, m_hj, s_h;
 Rbfweights changeinweights;
 allocate_rbfweights(&changeinweights, params);
	/*Update wih*/
	for (i = 0; i < network->output; i++)
		 for (h = 0; h < network->hidden + 1; h++)
				 changeinweights.w.values[i][h] = params->eta * real_actual_difference(network->output, inst, i, y) * p[h];
	/*Update mhj*/
	for (h = 0; h < network->hidden; h++)
		 for (j = 0; j < network->input; j++)
			 {
				 x_j = real_feature(inst, j);
					m_hj = network->weights.m.values[h][j];
					s_h = network->weights.s.values[0][h];
				 sum = 0.0;
				 for (i = 0; i < network->output; i++)
						 sum += real_actual_difference(network->output, inst, i, y) * network->weights.w.values[i][h];
					changeinweights.m.values[h][j] = (params->eta * sum * p[h] * (x_j - m_hj)) / (s_h * s_h);   
			 }
	/*Update sh*/
	for (h = 0; h < network->hidden; h++)
	 {
		 s_h = network->weights.s.values[0][h];
			sum = 0.0;
			for (i = 0; i < network->output; i++)
					sum += real_actual_difference(network->output, inst, i, y) * network->weights.w.values[i][h];
			changeinweights.s.values[0][h] = (params->eta * sum * p[h] * distance_to_rbf_gaussian(inst, network->input, network->weights.m.values[h])) / (s_h * s_h * s_h);
	 }
 return changeinweights;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x68(%rbp)
movq %rdi, %rax
movq %rax, -0x60(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x28(%rbp), %rsi
callq 0x9d120
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x9d7d3
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x8(%rbp), %rcx
movl (%rcx), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jge 0x9d7c3
movq -0x28(%rbp), %rax
movsd 0x28(%rax), %xmm0
movsd %xmm0, -0x70(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x9d690
movq -0x68(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x70(%rbp), %xmm0
mulsd %xmm1, %xmm0
movq -0x18(%rbp), %rcx
movslq -0x30(%rbp), %rdx
mulsd (%rcx,%rdx,8), %xmm0
movq 0x28(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x9d751
jmp 0x9d7c5
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9d73a
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x9d91e
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x9d90e
movq -0x10(%rbp), %rdi
movl -0x34(%rbp), %esi
callq 0x42c40
movsd %xmm0, -0x48(%rbp)
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x50(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x9d8b0
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x9d690
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x40(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9d857
movq -0x68(%rbp), %rax
movq -0x28(%rbp), %rcx
movsd 0x28(%rcx), %xmm0
mulsd -0x40(%rbp), %xmm0
movq -0x18(%rbp), %rcx
movslq -0x30(%rbp), %rdx
mulsd (%rcx,%rdx,8), %xmm0
movsd -0x48(%rbp), %xmm1
subsd -0x50(%rbp), %xmm1
mulsd %xmm1, %xmm0
movsd -0x58(%rbp), %xmm1
mulsd -0x58(%rbp), %xmm1
divsd %xmm1, %xmm0
movq 0x8(%rax), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x34(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x9d7f0
jmp 0x9d910
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x9d7da
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x9da36
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x58(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x40(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jge 0x9d9b5
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x9d690
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x30(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm2
movsd -0x40(%rbp), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x9d95c
movq -0x28(%rbp), %rax
movsd 0x28(%rax), %xmm0
mulsd -0x40(%rbp), %xmm0
movq -0x18(%rbp), %rax
movslq -0x30(%rbp), %rcx
mulsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x30(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0x9d450
movq -0x68(%rbp), %rax
movaps %xmm0, %xmm1
movsd -0x78(%rbp), %xmm0
mulsd %xmm1, %xmm0
movsd -0x58(%rbp), %xmm1
mulsd -0x58(%rbp), %xmm1
mulsd -0x58(%rbp), %xmm1
divsd %xmm1, %xmm0
movq 0x18(%rax), %rax
movq (%rax), %rax
movslq -0x30(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x9d925
movq -0x60(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)