<!-- (c) Electronic Arts. All Rights Reserved. -->
<TESTCLASS>

<!-- The Last Test is test265, please change this number when you add more tests, make sure test names do not repeat-->

<CLASS NAME="UnitTestQuaternion" HEADER="quaterniontest.h" SOURCE="quaterniontest.inc" RWHOSTHEADER="rw/math/vpu/quaternion_operation.h rw/math/vpu/matrix44affine_operation.h" RWGENERICHEADER="rw/math/fpu/quaternion_operation.h rw/math/fpu/matrix44affine_operation.h" RWOPTIMALHEADER="rw/math/optimal/quaternion_operation.h rw/math/optimal/matrix44affine_operation.h" HOST="true" GENERIC="true" OPTIMAL="true">

   <TYPE NAME="class">

     <TYPE NAME="correctness">


       <TEST NAME="Vector3VecFloatRefW">
         <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("Quaternion(Vector3, VecFloatRefW)");
            Vector3 v3i(1.0f, 2.1f, 3.2f);
            Vector4 v4i(0.0f, 0.0f, 0.0f, 4.3f);
            Quaternion q( v3i, v4i.W() );
            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.1f && (float)q.Z() == 3.2f && (float)q.W() == 4.3f);

#endif

      ]]>
       </TEST>


       <TEST NAME="Vector3VecFloatRefIndex">
         <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("Quaternion(Vector3, VecFloatRefIndex)");
            Vector3 v3i(1.0f, 2.1f, 3.2f);
            Vector4 v4i(0.0f, 0.0f, 0.0f, 4.3f);
            Quaternion q( v3i, v4i.GetComponent(3) );
            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.1f && (float)q.Z() == 3.2f && (float)q.W() == 4.3f);

#endif

      ]]>
       </TEST>


       <TEST NAME="Vector3VecFloatRefFloat">
         <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("Quaternion(Vector3, VecFloat)");
            Vector3 v3(1.0f, 2.1f, 3.2f);
            VecFloat vf(4.3f);
            Quaternion q( v3, vf );
            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.1f && (float)q.Z() == 3.2f && (float)q.W() == 4.3f);

