Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions src/math/p_root.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#include <pal.h>

/**
*
* Calculate 'a' radicand to the index 'b'
*
* @param a Pointer to input vector
*
* @param b Pointer to input vector
*
* @param c Pointer to output vector
*
* @param n Size of 'a' and 'c' vector.
*
* @param p Number of processor to use (task parallelism)
*
* @param team Team to work with
*
* @return None
*
*/
#include <math.h>
void p_root_f32(float *a, float *b, float *c, int n, int p, p_team_t team)
{

int i;
for (i = 0; i < n; i++) {
*(c + i) = powf(*(a + i), 1/(*(b + i)));
}
}