-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
math: p_atan: Implement atan Function #218
base: master
Are you sure you want to change the base?
Conversation
This is >6x slower than the existing code on ARM (and probably other archs too) $ git checkout master -b test-p_atan_code
$ mkdir build && cd build
$ ../configure CFLAGS="-O3 -ffast-math -mcpu=cortex-a9 -mfpu=neon"
$ make -j2
$ ./benchmark/math/bench_p_atan_f32
;name, size, duration (ns)
p_atan_f32, 16384, 331781
$ git merge origin/pr/218
$ make -j2
$ ./benchmark/math/bench_p_atan_f32
;name, size, duration (ns)
p_atan_f32, 16384, 2082794 |
old gold data has range of input values ( vector a) less than one which means that return value (vector c) is no greater than 45 degrees. If atan algorithm is supposed to be up to 90 degrees range, then all values of vector a ( including greater than one) should also be considered for testing the code. Thus, new old data has some vector a input values greater than 1 (on positive range and less than -1 on negative range ) |
On 2015-08-31 15:44, Adamszk wrote:
Thanks, |
On 2015-08-31 16:41, Ola Jeppsson wrote:
New test data is not within that range.
Phone: +46.733208642 |
If you look at sixth row ,the input vector a is equal to 6.265069 . The arctan (a) by calculator is 80.93122361 degrees. New algorithm calculation is 1.412516 in radiants which matches with standard gnu c compiler arctan(a). Converting it to degrees is 1.412516 * 360 / (2*pi) which is 80.93120. Since the maximum allowed rows of data is 100, I divided 100 by 10 to end up with ten ranges of numbers generated randomly. Hence 10 random number within 10 to 1, 10 random numbers with 1 to 0, 10 numbers within 0.1 to 0.0 (one decimal range), 10 random numbers in (two decimal range) etc. I used random number generator to ensure objective test. It just happens to have 6.2 as the largest number. |
@mateunho |
Corrected to eliminate divisions.