// 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 <cmath>
#include <complex>

void trigonometricToExponentialMomentsReal3(std::complex<float> pOutExponentialMoment[3],const float pTrigonometricMoment[3]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0]-1.57079633f;
	pOutExponentialMoment[0]=std::complex<float>(std::cos(zerothMomentPhase),std::sin(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=pTrigonometricMoment[1]*std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0];
	pOutExponentialMoment[2]=pTrigonometricMoment[2]*std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[1]*std::complex<float>(0.0f,3.14159265f)*pOutExponentialMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMomentsReal4(std::complex<float> pOutExponentialMoment[4],const float pTrigonometricMoment[4]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0]-1.57079633f;
	pOutExponentialMoment[0]=std::complex<float>(std::cos(zerothMomentPhase),std::sin(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=pTrigonometricMoment[1]*std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0];
	pOutExponentialMoment[2]=pTrigonometricMoment[2]*std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[1]*std::complex<float>(0.0f,3.14159265f)*pOutExponentialMoment[1];
	pOutExponentialMoment[3]=pTrigonometricMoment[3]*std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]+pTrigonometricMoment[2]*std::complex<float>(0.0f,4.1887902f)*pOutExponentialMoment[1]+pTrigonometricMoment[1]*std::complex<float>(0.0f,2.0943951f)*pOutExponentialMoment[2];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

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

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

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

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

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

void trigonometricToExponentialMoments2(std::complex<float> pOutExponentialMoment[2],const std::complex<float> pTrigonometricMoment[2]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0].real()-1.57079633f;
	pOutExponentialMoment[0]=std::complex<float>(std::cos(zerothMomentPhase),std::sin(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMoments3(std::complex<float> pOutExponentialMoment[3],const std::complex<float> pTrigonometricMoment[3]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0].real()-1.57079633f;
	pOutExponentialMoment[0]=std::complex<float>(std::cos(zerothMomentPhase),std::sin(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[1];
	pOutExponentialMoment[2]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[2]+std::complex<float>(0.0f,3.14159265f)*pOutExponentialMoment[1]*pTrigonometricMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMoments4(std::complex<float> pOutExponentialMoment[4],const std::complex<float> pTrigonometricMoment[4]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0].real()-1.57079633f;
	pOutExponentialMoment[0]=std::complex<float>(std::cos(zerothMomentPhase),std::sin(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[1];
	pOutExponentialMoment[2]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[2]+std::complex<float>(0.0f,3.14159265f)*pOutExponentialMoment[1]*pTrigonometricMoment[1];
	pOutExponentialMoment[3]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[3]+std::complex<float>(0.0f,4.1887902f)*pOutExponentialMoment[1]*pTrigonometricMoment[2]+std::complex<float>(0.0f,2.0943951f)*pOutExponentialMoment[2]*pTrigonometricMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}

void trigonometricToExponentialMoments5(std::complex<float> pOutExponentialMoment[5],const std::complex<float> pTrigonometricMoment[5]){
	float zerothMomentPhase=3.14159265f*pTrigonometricMoment[0].real()-1.57079633f;
	pOutExponentialMoment[0]=std::complex<float>(std::cos(zerothMomentPhase),std::sin(zerothMomentPhase));
	pOutExponentialMoment[0]=0.0795774715f*pOutExponentialMoment[0];
	pOutExponentialMoment[1]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[1];
	pOutExponentialMoment[2]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[2]+std::complex<float>(0.0f,3.14159265f)*pOutExponentialMoment[1]*pTrigonometricMoment[1];
	pOutExponentialMoment[3]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[3]+std::complex<float>(0.0f,4.1887902f)*pOutExponentialMoment[1]*pTrigonometricMoment[2]+std::complex<float>(0.0f,2.0943951f)*pOutExponentialMoment[2]*pTrigonometricMoment[1];
	pOutExponentialMoment[4]=std::complex<float>(0.0f,6.28318531f)*pOutExponentialMoment[0]*pTrigonometricMoment[4]+std::complex<float>(0.0f,4.71238898f)*pOutExponentialMoment[1]*pTrigonometricMoment[3]+std::complex<float>(0.0f,3.14159265f)*pOutExponentialMoment[2]*pTrigonometricMoment[2]+std::complex<float>(0.0f,1.57079633f)*pOutExponentialMoment[3]*pTrigonometricMoment[1];
	pOutExponentialMoment[0]=2.0f*pOutExponentialMoment[0];
}


void levinsonsAlgorithm2(std::complex<float> pOutSolution[2],const std::complex<float> pFirstColumn[2]){
	pOutSolution[0]=std::complex<float>(1.0f/(pFirstColumn[0].real()));
	std::complex<float> dotProduct;
	std::complex<float> flippedSolution1;
	float factor;
	dotProduct=pOutSolution[0].real()*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(-flippedSolution1.real()*dotProduct);
}

void levinsonsAlgorithm3(std::complex<float> pOutSolution[3],const std::complex<float> pFirstColumn[3]){
	pOutSolution[0]=std::complex<float>(1.0f/(pFirstColumn[0].real()));
	std::complex<float> dotProduct;
	std::complex<float> flippedSolution1;
	std::complex<float> flippedSolution2;
	float factor;
	dotProduct=pOutSolution[0].real()*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(-flippedSolution1.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[1]);
	flippedSolution2=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-flippedSolution2.real()*dotProduct);
}

void levinsonsAlgorithm4(std::complex<float> pOutSolution[4],const std::complex<float> pFirstColumn[4]){
	pOutSolution[0]=std::complex<float>(1.0f/(pFirstColumn[0].real()));
	std::complex<float> dotProduct;
	std::complex<float> flippedSolution1;
	std::complex<float> flippedSolution2;
	std::complex<float> flippedSolution3;
	float factor;
	dotProduct=pOutSolution[0].real()*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(-flippedSolution1.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[1]);
	flippedSolution2=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-flippedSolution2.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[2]);
	flippedSolution2=std::conj(pOutSolution[1]);
	flippedSolution3=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-flippedSolution3.real()*dotProduct);
}

void levinsonsAlgorithm5(std::complex<float> pOutSolution[5],const std::complex<float> pFirstColumn[5]){
	pOutSolution[0]=std::complex<float>(1.0f/(pFirstColumn[0].real()));
	std::complex<float> dotProduct;
	std::complex<float> flippedSolution1;
	std::complex<float> flippedSolution2;
	std::complex<float> flippedSolution3;
	std::complex<float> flippedSolution4;
	float factor;
	dotProduct=pOutSolution[0].real()*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(-flippedSolution1.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[1]);
	flippedSolution2=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-flippedSolution2.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[2]);
	flippedSolution2=std::conj(pOutSolution[1]);
	flippedSolution3=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-flippedSolution3.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[3]);
	flippedSolution2=std::conj(pOutSolution[2]);
	flippedSolution3=std::conj(pOutSolution[1]);
	flippedSolution4=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-flippedSolution4.real()*dotProduct);
}

