Skip to content

Instantly share code, notes, and snippets.

@RunningLight
Created May 11, 2015 17:52
Show Gist options
  • Save RunningLight/91246d5d1cc224cd008f to your computer and use it in GitHub Desktop.
Save RunningLight/91246d5d1cc224cd008f to your computer and use it in GitHub Desktop.
Running neon_mathfun_test on BBB RevC as suggested by https://github.com/machinekit/machinekit/issues/629
$ gcc -O3 -mfloat-abi=hard -mfpu=neon -march=armv7-a -mtune=cortex-a8 -Wall -W neon_mathfun_test.c -lm -o neon_mathfun_test
neon_mathfun_test.c: In function ‘print4’:
neon_mathfun_test.c:119:10: warning: unused variable ‘p’ [-Wunused-variable]
$ ./neon_mathfun_test
checking sines on [0*Pi, 1*Pi]
max deviation from sinf(x): 1.19209e-07 at 0.263172633899*Pi, max deviation from cephes_sin(x): 0
max deviation from cosf(x): 5.96046e-08 at 0.141602561694*Pi, max deviation from cephes_cos(x): 0
deviation of sin(x)^2+cos(x)^2-1: 1.78814e-07 (ref deviation is 1.78814e-07)
->> precision OK for the sin_ps / cos_ps / sincos_ps <<-
checking sines on [-1000*Pi, 1000*Pi]
max deviation from sinf(x): 1.19209e-07 at -998.270005266*Pi, max deviation from cephes_sin(x): 0
max deviation from cosf(x): 1.19209e-07 at -971.759749797*Pi, max deviation from cephes_cos(x): 0
deviation of sin(x)^2+cos(x)^2-1: 1.78814e-07 (ref deviation is 1.78814e-07)
->> precision OK for the sin_ps / cos_ps / sincos_ps <<-
checking exp/log [-60, 60]
max (relative) deviation from expf(x): 1.18777e-07 at 3.46936869621, max deviation from cephes_expf(x): 0
max (absolute) deviation from logf(x): 1.19209e-07 at -1.1134108305, max deviation from cephes_logf(x): 0
deviation of x - log(exp(x)): 1.19209e-07 (ref deviation is 1.19209e-07)
->> precision OK for the exp_ps / log_ps <<-
exp([ -1000, -100, 100, 1000]) = [ 0, 0, 2.4061436e+38, 2.4061436e+38]
exp([ -nan, inf, -inf, nan]) = [ nan, 2.4061436e+38, 0, nan]
log([ 0, -10, 1e+30, 1.0005271e-42]) = [ -nan, -nan, 69.077553, -nan]
log([ -nan, inf, -inf, nan]) = [ 89.128304, 88.722839, -nan, 89.128304]
sin([ -nan, inf, -inf, nan]) = [ nan, nan, -nan, nan]
cos([ -nan, inf, -inf, nan]) = [ nan, nan, nan, nan]
sin([ -1e+30, -100000, 1e+30, 100000]) = [ inf, -0.035749275, -inf, 0.035749275]
cos([ -1e+30, -100000, 1e+30, 100000]) = [ nan, -0.9993608, nan, -0.9993608]
benching sinf .. -> 0.5 millions of vector evaluations/second -> 417 cycles/value on a 1000MHz computer
benching cosf .. -> 0.5 millions of vector evaluations/second -> 456 cycles/value on a 1000MHz computer
benching expf .. -> 0.3 millions of vector evaluations/second -> 750 cycles/value on a 1000MHz computer
benching logf .. -> 0.5 millions of vector evaluations/second -> 484 cycles/value on a 1000MHz computer
benching cephes_sinf .. -> 0.6 millions of vector evaluations/second -> 357 cycles/value on a 1000MHz computer
benching cephes_cosf .. -> 0.6 millions of vector evaluations/second -> 387 cycles/value on a 1000MHz computer
benching cephes_expf .. -> 0.4 millions of vector evaluations/second -> 615 cycles/value on a 1000MHz computer
benching cephes_logf .. -> 0.4 millions of vector evaluations/second -> 517 cycles/value on a 1000MHz computer
benching sin_ps .. -> 5.6 millions of vector evaluations/second -> 45 cycles/value on a 1000MHz computer
benching cos_ps .. -> 5.8 millions of vector evaluations/second -> 43 cycles/value on a 1000MHz computer
benching sincos_ps .. -> 5.6 millions of vector evaluations/second -> 44 cycles/value on a 1000MHz computer
benching exp_ps .. -> 7.4 millions of vector evaluations/second -> 33 cycles/value on a 1000MHz computer
benching log_ps .. -> 6.4 millions of vector evaluations/second -> 38 cycles/value on a 1000MHz computer
@RunningLight
Copy link
Author

forgot to note I'm running a machinekit install from packages created some date I forget

$ uname -a
Linux beaglebone 3.8-1-xenomai.beaglebone-omap #1 Debian 3.8.13-9 armv7l GNU/Linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment