// Copyright (c) 2019, Christoph Peters
// All rights reserved.
// 
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//     * Redistributions of source code must retain the above copyright
//       notice, this list of conditions and the following disclaimer.
//     * Redistributions in binary form must reproduce the above copyright
//       notice, this list of conditions and the following disclaimer in the
//       documentation and/or other materials provided with the distribution.
//     * Neither the name of the Karlsruhe Institute of Technology nor the
//       names of its contributors may be used to endorse or promote products
//       derived from this software without specific prior written permission.
// 
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


#pragma once
#include <math.h>
#include <complex.h>

#ifndef CMPLXF
#define CMPLXF(x, y) ((float complex)((float)(x) + I * (float)(y)))
#endif

inline float complex cabssqrf(float complex z){
	float real=crealf(z);
	float imag=cimagf(z);
	return real*real+imag*imag;
}


void trigonometricToExponentialMomentsReal3(float complex pOutExponentialMoment[3],const float pTrigonometricMoment[3]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0]-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=pTrigonometricMoment[1]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0];
	pOutExponentialMoment[2]=pTrigonometricMoment[2]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[1]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMomentsReal4(float complex pOutExponentialMoment[4],const float pTrigonometricMoment[4]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0]-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=pTrigonometricMoment[1]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0];
	pOutExponentialMoment[2]=pTrigonometricMoment[2]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[1]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1];
	pOutExponentialMoment[3]=pTrigonometricMoment[3]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[2]*CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[1]+pTrigonometricMoment[1]*CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[2];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMomentsReal5(float complex pOutExponentialMoment[5],const float pTrigonometricMoment[5]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0]-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=pTrigonometricMoment[1]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0];
	pOutExponentialMoment[2]=pTrigonometricMoment[2]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[1]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1];
	pOutExponentialMoment[3]=pTrigonometricMoment[3]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[2]*CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[1]+pTrigonometricMoment[1]*CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[2];
	pOutExponentialMoment[4]=pTrigonometricMoment[4]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[3]*CMPLXF(0.0f,4.71238898f)*pOutExponentialMoment[1]+pTrigonometricMoment[2]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[2]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.57079633f)*pOutExponentialMoment[3];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMomentsReal6(float complex pOutExponentialMoment[6],const float pTrigonometricMoment[6]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0]-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=pTrigonometricMoment[1]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0];
	pOutExponentialMoment[2]=pTrigonometricMoment[2]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[1]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1];
	pOutExponentialMoment[3]=pTrigonometricMoment[3]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[2]*CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[1]+pTrigonometricMoment[1]*CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[2];
	pOutExponentialMoment[4]=pTrigonometricMoment[4]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[3]*CMPLXF(0.0f,4.71238898f)*pOutExponentialMoment[1]+pTrigonometricMoment[2]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[2]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.57079633f)*pOutExponentialMoment[3];
	pOutExponentialMoment[5]=pTrigonometricMoment[5]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[4]*CMPLXF(0.0f,5.02654825f)*pOutExponentialMoment[1]+pTrigonometricMoment[3]*CMPLXF(0.0f,3.76991118f)*pOutExponentialMoment[2]+pTrigonometricMoment[2]*CMPLXF(0.0f,2.51327412f)*pOutExponentialMoment[3]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.25663706f)*pOutExponentialMoment[4];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMomentsReal7(float complex pOutExponentialMoment[7],const float pTrigonometricMoment[7]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0]-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=pTrigonometricMoment[1]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0];
	pOutExponentialMoment[2]=pTrigonometricMoment[2]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[1]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1];
	pOutExponentialMoment[3]=pTrigonometricMoment[3]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[2]*CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[1]+pTrigonometricMoment[1]*CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[2];
	pOutExponentialMoment[4]=pTrigonometricMoment[4]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[3]*CMPLXF(0.0f,4.71238898f)*pOutExponentialMoment[1]+pTrigonometricMoment[2]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[2]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.57079633f)*pOutExponentialMoment[3];
	pOutExponentialMoment[5]=pTrigonometricMoment[5]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[4]*CMPLXF(0.0f,5.02654825f)*pOutExponentialMoment[1]+pTrigonometricMoment[3]*CMPLXF(0.0f,3.76991118f)*pOutExponentialMoment[2]+pTrigonometricMoment[2]*CMPLXF(0.0f,2.51327412f)*pOutExponentialMoment[3]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.25663706f)*pOutExponentialMoment[4];
	pOutExponentialMoment[6]=pTrigonometricMoment[6]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[5]*CMPLXF(0.0f,5.23598776f)*pOutExponentialMoment[1]+pTrigonometricMoment[4]*CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[2]+pTrigonometricMoment[3]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[3]+pTrigonometricMoment[2]*CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[4]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.04719755f)*pOutExponentialMoment[5];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMomentsReal8(float complex pOutExponentialMoment[8],const float pTrigonometricMoment[8]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0]-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=pTrigonometricMoment[1]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0];
	pOutExponentialMoment[2]=pTrigonometricMoment[2]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[1]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1];
	pOutExponentialMoment[3]=pTrigonometricMoment[3]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[2]*CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[1]+pTrigonometricMoment[1]*CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[2];
	pOutExponentialMoment[4]=pTrigonometricMoment[4]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[3]*CMPLXF(0.0f,4.71238898f)*pOutExponentialMoment[1]+pTrigonometricMoment[2]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[2]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.57079633f)*pOutExponentialMoment[3];
	pOutExponentialMoment[5]=pTrigonometricMoment[5]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[4]*CMPLXF(0.0f,5.02654825f)*pOutExponentialMoment[1]+pTrigonometricMoment[3]*CMPLXF(0.0f,3.76991118f)*pOutExponentialMoment[2]+pTrigonometricMoment[2]*CMPLXF(0.0f,2.51327412f)*pOutExponentialMoment[3]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.25663706f)*pOutExponentialMoment[4];
	pOutExponentialMoment[6]=pTrigonometricMoment[6]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[5]*CMPLXF(0.0f,5.23598776f)*pOutExponentialMoment[1]+pTrigonometricMoment[4]*CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[2]+pTrigonometricMoment[3]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[3]+pTrigonometricMoment[2]*CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[4]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.04719755f)*pOutExponentialMoment[5];
	pOutExponentialMoment[7]=pTrigonometricMoment[7]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[6]*CMPLXF(0.0f,5.38558741f)*pOutExponentialMoment[1]+pTrigonometricMoment[5]*CMPLXF(0.0f,4.48798951f)*pOutExponentialMoment[2]+pTrigonometricMoment[4]*CMPLXF(0.0f,3.5903916f)*pOutExponentialMoment[3]+pTrigonometricMoment[3]*CMPLXF(0.0f,2.6927937f)*pOutExponentialMoment[4]+pTrigonometricMoment[2]*CMPLXF(0.0f,1.7951958f)*pOutExponentialMoment[5]+pTrigonometricMoment[1]*CMPLXF(0.0f,0.897597901f)*pOutExponentialMoment[6];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMomentsReal9(float complex pOutExponentialMoment[9],const float pTrigonometricMoment[9]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0]-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=pTrigonometricMoment[1]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0];
	pOutExponentialMoment[2]=pTrigonometricMoment[2]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[1]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1];
	pOutExponentialMoment[3]=pTrigonometricMoment[3]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[2]*CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[1]+pTrigonometricMoment[1]*CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[2];
	pOutExponentialMoment[4]=pTrigonometricMoment[4]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[3]*CMPLXF(0.0f,4.71238898f)*pOutExponentialMoment[1]+pTrigonometricMoment[2]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[2]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.57079633f)*pOutExponentialMoment[3];
	pOutExponentialMoment[5]=pTrigonometricMoment[5]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[4]*CMPLXF(0.0f,5.02654825f)*pOutExponentialMoment[1]+pTrigonometricMoment[3]*CMPLXF(0.0f,3.76991118f)*pOutExponentialMoment[2]+pTrigonometricMoment[2]*CMPLXF(0.0f,2.51327412f)*pOutExponentialMoment[3]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.25663706f)*pOutExponentialMoment[4];
	pOutExponentialMoment[6]=pTrigonometricMoment[6]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[5]*CMPLXF(0.0f,5.23598776f)*pOutExponentialMoment[1]+pTrigonometricMoment[4]*CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[2]+pTrigonometricMoment[3]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[3]+pTrigonometricMoment[2]*CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[4]+pTrigonometricMoment[1]*CMPLXF(0.0f,1.04719755f)*pOutExponentialMoment[5];
	pOutExponentialMoment[7]=pTrigonometricMoment[7]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[6]*CMPLXF(0.0f,5.38558741f)*pOutExponentialMoment[1]+pTrigonometricMoment[5]*CMPLXF(0.0f,4.48798951f)*pOutExponentialMoment[2]+pTrigonometricMoment[4]*CMPLXF(0.0f,3.5903916f)*pOutExponentialMoment[3]+pTrigonometricMoment[3]*CMPLXF(0.0f,2.6927937f)*pOutExponentialMoment[4]+pTrigonometricMoment[2]*CMPLXF(0.0f,1.7951958f)*pOutExponentialMoment[5]+pTrigonometricMoment[1]*CMPLXF(0.0f,0.897597901f)*pOutExponentialMoment[6];
	pOutExponentialMoment[8]=pTrigonometricMoment[8]*CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[7]*CMPLXF(0.0f,5.49778714f)*pOutExponentialMoment[1]+pTrigonometricMoment[6]*CMPLXF(0.0f,4.71238898f)*pOutExponentialMoment[2]+pTrigonometricMoment[5]*CMPLXF(0.0f,3.92699082f)*pOutExponentialMoment[3]+pTrigonometricMoment[4]*CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[4]+pTrigonometricMoment[3]*CMPLXF(0.0f,2.35619449f)*pOutExponentialMoment[5]+pTrigonometricMoment[2]*CMPLXF(0.0f,1.57079633f)*pOutExponentialMoment[6]+pTrigonometricMoment[1]*CMPLXF(0.0f,0.785398163f)*pOutExponentialMoment[7];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMoments2(float complex pOutExponentialMoment[2],const float complex pTrigonometricMoment[2]){
	float zerothMomentPhase=3.14159265f*crealf(pTrigonometricMoment[0])-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMoments3(float complex pOutExponentialMoment[3],const float complex pTrigonometricMoment[3]){
	float zerothMomentPhase=3.14159265f*crealf(pTrigonometricMoment[0])-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[1];
	pOutExponentialMoment[2]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[2]+CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1]*pTrigonometricMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMoments4(float complex pOutExponentialMoment[4],const float complex pTrigonometricMoment[4]){
	float zerothMomentPhase=3.14159265f*crealf(pTrigonometricMoment[0])-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[1];
	pOutExponentialMoment[2]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[2]+CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1]*pTrigonometricMoment[1];
	pOutExponentialMoment[3]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[3]+CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[1]*pTrigonometricMoment[2]+CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[2]*pTrigonometricMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMoments5(float complex pOutExponentialMoment[5],const float complex pTrigonometricMoment[5]){
	float zerothMomentPhase=3.14159265f*crealf(pTrigonometricMoment[0])-1.57079633f;
	pOutExponentialMoment[0]=CMPLXF(cosf(zerothMomentPhase),sinf(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[1];
	pOutExponentialMoment[2]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[2]+CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[1]*pTrigonometricMoment[1];
	pOutExponentialMoment[3]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[3]+CMPLXF(0.0f,4.1887902f)*pOutExponentialMoment[1]*pTrigonometricMoment[2]+CMPLXF(0.0f,2.0943951f)*pOutExponentialMoment[2]*pTrigonometricMoment[1];
	pOutExponentialMoment[4]=CMPLXF(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[4]+CMPLXF(0.0f,4.71238898f)*pOutExponentialMoment[1]*pTrigonometricMoment[3]+CMPLXF(0.0f,3.14159265f)*pOutExponentialMoment[2]*pTrigonometricMoment[2]+CMPLXF(0.0f,1.57079633f)*pOutExponentialMoment[3]*pTrigonometricMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}


void levinsonsAlgorithm2(float complex pOutSolution[2],const float complex pFirstColumn[2]){
	pOutSolution[0]=CMPLXF(1.0f/(crealf(pFirstColumn[0])),0.0f);
	float complex dotProduct;
	float complex flippedSolution1;
	float factor;
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(-crealf(flippedSolution1)*dotProduct);
}

void levinsonsAlgorithm3(float complex pOutSolution[3],const float complex pFirstColumn[3]){
	pOutSolution[0]=CMPLXF(1.0f/(crealf(pFirstColumn[0])),0.0f);
	float complex dotProduct;
	float complex flippedSolution1;
	float complex flippedSolution2;
	float factor;
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(-crealf(flippedSolution1)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[1]);
	flippedSolution2=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-crealf(flippedSolution2)*dotProduct);
}

void levinsonsAlgorithm4(float complex pOutSolution[4],const float complex pFirstColumn[4]){
	pOutSolution[0]=CMPLXF(1.0f/(crealf(pFirstColumn[0])),0.0f);
	float complex dotProduct;
	float complex flippedSolution1;
	float complex flippedSolution2;
	float complex flippedSolution3;
	float factor;
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(-crealf(flippedSolution1)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[1]);
	flippedSolution2=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-crealf(flippedSolution2)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[2]);
	flippedSolution2=conjf(pOutSolution[1]);
	flippedSolution3=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-crealf(flippedSolution3)*dotProduct);
}

void levinsonsAlgorithm5(float complex pOutSolution[5],const float complex pFirstColumn[5]){
	pOutSolution[0]=CMPLXF(1.0f/(crealf(pFirstColumn[0])),0.0f);
	float complex dotProduct;
	float complex flippedSolution1;
	float complex flippedSolution2;
	float complex flippedSolution3;
	float complex flippedSolution4;
	float factor;
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(-crealf(flippedSolution1)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[1]);
	flippedSolution2=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-crealf(flippedSolution2)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[2]);
	flippedSolution2=conjf(pOutSolution[1]);
	flippedSolution3=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-crealf(flippedSolution3)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[3]);
	flippedSolution2=conjf(pOutSolution[2]);
	flippedSolution3=conjf(pOutSolution[1]);
	flippedSolution4=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-crealf(flippedSolution4)*dotProduct);
}

void levinsonsAlgorithm6(float complex pOutSolution[6],const float complex pFirstColumn[6]){
	pOutSolution[0]=CMPLXF(1.0f/(crealf(pFirstColumn[0])),0.0f);
	float complex dotProduct;
	float complex flippedSolution1;
	float complex flippedSolution2;
	float complex flippedSolution3;
	float complex flippedSolution4;
	float complex flippedSolution5;
	float factor;
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(-crealf(flippedSolution1)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[1]);
	flippedSolution2=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-crealf(flippedSolution2)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[2]);
	flippedSolution2=conjf(pOutSolution[1]);
	flippedSolution3=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-crealf(flippedSolution3)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[3]);
	flippedSolution2=conjf(pOutSolution[2]);
	flippedSolution3=conjf(pOutSolution[1]);
	flippedSolution4=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-crealf(flippedSolution4)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[5]+pOutSolution[1]*pFirstColumn[4]+pOutSolution[2]*pFirstColumn[3]+pOutSolution[3]*pFirstColumn[2]+pOutSolution[4]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[4]);
	flippedSolution2=conjf(pOutSolution[3]);
	flippedSolution3=conjf(pOutSolution[2]);
	flippedSolution4=conjf(pOutSolution[1]);
	flippedSolution5=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(-crealf(flippedSolution5)*dotProduct);
}

void levinsonsAlgorithm7(float complex pOutSolution[7],const float complex pFirstColumn[7]){
	pOutSolution[0]=CMPLXF(1.0f/(crealf(pFirstColumn[0])),0.0f);
	float complex dotProduct;
	float complex flippedSolution1;
	float complex flippedSolution2;
	float complex flippedSolution3;
	float complex flippedSolution4;
	float complex flippedSolution5;
	float complex flippedSolution6;
	float factor;
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(-crealf(flippedSolution1)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[1]);
	flippedSolution2=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-crealf(flippedSolution2)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[2]);
	flippedSolution2=conjf(pOutSolution[1]);
	flippedSolution3=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-crealf(flippedSolution3)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[3]);
	flippedSolution2=conjf(pOutSolution[2]);
	flippedSolution3=conjf(pOutSolution[1]);
	flippedSolution4=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-crealf(flippedSolution4)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[5]+pOutSolution[1]*pFirstColumn[4]+pOutSolution[2]*pFirstColumn[3]+pOutSolution[3]*pFirstColumn[2]+pOutSolution[4]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[4]);
	flippedSolution2=conjf(pOutSolution[3]);
	flippedSolution3=conjf(pOutSolution[2]);
	flippedSolution4=conjf(pOutSolution[1]);
	flippedSolution5=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(-crealf(flippedSolution5)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[6]+pOutSolution[1]*pFirstColumn[5]+pOutSolution[2]*pFirstColumn[4]+pOutSolution[3]*pFirstColumn[3]+pOutSolution[4]*pFirstColumn[2]+pOutSolution[5]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[5]);
	flippedSolution2=conjf(pOutSolution[4]);
	flippedSolution3=conjf(pOutSolution[3]);
	flippedSolution4=conjf(pOutSolution[2]);
	flippedSolution5=conjf(pOutSolution[1]);
	flippedSolution6=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(pOutSolution[5]-flippedSolution5*dotProduct);
	pOutSolution[6]=factor*(-crealf(flippedSolution6)*dotProduct);
}

void levinsonsAlgorithm8(float complex pOutSolution[8],const float complex pFirstColumn[8]){
	pOutSolution[0]=CMPLXF(1.0f/(crealf(pFirstColumn[0])),0.0f);
	float complex dotProduct;
	float complex flippedSolution1;
	float complex flippedSolution2;
	float complex flippedSolution3;
	float complex flippedSolution4;
	float complex flippedSolution5;
	float complex flippedSolution6;
	float complex flippedSolution7;
	float factor;
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(-crealf(flippedSolution1)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[1]);
	flippedSolution2=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-crealf(flippedSolution2)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[2]);
	flippedSolution2=conjf(pOutSolution[1]);
	flippedSolution3=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-crealf(flippedSolution3)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[3]);
	flippedSolution2=conjf(pOutSolution[2]);
	flippedSolution3=conjf(pOutSolution[1]);
	flippedSolution4=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-crealf(flippedSolution4)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[5]+pOutSolution[1]*pFirstColumn[4]+pOutSolution[2]*pFirstColumn[3]+pOutSolution[3]*pFirstColumn[2]+pOutSolution[4]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[4]);
	flippedSolution2=conjf(pOutSolution[3]);
	flippedSolution3=conjf(pOutSolution[2]);
	flippedSolution4=conjf(pOutSolution[1]);
	flippedSolution5=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(-crealf(flippedSolution5)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[6]+pOutSolution[1]*pFirstColumn[5]+pOutSolution[2]*pFirstColumn[4]+pOutSolution[3]*pFirstColumn[3]+pOutSolution[4]*pFirstColumn[2]+pOutSolution[5]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[5]);
	flippedSolution2=conjf(pOutSolution[4]);
	flippedSolution3=conjf(pOutSolution[3]);
	flippedSolution4=conjf(pOutSolution[2]);
	flippedSolution5=conjf(pOutSolution[1]);
	flippedSolution6=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(pOutSolution[5]-flippedSolution5*dotProduct);
	pOutSolution[6]=factor*(-crealf(flippedSolution6)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[7]+pOutSolution[1]*pFirstColumn[6]+pOutSolution[2]*pFirstColumn[5]+pOutSolution[3]*pFirstColumn[4]+pOutSolution[4]*pFirstColumn[3]+pOutSolution[5]*pFirstColumn[2]+pOutSolution[6]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[6]);
	flippedSolution2=conjf(pOutSolution[5]);
	flippedSolution3=conjf(pOutSolution[4]);
	flippedSolution4=conjf(pOutSolution[3]);
	flippedSolution5=conjf(pOutSolution[2]);
	flippedSolution6=conjf(pOutSolution[1]);
	flippedSolution7=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(pOutSolution[5]-flippedSolution5*dotProduct);
	pOutSolution[6]=factor*(pOutSolution[6]-flippedSolution6*dotProduct);
	pOutSolution[7]=factor*(-crealf(flippedSolution7)*dotProduct);
}

void levinsonsAlgorithm9(float complex pOutSolution[9],const float complex pFirstColumn[9]){
	pOutSolution[0]=CMPLXF(1.0f/(crealf(pFirstColumn[0])),0.0f);
	float complex dotProduct;
	float complex flippedSolution1;
	float complex flippedSolution2;
	float complex flippedSolution3;
	float complex flippedSolution4;
	float complex flippedSolution5;
	float complex flippedSolution6;
	float complex flippedSolution7;
	float complex flippedSolution8;
	float factor;
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(-crealf(flippedSolution1)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[1]);
	flippedSolution2=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-crealf(flippedSolution2)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[2]);
	flippedSolution2=conjf(pOutSolution[1]);
	flippedSolution3=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-crealf(flippedSolution3)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[3]);
	flippedSolution2=conjf(pOutSolution[2]);
	flippedSolution3=conjf(pOutSolution[1]);
	flippedSolution4=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-crealf(flippedSolution4)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[5]+pOutSolution[1]*pFirstColumn[4]+pOutSolution[2]*pFirstColumn[3]+pOutSolution[3]*pFirstColumn[2]+pOutSolution[4]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[4]);
	flippedSolution2=conjf(pOutSolution[3]);
	flippedSolution3=conjf(pOutSolution[2]);
	flippedSolution4=conjf(pOutSolution[1]);
	flippedSolution5=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(-crealf(flippedSolution5)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[6]+pOutSolution[1]*pFirstColumn[5]+pOutSolution[2]*pFirstColumn[4]+pOutSolution[3]*pFirstColumn[3]+pOutSolution[4]*pFirstColumn[2]+pOutSolution[5]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[5]);
	flippedSolution2=conjf(pOutSolution[4]);
	flippedSolution3=conjf(pOutSolution[3]);
	flippedSolution4=conjf(pOutSolution[2]);
	flippedSolution5=conjf(pOutSolution[1]);
	flippedSolution6=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(pOutSolution[5]-flippedSolution5*dotProduct);
	pOutSolution[6]=factor*(-crealf(flippedSolution6)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[7]+pOutSolution[1]*pFirstColumn[6]+pOutSolution[2]*pFirstColumn[5]+pOutSolution[3]*pFirstColumn[4]+pOutSolution[4]*pFirstColumn[3]+pOutSolution[5]*pFirstColumn[2]+pOutSolution[6]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[6]);
	flippedSolution2=conjf(pOutSolution[5]);
	flippedSolution3=conjf(pOutSolution[4]);
	flippedSolution4=conjf(pOutSolution[3]);
	flippedSolution5=conjf(pOutSolution[2]);
	flippedSolution6=conjf(pOutSolution[1]);
	flippedSolution7=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(pOutSolution[5]-flippedSolution5*dotProduct);
	pOutSolution[6]=factor*(pOutSolution[6]-flippedSolution6*dotProduct);
	pOutSolution[7]=factor*(-crealf(flippedSolution7)*dotProduct);
	dotProduct=crealf(pOutSolution[0])*pFirstColumn[8]+pOutSolution[1]*pFirstColumn[7]+pOutSolution[2]*pFirstColumn[6]+pOutSolution[3]*pFirstColumn[5]+pOutSolution[4]*pFirstColumn[4]+pOutSolution[5]*pFirstColumn[3]+pOutSolution[6]*pFirstColumn[2]+pOutSolution[7]*pFirstColumn[1];
	factor=1.0f/(1.0f-cabssqrf(dotProduct));
	flippedSolution1=conjf(pOutSolution[7]);
	flippedSolution2=conjf(pOutSolution[6]);
	flippedSolution3=conjf(pOutSolution[5]);
	flippedSolution4=conjf(pOutSolution[4]);
	flippedSolution5=conjf(pOutSolution[3]);
	flippedSolution6=conjf(pOutSolution[2]);
	flippedSolution7=conjf(pOutSolution[1]);
	flippedSolution8=CMPLXF(crealf(pOutSolution[0]),0.0f);
	pOutSolution[0]=CMPLXF(factor*crealf(pOutSolution[0]),0.0f);
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(pOutSolution[4]-flippedSolution4*dotProduct);
	pOutSolution[5]=factor*(pOutSolution[5]-flippedSolution5*dotProduct);
	pOutSolution[6]=factor*(pOutSolution[6]-flippedSolution6*dotProduct);
	pOutSolution[7]=factor*(pOutSolution[7]-flippedSolution7*dotProduct);
	pOutSolution[8]=factor*(-crealf(flippedSolution8)*dotProduct);
}