void levinsonsAlgorithm6(std::complex<float> pOutSolution[6],const std::complex<float> pFirstColumn[6]){
	pOutSolution[0]=std::complex<float>(1.0f/(pFirstColumn[0].real()));
	std::complex<float> dotProduct;
	std::complex<float> flippedSolution1;
	std::complex<float> flippedSolution2;
	std::complex<float> flippedSolution3;
	std::complex<float> flippedSolution4;
	std::complex<float> flippedSolution5;
	float factor;
	dotProduct=pOutSolution[0].real()*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(-flippedSolution1.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[1]);
	flippedSolution2=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-flippedSolution2.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[2]);
	flippedSolution2=std::conj(pOutSolution[1]);
	flippedSolution3=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-flippedSolution3.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[3]);
	flippedSolution2=std::conj(pOutSolution[2]);
	flippedSolution3=std::conj(pOutSolution[1]);
	flippedSolution4=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-flippedSolution4.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[5]+pOutSolution[1]*pFirstColumn[4]+pOutSolution[2]*pFirstColumn[3]+pOutSolution[3]*pFirstColumn[2]+pOutSolution[4]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[4]);
	flippedSolution2=std::conj(pOutSolution[3]);
	flippedSolution3=std::conj(pOutSolution[2]);
	flippedSolution4=std::conj(pOutSolution[1]);
	flippedSolution5=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution5.real()*dotProduct);
}

void levinsonsAlgorithm7(std::complex<float> pOutSolution[7],const std::complex<float> pFirstColumn[7]){
	pOutSolution[0]=std::complex<float>(1.0f/(pFirstColumn[0].real()));
	std::complex<float> dotProduct;
	std::complex<float> flippedSolution1;
	std::complex<float> flippedSolution2;
	std::complex<float> flippedSolution3;
	std::complex<float> flippedSolution4;
	std::complex<float> flippedSolution5;
	std::complex<float> flippedSolution6;
	float factor;
	dotProduct=pOutSolution[0].real()*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(-flippedSolution1.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[1]);
	flippedSolution2=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-flippedSolution2.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[2]);
	flippedSolution2=std::conj(pOutSolution[1]);
	flippedSolution3=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-flippedSolution3.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[3]);
	flippedSolution2=std::conj(pOutSolution[2]);
	flippedSolution3=std::conj(pOutSolution[1]);
	flippedSolution4=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-flippedSolution4.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[5]+pOutSolution[1]*pFirstColumn[4]+pOutSolution[2]*pFirstColumn[3]+pOutSolution[3]*pFirstColumn[2]+pOutSolution[4]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[4]);
	flippedSolution2=std::conj(pOutSolution[3]);
	flippedSolution3=std::conj(pOutSolution[2]);
	flippedSolution4=std::conj(pOutSolution[1]);
	flippedSolution5=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution5.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*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-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[5]);
	flippedSolution2=std::conj(pOutSolution[4]);
	flippedSolution3=std::conj(pOutSolution[3]);
	flippedSolution4=std::conj(pOutSolution[2]);
	flippedSolution5=std::conj(pOutSolution[1]);
	flippedSolution6=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution6.real()*dotProduct);
}

void levinsonsAlgorithm8(std::complex<float> pOutSolution[8],const std::complex<float> pFirstColumn[8]){
	pOutSolution[0]=std::complex<float>(1.0f/(pFirstColumn[0].real()));
	std::complex<float> dotProduct;
	std::complex<float> flippedSolution1;
	std::complex<float> flippedSolution2;
	std::complex<float> flippedSolution3;
	std::complex<float> flippedSolution4;
	std::complex<float> flippedSolution5;
	std::complex<float> flippedSolution6;
	std::complex<float> flippedSolution7;
	float factor;
	dotProduct=pOutSolution[0].real()*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(-flippedSolution1.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[1]);
	flippedSolution2=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-flippedSolution2.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[2]);
	flippedSolution2=std::conj(pOutSolution[1]);
	flippedSolution3=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-flippedSolution3.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[3]);
	flippedSolution2=std::conj(pOutSolution[2]);
	flippedSolution3=std::conj(pOutSolution[1]);
	flippedSolution4=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-flippedSolution4.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[5]+pOutSolution[1]*pFirstColumn[4]+pOutSolution[2]*pFirstColumn[3]+pOutSolution[3]*pFirstColumn[2]+pOutSolution[4]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[4]);
	flippedSolution2=std::conj(pOutSolution[3]);
	flippedSolution3=std::conj(pOutSolution[2]);
	flippedSolution4=std::conj(pOutSolution[1]);
	flippedSolution5=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution5.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*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-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[5]);
	flippedSolution2=std::conj(pOutSolution[4]);
	flippedSolution3=std::conj(pOutSolution[3]);
	flippedSolution4=std::conj(pOutSolution[2]);
	flippedSolution5=std::conj(pOutSolution[1]);
	flippedSolution6=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution6.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*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-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[6]);
	flippedSolution2=std::conj(pOutSolution[5]);
	flippedSolution3=std::conj(pOutSolution[4]);
	flippedSolution4=std::conj(pOutSolution[3]);
	flippedSolution5=std::conj(pOutSolution[2]);
	flippedSolution6=std::conj(pOutSolution[1]);
	flippedSolution7=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution7.real()*dotProduct);
}

void levinsonsAlgorithm9(std::complex<float> pOutSolution[9],const std::complex<float> pFirstColumn[9]){
	pOutSolution[0]=std::complex<float>(1.0f/(pFirstColumn[0].real()));
	std::complex<float> dotProduct;
	std::complex<float> flippedSolution1;
	std::complex<float> flippedSolution2;
	std::complex<float> flippedSolution3;
	std::complex<float> flippedSolution4;
	std::complex<float> flippedSolution5;
	std::complex<float> flippedSolution6;
	std::complex<float> flippedSolution7;
	std::complex<float> flippedSolution8;
	float factor;
	dotProduct=pOutSolution[0].real()*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(-flippedSolution1.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[2]+pOutSolution[1]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[1]);
	flippedSolution2=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(-flippedSolution2.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[3]+pOutSolution[1]*pFirstColumn[2]+pOutSolution[2]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[2]);
	flippedSolution2=std::conj(pOutSolution[1]);
	flippedSolution3=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(-flippedSolution3.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[4]+pOutSolution[1]*pFirstColumn[3]+pOutSolution[2]*pFirstColumn[2]+pOutSolution[3]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[3]);
	flippedSolution2=std::conj(pOutSolution[2]);
	flippedSolution3=std::conj(pOutSolution[1]);
	flippedSolution4=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	pOutSolution[1]=factor*(pOutSolution[1]-flippedSolution1*dotProduct);
	pOutSolution[2]=factor*(pOutSolution[2]-flippedSolution2*dotProduct);
	pOutSolution[3]=factor*(pOutSolution[3]-flippedSolution3*dotProduct);
	pOutSolution[4]=factor*(-flippedSolution4.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*pFirstColumn[5]+pOutSolution[1]*pFirstColumn[4]+pOutSolution[2]*pFirstColumn[3]+pOutSolution[3]*pFirstColumn[2]+pOutSolution[4]*pFirstColumn[1];
	factor=1.0f/(1.0f-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[4]);
	flippedSolution2=std::conj(pOutSolution[3]);
	flippedSolution3=std::conj(pOutSolution[2]);
	flippedSolution4=std::conj(pOutSolution[1]);
	flippedSolution5=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution5.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*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-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[5]);
	flippedSolution2=std::conj(pOutSolution[4]);
	flippedSolution3=std::conj(pOutSolution[3]);
	flippedSolution4=std::conj(pOutSolution[2]);
	flippedSolution5=std::conj(pOutSolution[1]);
	flippedSolution6=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution6.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*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-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[6]);
	flippedSolution2=std::conj(pOutSolution[5]);
	flippedSolution3=std::conj(pOutSolution[4]);
	flippedSolution4=std::conj(pOutSolution[3]);
	flippedSolution5=std::conj(pOutSolution[2]);
	flippedSolution6=std::conj(pOutSolution[1]);
	flippedSolution7=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution7.real()*dotProduct);
	dotProduct=pOutSolution[0].real()*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-std::norm(dotProduct));
	flippedSolution1=std::conj(pOutSolution[7]);
	flippedSolution2=std::conj(pOutSolution[6]);
	flippedSolution3=std::conj(pOutSolution[5]);
	flippedSolution4=std::conj(pOutSolution[4]);
	flippedSolution5=std::conj(pOutSolution[3]);
	flippedSolution6=std::conj(pOutSolution[2]);
	flippedSolution7=std::conj(pOutSolution[1]);
	flippedSolution8=std::complex<float>(pOutSolution[0].real());
	pOutSolution[0]=std::complex<float>(factor*pOutSolution[0].real());
	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*(-flippedSolution8.real()*dotProduct);
}


void computeAutocorrelation2(std::complex<float> pOutAutocorrelation[2],const std::complex<float> pSignal[2]){
	pOutAutocorrelation[0]=pSignal[0]*std::conj(pSignal[0])+pSignal[1]*std::conj(pSignal[1]);
	pOutAutocorrelation[1]=pSignal[0]*std::conj(pSignal[1]);
}

void computeAutocorrelation3(std::complex<float> pOutAutocorrelation[3],const std::complex<float> pSignal[3]){
	pOutAutocorrelation[0]=pSignal[0]*std::conj(pSignal[0])+pSignal[1]*std::conj(pSignal[1])+pSignal[2]*std::conj(pSignal[2]);
	pOutAutocorrelation[1]=pSignal[0]*std::conj(pSignal[1])+pSignal[1]*std::conj(pSignal[2]);
	pOutAutocorrelation[2]=pSignal[0]*std::conj(pSignal[2]);
}

void computeAutocorrelation4(std::complex<float> pOutAutocorrelation[4],const std::complex<float> pSignal[4]){
	pOutAutocorrelation[0]=pSignal[0]*std::conj(pSignal[0])+pSignal[1]*std::conj(pSignal[1])+pSignal[2]*std::conj(pSignal[2])+pSignal[3]*std::conj(pSignal[3]);
	pOutAutocorrelation[1]=pSignal[0]*std::conj(pSignal[1])+pSignal[1]*std::conj(pSignal[2])+pSignal[2]*std::conj(pSignal[3]);
	pOutAutocorrelation[2]=pSignal[0]*std::conj(pSignal[2])+pSignal[1]*std::conj(pSignal[3]);
	pOutAutocorrelation[3]=pSignal[0]*std::conj(pSignal[3]);
}

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

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

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

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

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


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

