Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00062 #include <math.h>
00063 #include "arm_math.h"
00064
00065
00066
00067
00068 #define MAX_BLOCKSIZE 32
00069 #define DELTA (0.000001f)
00070
00071
00072
00073
00074
00075
00076
00077 const float32_t testInput_f32[MAX_BLOCKSIZE] =
00078 {
00079 -1.244916875853235400, -4.793533929171324800, 0.360705030233248850, 0.827929644170887320, -3.299532218312426900, 3.427441903227623800, 3.422401784294607700, -0.108308165334010680,
00080 0.941943896490312180, 0.502609575000365850, -0.537345278736373500, 2.088817392965764500, -1.693168684143455700, 6.283185307179590700, -0.392545884746175080, 0.327893095115825040,
00081 3.070147440456292300, 0.170611405884662230, -0.275275082396073010, -2.395492805446796300, 0.847311163536506600, -3.845517018083148800, 2.055818378415868300, 4.672594161978930800,
00082 -1.990923030266425800, 2.469305197656249500, 3.609002606064021000, -4.586736582331667500, -4.147080139136136300, 1.643756718868359500, -1.150866392366494800, 1.985805026477433800
00083
00084
00085 };
00086
00087 const float32_t testRefOutput_f32 = 1.000000000;
00088
00089
00090
00091
00092 uint32_t blockSize = 32;
00093 float32_t testOutput;
00094 float32_t cosOutput;
00095 float32_t sinOutput;
00096 float32_t cosSquareOutput;
00097 float32_t sinSquareOutput;
00098
00099
00100
00101
00102
00103 arm_status status;
00104
00105 int32_t main(void)
00106 {
00107 float32_t diff;
00108 uint32_t i;
00109
00110 for(i=0; i< blockSize; i++)
00111 {
00112 cosOutput = arm_cos_f32(testInput_f32[i]);
00113 sinOutput = arm_sin_f32(testInput_f32[i]);
00114
00115 arm_mult_f32(&cosOutput, &cosOutput, &cosSquareOutput, 1);
00116 arm_mult_f32(&sinOutput, &sinOutput, &sinSquareOutput, 1);
00117
00118 arm_add_f32(&cosSquareOutput, &sinSquareOutput, &testOutput, 1);
00119
00120
00121 diff = fabsf(testRefOutput_f32 - testOutput);
00122
00123
00124 if(diff > DELTA)
00125 {
00126 status = ARM_MATH_TEST_FAILURE;
00127 }
00128
00129 if( status == ARM_MATH_TEST_FAILURE)
00130 {
00131 while(1);
00132 }
00133
00134 }
00135 }
00136