void computeAutocorrelation2(float complex pOutAutocorrelation[2],const float complex pSignal[2]){
	pOutAutocorrelation[0]=pSignal[0]*conjf(pSignal[0])+pSignal[1]*conjf(pSignal[1]);
	pOutAutocorrelation[1]=pSignal[0]*conjf(pSignal[1]);
}

void computeAutocorrelation3(float complex pOutAutocorrelation[3],const float complex pSignal[3]){
	pOutAutocorrelation[0]=pSignal[0]*conjf(pSignal[0])+pSignal[1]*conjf(pSignal[1])+pSignal[2]*conjf(pSignal[2]);
	pOutAutocorrelation[1]=pSignal[0]*conjf(pSignal[1])+pSignal[1]*conjf(pSignal[2]);
	pOutAutocorrelation[2]=pSignal[0]*conjf(pSignal[2]);
}

void computeAutocorrelation4(float complex pOutAutocorrelation[4],const float complex pSignal[4]){
	pOutAutocorrelation[0]=pSignal[0]*conjf(pSignal[0])+pSignal[1]*conjf(pSignal[1])+pSignal[2]*conjf(pSignal[2])+pSignal[3]*conjf(pSignal[3]);
	pOutAutocorrelation[1]=pSignal[0]*conjf(pSignal[1])+pSignal[1]*conjf(pSignal[2])+pSignal[2]*conjf(pSignal[3]);
	pOutAutocorrelation[2]=pSignal[0]*conjf(pSignal[2])+pSignal[1]*conjf(pSignal[3]);
	pOutAutocorrelation[3]=pSignal[0]*conjf(pSignal[3]);
}

void computeAutocorrelation5(float complex pOutAutocorrelation[5],const float complex pSignal[5]){
	pOutAutocorrelation[0]=pSignal[0]*conjf(pSignal[0])+pSignal[1]*conjf(pSignal[1])+pSignal[2]*conjf(pSignal[2])+pSignal[3]*conjf(pSignal[3])+pSignal[4]*conjf(pSignal[4]);
	pOutAutocorrelation[1]=pSignal[0]*conjf(pSignal[1])+pSignal[1]*conjf(pSignal[2])+pSignal[2]*conjf(pSignal[3])+pSignal[3]*conjf(pSignal[4]);
	pOutAutocorrelation[2]=pSignal[0]*conjf(pSignal[2])+pSignal[1]*conjf(pSignal[3])+pSignal[2]*conjf(pSignal[4]);
	pOutAutocorrelation[3]=pSignal[0]*conjf(pSignal[3])+pSignal[1]*conjf(pSignal[4]);
	pOutAutocorrelation[4]=pSignal[0]*conjf(pSignal[4]);
}

void computeAutocorrelation6(float complex pOutAutocorrelation[6],const float complex pSignal[6]){
	pOutAutocorrelation[0]=pSignal[0]*conjf(pSignal[0])+pSignal[1]*conjf(pSignal[1])+pSignal[2]*conjf(pSignal[2])+pSignal[3]*conjf(pSignal[3])+pSignal[4]*conjf(pSignal[4])+pSignal[5]*conjf(pSignal[5]);
	pOutAutocorrelation[1]=pSignal[0]*conjf(pSignal[1])+pSignal[1]*conjf(pSignal[2])+pSignal[2]*conjf(pSignal[3])+pSignal[3]*conjf(pSignal[4])+pSignal[4]*conjf(pSignal[5]);
	pOutAutocorrelation[2]=pSignal[0]*conjf(pSignal[2])+pSignal[1]*conjf(pSignal[3])+pSignal[2]*conjf(pSignal[4])+pSignal[3]*conjf(pSignal[5]);
	pOutAutocorrelation[3]=pSignal[0]*conjf(pSignal[3])+pSignal[1]*conjf(pSignal[4])+pSignal[2]*conjf(pSignal[5]);
	pOutAutocorrelation[4]=pSignal[0]*conjf(pSignal[4])+pSignal[1]*conjf(pSignal[5]);
	pOutAutocorrelation[5]=pSignal[0]*conjf(pSignal[5]);
}

void computeAutocorrelation7(float complex pOutAutocorrelation[7],const float complex pSignal[7]){
	pOutAutocorrelation[0]=pSignal[0]*conjf(pSignal[0])+pSignal[1]*conjf(pSignal[1])+pSignal[2]*conjf(pSignal[2])+pSignal[3]*conjf(pSignal[3])+pSignal[4]*conjf(pSignal[4])+pSignal[5]*conjf(pSignal[5])+pSignal[6]*conjf(pSignal[6]);
	pOutAutocorrelation[1]=pSignal[0]*conjf(pSignal[1])+pSignal[1]*conjf(pSignal[2])+pSignal[2]*conjf(pSignal[3])+pSignal[3]*conjf(pSignal[4])+pSignal[4]*conjf(pSignal[5])+pSignal[5]*conjf(pSignal[6]);
	pOutAutocorrelation[2]=pSignal[0]*conjf(pSignal[2])+pSignal[1]*conjf(pSignal[3])+pSignal[2]*conjf(pSignal[4])+pSignal[3]*conjf(pSignal[5])+pSignal[4]*conjf(pSignal[6]);
	pOutAutocorrelation[3]=pSignal[0]*conjf(pSignal[3])+pSignal[1]*conjf(pSignal[4])+pSignal[2]*conjf(pSignal[5])+pSignal[3]*conjf(pSignal[6]);
	pOutAutocorrelation[4]=pSignal[0]*conjf(pSignal[4])+pSignal[1]*conjf(pSignal[5])+pSignal[2]*conjf(pSignal[6]);
	pOutAutocorrelation[5]=pSignal[0]*conjf(pSignal[5])+pSignal[1]*conjf(pSignal[6]);
	pOutAutocorrelation[6]=pSignal[0]*conjf(pSignal[6]);
}

void computeAutocorrelation8(float complex pOutAutocorrelation[8],const float complex pSignal[8]){
	pOutAutocorrelation[0]=pSignal[0]*conjf(pSignal[0])+pSignal[1]*conjf(pSignal[1])+pSignal[2]*conjf(pSignal[2])+pSignal[3]*conjf(pSignal[3])+pSignal[4]*conjf(pSignal[4])+pSignal[5]*conjf(pSignal[5])+pSignal[6]*conjf(pSignal[6])+pSignal[7]*conjf(pSignal[7]);
	pOutAutocorrelation[1]=pSignal[0]*conjf(pSignal[1])+pSignal[1]*conjf(pSignal[2])+pSignal[2]*conjf(pSignal[3])+pSignal[3]*conjf(pSignal[4])+pSignal[4]*conjf(pSignal[5])+pSignal[5]*conjf(pSignal[6])+pSignal[6]*conjf(pSignal[7]);
	pOutAutocorrelation[2]=pSignal[0]*conjf(pSignal[2])+pSignal[1]*conjf(pSignal[3])+pSignal[2]*conjf(pSignal[4])+pSignal[3]*conjf(pSignal[5])+pSignal[4]*conjf(pSignal[6])+pSignal[5]*conjf(pSignal[7]);
	pOutAutocorrelation[3]=pSignal[0]*conjf(pSignal[3])+pSignal[1]*conjf(pSignal[4])+pSignal[2]*conjf(pSignal[5])+pSignal[3]*conjf(pSignal[6])+pSignal[4]*conjf(pSignal[7]);
	pOutAutocorrelation[4]=pSignal[0]*conjf(pSignal[4])+pSignal[1]*conjf(pSignal[5])+pSignal[2]*conjf(pSignal[6])+pSignal[3]*conjf(pSignal[7]);
	pOutAutocorrelation[5]=pSignal[0]*conjf(pSignal[5])+pSignal[1]*conjf(pSignal[6])+pSignal[2]*conjf(pSignal[7]);
	pOutAutocorrelation[6]=pSignal[0]*conjf(pSignal[6])+pSignal[1]*conjf(pSignal[7]);
	pOutAutocorrelation[7]=pSignal[0]*conjf(pSignal[7]);
}

void computeAutocorrelation9(float complex pOutAutocorrelation[9],const float complex pSignal[9]){
	pOutAutocorrelation[0]=pSignal[0]*conjf(pSignal[0])+pSignal[1]*conjf(pSignal[1])+pSignal[2]*conjf(pSignal[2])+pSignal[3]*conjf(pSignal[3])+pSignal[4]*conjf(pSignal[4])+pSignal[5]*conjf(pSignal[5])+pSignal[6]*conjf(pSignal[6])+pSignal[7]*conjf(pSignal[7])+pSignal[8]*conjf(pSignal[8]);
	pOutAutocorrelation[1]=pSignal[0]*conjf(pSignal[1])+pSignal[1]*conjf(pSignal[2])+pSignal[2]*conjf(pSignal[3])+pSignal[3]*conjf(pSignal[4])+pSignal[4]*conjf(pSignal[5])+pSignal[5]*conjf(pSignal[6])+pSignal[6]*conjf(pSignal[7])+pSignal[7]*conjf(pSignal[8]);
	pOutAutocorrelation[2]=pSignal[0]*conjf(pSignal[2])+pSignal[1]*conjf(pSignal[3])+pSignal[2]*conjf(pSignal[4])+pSignal[3]*conjf(pSignal[5])+pSignal[4]*conjf(pSignal[6])+pSignal[5]*conjf(pSignal[7])+pSignal[6]*conjf(pSignal[8]);
	pOutAutocorrelation[3]=pSignal[0]*conjf(pSignal[3])+pSignal[1]*conjf(pSignal[4])+pSignal[2]*conjf(pSignal[5])+pSignal[3]*conjf(pSignal[6])+pSignal[4]*conjf(pSignal[7])+pSignal[5]*conjf(pSignal[8]);
	pOutAutocorrelation[4]=pSignal[0]*conjf(pSignal[4])+pSignal[1]*conjf(pSignal[5])+pSignal[2]*conjf(pSignal[6])+pSignal[3]*conjf(pSignal[7])+pSignal[4]*conjf(pSignal[8]);
	pOutAutocorrelation[5]=pSignal[0]*conjf(pSignal[5])+pSignal[1]*conjf(pSignal[6])+pSignal[2]*conjf(pSignal[7])+pSignal[3]*conjf(pSignal[8]);
	pOutAutocorrelation[6]=pSignal[0]*conjf(pSignal[6])+pSignal[1]*conjf(pSignal[7])+pSignal[2]*conjf(pSignal[8]);
	pOutAutocorrelation[7]=pSignal[0]*conjf(pSignal[7])+pSignal[1]*conjf(pSignal[8]);
	pOutAutocorrelation[8]=pSignal[0]*conjf(pSignal[8]);
}


void computeCorrelation2(float complex pOutCorrelation[2],const float complex pLHS[2],const float complex pRHS[2]){
	pOutCorrelation[0]=pLHS[0]*pRHS[0]+pLHS[1]*pRHS[1];
	pOutCorrelation[1]=pLHS[1]*pRHS[0];
}