#endif

      ]]>
       </TEST>

       <TEST NAME="Vector3Float">
         <![CDATA[

            SetFunctionName("Vector4(Vector3, float)");
            Vector3 v3(1.0f, 2.1f, 3.2f);
            Quaternion q( v3, 4.3f );
            Validate(IsEqualWithEpsilon((float)q.X(), 1.0f) && IsEqualWithEpsilon((float)q.Y(), 2.1f) && IsEqualWithEpsilon((float)q.Z(), 3.2f) && IsEqualWithEpsilon((float)q.W(), 4.3f));

      ]]>
       </TEST>


       <TEST NAME="test0">
      <![CDATA[

            SetFunctionName("Quaternion( float _x, float _y, float _z, float _w )");
            Quaternion q( 1.0f, 2.1f, 3.2f, 4.3f );
            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.1f && (float)q.Z() == 3.2f && (float)q.W() == 4.3f);

      ]]>
      </TEST>


      <TEST NAME="test34">
      <![CDATA[

#ifdef HOST_TESTING
            float floatData[] = { 1.23f, 4.56f, 7.89f, 10.0f };
            AlignedFloatBuffer floatBuffer(floatData, sizeof(floatData));
            const float_basic_type *fPtr = floatBuffer.GetFloatData();
#else
            float_test_type fArray[4]={1.23f, 4.56f, 7.89f, 10.0f};
            float_test_type *fPtr = (float_test_type*)fArray;
#endif
            Quaternion vB(fPtr);

            SetFunctionName("explicit Quaternion( const float xyzw[4] )");
            Validate((float)vB.X() == 1.23f && (float)vB.Y() == 4.56f && (float)vB.Z() == 7.89f && (float)vB.W() == 10.f);

      ]]>
      </TEST>


      <TEST NAME="test13">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("Quaternion( VectorIntrinsicInParam v )");

            MakeVectorIntrinsic(vi, 1.0f, 2.0f, 3.0f, 4.0f);
            Quaternion q(vi);

            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.0f && (float)q.Z() == 3.0f && (float)q.W() == 4.0f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test2">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("Quaternion( VecFloat::InParam _x, VecFloat::InParam _y, VecFloat::InParam _z, VecFloat::InParam _w )");
            Quaternion q(VecFloat(1.2f), VecFloat(2.3f), VecFloat(3.5f), VecFloat(4.4f));
            Validate((float)q.X() == 1.2f && (float)q.Y() == 2.3f && (float)q.Z() == 3.5f && (float)q.W() == 4.4f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test4">
      <![CDATA[

#ifdef HOST_TESTING

            MakeVectorIntrinsic(vi, 1.1f, 2.1f, 3.1f, 4.1f);

            SetFunctionName("Quaternion(VecFloatRefIndex::InParam _x, VecFloatRefIndex::InParam _y, VecFloatRefIndex::InParam _z, VecFloatRefIndex::InParam _w)");
            Quaternion q(VecFloatRefIndex(vi,0), VecFloatRefIndex(vi,1), VecFloatRefIndex(vi,2), VecFloatRefIndex(vi,3));
            Validate((float)q.X() == 1.1f && (float)q.Y() == 2.1f && (float)q.Z() == 3.1f && (float)q.W() == 4.1f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test3">
      <![CDATA[

#ifdef HOST_TESTING

            MakeVectorIntrinsic(vi, 1.0f, 2.0f, 3.0f, 4.0f);

            SetFunctionName("Quaternion(VecFloatRef<XSRC_INDEX> _x, VecFloatRef<YSRC_INDEX> _y, VecFloatRef<ZSRC_INDEX> _z, VecFloatRef<WSRC_INDEX> _w)");
            Quaternion q = Quaternion(VecFloatRefX(vi), VecFloatRefY(vi), VecFloatRefZ(vi), VecFloatRefW(vi));
            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.0f && (float)q.Z() == 3.0f && (float)q.W() == 4.0f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test14">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("Quaternion& operator = (Quaternion::InParam q)");

            Quaternion testQuat;
            testQuat.Set(1.23f, 4.56f, 7.89f, 69.f);
            Quaternion q;
            q = testQuat;

            Validate((float)q.X() == 1.23f && (float)q.Y() == 4.56f && (float)q.Z() == 7.89f && (float)q.W() == 69.f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test15">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("Quaternion& operator = (VectorIntrinsicInParam v)");

            MakeVectorIntrinsic(vi, 1.0f, 2.0f, 3.0f, 4.0f);
            Quaternion q(vi);

            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.0f && (float)q.Z() == 3.0f && (float)q.W() == 4.0f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test16">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("VectorIntrinsic &vi = q.GetVector();&()");

            Quaternion q(1.0f, 2.0f, 3.0f, 4.0f);
            VectorIntrinsic &vi = q.GetVector();

            MakeVectorIntrinsic(ref, 1.0f, 2.0f, 3.0f, 4.0f);
            Validate(memcmp(&ref,&vi,sizeof(ref))==0);

#endif

      ]]>
      </TEST>


      <TEST NAME="test17">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("operator const VectorIntrinsic&() const");

            const Quaternion q(1.0f, 2.0f, 3.0f, 4.0f);
            const VectorIntrinsic &vi = q.GetVector();

            MakeVectorIntrinsic(ref, 1.0f, 2.0f, 3.0f, 4.0f);
            Validate(memcmp(&ref,&vi,sizeof(ref))==0);

#endif

      ]]>
      </TEST>


      <TEST NAME="test11">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("void SetVector(VectorIntrinsicInParam v)");

            MakeVectorIntrinsic(vi, 1.0f, 2.0f, 3.0f, 4.0f);
            Quaternion q;
            q.SetVector(vi);

            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.0f && (float)q.Z() == 3.0f && (float)q.W() == 4.0f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test18">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("VectorIntrinsic& GetVector()");

            Quaternion q(1.0f, 2.0f, 3.0f, 4.0f);
            VectorIntrinsic &vi = q.GetVector();

            MakeVectorIntrinsic(ref, 1.0f, 2.0f, 3.0f, 4.0f);
            Validate(memcmp(&ref,&vi,sizeof(ref))==0);

#endif

      ]]>
      </TEST>


      <TEST NAME="test20">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("const VectorIntrinsic& GetVector() const");

            const Quaternion q(1.0f, 2.0f, 3.0f, 4.0f);
            const VectorIntrinsic &vi = q.GetVector();

            MakeVectorIntrinsic(ref, 1.0f, 2.0f, 3.0f, 4.0f);
            Validate(memcmp(&ref,&vi,sizeof(ref))==0);

#endif

      ]]>
      </TEST>


      <TEST NAME="test1">
      <![CDATA[

        Quaternion testQuat;

        SetFunctionName("void Set(float _x, float _y, float _z, float _w)");
        testQuat.Set(1.1f, 2.2f, 3.4f, 4.3f);
        Validate((float)testQuat.X() == 1.1f && (float)testQuat.Y() == 2.2f && (float)testQuat.Z() == 3.4f && (float)testQuat.W() == 4.3f);

      ]]>
      </TEST>


      <TEST NAME="test5">
      <![CDATA[

#ifdef HOST_TESTING

            Quaternion testQuat;

            SetFunctionName("void Set(VecFloat::InParam _x, VecFloat::InParam _y, VecFloat::InParam _z, VecFloat::InParam _w)");
            testQuat.Set(VecFloat(1.2f), VecFloat(2.3f), VecFloat(3.5f), VecFloat(4.4f));
            Validate((float)testQuat.X() == 1.2f && (float)testQuat.Y() == 2.3f && (float)testQuat.Z() == 3.5f && (float)testQuat.W() == 4.4f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test6">
      <![CDATA[

#ifdef HOST_TESTING

            Quaternion testQuat;

            MakeVectorIntrinsic(vi, 1.1f, 2.1f, 3.1f, 4.1f);

            SetFunctionName("void Set(VecFloatRefIndex::InParam _x, VecFloatRefIndex::InParam _y, VecFloatRefIndex::InParam _z, VecFloatRefIndex::InParam _w)");
            testQuat.Set(VecFloatRefIndex(vi,0), VecFloatRefIndex(vi,1), VecFloatRefIndex(vi,2), VecFloatRefIndex(vi,3));
            Validate((float)testQuat.X() == 1.1f && (float)testQuat.Y() == 2.1f && (float)testQuat.Z() == 3.1f && (float)testQuat.W() == 4.1f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test7">
      <![CDATA[

#ifdef HOST_TESTING

            Quaternion testQuat;

            MakeVectorIntrinsic(vi, 1.0f, 2.0f, 3.0f, 4.0f);

            SetFunctionName("void Set(VecFloatRef<XSRC_INDEX> _x, VecFloatRef<YSRC_INDEX> _y, VecFloatRef<ZSRC_INDEX> _z, VecFloatRef<WSRC_INDEX> _w)");
            testQuat.Set(VecFloatRefX(vi), VecFloatRefY(vi), VecFloatRefZ(vi), VecFloatRefW(vi));
            Validate((float)testQuat.X() == 1.0f && (float)testQuat.Y() == 2.0f && (float)testQuat.Z() == 3.0f && (float)testQuat.W() == 4.0f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test19">
      <![CDATA[

            SetFunctionName("void SetComponent(int i, float value)");
            Quaternion v0( 1.0f, 2.0f, 3.0f, 4.0f );
            v0.SetComponent( 0, 101.0f );
            Quaternion v1( 101.0f, 2.0f, 3.0f, 4.0f );
            v1.SetComponent( 1, 10.0f );
            Quaternion v2( 101.0f, 10.0f, 3.0f, 4.0f );
            v2.SetComponent( 2, 69.0f );
            Quaternion v3( 101.0f, 10.0f, 69.0f, 4.0f );
            v3.SetComponent( 3, 9.0f );
            Validate(
                (float)v0.X() == 101.0f && (float)v0.Y() == 2.0f && (float)v0.Z() == 3.0f && (float)v0.W() == 4.0f &&
                (float)v1.X() == 101.0f && (float)v1.Y() == 10.0f && (float)v1.Z() == 3.0f && (float)v1.W() == 4.0f &&
                (float)v2.X() == 101.0f && (float)v2.Y() == 10.0f && (float)v2.Z() == 69.0f && (float)v2.W() == 4.0f &&
                (float)v3.X() == 101.0f && (float)v3.Y() == 10.0f && (float)v3.Z() == 69.0f && (float)v3.W() == 9.0f
            );

      ]]>
      </TEST>


      <TEST NAME="test8">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("void SetComponent(int i, VecFloat::InParam value)");
            Quaternion q( 1.0f, 2.0f, 3.0f, 4.0f );
            q.SetComponent( 1, VecFloat(12.0) );
            Validate((float)q.X() == 1.0f && (float)q.Y() == 12.0f && (float)q.Z() == 3.0f && (float)q.W() == 4.0f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test9">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("void SetComponent(int i, VecFloatRefIndex::InParam value)");
            Quaternion q( 1.0f, 2.0f, 3.0f, 4.0f );
            MakeVectorIntrinsic(vi, 1.1f, 2.1f, 3.1f, 4.1f);
            q.SetComponent( 2, VecFloatRefIndex(vi,3) );
            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.0f && (float)q.Z() == 4.1f && (float)q.W() == 4.0f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test10">
      <![CDATA[

#ifdef HOST_TESTING

            SetFunctionName("void SetComponent(int i, VecFloatRef<INDEX> value)");
            Quaternion q( 1.0f, 2.0f, 3.0f, 4.0f );
            MakeVectorIntrinsic(vi, 1.1f, 2.1f, 3.1f, 4.1f);
            q.SetComponent( 2, VecFloatRefZ(vi) );
            Validate((float)q.X() == 1.0f && (float)q.Y() == 2.0f && (float)q.Z() == 3.1f && (float)q.W() == 4.0f);

#endif

      ]]>
      </TEST>


      <TEST NAME="test11b">
      <![CDATA[

#ifdef HOST_TESTING

            Quaternion testQuat;

            MakeVectorIntrinsic(vi, 1.0f, 2.0f, 3.0f, 4.0f);
            testQuat.Set(VecFloatRefX(vi), VecFloatRefY(vi), VecFloatRefZ(vi), VecFloatRefW(vi));

            SetFunctionName("VecFloatRefIndex GetComponent(int i)");
            Validate(
                testQuat.X() == testQuat.GetComponent(0) &&
                testQuat.Y() == testQuat.GetComponent(1) &&
                testQuat.Z() == testQuat.GetComponent(2) &&
                testQuat.W() == testQuat.GetComponent(3)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test12">
      <![CDATA[

#ifdef HOST_TESTING

            Quaternion testQuat;

            MakeVectorIntrinsic(vi, 1.0f, 2.0f, 3.0f, 4.0f);
            testQuat.Set(VecFloatRefX(vi), VecFloatRefY(vi), VecFloatRefZ(vi), VecFloatRefW(vi));

            SetFunctionName("const VecFloatRefIndex GetComponent(int i) const");
            Validate(
                const_cast<const Quaternion*>(&testQuat)->X() == const_cast<const Quaternion*>(&testQuat)->GetComponent(0) &&
                const_cast<const Quaternion*>(&testQuat)->Y() == const_cast<const Quaternion*>(&testQuat)->GetComponent(1) &&
                const_cast<const Quaternion*>(&testQuat)->Z() == const_cast<const Quaternion*>(&testQuat)->GetComponent(2) &&
                const_cast<const Quaternion*>(&testQuat)->W() == const_cast<const Quaternion*>(&testQuat)->GetComponent(3)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test23">
      <![CDATA[

            SetFunctionName("void SetZero()");
            Quaternion v( 1.0f, 2.0f, 3.0f, 4.f );
            v.SetZero();
            Validate(v == GetQuaternion_Zero());

      ]]>
      </TEST>


      <TEST NAME="test24">
      <![CDATA[

            SetFunctionName("void SetIdentity()");
            Quaternion v( 1.0f, 2.0f, 3.0f, 4.f );
            v.SetIdentity();
            Validate(v == GetQuaternion_Identity());

      ]]>
      </TEST>


      <TEST NAME="test25">
      <![CDATA[

        Quaternion testQuat;
        testQuat.Set(1.1f, 2.2f, 3.4f, 4.3f);

        SetFunctionName("VecFloatRefIndex GetComponent(int i)");
        Validate(
            testQuat.X() == testQuat.GetComponent(0) &&
            testQuat.Y() == testQuat.GetComponent(1) &&
            testQuat.Z() == testQuat.GetComponent(2) &&
            testQuat.W() == testQuat.GetComponent(3)
        );

      ]]>
      </TEST>


      <TEST NAME="test26">
      <![CDATA[

        Quaternion testQuat;
        testQuat.Set(1.1f, 2.2f, 3.4f, 4.3f);

        SetFunctionName("const VecFloatRefIndex GetComponent(int i) const");
        Validate(
            const_cast<const Quaternion*>(&testQuat)->X() == const_cast<const Quaternion*>(&testQuat)->GetComponent(0) &&
            const_cast<const Quaternion*>(&testQuat)->Y() == const_cast<const Quaternion*>(&testQuat)->GetComponent(1) &&
            const_cast<const Quaternion*>(&testQuat)->Z() == const_cast<const Quaternion*>(&testQuat)->GetComponent(2) &&
            const_cast<const Quaternion*>(&testQuat)->W() == const_cast<const Quaternion*>(&testQuat)->GetComponent(3)
        );

      ]]>
      </TEST>


      <TEST NAME="test33">
      <![CDATA[

        Quaternion testQuat;
        testQuat.Set(1.23f, 4.56f, 7.89f, 69.f);

        Quaternion vA(testQuat);

        SetFunctionName("Quaternion(const Quaternion&)");
        Validate((float)vA.X() == 1.23f && (float)vA.Y() == 4.56f && (float)vA.Z() == 7.89f && (float)vA.W() == 69.f);

      ]]>
      </TEST>


      <TEST NAME="test35">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        SetFunctionName("X() = float");
        testQuat.X() = 1.0f;
        Validate((float)testQuat.X() == 1.0f);

      ]]>
      </TEST>


      <TEST NAME="test36">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        SetFunctionName("Y() = float");
        testQuat.Y() = 2.0f;
        Validate((float)testQuat.Y() == 2.0f);

      ]]>
      </TEST>


      <TEST NAME="test37">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        SetFunctionName("Z() = float");
        testQuat.Z() = 3.0f;
        Validate((float)testQuat.Z() == 3.0f);

      ]]>
      </TEST>


      <TEST NAME="test38">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        SetFunctionName("W() = float");
        testQuat.W() = 4.1f;
        Validate((float)testQuat.W() == 4.1f);

      ]]>
      </TEST>


      <TEST NAME="test39">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        SetFunctionName("VecFloatRefIndex operator [] (int i)");
        testQuat[0] = 99.0f;
        testQuat[1] = 100.0f;
        testQuat[2] = 55.0f;
        testQuat[3] = 65.0f;
        Validate(
            (float)testQuat.X() == 99.0f &&
            (float)testQuat.Y() == 100.0f &&
            (float)testQuat.Z() == 55.0f &&
            (float)testQuat.W() == 65.0f
        );

      ]]>
      </TEST>


      <TEST NAME="test40">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        SetFunctionName("const VecFloatRefIndex operator [] (int i) const");
        testQuat[0] = 99.0f;
        testQuat[1] = 100.0f;
        testQuat[2] = 55.0f;
        testQuat[3] = 65.0f;
        Validate(
            (float)const_cast<const Quaternion*>(&testQuat)->X() == 99.0f &&
            (float)const_cast<const Quaternion*>(&testQuat)->Y() == 100.0f &&
            (float)const_cast<const Quaternion*>(&testQuat)->Z() == 55.0f &&
            (float)const_cast<const Quaternion*>(&testQuat)->W() == 65.0f
        );

      ]]>
      </TEST>


      <TEST NAME="test43">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        testQuat[0] = 99.0f;

        SetFunctionName("VecFloatRefX X()");
        Validate((float)testQuat.X() == 99.0f);

      ]]>
      </TEST>


      <TEST NAME="test44">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        testQuat[1] = 100.0f;

        SetFunctionName("VecFloatRefY Y()");
        Validate((float)testQuat.Y() == 100.0f);

      ]]>
      </TEST>


      <TEST NAME="test45">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        testQuat[2] = 55.0f;

        SetFunctionName("VecFloatRefZ Z()");
        Validate((float)testQuat.Z() == 55.0f);

      ]]>
      </TEST>


      <TEST NAME="test46">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        testQuat[3] = 65.0f;

        SetFunctionName("VecFloatRefW W()");
        Validate((float)testQuat.W() == 65.0f);

      ]]>
      </TEST>


      <TEST NAME="test47">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        testQuat[0] = 99.0f;

        SetFunctionName("const VecFloatRefX X() const");
        Validate((float)const_cast<const Quaternion*>(&testQuat)->X() == 99.0f);

      ]]>
      </TEST>


      <TEST NAME="test48">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        testQuat[1] = 100.0f;

        SetFunctionName("const VecFloatRefY Y() const");
        Validate((float)const_cast<const Quaternion*>(&testQuat)->Y() == 100.0f);

      ]]>
      </TEST>


      <TEST NAME="test49">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        testQuat[2] = 55.0f;

        SetFunctionName("const VecFloatRefZ Z() const");
        Validate((float)const_cast<const Quaternion*>(&testQuat)->Z() == 55.0f);

      ]]>
      </TEST>


      <TEST NAME="test50">
      <![CDATA[

        Quaternion testQuat(0.0f, 0.0f, 0.0f, 0.0f);

        testQuat[3] = 65.0f;

        SetFunctionName("const VecFloatRefW W() const");
        Validate((float)const_cast<const Quaternion*>(&testQuat)->W() == 65.0f);

      ]]>
      </TEST>


      <TEST NAME="nlerp_estimate">
      <![CDATA[
        Quaternion qA, qB, qC, qOut1, qOut2;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        qC.Set(1.0f, -1.0f, -2.3f, -0.1f);

        SetFunctionName("NLerpEstimate( const Quaternion &v0, const Quaternion &v1, float_test_type t)");
        qOut1= NLerpEstimate(qA, qB, (float_test_type)0.15f);
        qOut2= NLerpEstimate(qB, qC, (float_test_type)0.3f);
        Validate(
                // This is sort of a "meta" test.  Ensure that the unit test covers both conditions in the implementation code.
                (float)Dot(qA, qB) > 0.0f &&
                (float)Dot(qB, qC) < 0.0f &&

                IsEqualWithEpsilon((float)qOut1.X(), 0.085500620f, 0.003f) &&
                IsEqualWithEpsilon((float)qOut1.Y(), 0.39544040f, 0.003f) &&
                IsEqualWithEpsilon((float)qOut1.Z(), 0.79675895f, 0.003f) &&
                IsEqualWithEpsilon((float)qOut1.W(), 0.44887829f, 0.003f) &&
                IsEqualWithEpsilon((float)qOut2.X(), -0.45059002559613476f, 0.003f) &&
                IsEqualWithEpsilon((float)qOut2.Y(),  0.18774584399838951f, 0.003f) &&
                IsEqualWithEpsilon((float)qOut2.Z(),  0.82608171359291382f, 0.003f) &&
                IsEqualWithEpsilon((float)qOut2.W(),  0.28161876599758423f, 0.003f)
                );
      ]]>
      </TEST>


      <TEST NAME="nlerp_fast">
      <![CDATA[
        Quaternion qA, qB, qC, qOut1, qOut2;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        qC.Set(1.0f, -1.0f, -2.3f, -0.1f);

        SetFunctionName("NLerpFast( const Quaternion &v0, const Quaternion &v1, float_test_type t)");
        qOut1= NLerpFast(qA, qB, (float_test_type)0.15f);
        qOut2= NLerpFast(qB, qC, (float_test_type)0.3f);
        Validate(
                // This is sort of a "meta" test.  Ensure that the unit test covers both conditions in the implementation code.
                (float)Dot(qA, qB) > 0.0f &&
                (float)Dot(qB, qC) < 0.0f &&

                IsEqualWithEpsilon((float)qOut1.X(), 0.085500620f) &&
                IsEqualWithEpsilon((float)qOut1.Y(), 0.39544040f) &&
                IsEqualWithEpsilon((float)qOut1.Z(), 0.79675895f) &&
                IsEqualWithEpsilon((float)qOut1.W(), 0.44887829f) &&
                IsEqualWithEpsilon((float)qOut2.X(), -0.45059002559613476f) &&
                IsEqualWithEpsilon((float)qOut2.Y(),  0.18774584399838951f) &&
                IsEqualWithEpsilon((float)qOut2.Z(),  0.82608171359291382f) &&
                IsEqualWithEpsilon((float)qOut2.W(),  0.28161876599758423f)
                );
      ]]>
      </TEST>


      <TEST NAME="nlerp">
      <![CDATA[
        Quaternion qA, qB, qC, qD, qE, qOut1, qOut2, qOut3;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        qC.Set(1.0f, -1.0f, -2.3f, -0.1f);

        qD.Set(-0.000000f,  -0.000000f,  1.000000f,  0.000489f);
        qE.Set(-0.000000f,  -0.000000f,  -0.000488f,  0.999817f);

        SetFunctionName("NLerp( const Quaternion &v0, const Quaternion &v1, float_test_type t)");
        qOut1= NLerp(qA, qB, (float_test_type)0.15f);
        qOut2= NLerp(qB, qC, (float_test_type)0.3f);
        qOut3= NLerp(qD, qE, (float_test_type)0.663576f);
        Validate(
                // This is sort of a "meta" test.  Ensure that the unit test covers both conditions in the implementation code.
                (float)Dot(qA, qB) > 0.0f &&
                (float)Dot(qB, qC) < 0.0f &&

                IsEqualWithEpsilon((float)qOut1.X(), 0.085500620f) &&
                IsEqualWithEpsilon((float)qOut1.Y(), 0.39544040f) &&
                IsEqualWithEpsilon((float)qOut1.Z(), 0.79675895f) &&
                IsEqualWithEpsilon((float)qOut1.W(), 0.44887829f) &&
                IsEqualWithEpsilon((float)qOut2.X(), -0.45059002559613476f) &&
                IsEqualWithEpsilon((float)qOut2.Y(),  0.18774584399838951f) &&
                IsEqualWithEpsilon((float)qOut2.Z(),  0.82608171359291382f) &&
                IsEqualWithEpsilon((float)qOut2.W(),  0.28161876599758423f) &&
                IsEqualWithEpsilon((float)qOut3.X(), -0.000000f ) &&
                IsEqualWithEpsilon((float)qOut3.Y(), -0.000000f ) &&
                IsEqualWithEpsilon((float)qOut3.Z(),  0.451821f ) &&
                IsEqualWithEpsilon((float)qOut3.W(),  0.892109f )
                );
      ]]>
      </TEST>


      <TEST NAME="issimilarrotation">
      <![CDATA[
        SetFunctionName("bool IsSimilarRotation(Quaternion& a, Quaternion& b, epsilon)");

        bool success = true;

        {
            Quaternion a( 0.153237f, -0.49853f, 0.007092f, 0.853367f ); 
            Quaternion b( 0.152086f, -0.49876f, 0.021511f, 0.853033f ); 
            success &= IsSimilarRotation( a, b, (float_test_type)0.02f );
        }
        {
            Quaternion a( 0.153237f, -0.49853f, 0.007092f, 0.853367f ); 
            Quaternion b( 0.152086f, -0.49876f, 0.021511f, 0.853033f ); 
            success &= !IsSimilarRotation( a, b, (float_test_type)0.0001f );
        }
        {
            Quaternion a( 0.153237f, -0.49853f, 0.007092f, 0.853367f ); 
            Quaternion b( -0.152086f, 0.49876f, -0.021511f, -0.853033f ); 
            success &= IsSimilarRotation( a, b, (float_test_type)0.02f );
        }
        {
            Quaternion a( 1.0f, 0.0f, 0.0f, 0.0f ); 
            Quaternion b( 0.0f, 0.0f, 0.0f, 1.0f ); 
            success &= !IsSimilarRotation( a, b, (float_test_type)0.02f );
        }
        {
            Quaternion a( 0.5f, -0.5f, -0.5f, -0.5f ); 
            Quaternion b(-a); 
            success &= IsSimilarRotation( a, b );
        }
        {
            float smallValue = 0.000001f;
            Quaternion a(1.0f, 0.0f, 0.0f,  smallValue ); 
            Quaternion b(1.0f, 0.0f, 0.0f, -smallValue ); 
            success &= IsSimilarRotation( a, b );
        }

        Validate(success);
      ]]>
      </TEST>

       <TEST NAME="UnalignedLoad">
         <![CDATA[

        SetFunctionName("Quaternion unaligned load/store tests");
        float buffer[8];
        
        //Test every position with 16 byte alignment, then move 4 bytes forward each time
        for (int i=0; i<8; i++)
          buffer[i] = static_cast<float>(i+1);
        
        ::rw::math::fpu::QuaternionTemplate<float>* alignedVec = reinterpret_cast< ::rw::math::fpu::QuaternionTemplate<float>*>(&buffer[0]);
        Quaternion v = LoadUnAlignedPacked(*alignedVec);
        Validate( v.X() == 1.0f && v.Y() == 2.0f && v.Z() == 3.0f  && v.W() == 4.0f);
        
        alignedVec = reinterpret_cast< ::rw::math::fpu::QuaternionTemplate<float>*>(&buffer[1]);
        v = LoadUnAlignedPacked(*alignedVec);
        Validate( v.X() == 2.0f && v.Y() == 3.0f && v.Z() == 4.0f  && v.W() == 5.0f);
        
        alignedVec = reinterpret_cast< ::rw::math::fpu::QuaternionTemplate<float>*>(&buffer[2]);
        v = LoadUnAlignedPacked(*alignedVec);
        Validate( v.X() == 3.0f && v.Y() == 4.0f && v.Z() == 5.0f  && v.W() == 6.0f);        
        
        alignedVec = reinterpret_cast< ::rw::math::fpu::QuaternionTemplate<float>*>(&buffer[3]); 
        v = LoadUnAlignedPacked(*alignedVec);
        Validate( v.X() == 4.0f && v.Y() == 5.0f && v.Z() == 6.0f  && v.W() == 7.0f);  
     

      ]]>
       </TEST>

       <TEST NAME="UnalignedStore">
         <![CDATA[

        SetFunctionName("Quaternion unaligned store tests");

        float buffer[8];
        
        //Test every position with 16 byte alignment, then move 4 bytes forward each time
        for (int i=0; i<8; i++)
          buffer[i] = 0.0f;
          
        Quaternion v2;

        v2.Set(1.1f, 2.2f, 3.3f, 4.4f);
        ::rw::math::fpu::Quaternion* unaligned = reinterpret_cast< ::rw::math::fpu::Quaternion*>(&buffer[0]);
        StoreUnAlignedPacked( *unaligned, v2);      
        Validate( buffer[0] == 1.1f && buffer[1] == 2.2f && buffer[2] == 3.3f && buffer[3] == 4.4f);    

        unaligned = reinterpret_cast< ::rw::math::fpu::Quaternion*>(&buffer[1]);
        StoreUnAlignedPacked( *unaligned, v2);       
        Validate( buffer[1] == 1.1f && buffer[2] == 2.2f && buffer[3] == 3.3f && buffer[4] == 4.4f);    
        
        unaligned = reinterpret_cast< ::rw::math::fpu::Quaternion*>(&buffer[2]);
        StoreUnAlignedPacked( *unaligned, v2);       
        Validate( buffer[2] == 1.1f && buffer[3] == 2.2f && buffer[4] == 3.3f && buffer[5] == 4.4f);    
        
        unaligned = reinterpret_cast< ::rw::math::fpu::Quaternion*>(&buffer[3]);
        StoreUnAlignedPacked( *unaligned, v2);   
        Validate( buffer[3] == 1.1f && buffer[4] == 2.2f && buffer[5] == 3.3f && buffer[6] == 4.4f);            

      ]]>
       </TEST>

     </TYPE>

    <TYPE NAME="performance">

      <TEST NAME="test51">
      <![CDATA[

        SetFunctionName("void Set(float _x, float _y, float _z, float _w)");
        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                quat_array[i].Set(x_array[i], y_array[i], z_array[i], w_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test52">
      <![CDATA[

        SetFunctionName("X() = float");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                quat_array[i].X() = x_array[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test53">
      <![CDATA[

        SetFunctionName("Y() = float");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                quat_array[i].Y() = x_array[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test54">
      <![CDATA[

        SetFunctionName("Z() = float");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                quat_array[i].Z() = z_array[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test55">
      <![CDATA[

        SetFunctionName("W() = float");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                quat_array[i].W() = w_array[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test56">
      <![CDATA[

        SetFunctionName("VecFloatRefX X()");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = quat_array[i].X();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test57">
      <![CDATA[

        SetFunctionName("VecFloatRefY Y()");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = quat_array[i].Y();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test58">
      <![CDATA[

        SetFunctionName("VecFloatRefZ Z()");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = quat_array[i].Z();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test59">
      <![CDATA[

        SetFunctionName("VecFloatRefW W()");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = quat_array[i].W();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test60">
      <![CDATA[

        SetFunctionName("float_t& operator [] (int i)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = quat_array[i][0];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test61">
      <![CDATA[

        SetFunctionName("float_t operator [] (int i) const");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = quat_array[i][0];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test62">
      <![CDATA[

        SetFunctionName("const VecFloatRefX X() const");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = const_cast<const Quaternion*>(&quat_array[i])->X();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test63">
      <![CDATA[

        SetFunctionName("const VecFloatRefY Y() const");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = const_cast<const Quaternion*>(&quat_array[i])->Y();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test64">
      <![CDATA[

        SetFunctionName("const VecFloatRefZ Z() const");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = const_cast<const Quaternion*>(&quat_array[i])->Z();
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test21">
      <![CDATA[

        SetFunctionName("const VecFloatRefW W() const");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = const_cast<const Quaternion*>(&quat_array[i])->W();
            }
        }

        StopTimer();

      ]]>
      </TEST>

    </TYPE>

  </TYPE>


  <TYPE NAME="function">

    <TYPE NAME="correctness">


      <TEST NAME="getxyz">
        <![CDATA[
    
        Quaternion q;

        SetFunctionName("Vector3Template<FloatType>& GetXYZ(const QuaternionTemplate<FloatType>& v)");
        q.Set(1.0f, 2.0f, 3.45f, 2.1f);
        const Vector3 &v3 = GetXYZ(q);
        Validate(v3.X()==q.X() && v3.Y()==q.Y() && v3.Z()==q.Z());

      ]]>
      </TEST>
      
      <TEST NAME="test94">
      <![CDATA[

        Quaternion qA, qB;

        SetFunctionName("bool IsSimilar(Quaternion::InParam a, Quaternion::InParam b, VecFloat::InParam epsilon = SMALL_FLOAT)");
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(1.0f, 2.0f, 3.45f, 2.1f);
        Quaternion qATest, qBTest;
        qATest.Set(1.01f, 2.0f, 1.2f, 2.1f);
        qBTest.Set(1.0f, 2.0f, 1.2f, 2.1f);
        Validate(IsSimilar(qA, qB, (float_test_type)0.0f) && !IsSimilar(qATest, qBTest, (float_test_type)0.0f) && IsSimilar(qATest, qBTest, (float_test_type)0.1f));

      ]]>
      </TEST>


      <TEST NAME="test95">
      <![CDATA[
    
#if !defined EA_PLATFORM_PS3_SPU
    {
        Quaternion qA, qB;
        SetFunctionName("bool IsValid(Quaternion::InParam q)");
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(1.0f, (float)testing::GetNaN(), 3.45f, 2.1f);

        Validate(IsValid(qA) && !IsValid(qB));
    }
#endif  
      ]]>
      </TEST>


      <TEST NAME="isanynan">
      <![CDATA[


#if !defined EA_PLATFORM_PS3_SPU
        SetFunctionName("IsAnyNaN(Quaternion v)");

        float zero = 0.0f;
        float_test_type nan = float_test_type(zero / zero);
        int numPermutations = 1 << Quaternion::NumberOfElement;
        bool result = true;
        for( int curPermutation=0;curPermutation<numPermutations;curPermutation++)
        {
            Quaternion q = GetQuaternion_Zero();
            for( int elem = 0; elem < Quaternion::NumberOfElement; elem++ )
            {
                if( curPermutation & (1<<elem) )
                {
                    q.SetComponent( elem, nan );
                }
            }
            if( curPermutation == 0 )
            {
                // All bits are zero so the quat has no NaN's
                result &= !IsAnyNaN(q);
            }
            else
            {
                // At least one element is NaN.
                result &= IsAnyNaN(q);
            }
        }
        Validate(result);
#endif

      ]]>
      </TEST>


      <TEST NAME="test97">
      <![CDATA[

        Quaternion qA, qB;

        SetFunctionName("bool IsIdentity(Quaternion::InParam q, VecFloat::InParam tolerance = EPSILON)");
        qA.Set(0.0f, 0.0f, 0.0f, 1.0f);
        qB.Set(0.0f, 0.0f, 0.0f, 1.1f);
        Validate( IsIdentity(qA) &&
                  IsIdentity(qB, (float_test_type)1.11f) &&
                 !IsIdentity(qB, (float_test_type)0.001f) );

      ]]>
      </TEST>


      <TEST NAME="test98">
      <![CDATA[

        Quaternion qA, qB;

        SetFunctionName("bool IsUnit(Quaternion::InParam q)");
        qA.Set(0.0f, 0.0f, 0.0f, 1.0f);
        qB.Set(0.0f, 0.0f, 0.0f, 1.1f);
        Validate( IsUnit(qA) &&
                  !IsUnit(qB) );

      ]]>
      </TEST>


      <TEST NAME="test99">
      <![CDATA[
        Quaternion qA, qB;

        SetFunctionName("bool IsPure(Quaternion::InParam q)");
        qA.Set(2.0f, 1.0f, 0.0f, 0.0f);
        qB.Set(0.0f, 0.0f, 0.0f, 0.1f);
        Validate( IsPure(qA) &&
                  !IsPure(qB) );

      ]]>
      </TEST>


      <TEST NAME="test66">
      <![CDATA[

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("Quaternion Negate(Quaternion::InParam v)");
        qOut= Negate(qA);
        Validate((float)qA.X() == -(float)qOut.X() && (float)qA.Y() == -(float)qOut.Y() && (float)qA.Z() == -(float)qOut.Z() && (float)qA.W() == -(float)qOut.W());

      ]]>
      </TEST>


      <TEST NAME="test68">
      <![CDATA[

        float_test_type multiplier = 2.1f;
        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("Quaternion Mult(Quaternion::InParam v, VecFloat::InParam s)");
        qOut= Mult(qA, multiplier);
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X()) * multiplier, (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y()) * multiplier, (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z()) * multiplier, (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W()) * multiplier, (float_test_type)qOut.W())
                );

      ]]>
      </TEST>

      <TEST NAME="multvector">
        <![CDATA[

        Quaternion qA, qOut;
        Vector4 v;
        qA.Set(1.0f, 2.1f, 3.2f, 4.3f);
        v.Set(5.4f, 6.5f, 7.6f, 8.7f);

        SetFunctionName("Quaternion MultByVector(Quaternion::InParam q, Vector4::InParam v)");
        qOut= MultByVector(qA, v);
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X()) * (v.X()), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y()) * (v.Y()), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z()) * (v.Z()), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W()) * (v.W()), (float_test_type)qOut.W())
                );
      ]]>
      </TEST>
            
      <TEST NAME="test248">
      <![CDATA[

#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.0f);

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("Quaternion Mult(Quaternion::InParam v, VecFloatRef<INDEX> s)");
        qOut= Mult(qA, VecFloatRefZ(multiplier));
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X()) * VecFloatRefZ(multiplier), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y()) * VecFloatRefZ(multiplier), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z()) * VecFloatRefZ(multiplier), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W()) * VecFloatRefZ(multiplier), (float_test_type)qOut.W())
                );

#endif

      ]]>
      </TEST>


      <TEST NAME="test249">
      <![CDATA[

#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.0f);

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("Quaternion Mult(Quaternion::InParam v, VecFloatRefIndex::InParam s)");
        qOut= Mult(qA, VecFloatRefIndex(multiplier, 2));
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X()) * VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y()) * VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z()) * VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W()) * VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.W())
                );

#endif

      ]]>
      </TEST>


      <TEST NAME="test70">
      <![CDATA[

        float_test_type multiplier = 2.1f;
        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("Quaternion Divide(Quaternion::InParam v, VecFloat::InParam s)");
        qOut= Divide(qA, multiplier);
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X() / multiplier), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y() / multiplier), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z() / multiplier), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W() / multiplier), (float_test_type)qOut.W())
                );

      ]]>
      </TEST>


      <TEST NAME="test250">
      <![CDATA[

#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.0f);

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("Quaternion Divide(Quaternion::InParam v, VecFloatRef<INDEX> s)");
        qOut= Divide(qA, VecFloatRefZ(multiplier));
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X()) / VecFloatRefZ(multiplier), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y()) / VecFloatRefZ(multiplier), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z()) / VecFloatRefZ(multiplier), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W()) / VecFloatRefZ(multiplier), (float_test_type)qOut.W())
                );

#endif

      ]]>
      </TEST>


      <TEST NAME="test251">
      <![CDATA[

#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.0f);

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("Quaternion Divide(Quaternion::InParam v, VecFloatRefIndex::InParam s)");
        qOut= Divide(qA, VecFloatRefIndex(multiplier, 2));
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X()) / VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y()) / VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z()) / VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W()) / VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.W())
                );

#endif

      ]]>
      </TEST>


      <TEST NAME="test72">
      <![CDATA[

        Quaternion qA, qB, qOut;
    qA.Set(1.0f, 2.0f, 2.0f, 4.0f);
    qB.Set(3.0f, 4.0f, 4.3f, 3.1f);

        SetFunctionName("Quaternion Add(Quaternion::InParam a, Quaternion::InParam b)");
        qOut= Add(qA, qB);
        Validate(
                IsEqualWithEpsilon((float)qA.X() + (float)qB.X(), (float)qOut.X()) &&
                IsEqualWithEpsilon((float)qA.Y() + (float)qB.Y(), (float)qOut.Y()) &&
                IsEqualWithEpsilon((float)qA.Z() + (float)qB.Z(), (float)qOut.Z()) &&
                IsEqualWithEpsilon((float)qA.W() + (float)qB.W(), (float)qOut.W())
                );

      ]]>
      </TEST>


      <TEST NAME="test74">
      <![CDATA[

        Quaternion qA, qB, qOut;
    qA.Set(1.0f, 2.0f, 2.0f, 4.0f);
    qB.Set(3.0f, 4.0f, 4.3f, 3.1f);

        SetFunctionName("Quaternion Subtract(Quaternion::InParam a, Quaternion::InParam b)");
        qOut= Subtract(qA, qB);
        Validate(
                IsEqualWithEpsilon((float)qA.X() - (float)qB.X(), (float)qOut.X()) &&
                IsEqualWithEpsilon((float)qA.Y() - (float)qB.Y(), (float)qOut.Y()) &&
                IsEqualWithEpsilon((float)qA.Z() - (float)qB.Z(), (float)qOut.Z()) &&
                IsEqualWithEpsilon((float)qA.W() - (float)qB.W(), (float)qOut.W())
                );

      ]]>
      </TEST>


      <TEST NAME="test82">
      <![CDATA[

        Quaternion qA, qB;

        SetFunctionName("VecFloat Dot(Quaternion::InParam a, Quaternion::InParam b)");
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        float_test_type fResult = Dot(qA, qB);
        Validate(IsEqualWithEpsilon(fResult, (float_test_type)21.695000f));

      ]]>
      </TEST>


      <TEST NAME="test83">
      <![CDATA[

        Quaternion qA, qB;

        SetFunctionName("VecFloat Dot(Quaternion::InParam a, Quaternion::InParam b)");
        qA.Set(SQRT_HALF, 0.0f, 0.0f, SQRT_HALF);
        qB.Set(0.0f, SQRT_HALF, SQRT_HALF, 0.0f);
        float_test_type fResult = Dot(qA, qB);
        Validate(IsEqualWithEpsilon(fResult, (float_test_type)0.0f));

      ]]>
      </TEST>


      <TEST NAME="test106">
      <![CDATA[

        Quaternion qA, qB, qOut, qRef;
        qA.Set(0.5f, 0.5f, 0.0f, SQRT_HALF);
        qB.Set(0.5f, 0.5f, 0.0f, SQRT_HALF);
        qRef.Set(SQRT_HALF, SQRT_HALF, 0.0f, 0.f);

        SetFunctionName("Quaternion Mult(Quaternion::InParam a, Quaternion::InParam b)");
        qOut= Mult(qA, qB);
        Validate(IsSimilar(qOut, qRef));

      ]]>
      </TEST>


      <TEST NAME="test252">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qB, qOut, qRef;
        qA.Set(0.5f, 0.5f, 0.0f, SQRT_HALF);
        qB.Set(0.5f, 0.5f, 0.0f, SQRT_HALF);
        qRef.Set(SQRT_HALF, SQRT_HALF, 0.0f, 0.f);

        SetFunctionName("Quaternion Mult(Quaternion::InParam a, Quaternion::InParam b)");
        qOut = Mult(qA, qB);
        Validate(IsSimilar(qOut, qRef));

