# GFloat Test And BenchMark
* Test time : Fri Oct 21 11:21:32 2022
Operation System |
C++ Compiler version |
CPU |
Base Frequency |
Darwin |
Apple LLVM 13.1.6 (clang-1316.0.21.2.5) |
Apple iPhone14,3 Arch : ARM64_E |
0.024 GHz or 0.024 GHz |
* Performance: float vs GFloat, Call 1000000 times |
|
|
|
* Error : the relative error between cmath (double) and GFloat Math |
|
|
|
Function |
input data range |
avg relative error |
max relative error |
max abs error |
float vs GFloat |
float / GFloat |
Add |
[ -10000.0, 10000.0] |
0.000004 % |
0.000024 % |
0.003906 |
0.46 vs 4.76 (ms) |
0.10 |
Sub |
[ -10000.0, 10000.0] |
0.000004 % |
0.000024 % |
0.003906 |
0.51 vs 4.88 (ms) |
0.11 |
Mul |
[ -10000.0, 10000.0] |
0.000012 % |
0.000048 % |
32.000000 |
0.48 vs 0.78 (ms) |
0.62 |
Div |
[ -10000.0, 10000.0] |
0.000009 % |
0.000024 % |
0.031250 |
0.52 vs 1.41 (ms) |
0.37 |
Ceil |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.27 vs 1.50 (ms) |
0.18 |
Floor |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.27 vs 0.72 (ms) |
0.37 |
Whole |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.31 vs 1.45 (ms) |
0.22 |
WholeFrac |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.27 vs 5.50 (ms) |
0.05 |
Fraction |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.29 vs 3.33 (ms) |
0.09 |
-() |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.29 vs 0.51 (ms) |
0.57 |
>() |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.46 vs 11.06 (ms) |
0.04 |
<() |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.67 vs 8.19 (ms) |
0.08 |
>=() |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.45 vs 7.97 (ms) |
0.06 |
<=() |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.57 vs 1.62 (ms) |
0.35 |
Abs |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.31 vs 0.54 (ms) |
0.57 |
Normalize32 |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.29 vs 1.03 (ms) |
0.28 |
Normalize64 |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.29 vs 1.02 (ms) |
0.28 |
FromInt |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.29 vs 0.87 (ms) |
0.33 |
Fromfloat |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.28 vs 0.36 (ms) |
0.77 |
CeilToInt |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.26 vs 2.30 (ms) |
0.11 |
FloorToInt |
[ -10000.0, 10000.0] |
0.000000 % |
0.000000 % |
0.000000 |
0.29 vs 1.95 (ms) |
0.15 |
Sin |
[ -10000.0, 10000.0] |
0.000099 % |
4.559921 % |
0.000005 |
3.67 vs 4.78 (ms) |
0.77 |
Cos |
[ -10000.0, 10000.0] |
0.001806 % |
0.122642 % |
0.000028 |
3.77 vs 5.19 (ms) |
0.73 |
Tan |
[ -10000.0, 10000.0] |
0.001776 % |
4.562861 % |
83.726562 |
6.30 vs 12.64 (ms) |
0.50 |
ASin |
[ -1.0, 1.0] |
0.031373 % |
100.000000 % |
0.049958 |
2.67 vs 7.09 (ms) |
0.38 |
ACos |
[ -1.0, 1.0] |
0.117627 % |
98.413861 % |
0.049958 |
3.28 vs 10.21 (ms) |
0.32 |
ATan |
[ -10000.0, 10000.0] |
0.003567 % |
0.036536 % |
0.000166 |
2.52 vs 10.47 (ms) |
0.24 |
ATan(10,x) |
[ -10000.0, 10000.0] |
0.006190 % |
0.021383 % |
0.000166 |
4.63 vs 14.24 (ms) |
0.33 |
ATan(x,10) |
[ -10000.0, 10000.0] |
0.007318 % |
0.230349 % |
0.000166 |
4.33 vs 13.40 (ms) |
0.32 |
Sqrt |
[ 0.0, 10000.0] |
0.000038 % |
0.000084 % |
0.000076 |
0.75 vs 4.89 (ms) |
0.15 |
InvSqrt |
[ 0.0, 10000.0] |
0.000026 % |
0.000062 % |
0.000183 |
0.94 vs 4.01 (ms) |
0.23 |
Exp |
[ -20.0, 20.0] |
0.001698 % |
0.050661 % |
19760.000000 |
5.55 vs 6.32 (ms) |
0.88 |
Pow2 |
[ -30.0, 30.0] |
0.001820 % |
0.050354 % |
72448.000000 |
1.99 vs 5.39 (ms) |
0.37 |
Log_e |
[ 0.0, 10000.0] |
0.001206 % |
86.225453 % |
0.000031 |
1.91 vs 3.28 (ms) |
0.58 |
Log_2 |
[ 0.0, 10000.0] |
0.001206 % |
86.225884 % |
0.000043 |
1.96 vs 2.89 (ms) |
0.68 |
Log_10 |
[ 0.0, 10000.0] |
0.001206 % |
86.224927 % |
0.000013 |
2.01 vs 3.37 (ms) |
0.60 |
Pow(1.7,x) |
[ -30.0, 30.0] |
0.003043 % |
0.049457 % |
2121.500000 |
4.64 vs 13.60 (ms) |
0.34 |
Pow(x,1.7) |
[ 0.6, 20.0] |
0.006763 % |
0.055199 % |
0.015121 |
4.71 vs 14.78 (ms) |
0.32 |
Fmod(x,1.7) |
[ -10000.0, 10000.0] |
0.129491 % |
7214.285714 % |
1.700575 |
15.72 vs 11.69 (ms) |
1.34 |
Fmod(1.7,x) |
[ -10000.0, 10000.0] |
0.000327 % |
15.789474 % |
0.000000 |
4.46 vs 5.71 (ms) |
0.78 |