void computeCorrelation3(float complex pOutCorrelation[3],const float complex pLHS[3],const float complex pRHS[3]){
	pOutCorrelation[0]=pLHS[0]*pRHS[0]+pLHS[1]*pRHS[1]+pLHS[2]*pRHS[2];
	pOutCorrelation[1]=pLHS[1]*pRHS[0]+pLHS[2]*pRHS[1];
	pOutCorrelation[2]=pLHS[2]*pRHS[0];
}

void computeCorrelation4(float complex pOutCorrelation[4],const float complex pLHS[4],const float complex pRHS[4]){
	pOutCorrelation[0]=pLHS[0]*pRHS[0]+pLHS[1]*pRHS[1]+pLHS[2]*pRHS[2]+pLHS[3]*pRHS[3];
	pOutCorrelation[1]=pLHS[1]*pRHS[0]+pLHS[2]*pRHS[1]+pLHS[3]*pRHS[2];
	pOutCorrelation[2]=pLHS[2]*pRHS[0]+pLHS[3]*pRHS[1];
	pOutCorrelation[3]=pLHS[3]*pRHS[0];
}

void computeCorrelation5(float complex pOutCorrelation[5],const float complex pLHS[5],const float complex pRHS[5]){
	pOutCorrelation[0]=pLHS[0]*pRHS[0]+pLHS[1]*pRHS[1]+pLHS[2]*pRHS[2]+pLHS[3]*pRHS[3]+pLHS[4]*pRHS[4];
	pOutCorrelation[1]=pLHS[1]*pRHS[0]+pLHS[2]*pRHS[1]+pLHS[3]*pRHS[2]+pLHS[4]*pRHS[3];
	pOutCorrelation[2]=pLHS[2]*pRHS[0]+pLHS[3]*pRHS[1]+pLHS[4]*pRHS[2];
	pOutCorrelation[3]=pLHS[3]*pRHS[0]+pLHS[4]*pRHS[1];
	pOutCorrelation[4]=pLHS[4]*pRHS[0];
}


void computeImaginaryCorrelation3(float pOutCorrelation[3],const float complex pLHS[3],const float complex pRHS[3]){
	pOutCorrelation[0]=crealf(pLHS[0])*cimagf(pRHS[0])+cimagf(pLHS[0])*crealf(pRHS[0])+crealf(pLHS[1])*cimagf(pRHS[1])+cimagf(pLHS[1])*crealf(pRHS[1])+crealf(pLHS[2])*cimagf(pRHS[2])+cimagf(pLHS[2])*crealf(pRHS[2]);
	pOutCorrelation[1]=crealf(pLHS[1])*cimagf(pRHS[0])+cimagf(pLHS[1])*crealf(pRHS[0])+crealf(pLHS[2])*cimagf(pRHS[1])+cimagf(pLHS[2])*crealf(pRHS[1]);
	pOutCorrelation[2]=crealf(pLHS[2])*cimagf(pRHS[0])+cimagf(pLHS[2])*crealf(pRHS[0]);
}

void computeImaginaryCorrelation4(float pOutCorrelation[4],const float complex pLHS[4],const float complex pRHS[4]){
	pOutCorrelation[0]=crealf(pLHS[0])*cimagf(pRHS[0])+cimagf(pLHS[0])*crealf(pRHS[0])+crealf(pLHS[1])*cimagf(pRHS[1])+cimagf(pLHS[1])*crealf(pRHS[1])+crealf(pLHS[2])*cimagf(pRHS[2])+cimagf(pLHS[2])*crealf(pRHS[2])+crealf(pLHS[3])*cimagf(pRHS[3])+cimagf(pLHS[3])*crealf(pRHS[3]);
	pOutCorrelation[1]=crealf(pLHS[1])*cimagf(pRHS[0])+cimagf(pLHS[1])*crealf(pRHS[0])+crealf(pLHS[2])*cimagf(pRHS[1])+cimagf(pLHS[2])*crealf(pRHS[1])+crealf(pLHS[3])*cimagf(pRHS[2])+cimagf(pLHS[3])*crealf(pRHS[2]);
	pOutCorrelation[2]=crealf(pLHS[2])*cimagf(pRHS[0])+cimagf(pLHS[2])*crealf(pRHS[0])+crealf(pLHS[3])*cimagf(pRHS[1])+cimagf(pLHS[3])*crealf(pRHS[1]);
	pOutCorrelation[3]=crealf(pLHS[3])*cimagf(pRHS[0])+cimagf(pLHS[3])*crealf(pRHS[0]);
}

void computeImaginaryCorrelation5(float pOutCorrelation[5],const float complex pLHS[5],const float complex pRHS[5]){
	pOutCorrelation[0]=crealf(pLHS[0])*cimagf(pRHS[0])+cimagf(pLHS[0])*crealf(pRHS[0])+crealf(pLHS[1])*cimagf(pRHS[1])+cimagf(pLHS[1])*crealf(pRHS[1])+crealf(pLHS[2])*cimagf(pRHS[2])+cimagf(pLHS[2])*crealf(pRHS[2])+crealf(pLHS[3])*cimagf(pRHS[3])+cimagf(pLHS[3])*crealf(pRHS[3])+crealf(pLHS[4])*cimagf(pRHS[4])+cimagf(pLHS[4])*crealf(pRHS[4]);
	pOutCorrelation[1]=crealf(pLHS[1])*cimagf(pRHS[0])+cimagf(pLHS[1])*crealf(pRHS[0])+crealf(pLHS[2])*cimagf(pRHS[1])+cimagf(pLHS[2])*crealf(pRHS[1])+crealf(pLHS[3])*cimagf(pRHS[2])+cimagf(pLHS[3])*crealf(pRHS[2])+crealf(pLHS[4])*cimagf(pRHS[3])+cimagf(pLHS[4])*crealf(pRHS[3]);
	pOutCorrelation[2]=crealf(pLHS[2])*cimagf(pRHS[0])+cimagf(pLHS[2])*crealf(pRHS[0])+crealf(pLHS[3])*cimagf(pRHS[1])+cimagf(pLHS[3])*crealf(pRHS[1])+crealf(pLHS[4])*cimagf(pRHS[2])+cimagf(pLHS[4])*crealf(pRHS[2]);
	pOutCorrelation[3]=crealf(pLHS[3])*cimagf(pRHS[0])+cimagf(pLHS[3])*crealf(pRHS[0])+crealf(pLHS[4])*cimagf(pRHS[1])+cimagf(pLHS[4])*crealf(pRHS[1]);
	pOutCorrelation[4]=crealf(pLHS[4])*cimagf(pRHS[0])+cimagf(pLHS[4])*crealf(pRHS[0]);
}

void computeImaginaryCorrelation6(float pOutCorrelation[6],const float complex pLHS[6],const float complex pRHS[6]){
	pOutCorrelation[0]=crealf(pLHS[0])*cimagf(pRHS[0])+cimagf(pLHS[0])*crealf(pRHS[0])+crealf(pLHS[1])*cimagf(pRHS[1])+cimagf(pLHS[1])*crealf(pRHS[1])+crealf(pLHS[2])*cimagf(pRHS[2])+cimagf(pLHS[2])*crealf(pRHS[2])+crealf(pLHS[3])*cimagf(pRHS[3])+cimagf(pLHS[3])*crealf(pRHS[3])+crealf(pLHS[4])*cimagf(pRHS[4])+cimagf(pLHS[4])*crealf(pRHS[4])+crealf(pLHS[5])*cimagf(pRHS[5])+cimagf(pLHS[5])*crealf(pRHS[5]);
	pOutCorrelation[1]=crealf(pLHS[1])*cimagf(pRHS[0])+cimagf(pLHS[1])*crealf(pRHS[0])+crealf(pLHS[2])*cimagf(pRHS[1])+cimagf(pLHS[2])*crealf(pRHS[1])+crealf(pLHS[3])*cimagf(pRHS[2])+cimagf(pLHS[3])*crealf(pRHS[2])+crealf(pLHS[4])*cimagf(pRHS[3])+cimagf(pLHS[4])*crealf(pRHS[3])+crealf(pLHS[5])*cimagf(pRHS[4])+cimagf(pLHS[5])*crealf(pRHS[4]);
	pOutCorrelation[2]=crealf(pLHS[2])*cimagf(pRHS[0])+cimagf(pLHS[2])*crealf(pRHS[0])+crealf(pLHS[3])*cimagf(pRHS[1])+cimagf(pLHS[3])*crealf(pRHS[1])+crealf(pLHS[4])*cimagf(pRHS[2])+cimagf(pLHS[4])*crealf(pRHS[2])+crealf(pLHS[5])*cimagf(pRHS[3])+cimagf(pLHS[5])*crealf(pRHS[3]);
	pOutCorrelation[3]=crealf(pLHS[3])*cimagf(pRHS[0])+cimagf(pLHS[3])*crealf(pRHS[0])+crealf(pLHS[4])*cimagf(pRHS[1])+cimagf(pLHS[4])*crealf(pRHS[1])+crealf(pLHS[5])*cimagf(pRHS[2])+cimagf(pLHS[5])*crealf(pRHS[2]);
	pOutCorrelation[4]=crealf(pLHS[4])*cimagf(pRHS[0])+cimagf(pLHS[4])*crealf(pRHS[0])+crealf(pLHS[5])*cimagf(pRHS[1])+cimagf(pLHS[5])*crealf(pRHS[1]);
	pOutCorrelation[5]=crealf(pLHS[5])*cimagf(pRHS[0])+cimagf(pLHS[5])*crealf(pRHS[0]);
}

void computeImaginaryCorrelation7(float pOutCorrelation[7],const float complex pLHS[7],const float complex pRHS[7]){
	pOutCorrelation[0]=crealf(pLHS[0])*cimagf(pRHS[0])+cimagf(pLHS[0])*crealf(pRHS[0])+crealf(pLHS[1])*cimagf(pRHS[1])+cimagf(pLHS[1])*crealf(pRHS[1])+crealf(pLHS[2])*cimagf(pRHS[2])+cimagf(pLHS[2])*crealf(pRHS[2])+crealf(pLHS[3])*cimagf(pRHS[3])+cimagf(pLHS[3])*crealf(pRHS[3])+crealf(pLHS[4])*cimagf(pRHS[4])+cimagf(pLHS[4])*crealf(pRHS[4])+crealf(pLHS[5])*cimagf(pRHS[5])+cimagf(pLHS[5])*crealf(pRHS[5])+crealf(pLHS[6])*cimagf(pRHS[6])+cimagf(pLHS[6])*crealf(pRHS[6]);
	pOutCorrelation[1]=crealf(pLHS[1])*cimagf(pRHS[0])+cimagf(pLHS[1])*crealf(pRHS[0])+crealf(pLHS[2])*cimagf(pRHS[1])+cimagf(pLHS[2])*crealf(pRHS[1])+crealf(pLHS[3])*cimagf(pRHS[2])+cimagf(pLHS[3])*crealf(pRHS[2])+crealf(pLHS[4])*cimagf(pRHS[3])+cimagf(pLHS[4])*crealf(pRHS[3])+crealf(pLHS[5])*cimagf(pRHS[4])+cimagf(pLHS[5])*crealf(pRHS[4])+crealf(pLHS[6])*cimagf(pRHS[5])+cimagf(pLHS[6])*crealf(pRHS[5]);
	pOutCorrelation[2]=crealf(pLHS[2])*cimagf(pRHS[0])+cimagf(pLHS[2])*crealf(pRHS[0])+crealf(pLHS[3])*cimagf(pRHS[1])+cimagf(pLHS[3])*crealf(pRHS[1])+crealf(pLHS[4])*cimagf(pRHS[2])+cimagf(pLHS[4])*crealf(pRHS[2])+crealf(pLHS[5])*cimagf(pRHS[3])+cimagf(pLHS[5])*crealf(pRHS[3])+crealf(pLHS[6])*cimagf(pRHS[4])+cimagf(pLHS[6])*crealf(pRHS[4]);
	pOutCorrelation[3]=crealf(pLHS[3])*cimagf(pRHS[0])+cimagf(pLHS[3])*crealf(pRHS[0])+crealf(pLHS[4])*cimagf(pRHS[1])+cimagf(pLHS[4])*crealf(pRHS[1])+crealf(pLHS[5])*cimagf(pRHS[2])+cimagf(pLHS[5])*crealf(pRHS[2])+crealf(pLHS[6])*cimagf(pRHS[3])+cimagf(pLHS[6])*crealf(pRHS[3]);
	pOutCorrelation[4]=crealf(pLHS[4])*cimagf(pRHS[0])+cimagf(pLHS[4])*crealf(pRHS[0])+crealf(pLHS[5])*cimagf(pRHS[1])+cimagf(pLHS[5])*crealf(pRHS[1])+crealf(pLHS[6])*cimagf(pRHS[2])+cimagf(pLHS[6])*crealf(pRHS[2]);
	pOutCorrelation[5]=crealf(pLHS[5])*cimagf(pRHS[0])+cimagf(pLHS[5])*crealf(pRHS[0])+crealf(pLHS[6])*cimagf(pRHS[1])+cimagf(pLHS[6])*crealf(pRHS[1]);
	pOutCorrelation[6]=crealf(pLHS[6])*cimagf(pRHS[0])+cimagf(pLHS[6])*crealf(pRHS[0]);
}