#endif

      ]]>
      </TEST>


      <TEST NAME="test75">
      <![CDATA[

        Quaternion qA;

        SetFunctionName("VecFloat Magnitude(Quaternion::InParam v)");
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        float_test_type mag = Magnitude(qA);
        Validate(IsEqualWithEpsilon(mag, (float_test_type)4.6165462f));

      ]]>
      </TEST>


      <TEST NAME="test76">
      <![CDATA[

        Quaternion qA;

        SetFunctionName("VecFloat MagnitudeSquared(Quaternion::InParam v)");
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        float_test_type mag = MagnitudeSquared(qA);
        Validate(IsEqualWithEpsilon(mag, (float_test_type)21.312500f));

      ]]>
      </TEST>


      <TEST NAME="test77">
      <![CDATA[

        Quaternion qA;

        SetFunctionName("VecFloat MagnitudeRecip(Quaternion::InParam v)");
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        float_test_type mag = MagnitudeRecip(qA);
        Validate(IsEqualWithEpsilon(mag, (float_test_type)0.21661215f));

      ]]>
      </TEST>


      <TEST NAME="normalize_estimate">
      <![CDATA[

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);

        SetFunctionName("Quaternion NormalizeEstimate(Quaternion::InParam v)");
        qOut= NormalizeEstimate(qA);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.21661215f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.43322429f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.74731189f) &&
                IsEqualWithEpsilon((float)qOut.W(), 0.45488548f)
        );

      ]]>
      </TEST>


      <TEST NAME="normalize_fast">
      <![CDATA[

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);

        SetFunctionName("Quaternion NormalizeFast(Quaternion::InParam v)");
        qOut= NormalizeFast(qA);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.21661215f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.43322429f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.74731189f) &&
                IsEqualWithEpsilon((float)qOut.W(), 0.45488548f)
        );

      ]]>
      </TEST>


      <TEST NAME="test79">
      <![CDATA[

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);

        SetFunctionName("Quaternion Normalize(Quaternion::InParam v)");
        qOut= Normalize(qA);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.21661215f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.43322429f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.74731189f) &&
                IsEqualWithEpsilon((float)qOut.W(), 0.45488548f)
        );

      ]]>
      </TEST>


      <TEST NAME="normalizereturnmagnitude">
      <![CDATA[

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);

        SetFunctionName("VecFloat NormalizeReturnMagnitude(Quaternion::InParam v, Quaternion& result)");
        float_test_type mag = NormalizeReturnMagnitude(qA, qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.21661215f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.43322429f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.74731189f) &&
                IsEqualWithEpsilon((float)qOut.W(), 0.45488548f) &&
                IsEqualWithEpsilon((float)mag, 4.6165463281548478f)
        );

      ]]>
      </TEST>


      <TEST NAME="checked_normalize_return_magnitude">
      <![CDATA[

        Quaternion quat, output;

        float fResult;
        bool success = true;
        SetFunctionName("CheckedNormalizeReturnMagnitude(const Quaternion &v, Quaternion &result)");

        quat.Set(1.0f, 2.0f, 3.45f, 2.1f);
        fResult = (float)CheckedNormalizeReturnMagnitude(quat, output);
        success &= IsEqualWithEpsilon((float)output.X(), 0.21661215f);
        success &= IsEqualWithEpsilon((float)output.Y(), 0.43322429f);
        success &= IsEqualWithEpsilon((float)output.Z(), 0.74731189f);
        success &= IsEqualWithEpsilon((float)output.W(), 0.45488548f);
        success &= IsEqualWithEpsilon(fResult, 4.6165462f);

        quat.Set(0.0f, 0.0f, 0.0f, 0.0f);
        fResult = (float)CheckedNormalizeReturnMagnitude(quat, output);
        success &= IsEqualWithEpsilon((float)output.X(), 0.0f);
        success &= IsEqualWithEpsilon((float)output.Y(), 0.0f);
        success &= IsEqualWithEpsilon((float)output.Z(), 0.0f);
        success &= IsEqualWithEpsilon((float)output.W(), 0.0f);
        success &= IsEqualWithEpsilon(fResult, 0.0f);

        quat.Set(SMALL_FLOAT, 0.0f, 0.0f, 0.0f);
        fResult = (float)CheckedNormalizeReturnMagnitude(quat, output);
        success &= IsEqualWithEpsilon((float)output.X(), 1.0f);
        success &= IsEqualWithEpsilon((float)output.Y(), 0.0f);
        success &= IsEqualWithEpsilon((float)output.Z(), 0.0f);
        success &= IsEqualWithEpsilon((float)output.W(), 0.0f);
        success &= IsEqualWithEpsilon(fResult, 0.0f);

        quat.Set(MIN_FLOAT, 0.0f, 0.0f, 0.0f);
        fResult = (float)CheckedNormalizeReturnMagnitude(quat, output);
        // Two solutions are acceptable depending on the precision that
        // calculations are carried out with.  Either the magnitude appears to
        // be zero (e.g. for 32bit calculations), or the magnitude appears to
        // be a very small number (i.e. MIN_FLOAT).
        // The result vector will then be 0 (if magnitude is zero), or the X
        // axis otherwise.
        success &= IsEqualWithEpsilon((float)output.X(), 0.0f) || IsEqualWithEpsilon((float)output.X(), 1.0f);
        success &= IsEqualWithEpsilon((float)output.Y(), 0.0f);
        success &= IsEqualWithEpsilon((float)output.Z(), 0.0f);
        success &= IsEqualWithEpsilon((float)output.W(), 0.0f);
        success &= IsEqualWithEpsilon(fResult, 0.0f) || IsEqualWithEpsilon(fResult, MIN_FLOAT);

        Validate(success);

      ]]>
      </TEST>


      <TEST NAME="test80">
      <![CDATA[

        Quaternion qA, qOut;
        qA.Set(0.0f, 0.0f, 0.0f, 0.0f);

        SetFunctionName("Quaternion Normalize(Quaternion::InParam v)");
        qOut= Normalize(qA);
        // Testing if it crashes on 0.0f which is undefined

      ]]>
      </TEST>


      <TEST NAME="test81">
      <![CDATA[

        Quaternion qA, qOut;
        qA.Set(0.0000000001f, 0.0f, 0.0f, 0.0000000001f);

        SetFunctionName("Quaternion Normalize(Quaternion::InParam v)");
        qOut= Normalize(qA);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), SQRT_HALF) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.0f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.0f) &&
                IsEqualWithEpsilon((float)qOut.W(), SQRT_HALF)
                );

      ]]>
      </TEST>


      <TEST NAME="test253">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qOut;
        float_test_type mag;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);

        SetFunctionName("Quaternion Normalize(Quaternion::InParam v, VecFloat::OutParam magnitude)");
        qOut = Normalize(qA, mag);
        Validate(
                IsEqualWithEpsilon((float_test_type)mag, (float_test_type)4.6165462f) &&
                IsEqualWithEpsilon((float)qOut.X(), 0.21661215f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.43322429f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.74731189f) &&
                IsEqualWithEpsilon((float)qOut.W(), 0.45488548f)
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test85">
      <![CDATA[

        Quaternion qA, qB, qC, qOut1, qOut2;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        qC.Set(1.0f, -1.0f, -2.3f, -0.1f);

        SetFunctionName("Quaternion Lerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloat::InParam t)");
        qOut1= Lerp(qA, qB, (float_test_type)0.25f);
        qOut2= Lerp(qB, qC, (float_test_type)0.3f);
        Validate(
                // This is sort of a "meta" test.  Ensure that the unit test covers both conditions in the implementation code.
                (float)Dot(qA, qB) > 0.0f &&
                (float)Dot(qB, qC) < 0.0f &&

                IsEqualWithEpsilon((float)qOut1.X(), 0.0f) &&
                IsEqualWithEpsilon((float)qOut1.Y(), 1.75f) &&
                IsEqualWithEpsilon((float)qOut1.Z(), 3.9125001f) &&
                IsEqualWithEpsilon((float)qOut1.W(), 2.0999999f) &&
                IsEqualWithEpsilon((float)qOut2.X(), -2.4f) &&
                IsEqualWithEpsilon((float)qOut2.Y(), 1.0f) &&
                IsEqualWithEpsilon((float)qOut2.Z(), 4.4f) &&
                IsEqualWithEpsilon((float)qOut2.W(), 1.5f)
                );

      ]]>
      </TEST>


      <TEST NAME="test89">
      <![CDATA[

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        Quaternion qA_normalized, qB_normalized;

        SetFunctionName("Quaternion SLerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloat::InParam t)");
        qA_normalized = Normalize(qA);
        qB_normalized = Normalize(qB);
        qOut= SLerp(qA_normalized, qB_normalized, (float_test_type)0.75f);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), -0.30123767f) &&
                IsEqualWithEpsilon((float)qOut.Y(),  0.23916793f) &&
                IsEqualWithEpsilon((float)qOut.Z(),  0.84240395f) &&
                IsEqualWithEpsilon((float)qOut.W(),  0.37737280f)
                );

      ]]>
      </TEST>


      <TEST NAME="test90">
      <![CDATA[

        float qA_X = -0.672199841439775f;
        float qA_Y = -0.411075209491423f;
        float qA_Z = 0.590064115157f;
        float qA_W = -0.176036602199404f;
        Quaternion qA, qB, qOut;
        qA.Set(qA_X,qA_Y,qA_Z,qA_W);
        qB.Set(-qA_X,-qA_Y,-qA_Z,-qA_W);

        SetFunctionName("Quaternion SLerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloat::InParam t)");
        qOut= SLerp(qA, qB, (float_test_type)0.5f);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), -qA_X) &&
                IsEqualWithEpsilon((float)qOut.Y(), -qA_Y) &&
                IsEqualWithEpsilon((float)qOut.Z(), -qA_Z) &&
                IsEqualWithEpsilon((float)qOut.W(), -qA_W)
                );

      ]]>
      </TEST>


      <TEST NAME="test87">
      <![CDATA[

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);

        SetFunctionName("Quaternion NLerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloat::InParam t)");
        qOut= NLerp(qA, qB, (float_test_type)0.15f);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.085500620f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.39544040f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.79675895f) &&
                IsEqualWithEpsilon((float)qOut.W(), 0.44887829f)
                );

      ]]>
      </TEST>


      <TEST NAME="test91">
      <![CDATA[

        Quaternion qA, qB, qOut, qRef;

        SetFunctionName("Quaternion SLerpNoCheck(Quaternion::InParam v0, Quaternion::InParam v1, VecFloat::InParam t)");
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        Quaternion qA_normalized, qB_normalized;
        qA_normalized = Normalize(qA);
        qB_normalized = Normalize(qB);
        qOut= SLerpNoCheck(qA_normalized, qB_normalized, (float_test_type)0.75f);
        qRef= SLerp(qA_normalized, qB_normalized, (float_test_type)0.75f);
        Validate(IsSimilar(qOut, qRef));

      ]]>
      </TEST>


      <TEST NAME="test101">
      <![CDATA[

        Quaternion qA, qOut;
        qA.Set(4.0f, 3.0f, 2.0f, -3.0f);

        SetFunctionName("Quaternion Inverse(Quaternion::InParam q)");
        qOut= Inverse(qA);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), -0.105263f) &&
                IsEqualWithEpsilon((float)qOut.Y(), -0.078947f) &&
                IsEqualWithEpsilon((float)qOut.Z(), -0.052632f) &&
                IsEqualWithEpsilon((float)qOut.W(), -0.078947f)
        );

      ]]>
      </TEST>


      <TEST NAME="test102">
      <![CDATA[

        Quaternion qA, qOut;
        qA.Set(0.0f, 0.0f, 0.0f, 0.0f);

        SetFunctionName("Quaternion Inverse(Quaternion::InParam q)");
        qOut= Inverse(qA);
        // Testing if it crashes on 0.0f which is undefined

      ]]>
      </TEST>


      <TEST NAME="test104">
      <![CDATA[

        Quaternion qA, qB, qOut;
        qA.Set(4.0f, 3.0f, 2.0f, -3.0f);
        qB.Set(-4.0f, -3.0f, -2.0f, -3.0f);

        SetFunctionName("Quaternion Conj(Quaternion::InParam q)");
        qOut= Conj(qA);
        Validate(IsSimilar(qOut, qB, (float_test_type)0.0f));

      ]]>
      </TEST>


      <TEST NAME="test92">
      <![CDATA[

        Quaternion qA, qB, qOut;

        SetFunctionName("Quaternion Concat(Quaternion::InParam a, Quaternion::InParam b)");
        qA.Set(1.1f, 2.2f, 3.3f, 4.4f);
        qB.Set(-5.5f, 6.6f, 7.7f, 8.8f);
        //mult/cross= (-19.36, 21.78, 82.28, 4.84), magSquared= 7642.602
        qOut= Concat(qA, qB);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), -0.22145461f) &&
                IsEqualWithEpsilon((float)qOut.Y(),  0.24913644f) &&
                IsEqualWithEpsilon((float)qOut.Z(),  0.94118211f) &&
                IsEqualWithEpsilon((float)qOut.W(),  0.05536365f)
                );

      ]]>
      </TEST>


      <TEST NAME="test93">
      <![CDATA[

        const float_test_type COMPRESS_ROTATION_EPSILON= 0.002f;
        Quaternion qA, qOut;

        SetFunctionName("uint32_t CompressRotation(Quaternion::InParam quat) ; Quaternion UnCompressRotation(uint32_t rotation)");
        qA.Set(1.123f, 2.2f, 3.3f, 4.4f);
        Quaternion qA_normalized= Normalize(qA);

        uint32_t qCompressed= CompressRotation(qA_normalized);
#ifdef GENERIC_TESTING
        qOut = UnCompressRotation<FloatType>(qCompressed);
#else
        qOut = UnCompressRotation(qCompressed);
#endif
        Validate(IsSimilar(qOut, qA_normalized, COMPRESS_ROTATION_EPSILON));

      ]]>
      </TEST>


      <TEST NAME="test108">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;
        vA.Set( SQRT_HALF, SQRT_HALF, 0);
        qB.Set( 0.5f, 0.5f, 0, SQRT_HALF);

        SetFunctionName("Quaternion QuaternionFromAxisRotationAngle(Vector3::InParam axis, VecFloat::InParam angle_radians)");
        qOut= QuaternionFromAxisRotationAngle(vA, (float_test_type)HALF_PI);
        Validate(IsSimilar(qOut, qB));

      ]]>
      </TEST>


      <TEST NAME="test109">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;
        vA.Set( 0.0f, 0.0f, 0.99996f);
        qB.Set( 0.0f, 0.0f, SQRT_HALF, SQRT_HALF);

        SetFunctionName("Quaternion QuaternionFromAxisRotationAngle(Vector3::InParam axis, VecFloat::InParam angle_radians)");
        qOut= QuaternionFromAxisRotationAngle(vA, (float_test_type)HALF_PI);
        Validate(IsSimilar(qOut, qB, (float_test_type)0.0001f));

      ]]>
      </TEST>


      <TEST NAME="test110">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;

        float_test_type angle = -PI + 0.0001f;
        vA.Set( 1.0f, 0.0f, 0.0f);

        for (; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            qB.Set( Sin(angle / float_test_type(2.0f)), float_test_type(0.0f), float_test_type(0.0f), Cos(angle / float_test_type(2.0f)));
            SetFunctionName("Quaternion QuaternionFromAxisRotationAngle(Vector3::InParam axis, VecFloat::InParam angle_radians)");
            qOut= QuaternionFromAxisRotationAngle(vA, angle);
            Validate(IsSimilar(qOut, qB, (float_test_type)0.0001f));
        }

      ]]>
      </TEST>


      <TEST NAME="test111">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;

        float_test_type angle = -PI + 0.0001f;
        vA.Set( 0.0f, 1.0f, 0.0f);

        for (; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            qB.Set( float_test_type(0.0f), Sin(angle / float_test_type(2.0f)),  float_test_type(0.0f), Cos(angle / float_test_type(2.0f)));
            SetFunctionName("Quaternion QuaternionFromAxisRotationAngle(Vector3::InParam axis, VecFloat::InParam angle_radians)");
            qOut= QuaternionFromAxisRotationAngle(vA, angle);
            Validate(IsSimilar(qOut, qB, (float_test_type)0.0001f));
        }

      ]]>
      </TEST>


      <TEST NAME="test112">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;

        float_test_type angle = -PI + 0.0001f;
        vA.Set( 0.0f, 0.0f, 1.0f);

        for (; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            qB.Set( float_test_type(0.0f), float_test_type(0.0f), Sin(angle / float_test_type(2.0f)), Cos(angle / float_test_type(2.0f)));
            SetFunctionName("Quaternion QuaternionFromAxisRotationAngle(Vector3::InParam axis, VecFloat::InParam angle_radians)");
            qOut= QuaternionFromAxisRotationAngle(vA, angle);
            Validate(IsSimilar(qOut, qB, (float_test_type)0.0001f));
        }

      ]]>
      </TEST>


      <TEST NAME="test113">
      <![CDATA[

        Vector3 vOut, vRef;
        float_test_type angleOut;
        Quaternion qA;
        bool result = true; // Assume the test succeeds

        SetFunctionName("void AxisAngleFromQuaternion(Quaternion::InParam q, Vector3::OutParam axis_out, VecFloat::OutParam angle_out)");

        qA.Set( 0.5f, 0.5f, 0, SQRT_HALF);
        vRef.Set( SQRT_HALF, SQRT_HALF, 0);
        AxisAngleFromQuaternion(qA, vOut, angleOut);
        result &= IsSimilar(vOut, vRef, (float_test_type)0.0001f) && IsSimilar(angleOut, (float_test_type)1.5707964f, (float_test_type)0.0001f);

        qA.Set( 0.0f, 0.0f, 0, 1.0f);
        vRef.Set( 1.0f, 0.0f, 0.0f);
        AxisAngleFromQuaternion(qA, vOut, angleOut);
        result &= IsSimilar(vOut, vRef, (float_test_type)0.0001f) && IsSimilar(angleOut, (float_test_type)0.0f, (float_test_type)0.0001f);

        Validate(result);
      ]]>
      </TEST>


      <TEST NAME="test114">
      <![CDATA[

        Vector3 vA, vB;
        float_test_type fA;
        Quaternion qA;

        SetFunctionName("void AxisAngleFromQuaternion(Quaternion::InParam q, Vector3::OutParam axis_out, VecFloat::OutParam angle_out)");

        qA.Set( 0.0f, 0.0f, 0.0f, 0.0f);
        vB.Set( 0.0f, 0.0f, 0.0f);

        AxisAngleFromQuaternion(qA, vA, fA);

        Validate(IsSimilar(Abs(vA), vB, (float_test_type)0.0001f));

      ]]>
      </TEST>


      <TEST NAME="test115">
      <![CDATA[

        Vector3 vA, vB;
        float_test_type fA;
        Quaternion qA;

        SetFunctionName("void AxisAngleFromQuaternion(Quaternion::InParam q, Vector3::OutParam axis_out, VecFloat::OutParam angle_out)");

        float_test_type angle = -PI + 0.0001f;

        bool success = true;
        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            qA.Set( Sin(float_test_type(angle/float_test_type(2.0f))), float_test_type(0.0f), float_test_type(0.0f), Cos(float_test_type(angle/float_test_type(2.0f))));
            vB.Set( 1, 0, 0);

            AxisAngleFromQuaternion(qA, vA, fA);

            success &= IsSimilar(Abs(vA), vB, (float_test_type)0.001f) &&
                       IsEqualWithEpsilon(fA, Abs(angle), (float_test_type)0.0001f);
        }
        Validate(success);

      ]]>
      </TEST>


      <TEST NAME="test116">
      <![CDATA[

        Vector3 vA, vB;
        float_test_type fA;
        Quaternion qA;

        SetFunctionName("void AxisAngleFromQuaternion(Quaternion::InParam q, Vector3::OutParam axis_out, VecFloat::OutParam angle_out)");

        float_test_type angle = -PI + 0.0001f;

        bool success = true;
        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            qA.Set( float_test_type(0.0f), Sin(float_test_type(angle/float_test_type(2.0f))),  float_test_type(0.0f), Cos(float_test_type(angle/float_test_type(2.0f))));
            vB.Set( 0, 1, 0);

            AxisAngleFromQuaternion(qA, vA, fA);

            success &= IsSimilar(Abs(vA), vB, (float_test_type)0.001f) &&
                       IsEqualWithEpsilon(fA, Abs(angle), (float_test_type)0.0001f);
        }
        Validate(success);

      ]]>
      </TEST>


      <TEST NAME="test117">
      <![CDATA[

        Vector3 vA, vB;
        float_test_type fA;
        Quaternion qA;

        SetFunctionName("void AxisAngleFromQuaternion(Quaternion::InParam q, Vector3::OutParam axis_out, VecFloat::OutParam angle_out)");

        float_test_type angle = -PI + 0.0001f;

        bool success = true;
        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            qA.Set( float_test_type(0.0f), float_test_type(0.0f), Sin(float_test_type(angle/float_test_type(2.0f))),  Cos(float_test_type(angle/float_test_type(2.0f))));
            vB.Set( 0, 0, 1);

            AxisAngleFromQuaternion(qA, vA, fA);

            success &= IsSimilar(Abs(vA), vB, (float_test_type)0.0001f) &&
                       IsEqualWithEpsilon(fA, Abs(angle), (float_test_type)0.0001f);
        }
        Validate(success);

      ]]>
      </TEST>
      
      <TEST NAME="test128">
      <![CDATA[

        Vector3 vA, vB;
        Quaternion qA;
        qA.Set( SQRT_HALF, 0.0f, 0.0f, SQRT_HALF);
        vB.Set( HALF_PI, 0.0f, 0.0f);

        SetFunctionName("Vector3 EulerXYZFromQuaternion(Quaternion::InParam q)");
        vA= EulerXYZFromQuaternion(qA);
        Validate(IsSimilar(vA, vB));

      ]]>
      </TEST>


      <TEST NAME="test129">
      <![CDATA[

        Vector3 vA, vB;
        Quaternion qA;

        qA.Set( 0.0f, 0.0f, 0.0f, 1.0f);
        vB.Set( 0.0f, 0.0f, 0.0f);

        SetFunctionName("Vector3 EulerXYZFromQuaternion(Quaternion::InParam q)");
        vA= EulerXYZFromQuaternion(qA);
        Validate(IsSimilar(vA, vB));

      ]]>
      </TEST>


      <TEST NAME="test130">
      <![CDATA[

        Vector3 vA, vB;
        Quaternion qA;

        qA.Set( 0.0f, 0.0f, 0.0f, 0.0f);
        vB.Set( 0.0f, 0.0f, 0.0f);

        SetFunctionName("Vector3 EulerXYZFromQuaternion(Quaternion::InParam q)");
        vA= EulerXYZFromQuaternion(qA);
        Validate(IsSimilar(vA, vB));

      ]]>
      </TEST>


      <TEST NAME="test131">
      <![CDATA[

        Vector3 vA, vB;
        Quaternion qA;

        SetFunctionName("Vector3 EulerXYZFromQuaternion(Quaternion::InParam q)");
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;
        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            qA.Set( Sin(angle / float_test_type(2.0f)),zero,zero, Cos(angle / float_test_type(2.0f)));
            vB.Set( angle, zero, zero);
            vA= EulerXYZFromQuaternion(qA);
            Validate(
                testing::IsSimilarAngle((float)vA.X(), (float)vB.X(), 0.001f) &&
                testing::IsSimilarAngle((float)vA.Y(), (float)vB.Y(), 0.001f) &&
                testing::IsSimilarAngle((float)vA.Z(), (float)vB.Z(), 0.001f)
            );
        }

      ]]>
      </TEST>


      <TEST NAME="test132">
      <![CDATA[

        Vector3 vA, vB;
        Quaternion qA;

        SetFunctionName("Vector3 EulerXYZFromQuaternion(Quaternion::InParam q)");
        // problems when angle is greater than 90 degrees
        float_test_type angle = -HALF_PI + 0.0001f;
        float_test_type zero = 0.0f;
        for(; angle < float_test_type(HALF_PI); angle += float_test_type(0.25f))
        {
            qA.Set( zero, Sin(angle / float_test_type(2.0f)),zero, Cos(angle / float_test_type(2.0f)));
            vB.Set( zero, angle, zero);
            vA= EulerXYZFromQuaternion(qA);
            Validate(
                testing::IsSimilarAngle((float)vA.X(), (float)vB.X(), 0.001f) &&
                testing::IsSimilarAngle((float)vA.Y(), (float)vB.Y(), 0.001f) &&
                testing::IsSimilarAngle((float)vA.Z(), (float)vB.Z(), 0.001f)
            );
        }

      ]]>
      </TEST>


      <TEST NAME="test133">
      <![CDATA[

        Vector3 vA, vB;
        Quaternion qA;

        SetFunctionName("Vector3 EulerXYZFromQuaternion(Quaternion::InParam q)");
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            qA.Set( zero,zero,Sin(angle / float_test_type(2.0f)), Cos(angle / float_test_type(2.0f)));
            vB.Set( zero, zero, angle);
            vA= EulerXYZFromQuaternion(qA);
            Validate(
                testing::IsSimilarAngle((float)vA.X(), (float)vB.X(), 0.001f) &&
                testing::IsSimilarAngle((float)vA.Y(), (float)vB.Y(), 0.001f) &&
                testing::IsSimilarAngle((float)vA.Z(), (float)vB.Z(), 0.001f)
            );
        }

      ]]>
      </TEST>


      <TEST NAME="test146">
      <![CDATA[

        Vector3 vA, vB, vC;
        Quaternion qA( 0.0f, 0.0f, SQRT_HALF, SQRT_HALF );

        vB.Set( 3, 5, 1);
        vC.Set(-5, 3, 1);

        SetFunctionName("Vector3 TransformVector(Vector3::InParam v, Quaternion::InParam q)");
        vA = TransformVector(vB, qA);
        Validate(IsSimilar(vA, vC));

      ]]>
      </TEST>


      <TEST NAME="test148">
      <![CDATA[

        Vector3 vA, vB, vC;
        Quaternion qA( SQRT_HALF, 0.0f, 0.0f, SQRT_HALF );

        vB.Set( 3, 5, 1);
        vC.Set( 3, -1, 5);

        SetFunctionName("Vector3 TransformVector(Vector3::InParam v, Quaternion::InParam q)");
        vA = TransformVector(vB, qA);
        Validate(IsSimilar(vA, vC));

      ]]>
      </TEST>


      <TEST NAME="test150">
      <![CDATA[

        Vector3 vA, vB, vC;
        Quaternion qA( 0.0f, SQRT_HALF, 0.0f, SQRT_HALF );

        vB.Set( 3, 5, 1);
        vC.Set(1, 5, -3);

        SetFunctionName("Vector3 TransformVector(Vector3::InParam v, Quaternion::InParam q)");
        vA = TransformVector(vB, qA);
        Validate(IsSimilar(vA, vC));

      ]]>
      </TEST>


      <TEST NAME="test158">
      <![CDATA[

        Matrix44 m44;
        Quaternion qOut;

        // Set Quaternion to rotate on the Z axis
        Quaternion qA(
                0.0f,
                0.0f,
                SQRT_HALF,
                SQRT_HALF);

        m44.Set(
         0, 1, 0, 0,
        -1, 0, 0, 0,
         0, 0, 1, 0,
         0, 0, 0, 1
         );

        // Testing QuaternionFromMatrix44
        // m44 A is 90 degrees rotation matrix in the z-axis
        // QuatB is 90 degrees rotation quaternion in the z-axis

        SetFunctionName("Quaternion QuaternionFromMatrix44(Matrix44::InParam m, VecFloat::InParam epsilon = ZERO_FLOAT)");
        qOut= QuaternionFromMatrix44(m44);
        Validate(IsSimilar(qA, qOut));

      ]]>
      </TEST>


      <TEST NAME="test160">
      <![CDATA[

        Matrix44 m44;
        Quaternion qOut;

        float_test_type angle = 0.342591234f;

        // Set Quaternion to rotate on the Z axis
        Quaternion qA(
                 (float_test_type)0.0f,
                 (float_test_type)0.0f,
                 Sin(angle /(float_test_type) 2.0f),
                 Cos(angle / (float_test_type) 2.0f));

        m44.Set(
          Cos(angle), Sin(angle), 0, 0,
        Sin(- angle), Cos(angle), 0, 0,
                   0,          0, 1, 0,
                   0,          0, 0, 1
        );

        SetFunctionName("Quaternion QuaternionFromMatrix44(Matrix44::InParam m, VecFloat::InParam epsilon = ZERO_FLOAT)");
        qOut= QuaternionFromMatrix44(m44);
        Validate(IsSimilar(qA, qOut));

      ]]>
      </TEST>


      <TEST NAME="test162">
      <![CDATA[

        Matrix44 m44;
        Quaternion qOut;

        float_test_type angle = 0.342591234f;

        // Set Quaternion to rotate on the Z axis
        Quaternion qA(
                 (float_test_type)0.0f,
                 Sin(angle /(float_test_type) 2.0f),
                 (float_test_type)0.0f,
                 Cos(angle / (float_test_type) 2.0f));

        m44.Set(
        Cos(angle), 0, Sin(- angle), 0,
                 0, 1,            0, 0,
        Sin(angle), 0,   Cos(angle), 0,
                 0, 0,            0, 1
        );

        SetFunctionName("Quaternion QuaternionFromMatrix44(Matrix44::InParam m, VecFloat::InParam epsilon = ZERO_FLOAT)");
        qOut= QuaternionFromMatrix44(m44);
        Validate(IsSimilar(qA, qOut));

      ]]>
      </TEST>


      <TEST NAME="test163">
      <![CDATA[

        Quaternion qOut;

        // Set Quaternion to rotate on the Z axis
        Quaternion qA(
                0.0f,
                0.0f,
                SQRT_HALF,
                SQRT_HALF);

        Matrix44Affine m(
            0, 1, 0,
            -1, 0, 0,
            0, 0, 1,
            0, 0, 0);

        // Testing QuaternionFromMatrix44Affine
        // m44 A is 90 degrees rotation matrix in the z-axis
        // QuatB is 90 degrees rotation quaternion in the z-axis

        SetFunctionName("Quaternion QuaternionFromMatrix44Affine(Matrix44Affine::InParam m, VecFloat::InParam epsilon = ZERO_FLOAT)");
        qOut = QuaternionFromMatrix44Affine(m);
        Validate(IsSimilar(qA, qOut));

      ]]>
      </TEST>


      <TEST NAME="test152">
      <![CDATA[

        Matrix33 m33;
        Quaternion qOut;

        Quaternion qA(
                0.0f,
                0.0f,
                SQRT_HALF,
                SQRT_HALF);

        m33.Set(
        0, 1, 0,
        -1, 0, 0,
            0, 0, 1 );

        SetFunctionName("Quaternion QuaternionFromMatrix33(Matrix33::InParam m, VecFloat::InParam epsilon = ZERO_FLOAT)");
        qOut= QuaternionFromMatrix33(m33);
        Validate(IsSimilar(qA, qOut));

      ]]>
      </TEST>


      <TEST NAME="test154">
      <![CDATA[

        Matrix33 m33;
        Quaternion qOut;


        Quaternion qA(
                0.0f,
                0.0f,
                0.0f,
                1.0f);

        m33.Set(
        1, 0, 0,
        0, 1, 0,
        0, 0, 1 );

        SetFunctionName("Quaternion QuaternionFromMatrix33(Matrix33::InParam m, VecFloat::InParam epsilon = ZERO_FLOAT)");
        qOut= QuaternionFromMatrix33(m33);
        Validate(IsSimilar(qA, qOut));

      ]]>
      </TEST>


      <TEST NAME="test156">
      <![CDATA[

        Matrix33 m33;
        Quaternion qOut;

        Quaternion qA(
                 1.0f,
                 0.0f,
                 0.0f,
                 0.0f);

        m33.Set(
        1, 0, 0,
        0, -1, 0,
        0, 0, -1 );

        SetFunctionName("Quaternion QuaternionFromMatrix33(Matrix33::InParam m, VecFloat::InParam epsilon = ZERO_FLOAT)");
        qOut= QuaternionFromMatrix33(m33);
        Validate(IsSimilar(qA, qOut));

      ]]>
      </TEST>


      <TEST NAME="test119">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;
        vA.Set( HALF_PI, 0, 0);
        qB.Set( SQRT_HALF, 0, 0, SQRT_HALF);

        SetFunctionName("Quaternion QuaternionFromEulerXYZ(Vector3::InParam euler)");
        qOut= QuaternionFromEulerXYZ(vA);
        Validate(IsSimilar(qOut, qB));

      ]]>
      </TEST>


      <TEST NAME="test120">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;
        vA.Set( 0.0f, 0.0f, 0.0f);
        qB.Set( 0.0f, 0.0f, 0.0f, 1.0f);

        SetFunctionName("Quaternion QuaternionFromEulerXYZ(Vector3::InParam euler)");
        qOut= QuaternionFromEulerXYZ(vA);
        Validate(IsSimilar(qOut, qB));

      ]]>
      </TEST>


      <TEST NAME="test121">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;

        SetFunctionName("Quaternion QuaternionFromEulerXYZ(Vector3::InParam euler)");
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            vA.Set( angle, zero, zero);
            qB.Set( Sin(angle / float_test_type(2.0f)),zero,zero, Cos(angle / float_test_type(2.0f)));
            qOut= QuaternionFromEulerXYZ(vA);
            Validate(IsSimilar(qOut, qB));
        }

      ]]>
      </TEST>


      <TEST NAME="test122">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;

        SetFunctionName("Quaternion QuaternionFromEulerXYZ(Vector3::InParam euler)");
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            vA.Set( zero, angle, zero);
            qB.Set( zero,Sin(angle / float_test_type(2.0f)),zero, Cos(angle / float_test_type(2.0f)));
            qOut= QuaternionFromEulerXYZ(vA);
            Validate(IsSimilar(qOut, qB));
        }

      ]]>
      </TEST>


      <TEST NAME="test123">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;

        SetFunctionName("Quaternion QuaternionFromEulerXYZ(Vector3::InParam euler)");
        float_test_type angle = -PI + 0.0001f;
        float_test_type zero = 0.0f;

        for(; angle < float_test_type(PI); angle += float_test_type(0.25f))
        {
            vA.Set( zero, zero, angle);
            qB.Set( zero, zero,Sin(angle / float_test_type(2.0f)),Cos(angle / float_test_type(2.0f)));
            qOut= QuaternionFromEulerXYZ(vA);
            Validate(IsSimilar(qOut, qB));
        }

      ]]>
      </TEST>


      <TEST NAME="test124">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;
        vA.Set( HALF_PI, 0.0f, HALF_PI);
        qB.Set( 0.5f, 0.5f, 0.5f, 0.5f);

        SetFunctionName("Quaternion QuaternionFromEulerXYZ(Vector3::InParam euler)");
        qOut= QuaternionFromEulerXYZ(vA);
        Validate(IsSimilar(qOut, qB));

      ]]>
      </TEST>


      <TEST NAME="test125">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;
        vA.Set( PI, PI, PI);
        qB.Set( 0.0f, 0.0f, 0.0f, 1.0f);

        SetFunctionName("Quaternion QuaternionFromEulerXYZ(Vector3::InParam euler)");
        qOut= QuaternionFromEulerXYZ(vA);
        Validate(IsSimilar(qOut, qB));

      ]]>
      </TEST>


      <TEST NAME="test126">
      <![CDATA[

        Vector3 vA;
        Quaternion qB, qOut;
        vA.Set( HALF_PI, HALF_PI, HALF_PI);
        qB.Set( 0.0f, SQRT_HALF, 0.0f, SQRT_HALF);

        SetFunctionName("Quaternion QuaternionFromEulerXYZ(Vector3::InParam euler)");
        qOut= QuaternionFromEulerXYZ(vA);
        Validate(IsSimilar(qOut, qB));

      ]]>
      </TEST>


      <TEST NAME="test134">
      <![CDATA[

        SetFunctionName("Quaternion QuaternionFromLookDirection(Vector3::InParam lookDirection, Vector3::InParam up)");
        Vector3 lookDir = Normalize(Vector3( 1.0f, 2.0f, 3.0f));
        Vector3 up(0.0f, 0.0f, 1.0f);
        Quaternion ref = QuaternionFromMatrix44( Matrix44FromLookAt( lookDir, up, GetVector3_Zero() ) );
        Quaternion result = QuaternionFromLookDirection( lookDir, up );

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test135">
      <![CDATA[

        SetFunctionName("Quaternion QuaternionFromLookDirection(Vector3::InParam lookDirection, Vector3::InParam up)");
        Vector3 lookDir = Vector3( 1.0f, 0.0f, 0.0f);
        Vector3 up(0.0f, 1.0f, 0.0f);
        float_test_type zero = 0.0f;
        float_test_type sqrt_half = SQRT_HALF;
        Quaternion ref = Quaternion(zero, sqrt_half, zero, sqrt_half);
        Quaternion result = QuaternionFromLookDirection( lookDir, up );

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test136">
      <![CDATA[

        SetFunctionName("Quaternion QuaternionFromLookDirection(Vector3::InParam lookDirection, Vector3::InParam up)");
        Vector3 lookDir = Vector3( 0.0f, 0.0f, 1.0f);
        Vector3 up(0.0f, 1.0f, 0.0f);
        Quaternion ref = Quaternion(0.0f, 1.0f, 0.0f, 0.0f);
        Quaternion result = QuaternionFromLookDirection( lookDir, up );

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test137">
      <![CDATA[

        SetFunctionName("Quaternion QuaternionFromLookDirection(Vector3::InParam lookDirection, Vector3::InParam up)");
        Vector3 lookDir = Vector3( -1.0f, 0.0f, 0.0f);
        Vector3 up(0.0f, 1.0f, 0.0f);
        float_test_type zero = 0.0f;
        float_test_type sqrt_half = SQRT_HALF;
        Quaternion ref = Quaternion(zero, -sqrt_half, zero, sqrt_half);
        Quaternion result = QuaternionFromLookDirection( lookDir, up );

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test138">
      <![CDATA[

        SetFunctionName("Quaternion QuaternionFromLookAt(Vector3::InParam lookAt, Vector3::InParam up, Vector3::InParam eyePosition)");
        Vector3 lookDir = Normalize(Vector3( 1.0f, 2.0f, 3.0f));
        Vector3 up(0.0f, 0.0f, 1.0f);
        Vector3 eye(12.0f, 9.0f, -4.0f);
        Quaternion ref = QuaternionFromMatrix44( Matrix44FromLookAt( lookDir + eye, up, eye ) );
        Quaternion result = QuaternionFromLookAt( lookDir + eye, up, eye );

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test139">
      <![CDATA[

        SetFunctionName("Quaternion QuaternionFromLookAt(Vector3::InParam lookAt, Vector3::InParam up, Vector3::InParam eyePosition)");
        Vector3 look = Vector3( 2.0f, 2.0f, 3.0f);
        Vector3 up(0.0f, 1.0f, 0.0f);
        Vector3 eye(0.0f, 2.0f, 3.0f);
        Quaternion ref = QuaternionFromMatrix44( Matrix44FromLookAt( look, up, eye ) );
        Quaternion result = QuaternionFromLookAt( look, up, eye );

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test140">
      <![CDATA[

        SetFunctionName("Quaternion QuaternionFromLookAt(Vector3::InParam lookAt, Vector3::InParam up, Vector3::InParam eyePosition)");
        Vector3 look = Vector3( 2.0f, 2.0f, 3.0f);
        Vector3 up(0.0f, 1.0f, 0.0f);
        Vector3 eye(2.0f, 2.0f, 0.0f);
        Quaternion ref(0,1,0,0);
        Quaternion result = QuaternionFromLookAt( look, up, eye );

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test141">
      <![CDATA[

        SetFunctionName("Quaternion QuaternionFromLookAt(Vector3::InParam lookAt, Vector3::InParam up, Vector3::InParam eyePosition)");
        Vector3 look = Vector3( 2.0f, 2.0f, 3.0f);
        Vector3 up(0.0f, 1.0f, 0.0f);
        Vector3 eye(2.0f, 2.0f, 6.0f);
        Quaternion ref(0,0,0,1);
        Quaternion result = QuaternionFromLookAt( look, up, eye );

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test142">
      <![CDATA[

        SetFunctionName("Vector3 QuaternionGetMatrix44AffineRowX(Quaternion::InParam quat)");
        Quaternion testQuat(1.0f, 2.0f, 3.0f, 4.0f);
        Vector3 ref = Matrix44AffineFromQuaternion(testQuat).XAxis();
        Vector3 result = QuaternionGetMatrix44AffineRowX(testQuat);

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test143">
      <![CDATA[

        SetFunctionName("Vector3 QuaternionGetMatrix44AffineRowY(Quaternion::InParam quat)");
        Quaternion testQuat(1.0f, 2.0f, 3.0f, 4.0f);
        Vector3 ref = Matrix44AffineFromQuaternion(testQuat).YAxis();
        Vector3 result = QuaternionGetMatrix44AffineRowY(testQuat);

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test144">
      <![CDATA[

        SetFunctionName("Vector3 QuaternionGetMatrix44AffineRowZ(Quaternion::InParam quat)");
        Quaternion testQuat(1.0f, 2.0f, 3.0f, 4.0f);
        Vector3 ref = Matrix44AffineFromQuaternion(testQuat).ZAxis();
        Vector3 result = QuaternionGetMatrix44AffineRowZ(testQuat);

        Validate( IsSimilar(result, ref) );

      ]]>
      </TEST>


      <TEST NAME="test65">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("void Negate(Quaternion::InParam vec, Quaternion::OutParam r)");
        Negate(qA, qOut);
        Validate(
                (float)qA.X() == -(float)qOut.X() &&
                (float)qA.Y() == -(float)qOut.Y() && 
                (float)qA.Z() == -(float)qOut.Z() && 
                (float)qA.W() == -(float)qOut.W()
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test67">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        float_test_type multiplier = 2.1f;
        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("void Mult(Quaternion::InParam vec, VecFloat::InParam scalar, Quaternion::OutParam r)");
        Mult(qA, multiplier, qOut);
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X()) * multiplier, (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y()) * multiplier, (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z()) * multiplier, (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W()) * multiplier, (float_test_type)qOut.W())
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test254">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.0f);

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("void Mult(Quaternion::InParam v, VecFloatRef<INDEX> s, Quaternion::OutParam r)");
        Mult(qA, VecFloatRefZ(multiplier), qOut);
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X()) * VecFloatRefZ(multiplier), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y()) * VecFloatRefZ(multiplier), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z()) * VecFloatRefZ(multiplier), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W()) * VecFloatRefZ(multiplier), (float_test_type)qOut.W())
        );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test255">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.0f);

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("void Mult(Quaternion::InParam v, VecFloatRefIndex::InParam s, Quaternion::OutParam r)");
        Mult(qA, VecFloatRefIndex(multiplier, 2), qOut);
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X()) * VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y()) * VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z()) * VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W()) * VecFloatRefIndex(multiplier, 2), (float_test_type)qOut.W())
        );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test69">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        float_test_type multiplier = 2.1f;
        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("void Divide(Quaternion::InParam vec, VecFloat::InParam scalar, Quaternion::OutParam r)");
        Divide(qA, multiplier, qOut);
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X() / multiplier), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y() / multiplier), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z() / multiplier), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W() / multiplier), (float_test_type)qOut.W())
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test256">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.0f);

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("void Divide(Quaternion::InParam v, VecFloatRef<INDEX> s, Quaternion::OutParam r)");
        Divide(qA, VecFloatRefZ(multiplier), qOut);
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X() / VecFloatRefZ(multiplier)), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y() / VecFloatRefZ(multiplier)), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z() / VecFloatRefZ(multiplier)), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W() / VecFloatRefZ(multiplier)), (float_test_type)qOut.W())
        );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test257">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.0f);

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);

        SetFunctionName("void Divide(Quaternion::InParam v, VecFloatRefIndex::InParam s, Quaternion::OutParam r)");
        Divide(qA, VecFloatRefIndex(multiplier, 2), qOut);
        Validate(
                IsEqualWithEpsilon((float_test_type)(qA.X() / VecFloatRefIndex(multiplier, 2)), (float_test_type)qOut.X()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Y() / VecFloatRefIndex(multiplier, 2)), (float_test_type)qOut.Y()) &&
                IsEqualWithEpsilon((float_test_type)(qA.Z() / VecFloatRefIndex(multiplier, 2)), (float_test_type)qOut.Z()) &&
                IsEqualWithEpsilon((float_test_type)(qA.W() / VecFloatRefIndex(multiplier, 2)), (float_test_type)qOut.W())
        );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test71">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);
        qB.Set(3.0f, 4.0f, 4.3f, 3.1f);

        SetFunctionName("void Add(Quaternion::InParam a, Quaternion::InParam b, Quaternion::OutParam r)");
        Add(qA, qB, qOut);
        Validate(
                IsEqualWithEpsilon((float)qA.X() + (float)qB.X(), (float)qOut.X()) &&
                IsEqualWithEpsilon((float)qA.Y() + (float)qB.Y(), (float)qOut.Y()) &&
                IsEqualWithEpsilon((float)qA.Z() + (float)qB.Z(), (float)qOut.Z()) &&
                IsEqualWithEpsilon((float)qA.W() + (float)qB.W(), (float)qOut.W())
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test73">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 2.0f, 4.0f);
        qB.Set(3.0f, 4.0f, 4.3f, 3.1f);

        SetFunctionName("void Subtract(Quaternion::InParam a, Quaternion::InParam b, Quaternion::OutParam r)");
        Subtract(qA, qB, qOut);
        Validate(
                IsEqualWithEpsilon((float)qA.X() - (float)qB.X(), (float)qOut.X()) &&
                IsEqualWithEpsilon((float)qA.Y() - (float)qB.Y(), (float)qOut.Y()) &&
                IsEqualWithEpsilon((float)qA.Z() - (float)qB.Z(), (float)qOut.Z()) &&
                IsEqualWithEpsilon((float)qA.W() - (float)qB.W(), (float)qOut.W())
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test105">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qB, qOut, qRef;
        qA.Set(0.5f, 0.5f, 0.0f, SQRT_HALF);
        qB.Set(0.5f, 0.5f, 0.0f, SQRT_HALF);
        qRef.Set(SQRT_HALF, SQRT_HALF, 0.0f, 0.f);

        SetFunctionName("void Mult(Quaternion::InParam a, Quaternion::InParam b, Quaternion::OutParam r)");
        Mult(qA, qB, qOut);
        Validate(IsSimilar(qOut, qRef));

#endif

      ]]>
      </TEST>


      <TEST NAME="test78">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);

        SetFunctionName("void Normalize(Quaternion::InParam vec, Quaternion::OutParam r)");
        Normalize(qA, qOut);
        Validate(
                IsEqualWithEpsilon((float_test_type)qOut.X(), (float_test_type)0.21661215f) &&
                IsEqualWithEpsilon((float_test_type)qOut.Y(), (float_test_type)0.43322429f) &&
                IsEqualWithEpsilon((float_test_type)qOut.Z(), (float_test_type)0.74731189f) &&
                IsEqualWithEpsilon((float_test_type)qOut.W(), (float_test_type)0.45488548f)
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test84">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);

        SetFunctionName("void Lerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloat::InParam t, Quaternion::OutParam r)");
        Lerp(qA, qB, (float_test_type)0.25f, qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.0f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 1.75f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 3.9125001f) &&
                IsEqualWithEpsilon((float)qOut.W(), 2.0999999f)
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test258">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.25f);

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);

        SetFunctionName("void Lerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloatRef<INDEX> t, Quaternion::OutParam r)");
        Lerp(qA, qB, VecFloatRefW(multiplier), qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.0f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 1.75f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 3.9125001f) &&
                IsEqualWithEpsilon((float)qOut.W(), 2.0999999f)
        );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test259">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.25f);

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);

        SetFunctionName("void Lerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloatRefIndex::InParam t, Quaternion::OutParam r)");
        Lerp(qA, qB, VecFloatRefIndex(multiplier, 3), qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.0f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 1.75f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 3.9125001f) &&
                IsEqualWithEpsilon((float)qOut.W(), 2.0999999f)
        );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test88">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        Quaternion qA_normalized, qB_normalized;

        SetFunctionName("void SLerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloat::InParam t, Quaternion::OutParam r)");
        Normalize(qA, qA_normalized);
        Normalize(qB, qB_normalized);
        SLerp(qA_normalized, qB_normalized, (float_test_type)0.75f, qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), -0.30123767f) &&
                IsEqualWithEpsilon((float)qOut.Y(),  0.23916793f) &&
                IsEqualWithEpsilon((float)qOut.Z(),  0.84240395f) &&
                IsEqualWithEpsilon((float)qOut.W(),  0.37737280f)
                );

