16 lines
503 B
Plaintext
16 lines
503 B
Plaintext
Timing for 10000000 math.h sin and cos: 2822266ns
|
|
Timing for 10000000 approximations: 1223832ns
|
|
Approximation faster, speedup: 1598434ns (2.31x)
|
|
Squared error in cosines (100000 runs):
|
|
Average: 0.000051 (0.713743% error)
|
|
Largest: 0.000174 (1.320551% error)
|
|
Input: 0.729202
|
|
Value: -0.659428
|
|
Approximation: -0.672634
|
|
Squared error in sines (100000 runs):
|
|
Average: 0.000070 (0.835334% error)
|
|
Largest: 0.000288 (1.698413% error)
|
|
Input: 0.842206
|
|
Value: 0.475669
|
|
Approximation: 0.458685
|