void computeImaginaryCorrelation8(float pOutCorrelation[8],const float complex pLHS[8],const float complex pRHS[8]){
	pOutCorrelation[0]=crealf(pLHS[0])*cimagf(pRHS[0])+cimagf(pLHS[0])*crealf(pRHS[0])+crealf(pLHS[1])*cimagf(pRHS[1])+cimagf(pLHS[1])*crealf(pRHS[1])+crealf(pLHS[2])*cimagf(pRHS[2])+cimagf(pLHS[2])*crealf(pRHS[2])+crealf(pLHS[3])*cimagf(pRHS[3])+cimagf(pLHS[3])*crealf(pRHS[3])+crealf(pLHS[4])*cimagf(pRHS[4])+cimagf(pLHS[4])*crealf(pRHS[4])+crealf(pLHS[5])*cimagf(pRHS[5])+cimagf(pLHS[5])*crealf(pRHS[5])+crealf(pLHS[6])*cimagf(pRHS[6])+cimagf(pLHS[6])*crealf(pRHS[6])+crealf(pLHS[7])*cimagf(pRHS[7])+cimagf(pLHS[7])*crealf(pRHS[7]);
	pOutCorrelation[1]=crealf(pLHS[1])*cimagf(pRHS[0])+cimagf(pLHS[1])*crealf(pRHS[0])+crealf(pLHS[2])*cimagf(pRHS[1])+cimagf(pLHS[2])*crealf(pRHS[1])+crealf(pLHS[3])*cimagf(pRHS[2])+cimagf(pLHS[3])*crealf(pRHS[2])+crealf(pLHS[4])*cimagf(pRHS[3])+cimagf(pLHS[4])*crealf(pRHS[3])+crealf(pLHS[5])*cimagf(pRHS[4])+cimagf(pLHS[5])*crealf(pRHS[4])+crealf(pLHS[6])*cimagf(pRHS[5])+cimagf(pLHS[6])*crealf(pRHS[5])+crealf(pLHS[7])*cimagf(pRHS[6])+cimagf(pLHS[7])*crealf(pRHS[6]);
	pOutCorrelation[2]=crealf(pLHS[2])*cimagf(pRHS[0])+cimagf(pLHS[2])*crealf(pRHS[0])+crealf(pLHS[3])*cimagf(pRHS[1])+cimagf(pLHS[3])*crealf(pRHS[1])+crealf(pLHS[4])*cimagf(pRHS[2])+cimagf(pLHS[4])*crealf(pRHS[2])+crealf(pLHS[5])*cimagf(pRHS[3])+cimagf(pLHS[5])*crealf(pRHS[3])+crealf(pLHS[6])*cimagf(pRHS[4])+cimagf(pLHS[6])*crealf(pRHS[4])+crealf(pLHS[7])*cimagf(pRHS[5])+cimagf(pLHS[7])*crealf(pRHS[5]);
	pOutCorrelation[3]=crealf(pLHS[3])*cimagf(pRHS[0])+cimagf(pLHS[3])*crealf(pRHS[0])+crealf(pLHS[4])*cimagf(pRHS[1])+cimagf(pLHS[4])*crealf(pRHS[1])+crealf(pLHS[5])*cimagf(pRHS[2])+cimagf(pLHS[5])*crealf(pRHS[2])+crealf(pLHS[6])*cimagf(pRHS[3])+cimagf(pLHS[6])*crealf(pRHS[3])+crealf(pLHS[7])*cimagf(pRHS[4])+cimagf(pLHS[7])*crealf(pRHS[4]);
	pOutCorrelation[4]=crealf(pLHS[4])*cimagf(pRHS[0])+cimagf(pLHS[4])*crealf(pRHS[0])+crealf(pLHS[5])*cimagf(pRHS[1])+cimagf(pLHS[5])*crealf(pRHS[1])+crealf(pLHS[6])*cimagf(pRHS[2])+cimagf(pLHS[6])*crealf(pRHS[2])+crealf(pLHS[7])*cimagf(pRHS[3])+cimagf(pLHS[7])*crealf(pRHS[3]);
	pOutCorrelation[5]=crealf(pLHS[5])*cimagf(pRHS[0])+cimagf(pLHS[5])*crealf(pRHS[0])+crealf(pLHS[6])*cimagf(pRHS[1])+cimagf(pLHS[6])*crealf(pRHS[1])+crealf(pLHS[7])*cimagf(pRHS[2])+cimagf(pLHS[7])*crealf(pRHS[2]);
	pOutCorrelation[6]=crealf(pLHS[6])*cimagf(pRHS[0])+cimagf(pLHS[6])*crealf(pRHS[0])+crealf(pLHS[7])*cimagf(pRHS[1])+cimagf(pLHS[7])*crealf(pRHS[1]);
	pOutCorrelation[7]=crealf(pLHS[7])*cimagf(pRHS[0])+cimagf(pLHS[7])*crealf(pRHS[0]);
}

void computeImaginaryCorrelation9(float pOutCorrelation[9],const float complex pLHS[9],const float complex pRHS[9]){
	pOutCorrelation[0]=crealf(pLHS[0])*cimagf(pRHS[0])+cimagf(pLHS[0])*crealf(pRHS[0])+crealf(pLHS[1])*cimagf(pRHS[1])+cimagf(pLHS[1])*crealf(pRHS[1])+crealf(pLHS[2])*cimagf(pRHS[2])+cimagf(pLHS[2])*crealf(pRHS[2])+crealf(pLHS[3])*cimagf(pRHS[3])+cimagf(pLHS[3])*crealf(pRHS[3])+crealf(pLHS[4])*cimagf(pRHS[4])+cimagf(pLHS[4])*crealf(pRHS[4])+crealf(pLHS[5])*cimagf(pRHS[5])+cimagf(pLHS[5])*crealf(pRHS[5])+crealf(pLHS[6])*cimagf(pRHS[6])+cimagf(pLHS[6])*crealf(pRHS[6])+crealf(pLHS[7])*cimagf(pRHS[7])+cimagf(pLHS[7])*crealf(pRHS[7])+crealf(pLHS[8])*cimagf(pRHS[8])+cimagf(pLHS[8])*crealf(pRHS[8]);
	pOutCorrelation[1]=crealf(pLHS[1])*cimagf(pRHS[0])+cimagf(pLHS[1])*crealf(pRHS[0])+crealf(pLHS[2])*cimagf(pRHS[1])+cimagf(pLHS[2])*crealf(pRHS[1])+crealf(pLHS[3])*cimagf(pRHS[2])+cimagf(pLHS[3])*crealf(pRHS[2])+crealf(pLHS[4])*cimagf(pRHS[3])+cimagf(pLHS[4])*crealf(pRHS[3])+crealf(pLHS[5])*cimagf(pRHS[4])+cimagf(pLHS[5])*crealf(pRHS[4])+crealf(pLHS[6])*cimagf(pRHS[5])+cimagf(pLHS[6])*crealf(pRHS[5])+crealf(pLHS[7])*cimagf(pRHS[6])+cimagf(pLHS[7])*crealf(pRHS[6])+crealf(pLHS[8])*cimagf(pRHS[7])+cimagf(pLHS[8])*crealf(pRHS[7]);
	pOutCorrelation[2]=crealf(pLHS[2])*cimagf(pRHS[0])+cimagf(pLHS[2])*crealf(pRHS[0])+crealf(pLHS[3])*cimagf(pRHS[1])+cimagf(pLHS[3])*crealf(pRHS[1])+crealf(pLHS[4])*cimagf(pRHS[2])+cimagf(pLHS[4])*crealf(pRHS[2])+crealf(pLHS[5])*cimagf(pRHS[3])+cimagf(pLHS[5])*crealf(pRHS[3])+crealf(pLHS[6])*cimagf(pRHS[4])+cimagf(pLHS[6])*crealf(pRHS[4])+crealf(pLHS[7])*cimagf(pRHS[5])+cimagf(pLHS[7])*crealf(pRHS[5])+crealf(pLHS[8])*cimagf(pRHS[6])+cimagf(pLHS[8])*crealf(pRHS[6]);
	pOutCorrelation[3]=crealf(pLHS[3])*cimagf(pRHS[0])+cimagf(pLHS[3])*crealf(pRHS[0])+crealf(pLHS[4])*cimagf(pRHS[1])+cimagf(pLHS[4])*crealf(pRHS[1])+crealf(pLHS[5])*cimagf(pRHS[2])+cimagf(pLHS[5])*crealf(pRHS[2])+crealf(pLHS[6])*cimagf(pRHS[3])+cimagf(pLHS[6])*crealf(pRHS[3])+crealf(pLHS[7])*cimagf(pRHS[4])+cimagf(pLHS[7])*crealf(pRHS[4])+crealf(pLHS[8])*cimagf(pRHS[5])+cimagf(pLHS[8])*crealf(pRHS[5]);
	pOutCorrelation[4]=crealf(pLHS[4])*cimagf(pRHS[0])+cimagf(pLHS[4])*crealf(pRHS[0])+crealf(pLHS[5])*cimagf(pRHS[1])+cimagf(pLHS[5])*crealf(pRHS[1])+crealf(pLHS[6])*cimagf(pRHS[2])+cimagf(pLHS[6])*crealf(pRHS[2])+crealf(pLHS[7])*cimagf(pRHS[3])+cimagf(pLHS[7])*crealf(pRHS[3])+crealf(pLHS[8])*cimagf(pRHS[4])+cimagf(pLHS[8])*crealf(pRHS[4]);
	pOutCorrelation[5]=crealf(pLHS[5])*cimagf(pRHS[0])+cimagf(pLHS[5])*crealf(pRHS[0])+crealf(pLHS[6])*cimagf(pRHS[1])+cimagf(pLHS[6])*crealf(pRHS[1])+crealf(pLHS[7])*cimagf(pRHS[2])+cimagf(pLHS[7])*crealf(pRHS[2])+crealf(pLHS[8])*cimagf(pRHS[3])+cimagf(pLHS[8])*crealf(pRHS[3]);
	pOutCorrelation[6]=crealf(pLHS[6])*cimagf(pRHS[0])+cimagf(pLHS[6])*crealf(pRHS[0])+crealf(pLHS[7])*cimagf(pRHS[1])+cimagf(pLHS[7])*crealf(pRHS[1])+crealf(pLHS[8])*cimagf(pRHS[2])+cimagf(pLHS[8])*crealf(pRHS[2]);
	pOutCorrelation[7]=crealf(pLHS[7])*cimagf(pRHS[0])+cimagf(pLHS[7])*crealf(pRHS[0])+crealf(pLHS[8])*cimagf(pRHS[1])+cimagf(pLHS[8])*crealf(pRHS[1]);
	pOutCorrelation[8]=crealf(pLHS[8])*cimagf(pRHS[0])+cimagf(pLHS[8])*crealf(pRHS[0]);
}