#endif

      ]]>
      </TEST>


      <TEST NAME="test260">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.75f);

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        Quaternion qA_normalized, qB_normalized;

        SetFunctionName("void SLerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloatRef<INDEX> t, Quaternion::OutParam r)");
        Normalize(qA, qA_normalized);
        Normalize(qB, qB_normalized);
        SLerp(qA_normalized, qB_normalized, VecFloatRefW(multiplier), qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), -0.30123767f) &&
                IsEqualWithEpsilon((float)qOut.Y(),  0.23916793f) &&
                IsEqualWithEpsilon((float)qOut.Z(),  0.84240395f) &&
                IsEqualWithEpsilon((float)qOut.W(),  0.37737280f)
                );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test261">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.75f);

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);
        Quaternion qA_normalized, qB_normalized;

        SetFunctionName("void SLerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloatRefIndex::InParam t,   Quaternion::OutParam r)");
        Normalize(qA, qA_normalized);
        Normalize(qB, qB_normalized);
        SLerp(qA_normalized, qB_normalized, VecFloatRefIndex(multiplier, 3), qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), -0.30123767f) &&
                IsEqualWithEpsilon((float)qOut.Y(),  0.23916793f) &&
                IsEqualWithEpsilon((float)qOut.Z(),  0.84240395f) &&
                IsEqualWithEpsilon((float)qOut.W(),  0.37737280f)
                );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test86">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);

        SetFunctionName("void NLerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloat::InParam t, Quaternion::OutParam r)");
        NLerp(qA, qB, (float_test_type)0.15f, qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.085500620f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.39544040f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.79675895f) &&
                IsEqualWithEpsilon((float)qOut.W(), 0.44887829f)
                );
#endif

      ]]>
      </TEST>


      <TEST NAME="test262">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.15f);

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);

        SetFunctionName("void NLerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloatRef<INDEX> t, Quaternion::OutParam r)");
        NLerp(qA, qB, VecFloatRefW(multiplier), qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.085500620f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.39544040f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.79675895f) &&
                IsEqualWithEpsilon((float)qOut.W(), 0.44887829f)
                );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test263">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, 0.15f);

        Quaternion qA, qB, qOut;
        qA.Set(1.0f, 2.0f, 3.45f, 2.1f);
        qB.Set(-3.0f, 1.0f, 5.3f, 2.1f);

        SetFunctionName("void NLerp(Quaternion::InParam v0, Quaternion::InParam v1, VecFloatRefIndex::InParam t, Quaternion::OutParam r)");
        NLerp(qA, qB, VecFloatRefIndex(multiplier, 3), qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), 0.085500620f) &&
                IsEqualWithEpsilon((float)qOut.Y(), 0.39544040f) &&
                IsEqualWithEpsilon((float)qOut.Z(), 0.79675895f) &&
                IsEqualWithEpsilon((float)qOut.W(), 0.44887829f)
                );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test100">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qOut;
        qA.Set(4.0f, 3.0f, 2.0f, -3.0f);

        SetFunctionName("void Inverse(Quaternion::InParam q, Quaternion::OutParam r)");
        Inverse(qA, qOut);
        Validate(
                IsEqualWithEpsilon((float)qOut.X(), -0.105263f) &&
                IsEqualWithEpsilon((float)qOut.Y(),  -0.078947f) &&
                IsEqualWithEpsilon((float)qOut.Z(),  -0.052632f) &&
                IsEqualWithEpsilon((float)qOut.W(),  -0.078947f)
        );

#endif

      ]]>
      </TEST>


      <TEST NAME="test103">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Quaternion qA, qB, qOut;
        qA.Set(4.0f, 3.0f, 2.0f, -3.0f);
        qB.Set(-4.0f, -3.0f, -2.0f, -3.0f);

        SetFunctionName("void Conj(Quaternion::InParam q, Quaternion::OutParam r)");
        Conj(qA, qOut);
        Validate(IsSimilar(qOut, qB, (float_test_type)0.0f));

#endif

      ]]>
      </TEST>


      <TEST NAME="test107">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Vector3 vA;
        Quaternion qB, qOut;

        //vA is normalized
        vA.Set( SQRT_HALF, SQRT_HALF, 0);
        qB.Set( 0.5f, 0.5f, 0, SQRT_HALF);

        SetFunctionName("void QuaternionFromAxisAngle(Vector3::InParam axis, VecFloat::InParam angle_radians, Quaternion::OutParam r)");
        QuaternionFromAxisAngle(vA, (float_test_type)HALF_PI, qOut);
        Validate(IsSimilar(qOut, qB));

#endif

      ]]>
      </TEST>


      <TEST NAME="test264">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, HALF_PI);

        Vector3 vA;
        Quaternion qB, qOut;

        //vA is normalized
        vA.Set( SQRT_HALF, SQRT_HALF, 0);
        qB.Set( 0.5f, 0.5f, 0, SQRT_HALF);

        SetFunctionName("void QuaternionFromAxisAngle(Vector3::InParam axis, VecFloatRef<INDEX> angle_radians, Quaternion::OutParam r)");
        QuaternionFromAxisAngle(vA, VecFloatRefW(multiplier), qOut);
        Validate(IsSimilar(qOut, qB));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test265">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API
#ifdef HOST_TESTING

        MakeVectorIntrinsic(multiplier, 1.33f, 1.543f, 2.1f, HALF_PI);

        Vector3 vA;
        Quaternion qB, qOut;

        //vA is normalized
        vA.Set( SQRT_HALF, SQRT_HALF, 0);
        qB.Set( 0.5f, 0.5f, 0, SQRT_HALF);

        SetFunctionName("void QuaternionFromAxisAngle(Vector3::InParam axis, VecFloatRefIndex::InParam angle_radians, Quaternion::OutParam r)");
        QuaternionFromAxisAngle(vA, VecFloatRefIndex(multiplier, 3), qOut);
        Validate(IsSimilar(qOut, qB));

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test127">
      <![CDATA[


#if RW_MATH_ENABLE_DEPRECATED_API

        Vector3 vA, vB;
        Quaternion qA;
        qA.Set( SQRT_HALF, 0.0f, 0.0f, SQRT_HALF);
        vB.Set( HALF_PI, 0.0f, 0.0f);

        SetFunctionName("void EulerXYZFromQuaternion(Quaternion::InParam q, Vector3::OutParam r)");
        EulerXYZFromQuaternion(qA, vA);
        Validate(IsSimilar(vA, vB));

#endif

      ]]>
      </TEST>


      <TEST NAME="test145">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Vector3 vA, vB, vC;
        Quaternion qA( 0.0f, 0.0f, SQRT_HALF, SQRT_HALF );

        vB.Set( 3, 5, 1);
        vC.Set(-5, 3, 1);

        SetFunctionName("void Vector3Transform(Quaternion::InParam q, Vector3::InParam v, Vector3::OutParam r)");
        Vector3Transform(qA, vB, vA);
        Validate(IsSimilar(vA, vC));

#endif

      ]]>
      </TEST>


      <TEST NAME="test147">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Vector3 vA, vB, vC;
        Quaternion qA( SQRT_HALF, 0.0f, 0.0f, SQRT_HALF );

        vB.Set( 3, 5, 1);
        vC.Set( 3, -1, 5);

        SetFunctionName("void Vector3Transform(Quaternion::InParam q, Vector3::InParam v, Vector3::OutParam r)");
        Vector3Transform(qA, vB, vA);
        Validate(IsSimilar(vA, vC));

#endif

      ]]>
      </TEST>


      <TEST NAME="test149">
      <![CDATA[


#if RW_MATH_ENABLE_DEPRECATED_API

        Vector3 vA, vB, vC;
        Quaternion qA( 0.0f, SQRT_HALF, 0.0f, SQRT_HALF );

        vB.Set( 3, 5, 1);
        vC.Set(1, 5, -3);


        SetFunctionName("void Vector3Transform(Quaternion::InParam q, Vector3::InParam v, Vector3::OutParam r)");
        Vector3Transform(qA, vB, vA);
        Validate(IsSimilar(vA, vC));

#endif

      ]]>
      </TEST>


      <TEST NAME="test157">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Matrix44 m44;
        Quaternion qOut;

        // Set Quaternion to rotate on the Z axis
        Quaternion qA(
                0.0f,
                0.0f,
                SQRT_HALF,
                SQRT_HALF);

        m44.Set(
        0, 1, 0, 0,
        -1, 0, 0, 0,
            0, 0, 1, 0,
            0, 0, 0, 1);

        // Testing QuaternionFromMatrix44
        // m44 A is 90 degrees rotation matrix in the z-axis
        // QuatB is 90 degrees rotation quaternion in the z-axis

        SetFunctionName("void QuaternionFromMatrix44(Matrix44::InParam m, Quaternion::OutParam q, VecFloat::InParam epsilon = ZERO_FLOAT)");
        QuaternionFromMatrix44(m44, qOut);
        Validate(IsSimilar(qA, qOut));

#endif

      ]]>
      </TEST>


      <TEST NAME="test159">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Matrix44 m44;
        Quaternion qOut;

        float_test_type angle = 0.342591234f;

        // Set Quaternion to rotate on the Z axis
        Quaternion qA(
                 (float_test_type)0.0f,
                 (float_test_type)0.0f,
                 Sin(angle /(float_test_type) 2.0f),
                 Cos(angle / (float_test_type) 2.0f));

        m44.Set(
        Cos(angle), Sin(angle), 0, 0,
        Sin(- angle), Cos(angle), 0, 0,
        0, 0, 1, 0,
        0, 0, 0, 1);

        // Testing QuaternionFromMatrix44
        // m44 A is 90 degrees rotation matrix in the z-axis
        // QuatB is 90 degrees rotation quaternion in the z-axis

        SetFunctionName("void QuaternionFromMatrix44(Matrix44::InParam m, Quaternion::OutParam q, VecFloat::InParam epsilon = ZERO_FLOAT)");
        QuaternionFromMatrix44(m44, qOut);
        Validate(IsSimilar(qA, qOut));

#endif

      ]]>
      </TEST>


      <TEST NAME="test161">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Matrix44 m44;
        Quaternion qOut;
        float_test_type angle = 0.342591234f;

        // Set Quaternion to rotate on the Z axis
        Quaternion qA(
                 (float_test_type)0.0f,
                 Sin(angle /(float_test_type) 2.0f),
                 (float_test_type)0.0f,
                 Cos(angle / (float_test_type) 2.0f));

        m44.Set(
        Cos(angle),0 , Sin(- angle), 0,
        0, 1, 0, 0,
        Sin(angle), 0, Cos(angle), 0,
        0, 0, 0, 1);

        // Testing QuaternionFromMatrix44
        // m44 A is 90 degrees rotation matrix in the z-axis
        // QuatB is 90 degrees rotation quaternion in the z-axis

        SetFunctionName("void QuaternionFromMatrix44(Matrix44::InParam m, Quaternion::OutParam q, VecFloat::InParam epsilon = ZERO_FLOAT)");
        QuaternionFromMatrix44(m44, qOut);
        Validate(IsSimilar(qA, qOut));

#endif

      ]]>
      </TEST>


      <TEST NAME="test151">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Matrix33 m33;
        Quaternion qOut;

        Quaternion qA(
                0.0f,
                0.0f,
                SQRT_HALF,
                SQRT_HALF);

        m33.Set(
        0, 1, 0,
        -1, 0, 0,
            0, 0, 1 );

        SetFunctionName("void QuaternionFromMatrix33(Matrix33::InParam m, Quaternion::OutParam q, VecFloat::InParam epsilon = ZERO_FLOAT)");

        // Testing QuaternionFromMatrix33
        // Matrix A is 90 degrees rotation matrix in the z-axis
        // QuatB is 90 degrees rotation quaternion in the z-axis

        QuaternionFromMatrix33(m33, qOut);
        Validate(IsSimilar(qA, qOut));

#endif

      ]]>
      </TEST>


      <TEST NAME="test153">
      <![CDATA[


#if RW_MATH_ENABLE_DEPRECATED_API

        Matrix33 m33;
        Quaternion qOut;

        Quaternion qA(
                0.0f,
                0.0f,
                0.0f,
                1.0f);

        m33.Set(
        1, 0, 0,
        0, 1, 0,
        0, 0, 1 );

        SetFunctionName("void QuaternionFromMatrix33(Matrix33::InParam m, Quaternion::OutParam q, VecFloat::InParam epsilon = ZERO_FLOAT)");

        QuaternionFromMatrix33(m33, qOut);
        Validate(IsSimilar(qA, qOut));

#endif

      ]]>
      </TEST>


      <TEST NAME="test155">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Matrix33 m33;
        Quaternion qOut;

        Quaternion qA(
                1.0f,
                0.0f,
                0.0f,
                0.0f);

        m33.Set(
        1, 0, 0,
        0, -1, 0,
        0, 0, -1 );

        SetFunctionName("void QuaternionFromMatrix33(Matrix33::InParam m, Quaternion::OutParam q, VecFloat::InParam epsilon = ZERO_FLOAT)");
        QuaternionFromMatrix33(m33, qOut);
        Validate(IsSimilar(qA, qOut));

