2025-10-22 21:17:53 +00:00
|
|
|
#include <stdint.h>
|
2025-11-02 17:36:56 +00:00
|
|
|
#include "stencil_helper.h"
|
2025-10-22 21:17:53 +00:00
|
|
|
|
|
|
|
|
//double (*math_pow)(double, double);
|
|
|
|
|
|
2025-10-31 15:59:46 +00:00
|
|
|
volatile extern int dummy_int;
|
|
|
|
|
volatile extern float dummy_float;
|
2025-10-22 21:17:53 +00:00
|
|
|
|
2025-11-11 14:56:15 +00:00
|
|
|
int floor_div(float arg1, float arg2) {
|
2025-10-22 21:17:53 +00:00
|
|
|
float x = arg1 / arg2;
|
|
|
|
|
int i = (int)x;
|
|
|
|
|
if (x < 0 && x != (float)i) i -= 1;
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-11 14:56:15 +00:00
|
|
|
float aux_sqrt(float x) {
|
2025-11-12 12:50:33 +00:00
|
|
|
return sqrtf(x);
|
2025-10-25 00:21:43 +00:00
|
|
|
}
|
|
|
|
|
|
2025-11-11 14:56:15 +00:00
|
|
|
float aux_get_42(float n) {
|
2025-10-26 15:09:02 +00:00
|
|
|
return n + 42.0;
|
2025-10-26 13:09:45 +00:00
|
|
|
}
|
|
|
|
|
|
2025-11-11 14:56:15 +00:00
|
|
|
float aux_log(float x)
|
2025-11-05 20:47:18 +00:00
|
|
|
{
|
2025-11-12 12:50:33 +00:00
|
|
|
return logf(x);
|
2025-11-05 20:47:18 +00:00
|
|
|
}
|
|
|
|
|
|
2025-11-11 14:56:15 +00:00
|
|
|
float aux_exp(float x)
|
2025-11-05 20:47:18 +00:00
|
|
|
{
|
2025-11-12 12:50:33 +00:00
|
|
|
return expf(x);
|
2025-10-26 13:09:45 +00:00
|
|
|
}
|