float complex evaluateFastHerglotzTransform2(const float complex circlePoint,const float complex pExponentialMoment[2],const float complex pEvaluationPolynomial[2]){
	float complex conjCirclePoint=conjf(circlePoint);
	float polynomial1=crealf(pEvaluationPolynomial[0]);
	float complex polynomial0=pEvaluationPolynomial[1]+polynomial1*conjCirclePoint;
	float complex dotProduct=polynomial1*pExponentialMoment[1];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

float complex evaluateFastHerglotzTransform3(const float complex circlePoint,const float complex pExponentialMoment[3],const float complex pEvaluationPolynomial[3]){
	float complex conjCirclePoint=conjf(circlePoint);
	float polynomial2=crealf(pEvaluationPolynomial[0]);
	float complex polynomial1=pEvaluationPolynomial[1]+polynomial2*conjCirclePoint;
	float complex polynomial0=pEvaluationPolynomial[2]+conjCirclePoint*polynomial1;
	float complex dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

float complex evaluateFastHerglotzTransform4(const float complex circlePoint,const float complex pExponentialMoment[4],const float complex pEvaluationPolynomial[4]){
	float complex conjCirclePoint=conjf(circlePoint);
	float polynomial3=crealf(pEvaluationPolynomial[0]);
	float complex polynomial2=pEvaluationPolynomial[1]+polynomial3*conjCirclePoint;
	float complex polynomial1=pEvaluationPolynomial[2]+conjCirclePoint*polynomial2;
	float complex polynomial0=pEvaluationPolynomial[3]+conjCirclePoint*polynomial1;
	float complex dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2]+polynomial3*pExponentialMoment[3];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

float complex evaluateFastHerglotzTransform5(const float complex circlePoint,const float complex pExponentialMoment[5],const float complex pEvaluationPolynomial[5]){
	float complex conjCirclePoint=conjf(circlePoint);
	float polynomial4=crealf(pEvaluationPolynomial[0]);
	float complex polynomial3=pEvaluationPolynomial[1]+polynomial4*conjCirclePoint;
	float complex polynomial2=pEvaluationPolynomial[2]+conjCirclePoint*polynomial3;
	float complex polynomial1=pEvaluationPolynomial[3]+conjCirclePoint*polynomial2;
	float complex polynomial0=pEvaluationPolynomial[4]+conjCirclePoint*polynomial1;
	float complex dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2]+polynomial3*pExponentialMoment[3]+polynomial4*pExponentialMoment[4];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

float complex evaluateFastHerglotzTransform6(const float complex circlePoint,const float complex pExponentialMoment[6],const float complex pEvaluationPolynomial[6]){
	float complex conjCirclePoint=conjf(circlePoint);
	float polynomial5=crealf(pEvaluationPolynomial[0]);
	float complex polynomial4=pEvaluationPolynomial[1]+polynomial5*conjCirclePoint;
	float complex polynomial3=pEvaluationPolynomial[2]+conjCirclePoint*polynomial4;
	float complex polynomial2=pEvaluationPolynomial[3]+conjCirclePoint*polynomial3;
	float complex polynomial1=pEvaluationPolynomial[4]+conjCirclePoint*polynomial2;
	float complex polynomial0=pEvaluationPolynomial[5]+conjCirclePoint*polynomial1;
	float complex dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2]+polynomial3*pExponentialMoment[3]+polynomial4*pExponentialMoment[4]+polynomial5*pExponentialMoment[5];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

float complex evaluateFastHerglotzTransform7(const float complex circlePoint,const float complex pExponentialMoment[7],const float complex pEvaluationPolynomial[7]){
	float complex conjCirclePoint=conjf(circlePoint);
	float polynomial6=crealf(pEvaluationPolynomial[0]);
	float complex polynomial5=pEvaluationPolynomial[1]+polynomial6*conjCirclePoint;
	float complex polynomial4=pEvaluationPolynomial[2]+conjCirclePoint*polynomial5;
	float complex polynomial3=pEvaluationPolynomial[3]+conjCirclePoint*polynomial4;
	float complex polynomial2=pEvaluationPolynomial[4]+conjCirclePoint*polynomial3;
	float complex polynomial1=pEvaluationPolynomial[5]+conjCirclePoint*polynomial2;
	float complex polynomial0=pEvaluationPolynomial[6]+conjCirclePoint*polynomial1;
	float complex dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2]+polynomial3*pExponentialMoment[3]+polynomial4*pExponentialMoment[4]+polynomial5*pExponentialMoment[5]+polynomial6*pExponentialMoment[6];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

float complex evaluateFastHerglotzTransform8(const float complex circlePoint,const float complex pExponentialMoment[8],const float complex pEvaluationPolynomial[8]){
	float complex conjCirclePoint=conjf(circlePoint);
	float polynomial7=crealf(pEvaluationPolynomial[0]);
	float complex polynomial6=pEvaluationPolynomial[1]+polynomial7*conjCirclePoint;
	float complex polynomial5=pEvaluationPolynomial[2]+conjCirclePoint*polynomial6;
	float complex polynomial4=pEvaluationPolynomial[3]+conjCirclePoint*polynomial5;
	float complex polynomial3=pEvaluationPolynomial[4]+conjCirclePoint*polynomial4;
	float complex polynomial2=pEvaluationPolynomial[5]+conjCirclePoint*polynomial3;
	float complex polynomial1=pEvaluationPolynomial[6]+conjCirclePoint*polynomial2;
	float complex polynomial0=pEvaluationPolynomial[7]+conjCirclePoint*polynomial1;
	float complex dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2]+polynomial3*pExponentialMoment[3]+polynomial4*pExponentialMoment[4]+polynomial5*pExponentialMoment[5]+polynomial6*pExponentialMoment[6]+polynomial7*pExponentialMoment[7];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

float complex evaluateFastHerglotzTransform9(const float complex circlePoint,const float complex pExponentialMoment[9],const float complex pEvaluationPolynomial[9]){
	float complex conjCirclePoint=conjf(circlePoint);
	float polynomial8=crealf(pEvaluationPolynomial[0]);
	float complex polynomial7=pEvaluationPolynomial[1]+polynomial8*conjCirclePoint;
	float complex polynomial6=pEvaluationPolynomial[2]+conjCirclePoint*polynomial7;
	float complex polynomial5=pEvaluationPolynomial[3]+conjCirclePoint*polynomial6;
	float complex polynomial4=pEvaluationPolynomial[4]+conjCirclePoint*polynomial5;
	float complex polynomial3=pEvaluationPolynomial[5]+conjCirclePoint*polynomial4;
	float complex polynomial2=pEvaluationPolynomial[6]+conjCirclePoint*polynomial3;
	float complex polynomial1=pEvaluationPolynomial[7]+conjCirclePoint*polynomial2;
	float complex polynomial0=pEvaluationPolynomial[8]+conjCirclePoint*polynomial1;
	float complex dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2]+polynomial3*pExponentialMoment[3]+polynomial4*pExponentialMoment[4]+polynomial5*pExponentialMoment[5]+polynomial6*pExponentialMoment[6]+polynomial7*pExponentialMoment[7]+polynomial8*pExponentialMoment[8];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}


float evaluateFourierSeries2(const float complex circlePoint,const float complex pFourierCoefficient[2]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float result=crealf(pFourierCoefficient[1])*crealf(circlePointPower1)-cimagf(pFourierCoefficient[1])*cimagf(circlePointPower1);
	return 2.0f*result+crealf(pFourierCoefficient[0]);
}

float evaluateFourierSeries3(const float complex circlePoint,const float complex pFourierCoefficient[3]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float result=crealf(pFourierCoefficient[1])*crealf(circlePointPower1)-cimagf(pFourierCoefficient[1])*cimagf(circlePointPower1)+crealf(pFourierCoefficient[2])*crealf(circlePointPower2)-cimagf(pFourierCoefficient[2])*cimagf(circlePointPower2);
	return 2.0f*result+crealf(pFourierCoefficient[0]);
}

float evaluateFourierSeries4(const float complex circlePoint,const float complex pFourierCoefficient[4]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float complex circlePointPower3=circlePointPower1*circlePointPower2;
	float result=crealf(pFourierCoefficient[1])*crealf(circlePointPower1)-cimagf(pFourierCoefficient[1])*cimagf(circlePointPower1)+crealf(pFourierCoefficient[2])*crealf(circlePointPower2)-cimagf(pFourierCoefficient[2])*cimagf(circlePointPower2)+crealf(pFourierCoefficient[3])*crealf(circlePointPower3)-cimagf(pFourierCoefficient[3])*cimagf(circlePointPower3);
	return 2.0f*result+crealf(pFourierCoefficient[0]);
}

float evaluateFourierSeries5(const float complex circlePoint,const float complex pFourierCoefficient[5]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float complex circlePointPower3=circlePointPower1*circlePointPower2;
	float complex circlePointPower4=circlePointPower2*circlePointPower2;
	float result=crealf(pFourierCoefficient[1])*crealf(circlePointPower1)-cimagf(pFourierCoefficient[1])*cimagf(circlePointPower1)+crealf(pFourierCoefficient[2])*crealf(circlePointPower2)-cimagf(pFourierCoefficient[2])*cimagf(circlePointPower2)+crealf(pFourierCoefficient[3])*crealf(circlePointPower3)-cimagf(pFourierCoefficient[3])*cimagf(circlePointPower3)+crealf(pFourierCoefficient[4])*crealf(circlePointPower4)-cimagf(pFourierCoefficient[4])*cimagf(circlePointPower4);
	return 2.0f*result+crealf(pFourierCoefficient[0]);
}


float evaluateFourierSeriesReal3(const float complex circlePoint,const float pFourierCoefficient[3]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float result=pFourierCoefficient[1]*crealf(circlePointPower1)+pFourierCoefficient[2]*crealf(circlePointPower2);
	return 2.0f*result+pFourierCoefficient[0];
}

float evaluateFourierSeriesReal4(const float complex circlePoint,const float pFourierCoefficient[4]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float complex circlePointPower3=circlePointPower1*circlePointPower2;
	float result=pFourierCoefficient[1]*crealf(circlePointPower1)+pFourierCoefficient[2]*crealf(circlePointPower2)+pFourierCoefficient[3]*crealf(circlePointPower3);
	return 2.0f*result+pFourierCoefficient[0];
}

float evaluateFourierSeriesReal5(const float complex circlePoint,const float pFourierCoefficient[5]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float complex circlePointPower3=circlePointPower1*circlePointPower2;
	float complex circlePointPower4=circlePointPower2*circlePointPower2;
	float result=pFourierCoefficient[1]*crealf(circlePointPower1)+pFourierCoefficient[2]*crealf(circlePointPower2)+pFourierCoefficient[3]*crealf(circlePointPower3)+pFourierCoefficient[4]*crealf(circlePointPower4);
	return 2.0f*result+pFourierCoefficient[0];
}

float evaluateFourierSeriesReal6(const float complex circlePoint,const float pFourierCoefficient[6]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float complex circlePointPower3=circlePointPower1*circlePointPower2;
	float complex circlePointPower4=circlePointPower2*circlePointPower2;
	float complex circlePointPower5=circlePointPower1*circlePointPower4;
	float result=pFourierCoefficient[1]*crealf(circlePointPower1)+pFourierCoefficient[2]*crealf(circlePointPower2)+pFourierCoefficient[3]*crealf(circlePointPower3)+pFourierCoefficient[4]*crealf(circlePointPower4)+pFourierCoefficient[5]*crealf(circlePointPower5);
	return 2.0f*result+pFourierCoefficient[0];
}

float evaluateFourierSeriesReal7(const float complex circlePoint,const float pFourierCoefficient[7]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float complex circlePointPower3=circlePointPower1*circlePointPower2;
	float complex circlePointPower4=circlePointPower2*circlePointPower2;
	float complex circlePointPower5=circlePointPower1*circlePointPower4;
	float complex circlePointPower6=circlePointPower2*circlePointPower4;
	float result=pFourierCoefficient[1]*crealf(circlePointPower1)+pFourierCoefficient[2]*crealf(circlePointPower2)+pFourierCoefficient[3]*crealf(circlePointPower3)+pFourierCoefficient[4]*crealf(circlePointPower4)+pFourierCoefficient[5]*crealf(circlePointPower5)+pFourierCoefficient[6]*crealf(circlePointPower6);
	return 2.0f*result+pFourierCoefficient[0];
}

float evaluateFourierSeriesReal8(const float complex circlePoint,const float pFourierCoefficient[8]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float complex circlePointPower3=circlePointPower1*circlePointPower2;
	float complex circlePointPower4=circlePointPower2*circlePointPower2;
	float complex circlePointPower5=circlePointPower1*circlePointPower4;
	float complex circlePointPower6=circlePointPower2*circlePointPower4;
	float complex circlePointPower7=circlePointPower3*circlePointPower4;
	float result=pFourierCoefficient[1]*crealf(circlePointPower1)+pFourierCoefficient[2]*crealf(circlePointPower2)+pFourierCoefficient[3]*crealf(circlePointPower3)+pFourierCoefficient[4]*crealf(circlePointPower4)+pFourierCoefficient[5]*crealf(circlePointPower5)+pFourierCoefficient[6]*crealf(circlePointPower6)+pFourierCoefficient[7]*crealf(circlePointPower7);
	return 2.0f*result+pFourierCoefficient[0];
}

float evaluateFourierSeriesReal9(const float complex circlePoint,const float pFourierCoefficient[9]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	float complex circlePointPower1=circlePoint;
	float complex circlePointPower2=circlePointPower1*circlePointPower1;
	float complex circlePointPower3=circlePointPower1*circlePointPower2;
	float complex circlePointPower4=circlePointPower2*circlePointPower2;
	float complex circlePointPower5=circlePointPower1*circlePointPower4;
	float complex circlePointPower6=circlePointPower2*circlePointPower4;
	float complex circlePointPower7=circlePointPower3*circlePointPower4;
	float complex circlePointPower8=circlePointPower4*circlePointPower4;
	float result=pFourierCoefficient[1]*crealf(circlePointPower1)+pFourierCoefficient[2]*crealf(circlePointPower2)+pFourierCoefficient[3]*crealf(circlePointPower3)+pFourierCoefficient[4]*crealf(circlePointPower4)+pFourierCoefficient[5]*crealf(circlePointPower5)+pFourierCoefficient[6]*crealf(circlePointPower6)+pFourierCoefficient[7]*crealf(circlePointPower7)+pFourierCoefficient[8]*crealf(circlePointPower8);
	return 2.0f*result+pFourierCoefficient[0];
}


void prepareReflectanceSpectrum2(float complex pOutExponentialMoment[2],float complex pOutEvaluationPolynomial[2],const float complex pTrigonometricMoment[2]){
	trigonometricToExponentialMoments2(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm2(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
}

void prepareReflectanceSpectrum3(float complex pOutExponentialMoment[3],float complex pOutEvaluationPolynomial[3],const float complex pTrigonometricMoment[3]){
	trigonometricToExponentialMoments3(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm3(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
}

void prepareReflectanceSpectrum4(float complex pOutExponentialMoment[4],float complex pOutEvaluationPolynomial[4],const float complex pTrigonometricMoment[4]){
	trigonometricToExponentialMoments4(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm4(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
	pOutEvaluationPolynomial[3]=6.28318531f*pOutEvaluationPolynomial[3];
}

void prepareReflectanceSpectrum5(float complex pOutExponentialMoment[5],float complex pOutEvaluationPolynomial[5],const float complex pTrigonometricMoment[5]){
	trigonometricToExponentialMoments5(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm5(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
	pOutEvaluationPolynomial[3]=6.28318531f*pOutEvaluationPolynomial[3];
	pOutEvaluationPolynomial[4]=6.28318531f*pOutEvaluationPolynomial[4];
}

void prepareReflectanceSpectrumReal3(float complex pOutExponentialMoment[3],float complex pOutEvaluationPolynomial[3],const float pTrigonometricMoment[3]){
	trigonometricToExponentialMomentsReal3(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm3(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
}

void prepareReflectanceSpectrumReal4(float complex pOutExponentialMoment[4],float complex pOutEvaluationPolynomial[4],const float pTrigonometricMoment[4]){
	trigonometricToExponentialMomentsReal4(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm4(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
	pOutEvaluationPolynomial[3]=6.28318531f*pOutEvaluationPolynomial[3];
}

void prepareReflectanceSpectrumReal5(float complex pOutExponentialMoment[5],float complex pOutEvaluationPolynomial[5],const float pTrigonometricMoment[5]){
	trigonometricToExponentialMomentsReal5(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm5(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
	pOutEvaluationPolynomial[3]=6.28318531f*pOutEvaluationPolynomial[3];
	pOutEvaluationPolynomial[4]=6.28318531f*pOutEvaluationPolynomial[4];
}

void prepareReflectanceSpectrumReal6(float complex pOutExponentialMoment[6],float complex pOutEvaluationPolynomial[6],const float pTrigonometricMoment[6]){
	trigonometricToExponentialMomentsReal6(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm6(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
	pOutEvaluationPolynomial[3]=6.28318531f*pOutEvaluationPolynomial[3];
	pOutEvaluationPolynomial[4]=6.28318531f*pOutEvaluationPolynomial[4];
	pOutEvaluationPolynomial[5]=6.28318531f*pOutEvaluationPolynomial[5];
}

void prepareReflectanceSpectrumReal7(float complex pOutExponentialMoment[7],float complex pOutEvaluationPolynomial[7],const float pTrigonometricMoment[7]){
	trigonometricToExponentialMomentsReal7(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm7(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
	pOutEvaluationPolynomial[3]=6.28318531f*pOutEvaluationPolynomial[3];
	pOutEvaluationPolynomial[4]=6.28318531f*pOutEvaluationPolynomial[4];
	pOutEvaluationPolynomial[5]=6.28318531f*pOutEvaluationPolynomial[5];
	pOutEvaluationPolynomial[6]=6.28318531f*pOutEvaluationPolynomial[6];
}

void prepareReflectanceSpectrumReal8(float complex pOutExponentialMoment[8],float complex pOutEvaluationPolynomial[8],const float pTrigonometricMoment[8]){
	trigonometricToExponentialMomentsReal8(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm8(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
	pOutEvaluationPolynomial[3]=6.28318531f*pOutEvaluationPolynomial[3];
	pOutEvaluationPolynomial[4]=6.28318531f*pOutEvaluationPolynomial[4];
	pOutEvaluationPolynomial[5]=6.28318531f*pOutEvaluationPolynomial[5];
	pOutEvaluationPolynomial[6]=6.28318531f*pOutEvaluationPolynomial[6];
	pOutEvaluationPolynomial[7]=6.28318531f*pOutEvaluationPolynomial[7];
}

void prepareReflectanceSpectrumReal9(float complex pOutExponentialMoment[9],float complex pOutEvaluationPolynomial[9],const float pTrigonometricMoment[9]){
	trigonometricToExponentialMomentsReal9(pOutExponentialMoment,pTrigonometricMoment);
	levinsonsAlgorithm9(pOutEvaluationPolynomial,pOutExponentialMoment);
	pOutEvaluationPolynomial[0]=6.28318531f*pOutEvaluationPolynomial[0];
	pOutEvaluationPolynomial[1]=6.28318531f*pOutEvaluationPolynomial[1];
	pOutEvaluationPolynomial[2]=6.28318531f*pOutEvaluationPolynomial[2];
	pOutEvaluationPolynomial[3]=6.28318531f*pOutEvaluationPolynomial[3];
	pOutEvaluationPolynomial[4]=6.28318531f*pOutEvaluationPolynomial[4];
	pOutEvaluationPolynomial[5]=6.28318531f*pOutEvaluationPolynomial[5];
	pOutEvaluationPolynomial[6]=6.28318531f*pOutEvaluationPolynomial[6];
	pOutEvaluationPolynomial[7]=6.28318531f*pOutEvaluationPolynomial[7];
	pOutEvaluationPolynomial[8]=6.28318531f*pOutEvaluationPolynomial[8];
}


float evaluateReflectanceSpectrum2(const float phase,const float complex pExponentialMoment[2],const float complex pEvaluationPolynomial[2]){
	float complex circlePoint;
	circlePoint=CMPLXF(cosf(phase),sinf(phase));
	float complex herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform2(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return atan2(cimagf(herglotzTransform),crealf(herglotzTransform))*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum3(const float phase,const float complex pExponentialMoment[3],const float complex pEvaluationPolynomial[3]){
	float complex circlePoint;
	circlePoint=CMPLXF(cosf(phase),sinf(phase));
	float complex herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform3(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return atan2(cimagf(herglotzTransform),crealf(herglotzTransform))*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum4(const float phase,const float complex pExponentialMoment[4],const float complex pEvaluationPolynomial[4]){
	float complex circlePoint;
	circlePoint=CMPLXF(cosf(phase),sinf(phase));
	float complex herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform4(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return atan2(cimagf(herglotzTransform),crealf(herglotzTransform))*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum5(const float phase,const float complex pExponentialMoment[5],const float complex pEvaluationPolynomial[5]){
	float complex circlePoint;
	circlePoint=CMPLXF(cosf(phase),sinf(phase));
	float complex herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform5(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return atan2(cimagf(herglotzTransform),crealf(herglotzTransform))*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum6(const float phase,const float complex pExponentialMoment[6],const float complex pEvaluationPolynomial[6]){
	float complex circlePoint;
	circlePoint=CMPLXF(cosf(phase),sinf(phase));
	float complex herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform6(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return atan2(cimagf(herglotzTransform),crealf(herglotzTransform))*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum7(const float phase,const float complex pExponentialMoment[7],const float complex pEvaluationPolynomial[7]){
	float complex circlePoint;
	circlePoint=CMPLXF(cosf(phase),sinf(phase));
	float complex herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform7(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return atan2(cimagf(herglotzTransform),crealf(herglotzTransform))*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum8(const float phase,const float complex pExponentialMoment[8],const float complex pEvaluationPolynomial[8]){
	float complex circlePoint;
	circlePoint=CMPLXF(cosf(phase),sinf(phase));
	float complex herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform8(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return atan2(cimagf(herglotzTransform),crealf(herglotzTransform))*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum9(const float phase,const float complex pExponentialMoment[9],const float complex pEvaluationPolynomial[9]){
	float complex circlePoint;
	circlePoint=CMPLXF(cosf(phase),sinf(phase));
	float complex herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform9(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return atan2(cimagf(herglotzTransform),crealf(herglotzTransform))*0.318309886f+0.5f;
}


void prepareReflectanceSpectrumLagrange2(float complex pOutLagrangeMultiplier[2],const float complex pTrigonometricMoment[2]){
	float complex pExponentialMoment[2];
	trigonometricToExponentialMoments2(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[2];
	levinsonsAlgorithm2(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	float complex pAutocorrelation[2];
	computeAutocorrelation2(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeCorrelation2(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[0]);
	pOutLagrangeMultiplier[1]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[1]);
	pOutLagrangeMultiplier[0]=CMPLXF(crealf(pOutLagrangeMultiplier[0]),0.0f);
}

void prepareReflectanceSpectrumLagrange3(float complex pOutLagrangeMultiplier[3],const float complex pTrigonometricMoment[3]){
	float complex pExponentialMoment[3];
	trigonometricToExponentialMoments3(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[3];
	levinsonsAlgorithm3(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	float complex pAutocorrelation[3];
	computeAutocorrelation3(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeCorrelation3(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[0]);
	pOutLagrangeMultiplier[1]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[1]);
	pOutLagrangeMultiplier[2]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[2]);
	pOutLagrangeMultiplier[0]=CMPLXF(crealf(pOutLagrangeMultiplier[0]),0.0f);
}

void prepareReflectanceSpectrumLagrange4(float complex pOutLagrangeMultiplier[4],const float complex pTrigonometricMoment[4]){
	float complex pExponentialMoment[4];
	trigonometricToExponentialMoments4(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[4];
	levinsonsAlgorithm4(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	pEvaluationPolynomial[3]=6.28318531f*pEvaluationPolynomial[3];
	float complex pAutocorrelation[4];
	computeAutocorrelation4(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeCorrelation4(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[0]);
	pOutLagrangeMultiplier[1]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[1]);
	pOutLagrangeMultiplier[2]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[2]);
	pOutLagrangeMultiplier[3]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[3]);
	pOutLagrangeMultiplier[0]=CMPLXF(crealf(pOutLagrangeMultiplier[0]),0.0f);
}

void prepareReflectanceSpectrumLagrange5(float complex pOutLagrangeMultiplier[5],const float complex pTrigonometricMoment[5]){
	float complex pExponentialMoment[5];
	trigonometricToExponentialMoments5(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[5];
	levinsonsAlgorithm5(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	pEvaluationPolynomial[3]=6.28318531f*pEvaluationPolynomial[3];
	pEvaluationPolynomial[4]=6.28318531f*pEvaluationPolynomial[4];
	float complex pAutocorrelation[5];
	computeAutocorrelation5(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeCorrelation5(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[0]);
	pOutLagrangeMultiplier[1]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[1]);
	pOutLagrangeMultiplier[2]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[2]);
	pOutLagrangeMultiplier[3]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[3]);
	pOutLagrangeMultiplier[4]=normalizationFactor*(CMPLXF(-0.0f,-1.0f)*pOutLagrangeMultiplier[4]);
	pOutLagrangeMultiplier[0]=CMPLXF(crealf(pOutLagrangeMultiplier[0]),0.0f);
}

void prepareReflectanceSpectrumLagrangeReal3(float pOutLagrangeMultiplier[3],const float pTrigonometricMoment[3]){
	float complex pExponentialMoment[3];
	trigonometricToExponentialMomentsReal3(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[3];
	levinsonsAlgorithm3(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	float complex pAutocorrelation[3];
	computeAutocorrelation3(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation3(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*pOutLagrangeMultiplier[0];
	pOutLagrangeMultiplier[1]=normalizationFactor*pOutLagrangeMultiplier[1];
	pOutLagrangeMultiplier[2]=normalizationFactor*pOutLagrangeMultiplier[2];
}

void prepareReflectanceSpectrumLagrangeReal4(float pOutLagrangeMultiplier[4],const float pTrigonometricMoment[4]){
	float complex pExponentialMoment[4];
	trigonometricToExponentialMomentsReal4(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[4];
	levinsonsAlgorithm4(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	pEvaluationPolynomial[3]=6.28318531f*pEvaluationPolynomial[3];
	float complex pAutocorrelation[4];
	computeAutocorrelation4(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation4(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*pOutLagrangeMultiplier[0];
	pOutLagrangeMultiplier[1]=normalizationFactor*pOutLagrangeMultiplier[1];
	pOutLagrangeMultiplier[2]=normalizationFactor*pOutLagrangeMultiplier[2];
	pOutLagrangeMultiplier[3]=normalizationFactor*pOutLagrangeMultiplier[3];
}

void prepareReflectanceSpectrumLagrangeReal5(float pOutLagrangeMultiplier[5],const float pTrigonometricMoment[5]){
	float complex pExponentialMoment[5];
	trigonometricToExponentialMomentsReal5(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[5];
	levinsonsAlgorithm5(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	pEvaluationPolynomial[3]=6.28318531f*pEvaluationPolynomial[3];
	pEvaluationPolynomial[4]=6.28318531f*pEvaluationPolynomial[4];
	float complex pAutocorrelation[5];
	computeAutocorrelation5(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation5(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*pOutLagrangeMultiplier[0];
	pOutLagrangeMultiplier[1]=normalizationFactor*pOutLagrangeMultiplier[1];
	pOutLagrangeMultiplier[2]=normalizationFactor*pOutLagrangeMultiplier[2];
	pOutLagrangeMultiplier[3]=normalizationFactor*pOutLagrangeMultiplier[3];
	pOutLagrangeMultiplier[4]=normalizationFactor*pOutLagrangeMultiplier[4];
}

void prepareReflectanceSpectrumLagrangeReal6(float pOutLagrangeMultiplier[6],const float pTrigonometricMoment[6]){
	float complex pExponentialMoment[6];
	trigonometricToExponentialMomentsReal6(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[6];
	levinsonsAlgorithm6(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	pEvaluationPolynomial[3]=6.28318531f*pEvaluationPolynomial[3];
	pEvaluationPolynomial[4]=6.28318531f*pEvaluationPolynomial[4];
	pEvaluationPolynomial[5]=6.28318531f*pEvaluationPolynomial[5];
	float complex pAutocorrelation[6];
	computeAutocorrelation6(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation6(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*pOutLagrangeMultiplier[0];
	pOutLagrangeMultiplier[1]=normalizationFactor*pOutLagrangeMultiplier[1];
	pOutLagrangeMultiplier[2]=normalizationFactor*pOutLagrangeMultiplier[2];
	pOutLagrangeMultiplier[3]=normalizationFactor*pOutLagrangeMultiplier[3];
	pOutLagrangeMultiplier[4]=normalizationFactor*pOutLagrangeMultiplier[4];
	pOutLagrangeMultiplier[5]=normalizationFactor*pOutLagrangeMultiplier[5];
}

void prepareReflectanceSpectrumLagrangeReal7(float pOutLagrangeMultiplier[7],const float pTrigonometricMoment[7]){
	float complex pExponentialMoment[7];
	trigonometricToExponentialMomentsReal7(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[7];
	levinsonsAlgorithm7(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	pEvaluationPolynomial[3]=6.28318531f*pEvaluationPolynomial[3];
	pEvaluationPolynomial[4]=6.28318531f*pEvaluationPolynomial[4];
	pEvaluationPolynomial[5]=6.28318531f*pEvaluationPolynomial[5];
	pEvaluationPolynomial[6]=6.28318531f*pEvaluationPolynomial[6];
	float complex pAutocorrelation[7];
	computeAutocorrelation7(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation7(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*pOutLagrangeMultiplier[0];
	pOutLagrangeMultiplier[1]=normalizationFactor*pOutLagrangeMultiplier[1];
	pOutLagrangeMultiplier[2]=normalizationFactor*pOutLagrangeMultiplier[2];
	pOutLagrangeMultiplier[3]=normalizationFactor*pOutLagrangeMultiplier[3];
	pOutLagrangeMultiplier[4]=normalizationFactor*pOutLagrangeMultiplier[4];
	pOutLagrangeMultiplier[5]=normalizationFactor*pOutLagrangeMultiplier[5];
	pOutLagrangeMultiplier[6]=normalizationFactor*pOutLagrangeMultiplier[6];
}

void prepareReflectanceSpectrumLagrangeReal8(float pOutLagrangeMultiplier[8],const float pTrigonometricMoment[8]){
	float complex pExponentialMoment[8];
	trigonometricToExponentialMomentsReal8(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[8];
	levinsonsAlgorithm8(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	pEvaluationPolynomial[3]=6.28318531f*pEvaluationPolynomial[3];
	pEvaluationPolynomial[4]=6.28318531f*pEvaluationPolynomial[4];
	pEvaluationPolynomial[5]=6.28318531f*pEvaluationPolynomial[5];
	pEvaluationPolynomial[6]=6.28318531f*pEvaluationPolynomial[6];
	pEvaluationPolynomial[7]=6.28318531f*pEvaluationPolynomial[7];
	float complex pAutocorrelation[8];
	computeAutocorrelation8(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation8(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*pOutLagrangeMultiplier[0];
	pOutLagrangeMultiplier[1]=normalizationFactor*pOutLagrangeMultiplier[1];
	pOutLagrangeMultiplier[2]=normalizationFactor*pOutLagrangeMultiplier[2];
	pOutLagrangeMultiplier[3]=normalizationFactor*pOutLagrangeMultiplier[3];
	pOutLagrangeMultiplier[4]=normalizationFactor*pOutLagrangeMultiplier[4];
	pOutLagrangeMultiplier[5]=normalizationFactor*pOutLagrangeMultiplier[5];
	pOutLagrangeMultiplier[6]=normalizationFactor*pOutLagrangeMultiplier[6];
	pOutLagrangeMultiplier[7]=normalizationFactor*pOutLagrangeMultiplier[7];
}

void prepareReflectanceSpectrumLagrangeReal9(float pOutLagrangeMultiplier[9],const float pTrigonometricMoment[9]){
	float complex pExponentialMoment[9];
	trigonometricToExponentialMomentsReal9(pExponentialMoment,pTrigonometricMoment);
	float complex pEvaluationPolynomial[9];
	levinsonsAlgorithm9(pEvaluationPolynomial,pExponentialMoment);
	pEvaluationPolynomial[0]=6.28318531f*pEvaluationPolynomial[0];
	pEvaluationPolynomial[1]=6.28318531f*pEvaluationPolynomial[1];
	pEvaluationPolynomial[2]=6.28318531f*pEvaluationPolynomial[2];
	pEvaluationPolynomial[3]=6.28318531f*pEvaluationPolynomial[3];
	pEvaluationPolynomial[4]=6.28318531f*pEvaluationPolynomial[4];
	pEvaluationPolynomial[5]=6.28318531f*pEvaluationPolynomial[5];
	pEvaluationPolynomial[6]=6.28318531f*pEvaluationPolynomial[6];
	pEvaluationPolynomial[7]=6.28318531f*pEvaluationPolynomial[7];
	pEvaluationPolynomial[8]=6.28318531f*pEvaluationPolynomial[8];
	float complex pAutocorrelation[9];
	computeAutocorrelation9(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation9(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*crealf(pEvaluationPolynomial[0]));
	pOutLagrangeMultiplier[0]=normalizationFactor*pOutLagrangeMultiplier[0];
	pOutLagrangeMultiplier[1]=normalizationFactor*pOutLagrangeMultiplier[1];
	pOutLagrangeMultiplier[2]=normalizationFactor*pOutLagrangeMultiplier[2];
	pOutLagrangeMultiplier[3]=normalizationFactor*pOutLagrangeMultiplier[3];
	pOutLagrangeMultiplier[4]=normalizationFactor*pOutLagrangeMultiplier[4];
	pOutLagrangeMultiplier[5]=normalizationFactor*pOutLagrangeMultiplier[5];
	pOutLagrangeMultiplier[6]=normalizationFactor*pOutLagrangeMultiplier[6];
	pOutLagrangeMultiplier[7]=normalizationFactor*pOutLagrangeMultiplier[7];
	pOutLagrangeMultiplier[8]=normalizationFactor*pOutLagrangeMultiplier[8];
}


float evaluateReflectanceSpectrumLagrange2(const float phase,const float complex pLagrangeMultiplier[2]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeries2(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrange3(const float phase,const float complex pLagrangeMultiplier[3]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeries3(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrange4(const float phase,const float complex pLagrangeMultiplier[4]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeries4(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrange5(const float phase,const float complex pLagrangeMultiplier[5]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeries5(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal3(const float phase,const float pLagrangeMultiplier[3]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal3(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal4(const float phase,const float pLagrangeMultiplier[4]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal4(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal5(const float phase,const float pLagrangeMultiplier[5]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal5(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal6(const float phase,const float pLagrangeMultiplier[6]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal6(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal7(const float phase,const float pLagrangeMultiplier[7]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal7(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal8(const float phase,const float pLagrangeMultiplier[8]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal8(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal9(const float phase,const float pLagrangeMultiplier[9]){
	float complex conjCirclePoint;
	conjCirclePoint=CMPLXF(cosf(-phase),sinf(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal9(conjCirclePoint,pLagrangeMultiplier);
	return atan(lagrangeSeries)*0.318309886f+0.5f;
}