#endif
      ]]>
      </TEST>


      <TEST NAME="test118">
      <![CDATA[

#if RW_MATH_ENABLE_DEPRECATED_API

        Vector3 vA;
        Quaternion qB, qOut;
        vA.Set( HALF_PI, 0, 0);
        qB.Set( SQRT_HALF, 0, 0, SQRT_HALF);

        SetFunctionName("void QuaternionFromEulerXYZ(Vector3::InParam euler, Quaternion::OutParam r)");
        QuaternionFromEulerXYZ(vA, qOut);
        Validate(IsSimilar(qOut, qB));

#endif

      ]]>
      </TEST>


      <TEST NAME="max_quaternion">
      <![CDATA[

        Quaternion qa, qb;

        SetFunctionName("Max(Quaternion v1, Quaternion v2)");
        qa.Set(-1.0f, 3.0f, 2.0f, -3.0f);
        qb.Set(-3.0f, 1.0f, 3.0f, 2.0f);
        Quaternion result = Max( qa, qb );
        Validate( result == Quaternion(-1.0f, 3.0f, 3.0f, 2.0f) );

      ]]>
      </TEST>


      <TEST NAME="min_quaternion">
      <![CDATA[

        Quaternion qa, qb;

        SetFunctionName("Min(Quaternion v1, Quaternion v2)");
        qa.Set(-1.0f, 3.0f, 2.0f, -3.0f);
        qb.Set(-3.0f, 1.0f, 3.0f, 2.0f);
        Quaternion result = Min( qa, qb );
        Validate( result == Quaternion(-3.0f, 1.0f, 2.0f, -3.0f) );

      ]]>
      </TEST>


      <TEST NAME="clamp_quaternion">
      <![CDATA[

        Quaternion q(2.5f, 1.99f, 1.01f, -2.5f);
        Quaternion one = GetQuaternion_One();
        Quaternion two = float_test_type(2.0f) * one;
        Quaternion ref(2.0f, 1.99f, 1.01f, 1.0f );
        Quaternion result = Clamp( q, one, two );

        SetFunctionName("Clamp(Quaternion, Quaternion, Quaternion");
        Validate( result == ref );

      ]]>
      </TEST>

      <TEST NAME="abs">
      <![CDATA[

        Quaternion qa;

        SetFunctionName("Abs(Quaternion v1)");
        qa.Set(-1.0f, 3.0f, 2.0f, -3.0f);
        Quaternion result = Abs( qa );
        Validate( result == Quaternion(1.0f, 3.0f, 2.0f, 3.0f) );

      ]]>
      </TEST>

      <TEST NAME="complessthan">
      <![CDATA[
      
        SetFunctionName("Mask4 CompLessThan(Quaternion a, Quaternion b)");
        Quaternion va(1.0f, 1.0f, 2.0f, 2.0f );
        Quaternion vb(1.0f, 2.0f, 1.0f, -1.0f );

        Mask4 mask(CompLessThan(va, vb));
        Validate(
            !mask.GetX().GetBool() &&
             mask.GetY().GetBool() &&
            !mask.GetZ().GetBool() &&
            !mask.GetW().GetBool()
        );

      ]]>
      </TEST>

      <TEST NAME="compgreaterthan">
      <![CDATA[
      
        SetFunctionName("Mask4 CompGreaterThan(Quaternion a, Quaternion b)");
        Quaternion va(1.0f, 1.0f, 2.0f, 2.0f );
        Quaternion vb(1.0f, 2.0f, 1.0f, -1.0f );

        Mask4 mask(CompGreaterThan(va, vb));
        Validate(
            !mask.GetX().GetBool() &&
            !mask.GetY().GetBool() &&
             mask.GetZ().GetBool() &&
             mask.GetW().GetBool()
        );

      ]]>
      </TEST>

      <TEST NAME="complessequal">
      <![CDATA[
      
        SetFunctionName("Mask4 CompLessEqual(Quaternion a, Quaternion b)");
        Quaternion va(1.0f, 1.0f, 2.0f, 2.0f );
        Quaternion vb(1.0f, 2.0f, 1.0f, -1.0f );

        Mask4 mask(CompLessEqual(va, vb));
        Validate(
             mask.GetX().GetBool() &&
             mask.GetY().GetBool() &&
            !mask.GetZ().GetBool() &&
            !mask.GetW().GetBool()
        );

      ]]>
      </TEST>

      <TEST NAME="compgreaterequal">
      <![CDATA[
      
        SetFunctionName("Mask4 CompGreaterEqual(Quaternion a, Quaternion b)");
        Quaternion va(1.0f, 1.0f, 2.0f, 2.0f );
        Quaternion vb(1.0f, 2.0f, 1.0f, -1.0f );

        Mask4 mask(CompGreaterEqual(va, vb));
        Validate(
             mask.GetX().GetBool() &&
            !mask.GetY().GetBool() &&
             mask.GetZ().GetBool() &&
             mask.GetW().GetBool()
        );

      ]]>
      </TEST>

      <TEST NAME="compequal">
      <![CDATA[
      
        SetFunctionName("Mask4 CompEqual(Quaternion a, Quaternion b)");
        Quaternion va(1.0f, 1.0f, 2.0f, 2.0f );
        Quaternion vb(1.0f, 2.0f, 1.0f, -1.0f );

        Mask4 mask(CompEqual(va, vb));
        Validate(
             mask.GetX().GetBool() &&
            !mask.GetY().GetBool() &&
            !mask.GetZ().GetBool() &&
            !mask.GetW().GetBool()
        );

      ]]>
      </TEST>

      <TEST NAME="compnotequal">
      <![CDATA[
      
        SetFunctionName("Mask4 CompNotEqual(Quaternion a, Quaternion b)");
        Quaternion va(1.0f, 1.0f, 2.0f, 2.0f );
        Quaternion vb(1.0f, 2.0f, 1.0f, -1.0f );

        Mask4 mask(CompNotEqual(va, vb));
        Validate(
            !mask.GetX().GetBool() &&
             mask.GetY().GetBool() &&
             mask.GetZ().GetBool() &&
             mask.GetW().GetBool()
        );

      ]]>
      </TEST>

      <TEST NAME="select_maskscalar">
      <![CDATA[
      
        SetFunctionName("Quaternion Select(MaskScalar mask, Quaternion a, Quaternion b)");
        Quaternion v1(1.0f, 2.0f, 3.0f, 4.0f);
        Quaternion v2(10.0f, 20.0f, 30.0f, 40.0f);

        Quaternion result1 = Select( MaskScalar(true), v1, v2 );
        Quaternion result2 = Select( MaskScalar(false), v1, v2 );
        Validate(
            result1 == v1 &&
            result2 == v2
        );

      ]]>
      </TEST>

      <TEST NAME="select_mask4_bitwise">
      <![CDATA[
#ifdef HOST_TESTING
        SetFunctionName("Quaternion Select(MaskScalar mask, Quaternion a, Quaternion b)");
        Quaternion v1(1.0f, 2.0f, 3.0f, 4.0f);
        Quaternion v2(-10.0f, -20.0f, -30.0f, -40.0f);
        Quaternion ref1( -1.0f, 20.0f, -3.0f, -40.0f);

        uint32_t values[] = { 0x7fffffff, 0x80000000, 0x7fffffff, 0x00000000 };
        Mask4 mask(values[0], values[1], values[2], values[3]);

        Quaternion result1 = Select( mask, v1, v2 );
        Validate( result1 == ref1 );
#endif
      ]]>
      </TEST>

      <TEST NAME="select_mask4">
      <![CDATA[
      
        SetFunctionName("Quaternion Select(Mask4 mask, Quaternion a, Quaternion b)");
        Quaternion v1(1.0f, 2.0f, 3.0f, 4.0f);
        Quaternion v2(10.0f, 20.0f, 30.0f, 40.0f);
        Quaternion ref1(1.0f, 2.0f, 30.0f, 40.0f);
        Quaternion ref2(10.0f, 20.0f, 3.0f, 4.0f);
        Mask4 mask1(true, true, false, false);
        Mask4 mask2(false, false, true, true);

        Quaternion result1 = Select( mask1, v1, v2 );
        Quaternion result2 = Select( mask2, v1, v2 );
        Validate(
            result1 == ref1 &&
            result2 == ref2
        );

      ]]>
      </TEST>

      <TEST NAME="TestPow">
            <![CDATA[
      
     
        SetFunctionName("Quaternion Pow(Quaternion::InParam v, VecFloat::InParam e)");
        
        Quaternion identity_q, input_q;
        identity_q.SetIdentity();
        
        Vector3 xAxisPositive(1.0f, 0.0f, 0.0f);
        Vector3 xAxisNegative(-1.0f, 0.0f, 0.0f);
        float_test_type angle60( PI / 3.0f );
        input_q = QuaternionFromAxisRotationAngle(xAxisPositive, float_test_type(angle60));
        
        Quaternion q0 = Pow(input_q, float_test_type(0.0f));
        Quaternion q1 = Pow(input_q, float_test_type(1.0f));
        Quaternion q2 = Pow(input_q, float_test_type(2.0f));
        Quaternion q05 = Pow(input_q, float_test_type(0.5f));
        Quaternion qn0 = Pow(input_q, float_test_type(-0.0f));
        Quaternion qn1 = Pow(input_q, float_test_type(-1.0f));
        Quaternion qn2 = Pow(input_q, float_test_type(-2.0f));
        Quaternion qn05 = Pow(input_q, float_test_type(-0.5f));
        
        Vector3 q0_axis, q1_axis, q2_axis, q05_axis, qn0_axis, qn1_axis, qn2_axis, qn05_axis;
        float_test_type q0_angle, q1_angle, q2_angle, q05_angle, qn0_angle, qn1_angle, qn2_angle, qn05_angle;
        
        AxisAngleFromQuaternion(q0, q0_axis, q0_angle);
        AxisAngleFromQuaternion(q1, q1_axis, q1_angle);
        AxisAngleFromQuaternion(q2, q2_axis, q2_angle);
        AxisAngleFromQuaternion(q05, q05_axis, q05_angle);
        AxisAngleFromQuaternion(qn0, qn0_axis, qn0_angle);
        AxisAngleFromQuaternion(qn1, qn1_axis, qn1_angle);
        AxisAngleFromQuaternion(qn2, qn2_axis, qn2_angle);
        AxisAngleFromQuaternion(qn05, qn05_axis, qn05_angle);
        

       Validate( 
        IsSimilar(q0_angle, (float_test_type)0.0f) && IsSimilar(q1_angle, angle60) &&
        IsSimilar(q2_angle, angle60 * 2.0f) && IsSimilar(q05_angle, angle60 / 2.0f) && 
        IsSimilar(qn0_angle, (float_test_type)0.0f) && IsSimilar(qn1_angle, angle60) &&
        IsSimilar(qn2_angle, angle60 * 2.0f) && IsSimilar(qn05_angle, angle60 / 2.0f) &&
        IsSimilar(q0_axis, xAxisPositive, (float_test_type)0.0001f) && IsSimilar(q1_axis, xAxisPositive, (float_test_type)0.0001f) &&
        IsSimilar(q2_axis, xAxisPositive, (float_test_type)0.0001f) && IsSimilar(q05_axis, xAxisPositive, (float_test_type)0.0001f) &&
        IsSimilar(qn0_axis, xAxisPositive, (float_test_type)0.0001f) && IsSimilar(qn1_axis, xAxisNegative, (float_test_type)0.0001f) &&
        IsSimilar(qn2_axis, xAxisNegative, (float_test_type)0.0001f) && IsSimilar(qn05_axis, xAxisNegative, (float_test_type)0.0001f)  
        );

      ]]>
        </TEST>

      
    </TYPE>


    <TYPE NAME="performance">

      <TEST NAME="test164">
      <![CDATA[

        SetFunctionName("void Negate(Quaternion::InParam vec, Quaternion::OutParam r)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Negate(qAArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test165">
      <![CDATA[

        SetFunctionName("Mult(const Quaternion &v, VecFloat s, Quaternion &result)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Mult(qAArray[i], xArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test166">
      <![CDATA[

        SetFunctionName("Divide(const Quaternion &v, VecFloat s, Quaternion &result)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Divide(qAArray[i], xArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test167">
      <![CDATA[

        SetFunctionName("Add(const Quaternion &v, VecFloat s, Quaternion &result)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Add(qAArray[i], qBArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test168">
      <![CDATA[

        SetFunctionName("Subtract(const Quaternion &v, VecFloat s, Quaternion &result)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Subtract(qAArray[i], qBArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test169">
      <![CDATA[

        SetFunctionName("Magnitude(const Quaternion &v)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = Magnitude(qAArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test170">
      <![CDATA[

        SetFunctionName("MagnitudeRecip(const Quaternion &v)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = MagnitudeRecip(qAArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test171">
      <![CDATA[

        SetFunctionName("Normalize(const Quaternion &v)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Normalize(qAArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test172">
      <![CDATA[

        SetFunctionName("VecFloat Dot(Quaternion::InParam a, Quaternion::InParam b)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueFloat = Dot(qAArray[i], qBArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test173">
      <![CDATA[

        SetFunctionName("Lerp( const Quaternion &v0, const Quaternion &v1, const VecFloat t, Quaternion &r)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Lerp(qAArray[i], qBArray[i], (float_test_type)0.25f);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test174">
      <![CDATA[

        SetFunctionName("SLerp( const Quaternion &v0, const Quaternion &v1, const VecFloat t, Quaternion &r)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= SLerp(qANormArray[i], qBNormArray[i], (float_test_type)0.25f);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test175">
      <![CDATA[

        SetFunctionName("NLerp( const Quaternion &v0, const Quaternion &v1, const VecFloat t, Quaternion &r)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= NLerp(qAArray[i], qBArray[i], (float_test_type)0.25f);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test176">
      <![CDATA[

        SetFunctionName("IsSimilar(const Quaternion &a, const Quaternion &b, VecFloat epsilon = SMALL_FLOAT)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueBool = IsSimilar(qAArray[i], qBArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test177">
      <![CDATA[

        SetFunctionName("void Inverse(Quaternion::InParam q, Quaternion::OutParam r)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Inverse(qAArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test178">
      <![CDATA[

        SetFunctionName("Conj(Quaternion::InParam q,       Quaternion &result)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Conj(qAArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test179">
      <![CDATA[

        SetFunctionName("Mult(Quaternion::InParam a,      Quaternion::InParam b,      Quaternion::OutParam result);");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Mult(qAArray[i], qBArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test180">
      <![CDATA[

        SetFunctionName("QuaternionFromAxisRotationAngle");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= QuaternionFromAxisRotationAngle(v3NormArray[i], xArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test181">
      <![CDATA[

        SetFunctionName("AxisAngleFromQuaternion");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                AxisAngleFromQuaternion(qAArray[i], v3a_array[i], fOutArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test182">
      <![CDATA[

        SetFunctionName("QuaternionFromEulerXYZ");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= QuaternionFromEulerXYZ(v3a_array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test183">
      <![CDATA[

        SetFunctionName("EulerXYZFromQuaternion");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                v3OutArray[i]= EulerXYZFromQuaternion(qAArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test184">
      <![CDATA[

        SetFunctionName("TransformVector");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                v3OutArray[i] = TransformVector(v3a_array[i], qAArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="QuaternionFromMatrix33_performance_test">
      <![CDATA[

        SetFunctionName("QuaternionFromMatrix33");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= QuaternionFromMatrix33(m33Array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="QuaternionFromMatrix33_performance_test_unrolled_twice">
      <![CDATA[

        SetFunctionName("Unrolled (x2) QuaternionFromMatrix33");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i+=2)
            {
                Quaternion temp0 = QuaternionFromMatrix33(m33Array[i+0]);
                Quaternion temp1 = QuaternionFromMatrix33(m33Array[i+1]);
                qOutArray[i+0] = temp0;
                qOutArray[i+1] = temp1;
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="QuaternionFromMatrix33_performance_test_unrolled_four">
      <![CDATA[

        SetFunctionName("Unrolled (x4) QuaternionFromMatrix33");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i+=4)
            {
                Quaternion temp0 = QuaternionFromMatrix33(m33Array[i+0]);
                Quaternion temp1 = QuaternionFromMatrix33(m33Array[i+1]);
                Quaternion temp2 = QuaternionFromMatrix33(m33Array[i+2]);
                Quaternion temp3 = QuaternionFromMatrix33(m33Array[i+3]);
                qOutArray[i+0] = temp0;
                qOutArray[i+1] = temp1;
                qOutArray[i+2] = temp2;
                qOutArray[i+3] = temp3;
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="QuaternionFromMatrix33_performance_test_unrolled_eight">
      <![CDATA[

        SetFunctionName("Unrolled (x8) QuaternionFromMatrix33");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i+=8)
            {
                Quaternion temp0 = QuaternionFromMatrix33(m33Array[i+0]);
                Quaternion temp1 = QuaternionFromMatrix33(m33Array[i+1]);
                Quaternion temp2 = QuaternionFromMatrix33(m33Array[i+2]);
                Quaternion temp3 = QuaternionFromMatrix33(m33Array[i+3]);
                Quaternion temp4 = QuaternionFromMatrix33(m33Array[i+4]);
                Quaternion temp5 = QuaternionFromMatrix33(m33Array[i+5]);
                Quaternion temp6 = QuaternionFromMatrix33(m33Array[i+6]);
                Quaternion temp7 = QuaternionFromMatrix33(m33Array[i+7]);
                qOutArray[i+0] = temp0;
                qOutArray[i+1] = temp1;
                qOutArray[i+2] = temp2;
                qOutArray[i+3] = temp3;
                qOutArray[i+4] = temp4;
                qOutArray[i+5] = temp5;
                qOutArray[i+6] = temp6;
                qOutArray[i+7] = temp7;
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="QuaternionFromMatrix33_performance_test_unrolled_sixteen">
      <![CDATA[

        SetFunctionName("Unrolled (x16) QuaternionFromMatrix33");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i+=16)
            {
                Quaternion  temp0 = QuaternionFromMatrix33(m33Array[i+ 0]);
                Quaternion  temp1 = QuaternionFromMatrix33(m33Array[i+ 1]);
                Quaternion  temp2 = QuaternionFromMatrix33(m33Array[i+ 2]);
                Quaternion  temp3 = QuaternionFromMatrix33(m33Array[i+ 3]);
                Quaternion  temp4 = QuaternionFromMatrix33(m33Array[i+ 4]);
                Quaternion  temp5 = QuaternionFromMatrix33(m33Array[i+ 5]);
                Quaternion  temp6 = QuaternionFromMatrix33(m33Array[i+ 6]);
                Quaternion  temp7 = QuaternionFromMatrix33(m33Array[i+ 7]);
                Quaternion  temp8 = QuaternionFromMatrix33(m33Array[i+ 8]);
                Quaternion  temp9 = QuaternionFromMatrix33(m33Array[i+ 9]);
                Quaternion temp10 = QuaternionFromMatrix33(m33Array[i+10]);
                Quaternion temp11 = QuaternionFromMatrix33(m33Array[i+11]);
                Quaternion temp12 = QuaternionFromMatrix33(m33Array[i+12]);
                Quaternion temp13 = QuaternionFromMatrix33(m33Array[i+13]);
                Quaternion temp14 = QuaternionFromMatrix33(m33Array[i+14]);
                Quaternion temp15 = QuaternionFromMatrix33(m33Array[i+15]);
                qOutArray[i+ 0] =  temp0;
                qOutArray[i+ 1] =  temp1;
                qOutArray[i+ 2] =  temp2;
                qOutArray[i+ 3] =  temp3;
                qOutArray[i+ 4] =  temp4;
                qOutArray[i+ 5] =  temp5;
                qOutArray[i+ 6] =  temp6;
                qOutArray[i+ 7] =  temp7;
                qOutArray[i+ 8] =  temp8;
                qOutArray[i+ 9] =  temp9;
                qOutArray[i+10] = temp10;
                qOutArray[i+11] = temp11;
                qOutArray[i+12] = temp12;
                qOutArray[i+13] = temp13;
                qOutArray[i+14] = temp14;
                qOutArray[i+15] = temp15;
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test186">
      <![CDATA[

        SetFunctionName("QuaternionFromMatrix44");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= QuaternionFromMatrix44(m44Array[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test187">
      <![CDATA[

        SetFunctionName("SLerpNoCheck");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= SLerpNoCheck(qANormArray[i], qBNormArray[i], (float_test_type)0.25f);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test188">
      <![CDATA[

        SetFunctionName("Concat");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i]= Concat(qAArray[i], qBArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test189">
      <![CDATA[

        SetFunctionName("CompressRotation");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qCompressedArray[i]= CompressRotation(qANormArray[i]);
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test190">
      <![CDATA[

        SetFunctionName("UnCompressRotation");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
#ifdef GENERIC_TESTING
                qOutArray[i]= UnCompressRotation<FloatType>(qCompressedArray[i]);
#else
                qOutArray[i]= UnCompressRotation(qCompressedArray[i]);
#endif
            }
        }

        StopTimer();

      ]]>

      </TEST>

    </TYPE>

  </TYPE>


  <TYPE NAME="operator">

    <TYPE NAME="correctness">

      <TEST NAME="test193">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator *= (Quaternion::InOutParam v, VecFloat::InParam a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA *= (float_test_type)1.5f;

        Validate(
                IsEqualWithEpsilon((float)qA.X(), 1.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.Y(), 2.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.Z(), 3.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.W(), 1.0f * 1.5f)
                );

#endif

      ]]>
      </TEST>


      <TEST NAME="test194">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator /= (Quaternion::InOutParam v, VecFloat::InParam a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA /= (float_test_type)1.5f;

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f / 1.5f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test217">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS


        SetFunctionName("Quaternion& operator += (Quaternion::InOutParam v, float_test_type a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA += (float_test_type)1.5f;

        Validate(
            IsEqualWithEpsilon(qA.X(), (float_test_type)1.0f + (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.Y(), (float_test_type)2.0f + (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.Z(), (float_test_type)3.0f + (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.W(), (float_test_type)1.0f + (float_test_type)1.5f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test218">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator -= (Quaternion::InOutParam v, float_test_type a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA -= (float_test_type)1.5f;

        Validate(
            IsEqualWithEpsilon(qA.X(), (float_test_type)1.0f - (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.Y(), (float_test_type)2.0f - (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.Z(), (float_test_type)3.0f - (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.W(), (float_test_type)1.0f - (float_test_type)1.5f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test198">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator * (Quaternion::InParam v, VecFloat::InParam s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA * (float_test_type)1.24f;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() * 1.24f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test199">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator * (VecFloat::InParam s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = (float_test_type)1.24f *qA;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() * 1.24f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test201">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator / (Quaternion::InParam v, VecFloat::InParam s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA / (float_test_type)1.24f;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() / 1.24f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test222">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator + (Quaternion::InParam v, float_test_type s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA + (float_test_type)1.24f;

        Validate(
            IsEqualWithEpsilon(qOut.X(), qA.X() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Y(), qA.Y() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Z(), qA.Z() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.W(), qA.W() + (float_test_type)1.24f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test222_2">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator + (float_test_type s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = (float_test_type)1.24f + qA;

        Validate(
            IsEqualWithEpsilon(qOut.X(), qA.X() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Y(), qA.Y() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Z(), qA.Z() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.W(), qA.W() + (float_test_type)1.24f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test222_3">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion operator + (float s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        // use a float type explicitly
        qOut = 1.24f + qA;

        Validate(
            IsEqualWithEpsilon(qOut.X(), qA.X() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Y(), qA.Y() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Z(), qA.Z() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.W(), qA.W() + (float_test_type)1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test222_4">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion operator + (VecFloatRef<INDEX>, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        MakeVectorIntrinsic(vi, 1.1f, 2.1f, 1.24f, 4.1f);
        qOut = VecFloatRefZ(vi) + qA;

        Validate(
            IsEqualWithEpsilon(qOut.X(), qA.X() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Y(), qA.Y() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Z(), qA.Z() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.W(), qA.W() + (float_test_type)1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test222_5">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion operator + (VecFloatRefIndex, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        MakeVectorIntrinsic(vi, 1.1f, 2.1f, 1.24f, 4.1f);
        qOut = VecFloatRefIndex(vi, 2) + qA;

        Validate(
            IsEqualWithEpsilon(qOut.X(), qA.X() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Y(), qA.Y() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Z(), qA.Z() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.W(), qA.W() + (float_test_type)1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test224">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator - (Quaternion::InParam v, float_test_type s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA - (float_test_type)1.24f;

        Validate(
            IsEqualWithEpsilon(qOut.X(), qA.X() - (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Y(), qA.Y() - (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Z(), qA.Z() - (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.W(), qA.W() - (float_test_type)1.24f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test224_2">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator - (float_test_type s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = (float_test_type)1.24f - qA;

        Validate(
            IsEqualWithEpsilon(qOut.X(), (float_test_type)1.24f - qA.X()) &&
            IsEqualWithEpsilon(qOut.Y(), (float_test_type)1.24f - qA.Y()) &&
            IsEqualWithEpsilon(qOut.Z(), (float_test_type)1.24f - qA.Z()) &&
            IsEqualWithEpsilon(qOut.W(), (float_test_type)1.24f - qA.W())
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test224_3">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion operator - (float s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = 1.24f - qA;

        Validate(
            IsEqualWithEpsilon(qOut.X(), (float_test_type)1.24f - qA.X()) &&
            IsEqualWithEpsilon(qOut.Y(), (float_test_type)1.24f - qA.Y()) &&
            IsEqualWithEpsilon(qOut.Z(), (float_test_type)1.24f - qA.Z()) &&
            IsEqualWithEpsilon(qOut.W(), (float_test_type)1.24f - qA.W())
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test224_4">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion operator - (VecFloatRef<INDEX> s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        MakeVectorIntrinsic(vi, 1.1f, 2.1f, 1.24f, 4.1f);
        qOut = VecFloatRefZ(vi) - qA;

        Validate(
            IsEqualWithEpsilon(qOut.X(), (float_test_type)1.24f - qA.X()) &&
            IsEqualWithEpsilon(qOut.Y(), (float_test_type)1.24f - qA.Y()) &&
            IsEqualWithEpsilon(qOut.Z(), (float_test_type)1.24f - qA.Z()) &&
            IsEqualWithEpsilon(qOut.W(), (float_test_type)1.24f - qA.W())
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test224_5">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion operator - (VecFloatRefIndex s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        MakeVectorIntrinsic(vi, 1.1f, 2.1f, 1.24f, 4.1f);
        qOut = VecFloatRefIndex(vi, 2) - qA;

        Validate(
            IsEqualWithEpsilon(qOut.X(), (float_test_type)1.24f - qA.X()) &&
            IsEqualWithEpsilon(qOut.Y(), (float_test_type)1.24f - qA.Y()) &&
            IsEqualWithEpsilon(qOut.Z(), (float_test_type)1.24f - qA.Z()) &&
            IsEqualWithEpsilon(qOut.W(), (float_test_type)1.24f - qA.W())
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="float_test193">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator *= (Quaternion::InOutParam v, float a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA *= (float_basic_type)1.5f;

        Validate(
                IsEqualWithEpsilon((float)qA.X(), 1.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.Y(), 2.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.Z(), 3.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.W(), 1.0f * 1.5f)
                );

#endif

      ]]>
      </TEST>


      <TEST NAME="float_test194">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator /= (Quaternion::InOutParam v, float a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA /= (float_basic_type)1.5f;

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f / 1.5f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="float_test217">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING


        SetFunctionName("Quaternion& operator += (Quaternion::InOutParam v, float a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA += (float_basic_type)1.5f;

        Validate(
            IsEqualWithEpsilon(qA.X(), (float_test_type)1.0f + (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.Y(), (float_test_type)2.0f + (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.Z(), (float_test_type)3.0f + (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.W(), (float_test_type)1.0f + (float_test_type)1.5f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="float_test218">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion& operator -= (Quaternion::InOutParam v, float a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA -= (float_basic_type)1.5f;

        Validate(
            IsEqualWithEpsilon(qA.X(), (float_test_type)1.0f - (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.Y(), (float_test_type)2.0f - (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.Z(), (float_test_type)3.0f - (float_test_type)1.5f) &&
            IsEqualWithEpsilon(qA.W(), (float_test_type)1.0f - (float_test_type)1.5f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="float_test198">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator * (Quaternion::InParam v, float s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA * (float_basic_type)1.24f;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() * 1.24f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="float_test199">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator * (float s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = (float_basic_type)1.24f *qA;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() * 1.24f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="float_test201">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator / (Quaternion::InParam v, float s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA / (float_basic_type)1.24f;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() / 1.24f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="float_test222">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion operator + (Quaternion::InParam v, float s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA + (float_basic_type)1.24f;

        Validate(
            IsEqualWithEpsilon(qOut.X(), qA.X() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Y(), qA.Y() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Z(), qA.Z() + (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.W(), qA.W() + (float_test_type)1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="float_test224">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion operator - (Quaternion::InParam v, float s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA - (float_basic_type)1.24f;

        Validate(
            IsEqualWithEpsilon(qOut.X(), qA.X() - (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Y(), qA.Y() - (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.Z(), qA.Z() - (float_test_type)1.24f) &&
            IsEqualWithEpsilon(qOut.W(), qA.W() - (float_test_type)1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test22">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator *= (Quaternion::InOutParam v, VecFloatRef<INDEX> a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA *= VecFloatRefX(vi);

        Validate(
                IsEqualWithEpsilon((float)qA.X(), 1.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.Y(), 2.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.Z(), 3.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.W(), 1.0f * 1.5f)
                );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test27">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator /= (Quaternion::InOutParam v, VecFloatRef<INDEX> a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA /= VecFloatRefX(vi);

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f / 1.5f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test219">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator += (Quaternion::InOutParam v, VecFloatRef<INDEX> a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA += VecFloatRefX(vi);

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f + 1.5f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f + 1.5f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f + 1.5f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f + 1.5f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test220">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator -= (Quaternion::InOutParam v, VecFloatRef<INDEX> a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA -= VecFloatRefX(vi);

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f - 1.5f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f - 1.5f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f - 1.5f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f - 1.5f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test28">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator * (Quaternion::InParam v, VecFloatRef<INDEX> s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA * VecFloatRefY(vi);

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() * 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test29">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator * (VecFloatRef<INDEX> s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = VecFloatRefY(vi) * qA;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() * 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test30">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator / (Quaternion::InParam v, VecFloatRef<INDEX> s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA / VecFloatRefY(vi);

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() / 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test225">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator + (Quaternion::InParam v, VecFloatRef<INDEX> s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA + VecFloatRefY(vi);

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() + 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() + 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() + 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() + 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test227">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator - (Quaternion::InParam v, VecFloatRef<INDEX> s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA - VecFloatRefY(vi);

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() - 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() - 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() - 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() - 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test31">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator *= (Quaternion::InOutParam v, VecFloatRefIndex::InParam a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA *= VecFloatRefIndex(vi, 0);

        Validate(
                IsEqualWithEpsilon((float)qA.X(), 1.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.Y(), 2.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.Z(), 3.0f * 1.5f) &&
                IsEqualWithEpsilon((float)qA.W(), 1.0f * 1.5f)
                );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test32">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator /= (Quaternion::InOutParam v, VecFloatRefIndex::InParam a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA /= VecFloatRefIndex(vi, 0);

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f / 1.5f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f / 1.5f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test221">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator += (Quaternion::InOutParam v, VecFloatRefIndex::InParam a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA += VecFloatRefIndex(vi, 0);

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f + 1.5f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f + 1.5f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f + 1.5f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f + 1.5f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test41">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator -= (Quaternion::InOutParam v, VecFloatRefIndex::InParam a)");

        Quaternion qA;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qA -= VecFloatRefIndex(vi, 0);

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f - 1.5f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f - 1.5f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f - 1.5f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f - 1.5f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test42">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator * (Quaternion::InParam v, VecFloatRefIndex::InParam s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA * VecFloatRefIndex(vi, 1);

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() * 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test246">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator * (VecFloatRefIndex::InParam s, Quaternion::InParam v)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = VecFloatRefIndex(vi, 1) * qA;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() * 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() * 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test247">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator / (Quaternion::InParam v, VecFloatRefIndex::InParam s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA / VecFloatRefIndex(vi, 1);

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() / 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() / 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test228">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator + (Quaternion::InParam v, VecFloatRefIndex::InParam s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA + VecFloatRefIndex(vi, 1);

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() + 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() + 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() + 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() + 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test230">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vi, 1.5f, 1.24f, 0.0f, 0.0f);

        SetFunctionName("Quaternion operator - (Quaternion::InParam v, VecFloatRefIndex::InParam s)");

        Quaternion qA, qOut;

        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);

        qOut = qA - VecFloatRefIndex(vi, 1);

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() - 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() - 1.24f) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() - 1.24f) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() - 1.24f)
            );

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test197">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator - (Quaternion::InParam v)");

        Quaternion qA;
        Quaternion qB;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);
        qB.Set(3.0f, 6.0f, 4.0f, 1.0f);

        qB = -qA;

        Validate(
            IsEqualWithEpsilon((float)qA.X(), -(float)qB.X()) &&
            IsEqualWithEpsilon((float)qA.Y(), -(float)qB.Y()) &&
            IsEqualWithEpsilon((float)qA.Z(), -(float)qB.Z()) &&
            IsEqualWithEpsilon((float)qA.W(), -(float)qB.W())
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test195">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator += (Quaternion::InOutParam v, Quaternion::InParam b)");

        Quaternion qA;
        Quaternion qB;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);
        qB.Set(3.0f, 6.0f, 4.0f, 1.0f);

        qA += qB;

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f + 3.0f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f + 6.0f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f + 4.0f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f + 1.0f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test196">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator -= (Quaternion::InOutParam v, Quaternion::InParam b)");

        Quaternion qA;
        Quaternion qB;
        qA.Set(1.0f, 2.0f, 3.0f, 1.0f);
        qB.Set(3.0f, 6.0f, 4.0f, 1.0f);

        qA -= qB;

        Validate(
            IsEqualWithEpsilon((float)qA.X(), 1.0f - 3.0f) &&
            IsEqualWithEpsilon((float)qA.Y(), 2.0f - 6.0f) &&
            IsEqualWithEpsilon((float)qA.Z(), 3.0f - 4.0f) &&
            IsEqualWithEpsilon((float)qA.W(), 1.0f - 1.0f)
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test203">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator - (Quaternion::InParam a, Quaternion::InParam b)");

        Quaternion qA, qB, qOut;

        qA.Set(1.0f, 2.0f, 10.3f, 1.0f);
        qB.Set(1.2f, 2.3f, 4.23f, 1.0f);

        qOut = qA - qB;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() - (float)qB.X()) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() - (float)qB.Y()) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() - (float)qB.Z()) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() - (float)qB.W())
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test202">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator + (Quaternion::InParam a, Quaternion::InParam b)");

        Quaternion qA, qB, qOut;

        qA.Set(1.0f, 2.0f, 1.4f, 1.0f);
        qB.Set(1.2f, 2.3f, 4.5f, 1.0f);

        qOut = qA + qB;

        Validate(
            IsEqualWithEpsilon((float)qOut.X(), (float)qA.X() + (float)qB.X()) &&
            IsEqualWithEpsilon((float)qOut.Y(), (float)qA.Y() + (float)qB.Y()) &&
            IsEqualWithEpsilon((float)qOut.Z(), (float)qA.Z() + (float)qB.Z()) &&
            IsEqualWithEpsilon((float)qOut.W(), (float)qA.W() + (float)qB.W())
            );

#endif

      ]]>
      </TEST>


      <TEST NAME="test200">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion operator * (Quaternion::InParam a, Quaternion::InParam b)");

        Quaternion qA, qB, qRef, qOut;

        qA.Set(0.5f, 0.5f, 0.0f, SQRT_HALF);
        qB.Set(0.5f, 0.5f, 0.0f, SQRT_HALF);
        qRef.Set(SQRT_HALF, SQRT_HALF, 0.0f, 0.f);

        qOut = qA * qB;

        // Should be
        // x = w1x2 + w2x1 + y1z2 - y2z1
        // y = W1y2 + w2y1 + z1x2 - z2x1
        // z = w1z2 + w2z1 + x1y2 - x2y1
        // w = w1w2 - x1x2 - y1y2 - z1z2

        Validate(IsSimilar(qOut, qRef));

#endif

      ]]>
      </TEST>


      <TEST NAME="test191">
      <![CDATA[

        Quaternion qAEqual, qBEqual;
        qAEqual.Set(1.0f, 2.0f, 3.0f, 1.0f);
        qBEqual.Set(1.0f, 2.0f, 3.0f, 1.0f);

        SetFunctionName("bool operator == (Quaternion::InParam a, Quaternion::InParam b)");
        Validate(qAEqual == qBEqual);

      ]]>
      </TEST>


      <TEST NAME="test192">
      <![CDATA[

        Quaternion qAEqual, qBEqual;
        qAEqual.Set(1.0f, 2.0f, 3.0f, 1.2f);
        qBEqual.Set(1.0f, 3.0f, 3.0f, 1.0f);

        SetFunctionName("bool operator != (Quaternion::InParam a, Quaternion::InParam b)");
        Validate(qAEqual != qBEqual);

      ]]>
      </TEST>

    </TYPE>


    <TYPE NAME="performance">

      <TEST NAME="test204">
      <![CDATA[

        SetFunctionName("bool operator == (const Quaternion &a,const Quaternion &b)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueBool = qAArray[i] == qBArray[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test205">
      <![CDATA[

        SetFunctionName("bool operator != (const Quaternion &a,const Quaternion &b)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                retValueBool = qAArray[i] != qBArray[i];
            }
        }

        StopTimer();

      ]]>
      </TEST>


      <TEST NAME="test206">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator *= (Quaternion &v,float_t a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] *= (float_test_type)1.33f;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test207">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator /= (Quaternion &v,float_t a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] /= (float_test_type)1.33f;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test208">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator += (Quaternion &v,const Quaternion &b)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] += qBArray[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test209">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion& operator -= (Quaternion &v,const Quaternion &b)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] -= qBArray[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test210">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("const Quaternion operator - (const Quaternion &v)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = -qAArray[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test211">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("const Quaternion operator * (const Quaternion &v,float_t s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] * (float_test_type)1.543f;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test212">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("const Quaternion operator * (float_t s, const Quaternion &v)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = (float_test_type)1.543f * qAArray[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test213">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("const Quaternion operator / (const Quaternion &v,float_t s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] / (float_test_type)1.543f;
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test214">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("const Quaternion operator + (const Quaternion &a,const Quaternion &b)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] + qBArray[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test215">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("const Quaternion operator - (const Quaternion &a,const Quaternion &b)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] - qBArray[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test216">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS

        SetFunctionName("Quaternion::RetParam operator *  (Quaternion::InParam a,      Quaternion::InParam b);");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] * qBArray[i];
            }
        }

        StopTimer();

#endif

      ]]>
      </TEST>


      <TEST NAME="test231">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING


        SetFunctionName("Quaternion& operator += (Quaternion &v,VecFloat a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] += (float_test_type)1.33f;
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test232">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("Quaternion& operator -= (Quaternion &v,VecFloat a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] -= (float_test_type)1.33f;
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test233">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("const Quaternion operator + (const Quaternion &v,VecFloat s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] + (float_test_type)1.543f;
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test234">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("const Quaternion operator + (VecFloat s, const Quaternion &v)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = (float_test_type)1.543f + qAArray[i];
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test235">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        SetFunctionName("const Quaternion operator - (const Quaternion &v,VecFloat s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] - (float_test_type)1.543f;
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test236">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator += (Quaternion &v,VecFloatRef<INDEX> a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] += VecFloatRefX(vt);
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test237">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator -= (Quaternion &v,VecFloatRef<INDEX> a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] -= VecFloatRefX(vt);
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test238">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator += (Quaternion &v,VecFloatRefIndex a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] += VecFloatRefIndex(vt, 0);
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test239">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("Quaternion& operator -= (Quaternion &v,VecFloatRefIndex a)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qAArray[i] -= VecFloatRefIndex(vt, 0);
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test240">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("const Quaternion operator + (const Quaternion &v,VecFloatRef<INDEX> s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] + VecFloatRefY(vt);
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test241">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("const Quaternion operator + (const Quaternion &v,VecFloatRef<INDEX> s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = VecFloatRefY(vt) + qAArray[i];
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test242">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("const Quaternion operator - (const Quaternion &v,VecFloatRef<INDEX> s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] - VecFloatRefY(vt);
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test243">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("const Quaternion operator + (const Quaternion &v,VecFloatRefIndex s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] + VecFloatRefIndex(vt, 1);
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test244">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("const Quaternion operator + (const Quaternion &v,VecFloatRefIndex s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = VecFloatRefIndex(vt, 1) + qAArray[i];
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>


      <TEST NAME="test245">
      <![CDATA[

#if !defined RW_MATH_NO_OPERATOR_OVERLOADS
#ifdef HOST_TESTING

        MakeVectorIntrinsic(vt, 1.33f, 1.543f, 0.0f, 0.0f);

        SetFunctionName("const Quaternion operator - (const Quaternion &v,VecFloatRefIndex s)");

        StartTimer(testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE * testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG);

        for (int testloop = 0; testloop < testing::RW_MATH_UNITTEST_TEST_LOOP_COUNT_LONG; testloop++)
        {
            for (int i = 0; i < testing::RW_MATH_UNITTEST_TEST_VECTOR_ARRAY_SIZE; i++)
            {
                qOutArray[i] = qAArray[i] - VecFloatRefIndex(vt, 1);
            }
        }

        StopTimer();

#endif
#endif

      ]]>
      </TEST>
      

    </TYPE>

 </TYPE>

</CLASS>

<!-- The Last Test is test265, please change this number when you add more tests, make sure test names do not repeat-->

</TESTCLASS>