void computeCorrelation3(std::complex<float> pOutCorrelation[3],const std::complex<float> pLHS[3],const std::complex<float> 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(std::complex<float> pOutCorrelation[4],const std::complex<float> pLHS[4],const std::complex<float> 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(std::complex<float> pOutCorrelation[5],const std::complex<float> pLHS[5],const std::complex<float> 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 std::complex<float> pLHS[3],const std::complex<float> pRHS[3]){
	pOutCorrelation[0]=pLHS[0].real()*pRHS[0].imag()+pLHS[0].imag()*pRHS[0].real()+pLHS[1].real()*pRHS[1].imag()+pLHS[1].imag()*pRHS[1].real()+pLHS[2].real()*pRHS[2].imag()+pLHS[2].imag()*pRHS[2].real();
	pOutCorrelation[1]=pLHS[1].real()*pRHS[0].imag()+pLHS[1].imag()*pRHS[0].real()+pLHS[2].real()*pRHS[1].imag()+pLHS[2].imag()*pRHS[1].real();
	pOutCorrelation[2]=pLHS[2].real()*pRHS[0].imag()+pLHS[2].imag()*pRHS[0].real();
}

void computeImaginaryCorrelation4(float pOutCorrelation[4],const std::complex<float> pLHS[4],const std::complex<float> pRHS[4]){
	pOutCorrelation[0]=pLHS[0].real()*pRHS[0].imag()+pLHS[0].imag()*pRHS[0].real()+pLHS[1].real()*pRHS[1].imag()+pLHS[1].imag()*pRHS[1].real()+pLHS[2].real()*pRHS[2].imag()+pLHS[2].imag()*pRHS[2].real()+pLHS[3].real()*pRHS[3].imag()+pLHS[3].imag()*pRHS[3].real();
	pOutCorrelation[1]=pLHS[1].real()*pRHS[0].imag()+pLHS[1].imag()*pRHS[0].real()+pLHS[2].real()*pRHS[1].imag()+pLHS[2].imag()*pRHS[1].real()+pLHS[3].real()*pRHS[2].imag()+pLHS[3].imag()*pRHS[2].real();
	pOutCorrelation[2]=pLHS[2].real()*pRHS[0].imag()+pLHS[2].imag()*pRHS[0].real()+pLHS[3].real()*pRHS[1].imag()+pLHS[3].imag()*pRHS[1].real();
	pOutCorrelation[3]=pLHS[3].real()*pRHS[0].imag()+pLHS[3].imag()*pRHS[0].real();
}

void computeImaginaryCorrelation5(float pOutCorrelation[5],const std::complex<float> pLHS[5],const std::complex<float> pRHS[5]){
	pOutCorrelation[0]=pLHS[0].real()*pRHS[0].imag()+pLHS[0].imag()*pRHS[0].real()+pLHS[1].real()*pRHS[1].imag()+pLHS[1].imag()*pRHS[1].real()+pLHS[2].real()*pRHS[2].imag()+pLHS[2].imag()*pRHS[2].real()+pLHS[3].real()*pRHS[3].imag()+pLHS[3].imag()*pRHS[3].real()+pLHS[4].real()*pRHS[4].imag()+pLHS[4].imag()*pRHS[4].real();
	pOutCorrelation[1]=pLHS[1].real()*pRHS[0].imag()+pLHS[1].imag()*pRHS[0].real()+pLHS[2].real()*pRHS[1].imag()+pLHS[2].imag()*pRHS[1].real()+pLHS[3].real()*pRHS[2].imag()+pLHS[3].imag()*pRHS[2].real()+pLHS[4].real()*pRHS[3].imag()+pLHS[4].imag()*pRHS[3].real();
	pOutCorrelation[2]=pLHS[2].real()*pRHS[0].imag()+pLHS[2].imag()*pRHS[0].real()+pLHS[3].real()*pRHS[1].imag()+pLHS[3].imag()*pRHS[1].real()+pLHS[4].real()*pRHS[2].imag()+pLHS[4].imag()*pRHS[2].real();
	pOutCorrelation[3]=pLHS[3].real()*pRHS[0].imag()+pLHS[3].imag()*pRHS[0].real()+pLHS[4].real()*pRHS[1].imag()+pLHS[4].imag()*pRHS[1].real();
	pOutCorrelation[4]=pLHS[4].real()*pRHS[0].imag()+pLHS[4].imag()*pRHS[0].real();
}

void computeImaginaryCorrelation6(float pOutCorrelation[6],const std::complex<float> pLHS[6],const std::complex<float> pRHS[6]){
	pOutCorrelation[0]=pLHS[0].real()*pRHS[0].imag()+pLHS[0].imag()*pRHS[0].real()+pLHS[1].real()*pRHS[1].imag()+pLHS[1].imag()*pRHS[1].real()+pLHS[2].real()*pRHS[2].imag()+pLHS[2].imag()*pRHS[2].real()+pLHS[3].real()*pRHS[3].imag()+pLHS[3].imag()*pRHS[3].real()+pLHS[4].real()*pRHS[4].imag()+pLHS[4].imag()*pRHS[4].real()+pLHS[5].real()*pRHS[5].imag()+pLHS[5].imag()*pRHS[5].real();
	pOutCorrelation[1]=pLHS[1].real()*pRHS[0].imag()+pLHS[1].imag()*pRHS[0].real()+pLHS[2].real()*pRHS[1].imag()+pLHS[2].imag()*pRHS[1].real()+pLHS[3].real()*pRHS[2].imag()+pLHS[3].imag()*pRHS[2].real()+pLHS[4].real()*pRHS[3].imag()+pLHS[4].imag()*pRHS[3].real()+pLHS[5].real()*pRHS[4].imag()+pLHS[5].imag()*pRHS[4].real();
	pOutCorrelation[2]=pLHS[2].real()*pRHS[0].imag()+pLHS[2].imag()*pRHS[0].real()+pLHS[3].real()*pRHS[1].imag()+pLHS[3].imag()*pRHS[1].real()+pLHS[4].real()*pRHS[2].imag()+pLHS[4].imag()*pRHS[2].real()+pLHS[5].real()*pRHS[3].imag()+pLHS[5].imag()*pRHS[3].real();
	pOutCorrelation[3]=pLHS[3].real()*pRHS[0].imag()+pLHS[3].imag()*pRHS[0].real()+pLHS[4].real()*pRHS[1].imag()+pLHS[4].imag()*pRHS[1].real()+pLHS[5].real()*pRHS[2].imag()+pLHS[5].imag()*pRHS[2].real();
	pOutCorrelation[4]=pLHS[4].real()*pRHS[0].imag()+pLHS[4].imag()*pRHS[0].real()+pLHS[5].real()*pRHS[1].imag()+pLHS[5].imag()*pRHS[1].real();
	pOutCorrelation[5]=pLHS[5].real()*pRHS[0].imag()+pLHS[5].imag()*pRHS[0].real();
}

void computeImaginaryCorrelation7(float pOutCorrelation[7],const std::complex<float> pLHS[7],const std::complex<float> pRHS[7]){
	pOutCorrelation[0]=pLHS[0].real()*pRHS[0].imag()+pLHS[0].imag()*pRHS[0].real()+pLHS[1].real()*pRHS[1].imag()+pLHS[1].imag()*pRHS[1].real()+pLHS[2].real()*pRHS[2].imag()+pLHS[2].imag()*pRHS[2].real()+pLHS[3].real()*pRHS[3].imag()+pLHS[3].imag()*pRHS[3].real()+pLHS[4].real()*pRHS[4].imag()+pLHS[4].imag()*pRHS[4].real()+pLHS[5].real()*pRHS[5].imag()+pLHS[5].imag()*pRHS[5].real()+pLHS[6].real()*pRHS[6].imag()+pLHS[6].imag()*pRHS[6].real();
	pOutCorrelation[1]=pLHS[1].real()*pRHS[0].imag()+pLHS[1].imag()*pRHS[0].real()+pLHS[2].real()*pRHS[1].imag()+pLHS[2].imag()*pRHS[1].real()+pLHS[3].real()*pRHS[2].imag()+pLHS[3].imag()*pRHS[2].real()+pLHS[4].real()*pRHS[3].imag()+pLHS[4].imag()*pRHS[3].real()+pLHS[5].real()*pRHS[4].imag()+pLHS[5].imag()*pRHS[4].real()+pLHS[6].real()*pRHS[5].imag()+pLHS[6].imag()*pRHS[5].real();
	pOutCorrelation[2]=pLHS[2].real()*pRHS[0].imag()+pLHS[2].imag()*pRHS[0].real()+pLHS[3].real()*pRHS[1].imag()+pLHS[3].imag()*pRHS[1].real()+pLHS[4].real()*pRHS[2].imag()+pLHS[4].imag()*pRHS[2].real()+pLHS[5].real()*pRHS[3].imag()+pLHS[5].imag()*pRHS[3].real()+pLHS[6].real()*pRHS[4].imag()+pLHS[6].imag()*pRHS[4].real();
	pOutCorrelation[3]=pLHS[3].real()*pRHS[0].imag()+pLHS[3].imag()*pRHS[0].real()+pLHS[4].real()*pRHS[1].imag()+pLHS[4].imag()*pRHS[1].real()+pLHS[5].real()*pRHS[2].imag()+pLHS[5].imag()*pRHS[2].real()+pLHS[6].real()*pRHS[3].imag()+pLHS[6].imag()*pRHS[3].real();
	pOutCorrelation[4]=pLHS[4].real()*pRHS[0].imag()+pLHS[4].imag()*pRHS[0].real()+pLHS[5].real()*pRHS[1].imag()+pLHS[5].imag()*pRHS[1].real()+pLHS[6].real()*pRHS[2].imag()+pLHS[6].imag()*pRHS[2].real();
	pOutCorrelation[5]=pLHS[5].real()*pRHS[0].imag()+pLHS[5].imag()*pRHS[0].real()+pLHS[6].real()*pRHS[1].imag()+pLHS[6].imag()*pRHS[1].real();
	pOutCorrelation[6]=pLHS[6].real()*pRHS[0].imag()+pLHS[6].imag()*pRHS[0].real();
}

void computeImaginaryCorrelation8(float pOutCorrelation[8],const std::complex<float> pLHS[8],const std::complex<float> pRHS[8]){
	pOutCorrelation[0]=pLHS[0].real()*pRHS[0].imag()+pLHS[0].imag()*pRHS[0].real()+pLHS[1].real()*pRHS[1].imag()+pLHS[1].imag()*pRHS[1].real()+pLHS[2].real()*pRHS[2].imag()+pLHS[2].imag()*pRHS[2].real()+pLHS[3].real()*pRHS[3].imag()+pLHS[3].imag()*pRHS[3].real()+pLHS[4].real()*pRHS[4].imag()+pLHS[4].imag()*pRHS[4].real()+pLHS[5].real()*pRHS[5].imag()+pLHS[5].imag()*pRHS[5].real()+pLHS[6].real()*pRHS[6].imag()+pLHS[6].imag()*pRHS[6].real()+pLHS[7].real()*pRHS[7].imag()+pLHS[7].imag()*pRHS[7].real();
	pOutCorrelation[1]=pLHS[1].real()*pRHS[0].imag()+pLHS[1].imag()*pRHS[0].real()+pLHS[2].real()*pRHS[1].imag()+pLHS[2].imag()*pRHS[1].real()+pLHS[3].real()*pRHS[2].imag()+pLHS[3].imag()*pRHS[2].real()+pLHS[4].real()*pRHS[3].imag()+pLHS[4].imag()*pRHS[3].real()+pLHS[5].real()*pRHS[4].imag()+pLHS[5].imag()*pRHS[4].real()+pLHS[6].real()*pRHS[5].imag()+pLHS[6].imag()*pRHS[5].real()+pLHS[7].real()*pRHS[6].imag()+pLHS[7].imag()*pRHS[6].real();
	pOutCorrelation[2]=pLHS[2].real()*pRHS[0].imag()+pLHS[2].imag()*pRHS[0].real()+pLHS[3].real()*pRHS[1].imag()+pLHS[3].imag()*pRHS[1].real()+pLHS[4].real()*pRHS[2].imag()+pLHS[4].imag()*pRHS[2].real()+pLHS[5].real()*pRHS[3].imag()+pLHS[5].imag()*pRHS[3].real()+pLHS[6].real()*pRHS[4].imag()+pLHS[6].imag()*pRHS[4].real()+pLHS[7].real()*pRHS[5].imag()+pLHS[7].imag()*pRHS[5].real();
	pOutCorrelation[3]=pLHS[3].real()*pRHS[0].imag()+pLHS[3].imag()*pRHS[0].real()+pLHS[4].real()*pRHS[1].imag()+pLHS[4].imag()*pRHS[1].real()+pLHS[5].real()*pRHS[2].imag()+pLHS[5].imag()*pRHS[2].real()+pLHS[6].real()*pRHS[3].imag()+pLHS[6].imag()*pRHS[3].real()+pLHS[7].real()*pRHS[4].imag()+pLHS[7].imag()*pRHS[4].real();
	pOutCorrelation[4]=pLHS[4].real()*pRHS[0].imag()+pLHS[4].imag()*pRHS[0].real()+pLHS[5].real()*pRHS[1].imag()+pLHS[5].imag()*pRHS[1].real()+pLHS[6].real()*pRHS[2].imag()+pLHS[6].imag()*pRHS[2].real()+pLHS[7].real()*pRHS[3].imag()+pLHS[7].imag()*pRHS[3].real();
	pOutCorrelation[5]=pLHS[5].real()*pRHS[0].imag()+pLHS[5].imag()*pRHS[0].real()+pLHS[6].real()*pRHS[1].imag()+pLHS[6].imag()*pRHS[1].real()+pLHS[7].real()*pRHS[2].imag()+pLHS[7].imag()*pRHS[2].real();
	pOutCorrelation[6]=pLHS[6].real()*pRHS[0].imag()+pLHS[6].imag()*pRHS[0].real()+pLHS[7].real()*pRHS[1].imag()+pLHS[7].imag()*pRHS[1].real();
	pOutCorrelation[7]=pLHS[7].real()*pRHS[0].imag()+pLHS[7].imag()*pRHS[0].real();
}

void computeImaginaryCorrelation9(float pOutCorrelation[9],const std::complex<float> pLHS[9],const std::complex<float> pRHS[9]){
	pOutCorrelation[0]=pLHS[0].real()*pRHS[0].imag()+pLHS[0].imag()*pRHS[0].real()+pLHS[1].real()*pRHS[1].imag()+pLHS[1].imag()*pRHS[1].real()+pLHS[2].real()*pRHS[2].imag()+pLHS[2].imag()*pRHS[2].real()+pLHS[3].real()*pRHS[3].imag()+pLHS[3].imag()*pRHS[3].real()+pLHS[4].real()*pRHS[4].imag()+pLHS[4].imag()*pRHS[4].real()+pLHS[5].real()*pRHS[5].imag()+pLHS[5].imag()*pRHS[5].real()+pLHS[6].real()*pRHS[6].imag()+pLHS[6].imag()*pRHS[6].real()+pLHS[7].real()*pRHS[7].imag()+pLHS[7].imag()*pRHS[7].real()+pLHS[8].real()*pRHS[8].imag()+pLHS[8].imag()*pRHS[8].real();
	pOutCorrelation[1]=pLHS[1].real()*pRHS[0].imag()+pLHS[1].imag()*pRHS[0].real()+pLHS[2].real()*pRHS[1].imag()+pLHS[2].imag()*pRHS[1].real()+pLHS[3].real()*pRHS[2].imag()+pLHS[3].imag()*pRHS[2].real()+pLHS[4].real()*pRHS[3].imag()+pLHS[4].imag()*pRHS[3].real()+pLHS[5].real()*pRHS[4].imag()+pLHS[5].imag()*pRHS[4].real()+pLHS[6].real()*pRHS[5].imag()+pLHS[6].imag()*pRHS[5].real()+pLHS[7].real()*pRHS[6].imag()+pLHS[7].imag()*pRHS[6].real()+pLHS[8].real()*pRHS[7].imag()+pLHS[8].imag()*pRHS[7].real();
	pOutCorrelation[2]=pLHS[2].real()*pRHS[0].imag()+pLHS[2].imag()*pRHS[0].real()+pLHS[3].real()*pRHS[1].imag()+pLHS[3].imag()*pRHS[1].real()+pLHS[4].real()*pRHS[2].imag()+pLHS[4].imag()*pRHS[2].real()+pLHS[5].real()*pRHS[3].imag()+pLHS[5].imag()*pRHS[3].real()+pLHS[6].real()*pRHS[4].imag()+pLHS[6].imag()*pRHS[4].real()+pLHS[7].real()*pRHS[5].imag()+pLHS[7].imag()*pRHS[5].real()+pLHS[8].real()*pRHS[6].imag()+pLHS[8].imag()*pRHS[6].real();
	pOutCorrelation[3]=pLHS[3].real()*pRHS[0].imag()+pLHS[3].imag()*pRHS[0].real()+pLHS[4].real()*pRHS[1].imag()+pLHS[4].imag()*pRHS[1].real()+pLHS[5].real()*pRHS[2].imag()+pLHS[5].imag()*pRHS[2].real()+pLHS[6].real()*pRHS[3].imag()+pLHS[6].imag()*pRHS[3].real()+pLHS[7].real()*pRHS[4].imag()+pLHS[7].imag()*pRHS[4].real()+pLHS[8].real()*pRHS[5].imag()+pLHS[8].imag()*pRHS[5].real();
	pOutCorrelation[4]=pLHS[4].real()*pRHS[0].imag()+pLHS[4].imag()*pRHS[0].real()+pLHS[5].real()*pRHS[1].imag()+pLHS[5].imag()*pRHS[1].real()+pLHS[6].real()*pRHS[2].imag()+pLHS[6].imag()*pRHS[2].real()+pLHS[7].real()*pRHS[3].imag()+pLHS[7].imag()*pRHS[3].real()+pLHS[8].real()*pRHS[4].imag()+pLHS[8].imag()*pRHS[4].real();
	pOutCorrelation[5]=pLHS[5].real()*pRHS[0].imag()+pLHS[5].imag()*pRHS[0].real()+pLHS[6].real()*pRHS[1].imag()+pLHS[6].imag()*pRHS[1].real()+pLHS[7].real()*pRHS[2].imag()+pLHS[7].imag()*pRHS[2].real()+pLHS[8].real()*pRHS[3].imag()+pLHS[8].imag()*pRHS[3].real();
	pOutCorrelation[6]=pLHS[6].real()*pRHS[0].imag()+pLHS[6].imag()*pRHS[0].real()+pLHS[7].real()*pRHS[1].imag()+pLHS[7].imag()*pRHS[1].real()+pLHS[8].real()*pRHS[2].imag()+pLHS[8].imag()*pRHS[2].real();
	pOutCorrelation[7]=pLHS[7].real()*pRHS[0].imag()+pLHS[7].imag()*pRHS[0].real()+pLHS[8].real()*pRHS[1].imag()+pLHS[8].imag()*pRHS[1].real();
	pOutCorrelation[8]=pLHS[8].real()*pRHS[0].imag()+pLHS[8].imag()*pRHS[0].real();
}


std::complex<float> evaluateFastHerglotzTransform2(const std::complex<float> circlePoint,const std::complex<float> pExponentialMoment[2],const std::complex<float> pEvaluationPolynomial[2]){
	std::complex<float> conjCirclePoint=std::conj(circlePoint);
	float polynomial1=pEvaluationPolynomial[0].real();
	std::complex<float> polynomial0=pEvaluationPolynomial[1]+polynomial1*conjCirclePoint;
	std::complex<float> dotProduct=polynomial1*pExponentialMoment[1];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

std::complex<float> evaluateFastHerglotzTransform3(const std::complex<float> circlePoint,const std::complex<float> pExponentialMoment[3],const std::complex<float> pEvaluationPolynomial[3]){
	std::complex<float> conjCirclePoint=std::conj(circlePoint);
	float polynomial2=pEvaluationPolynomial[0].real();
	std::complex<float> polynomial1=pEvaluationPolynomial[1]+polynomial2*conjCirclePoint;
	std::complex<float> polynomial0=pEvaluationPolynomial[2]+conjCirclePoint*polynomial1;
	std::complex<float> dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

std::complex<float> evaluateFastHerglotzTransform4(const std::complex<float> circlePoint,const std::complex<float> pExponentialMoment[4],const std::complex<float> pEvaluationPolynomial[4]){
	std::complex<float> conjCirclePoint=std::conj(circlePoint);
	float polynomial3=pEvaluationPolynomial[0].real();
	std::complex<float> polynomial2=pEvaluationPolynomial[1]+polynomial3*conjCirclePoint;
	std::complex<float> polynomial1=pEvaluationPolynomial[2]+conjCirclePoint*polynomial2;
	std::complex<float> polynomial0=pEvaluationPolynomial[3]+conjCirclePoint*polynomial1;
	std::complex<float> dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2]+polynomial3*pExponentialMoment[3];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

std::complex<float> evaluateFastHerglotzTransform5(const std::complex<float> circlePoint,const std::complex<float> pExponentialMoment[5],const std::complex<float> pEvaluationPolynomial[5]){
	std::complex<float> conjCirclePoint=std::conj(circlePoint);
	float polynomial4=pEvaluationPolynomial[0].real();
	std::complex<float> polynomial3=pEvaluationPolynomial[1]+polynomial4*conjCirclePoint;
	std::complex<float> polynomial2=pEvaluationPolynomial[2]+conjCirclePoint*polynomial3;
	std::complex<float> polynomial1=pEvaluationPolynomial[3]+conjCirclePoint*polynomial2;
	std::complex<float> polynomial0=pEvaluationPolynomial[4]+conjCirclePoint*polynomial1;
	std::complex<float> dotProduct=polynomial1*pExponentialMoment[1]+polynomial2*pExponentialMoment[2]+polynomial3*pExponentialMoment[3]+polynomial4*pExponentialMoment[4];
	return pExponentialMoment[0]+2.0f*(dotProduct)/(polynomial0);
}

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

std::complex<float> evaluateFastHerglotzTransform7(const std::complex<float> circlePoint,const std::complex<float> pExponentialMoment[7],const std::complex<float> pEvaluationPolynomial[7]){
	std::complex<float> conjCirclePoint=std::conj(circlePoint);
	float polynomial6=pEvaluationPolynomial[0].real();
	std::complex<float> polynomial5=pEvaluationPolynomial[1]+polynomial6*conjCirclePoint;
	std::complex<float> polynomial4=pEvaluationPolynomial[2]+conjCirclePoint*polynomial5;
	std::complex<float> polynomial3=pEvaluationPolynomial[3]+conjCirclePoint*polynomial4;
	std::complex<float> polynomial2=pEvaluationPolynomial[4]+conjCirclePoint*polynomial3;
	std::complex<float> polynomial1=pEvaluationPolynomial[5]+conjCirclePoint*polynomial2;
	std::complex<float> polynomial0=pEvaluationPolynomial[6]+conjCirclePoint*polynomial1;
	std::complex<float> 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);
}

std::complex<float> evaluateFastHerglotzTransform8(const std::complex<float> circlePoint,const std::complex<float> pExponentialMoment[8],const std::complex<float> pEvaluationPolynomial[8]){
	std::complex<float> conjCirclePoint=std::conj(circlePoint);
	float polynomial7=pEvaluationPolynomial[0].real();
	std::complex<float> polynomial6=pEvaluationPolynomial[1]+polynomial7*conjCirclePoint;
	std::complex<float> polynomial5=pEvaluationPolynomial[2]+conjCirclePoint*polynomial6;
	std::complex<float> polynomial4=pEvaluationPolynomial[3]+conjCirclePoint*polynomial5;
	std::complex<float> polynomial3=pEvaluationPolynomial[4]+conjCirclePoint*polynomial4;
	std::complex<float> polynomial2=pEvaluationPolynomial[5]+conjCirclePoint*polynomial3;
	std::complex<float> polynomial1=pEvaluationPolynomial[6]+conjCirclePoint*polynomial2;
	std::complex<float> polynomial0=pEvaluationPolynomial[7]+conjCirclePoint*polynomial1;
	std::complex<float> 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);
}

std::complex<float> evaluateFastHerglotzTransform9(const std::complex<float> circlePoint,const std::complex<float> pExponentialMoment[9],const std::complex<float> pEvaluationPolynomial[9]){
	std::complex<float> conjCirclePoint=std::conj(circlePoint);
	float polynomial8=pEvaluationPolynomial[0].real();
	std::complex<float> polynomial7=pEvaluationPolynomial[1]+polynomial8*conjCirclePoint;
	std::complex<float> polynomial6=pEvaluationPolynomial[2]+conjCirclePoint*polynomial7;
	std::complex<float> polynomial5=pEvaluationPolynomial[3]+conjCirclePoint*polynomial6;
	std::complex<float> polynomial4=pEvaluationPolynomial[4]+conjCirclePoint*polynomial5;
	std::complex<float> polynomial3=pEvaluationPolynomial[5]+conjCirclePoint*polynomial4;
	std::complex<float> polynomial2=pEvaluationPolynomial[6]+conjCirclePoint*polynomial3;
	std::complex<float> polynomial1=pEvaluationPolynomial[7]+conjCirclePoint*polynomial2;
	std::complex<float> polynomial0=pEvaluationPolynomial[8]+conjCirclePoint*polynomial1;
	std::complex<float> 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 std::complex<float> circlePoint,const std::complex<float> pFourierCoefficient[2]){
	// Minimize sequential dependencies by computing powers of circlePoint
	// by multiplying previous powers by powers of two
	std::complex<float> circlePointPower1=circlePoint;
	float result=pFourierCoefficient[1].real()*circlePointPower1.real()-pFourierCoefficient[1].imag()*circlePointPower1.imag();
	return 2.0f*result+pFourierCoefficient[0].real();
}

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

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

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


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

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

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

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

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

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

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


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

void prepareReflectanceSpectrum3(std::complex<float> pOutExponentialMoment[3],std::complex<float> pOutEvaluationPolynomial[3],const std::complex<float> 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(std::complex<float> pOutExponentialMoment[4],std::complex<float> pOutEvaluationPolynomial[4],const std::complex<float> 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(std::complex<float> pOutExponentialMoment[5],std::complex<float> pOutEvaluationPolynomial[5],const std::complex<float> 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(std::complex<float> pOutExponentialMoment[3],std::complex<float> 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(std::complex<float> pOutExponentialMoment[4],std::complex<float> 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(std::complex<float> pOutExponentialMoment[5],std::complex<float> 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(std::complex<float> pOutExponentialMoment[6],std::complex<float> 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(std::complex<float> pOutExponentialMoment[7],std::complex<float> 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(std::complex<float> pOutExponentialMoment[8],std::complex<float> 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(std::complex<float> pOutExponentialMoment[9],std::complex<float> 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 std::complex<float> pExponentialMoment[2],const std::complex<float> pEvaluationPolynomial[2]){
	std::complex<float> circlePoint;
	circlePoint=std::complex<float>(std::cos(phase),std::sin(phase));
	std::complex<float> herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform2(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return std::atan2(herglotzTransform.imag(),herglotzTransform.real())*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum3(const float phase,const std::complex<float> pExponentialMoment[3],const std::complex<float> pEvaluationPolynomial[3]){
	std::complex<float> circlePoint;
	circlePoint=std::complex<float>(std::cos(phase),std::sin(phase));
	std::complex<float> herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform3(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return std::atan2(herglotzTransform.imag(),herglotzTransform.real())*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum4(const float phase,const std::complex<float> pExponentialMoment[4],const std::complex<float> pEvaluationPolynomial[4]){
	std::complex<float> circlePoint;
	circlePoint=std::complex<float>(std::cos(phase),std::sin(phase));
	std::complex<float> herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform4(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return std::atan2(herglotzTransform.imag(),herglotzTransform.real())*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum5(const float phase,const std::complex<float> pExponentialMoment[5],const std::complex<float> pEvaluationPolynomial[5]){
	std::complex<float> circlePoint;
	circlePoint=std::complex<float>(std::cos(phase),std::sin(phase));
	std::complex<float> herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform5(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return std::atan2(herglotzTransform.imag(),herglotzTransform.real())*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum6(const float phase,const std::complex<float> pExponentialMoment[6],const std::complex<float> pEvaluationPolynomial[6]){
	std::complex<float> circlePoint;
	circlePoint=std::complex<float>(std::cos(phase),std::sin(phase));
	std::complex<float> herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform6(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return std::atan2(herglotzTransform.imag(),herglotzTransform.real())*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum7(const float phase,const std::complex<float> pExponentialMoment[7],const std::complex<float> pEvaluationPolynomial[7]){
	std::complex<float> circlePoint;
	circlePoint=std::complex<float>(std::cos(phase),std::sin(phase));
	std::complex<float> herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform7(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return std::atan2(herglotzTransform.imag(),herglotzTransform.real())*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum8(const float phase,const std::complex<float> pExponentialMoment[8],const std::complex<float> pEvaluationPolynomial[8]){
	std::complex<float> circlePoint;
	circlePoint=std::complex<float>(std::cos(phase),std::sin(phase));
	std::complex<float> herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform8(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return std::atan2(herglotzTransform.imag(),herglotzTransform.real())*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrum9(const float phase,const std::complex<float> pExponentialMoment[9],const std::complex<float> pEvaluationPolynomial[9]){
	std::complex<float> circlePoint;
	circlePoint=std::complex<float>(std::cos(phase),std::sin(phase));
	std::complex<float> herglotzTransform;
	herglotzTransform=evaluateFastHerglotzTransform9(circlePoint,pExponentialMoment,pEvaluationPolynomial);
	return std::atan2(herglotzTransform.imag(),herglotzTransform.real())*0.318309886f+0.5f;
}


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

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

void prepareReflectanceSpectrumLagrange4(std::complex<float> pOutLagrangeMultiplier[4],const std::complex<float> pTrigonometricMoment[4]){
	std::complex<float> pExponentialMoment[4];
	trigonometricToExponentialMoments4(pExponentialMoment,pTrigonometricMoment);
	std::complex<float> 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];
	std::complex<float> pAutocorrelation[4];
	computeAutocorrelation4(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeCorrelation4(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*pEvaluationPolynomial[0].real());
	pOutLagrangeMultiplier[0]=normalizationFactor*(std::complex<float>(-0.0f,-1.0f)*pOutLagrangeMultiplier[0]);
	pOutLagrangeMultiplier[1]=normalizationFactor*(std::complex<float>(-0.0f,-1.0f)*pOutLagrangeMultiplier[1]);
	pOutLagrangeMultiplier[2]=normalizationFactor*(std::complex<float>(-0.0f,-1.0f)*pOutLagrangeMultiplier[2]);
	pOutLagrangeMultiplier[3]=normalizationFactor*(std::complex<float>(-0.0f,-1.0f)*pOutLagrangeMultiplier[3]);
	pOutLagrangeMultiplier[0]=std::complex<float>(pOutLagrangeMultiplier[0].real());
}

void prepareReflectanceSpectrumLagrange5(std::complex<float> pOutLagrangeMultiplier[5],const std::complex<float> pTrigonometricMoment[5]){
	std::complex<float> pExponentialMoment[5];
	trigonometricToExponentialMoments5(pExponentialMoment,pTrigonometricMoment);
	std::complex<float> 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];
	std::complex<float> pAutocorrelation[5];
	computeAutocorrelation5(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeCorrelation5(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*pEvaluationPolynomial[0].real());
	pOutLagrangeMultiplier[0]=normalizationFactor*(std::complex<float>(-0.0f,-1.0f)*pOutLagrangeMultiplier[0]);
	pOutLagrangeMultiplier[1]=normalizationFactor*(std::complex<float>(-0.0f,-1.0f)*pOutLagrangeMultiplier[1]);
	pOutLagrangeMultiplier[2]=normalizationFactor*(std::complex<float>(-0.0f,-1.0f)*pOutLagrangeMultiplier[2]);
	pOutLagrangeMultiplier[3]=normalizationFactor*(std::complex<float>(-0.0f,-1.0f)*pOutLagrangeMultiplier[3]);
	pOutLagrangeMultiplier[4]=normalizationFactor*(std::complex<float>(-0.0f,-1.0f)*pOutLagrangeMultiplier[4]);
	pOutLagrangeMultiplier[0]=std::complex<float>(pOutLagrangeMultiplier[0].real());
}

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

void prepareReflectanceSpectrumLagrangeReal4(float pOutLagrangeMultiplier[4],const float pTrigonometricMoment[4]){
	std::complex<float> pExponentialMoment[4];
	trigonometricToExponentialMomentsReal4(pExponentialMoment,pTrigonometricMoment);
	std::complex<float> 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];
	std::complex<float> pAutocorrelation[4];
	computeAutocorrelation4(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation4(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*pEvaluationPolynomial[0].real());
	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]){
	std::complex<float> pExponentialMoment[5];
	trigonometricToExponentialMomentsReal5(pExponentialMoment,pTrigonometricMoment);
	std::complex<float> 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];
	std::complex<float> pAutocorrelation[5];
	computeAutocorrelation5(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation5(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*pEvaluationPolynomial[0].real());
	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]){
	std::complex<float> pExponentialMoment[6];
	trigonometricToExponentialMomentsReal6(pExponentialMoment,pTrigonometricMoment);
	std::complex<float> 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];
	std::complex<float> pAutocorrelation[6];
	computeAutocorrelation6(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation6(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*pEvaluationPolynomial[0].real());
	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]){
	std::complex<float> pExponentialMoment[7];
	trigonometricToExponentialMomentsReal7(pExponentialMoment,pTrigonometricMoment);
	std::complex<float> 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];
	std::complex<float> pAutocorrelation[7];
	computeAutocorrelation7(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation7(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*pEvaluationPolynomial[0].real());
	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]){
	std::complex<float> pExponentialMoment[8];
	trigonometricToExponentialMomentsReal8(pExponentialMoment,pTrigonometricMoment);
	std::complex<float> 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];
	std::complex<float> pAutocorrelation[8];
	computeAutocorrelation8(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation8(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*pEvaluationPolynomial[0].real());
	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]){
	std::complex<float> pExponentialMoment[9];
	trigonometricToExponentialMomentsReal9(pExponentialMoment,pTrigonometricMoment);
	std::complex<float> 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];
	std::complex<float> pAutocorrelation[9];
	computeAutocorrelation9(pAutocorrelation,pEvaluationPolynomial);
	pExponentialMoment[0]=0.5f*pExponentialMoment[0];
	computeImaginaryCorrelation9(pOutLagrangeMultiplier,pAutocorrelation,pExponentialMoment);
	float normalizationFactor=1.0f/(3.14159265f*pEvaluationPolynomial[0].real());
	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 std::complex<float> pLagrangeMultiplier[2]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeries2(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrange3(const float phase,const std::complex<float> pLagrangeMultiplier[3]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeries3(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrange4(const float phase,const std::complex<float> pLagrangeMultiplier[4]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeries4(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrange5(const float phase,const std::complex<float> pLagrangeMultiplier[5]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeries5(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal3(const float phase,const float pLagrangeMultiplier[3]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal3(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal4(const float phase,const float pLagrangeMultiplier[4]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal4(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal5(const float phase,const float pLagrangeMultiplier[5]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal5(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal6(const float phase,const float pLagrangeMultiplier[6]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal6(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal7(const float phase,const float pLagrangeMultiplier[7]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal7(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal8(const float phase,const float pLagrangeMultiplier[8]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal8(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}

float evaluateReflectanceSpectrumLagrangeReal9(const float phase,const float pLagrangeMultiplier[9]){
	std::complex<float> conjCirclePoint;
	conjCirclePoint=std::complex<float>(std::cos(-phase),std::sin(-phase));
	float lagrangeSeries;
	lagrangeSeries=evaluateFourierSeriesReal9(conjCirclePoint,pLagrangeMultiplier);
	return std::atan(lagrangeSeries)*0.318309886f+0.5f;
}


