Más contenido relacionado La actualidad más candente (11) Similar a log_algorithm (14) Más de Shereef Shehata (18) log_algorithm1. A hardware for the logarithm transcendental
function
Shereef Shehata
add/subtract operations.
βαψζ →→→→ bandaCM ,,,
The definition of the error function:
)(xfx −+⋅=Ε ψζ
The mean square value of the erros is given by:
dxxfx 22
)]([
)(
1
][ −+⋅⋅
−
=Εℑ ∫ ψζ
αβ
β
α
The two possible variables in this formulation are ζ and ψ
Computation of ζ
1
2. [ ] [ ]
[ ] [ ])()()4/1()()()3/1(
)log()log(
2log2
)(
)2/1(log)2/1(log
2log2
)(
222222
22
22
αβαβαβαβ
αααβββ
αβ
ααββ
αβ
ζ
−⋅−⋅−−⋅−⋅
−−−
−
−−−−
−
=
ee
e
ee
e
Computation of ψ
[ ] [ ]
[ ] [ ])()()4/1()()()3/1(
)2/1(log)2/1(log
2log4
)(
)log()log(
2log3
)(
222233
22
2233
αβαβαβαβ
ααββ
αβ
αααβββ
αβ
ψ
−⋅−⋅−−⋅−⋅
−−−
−
−−−−
−
=
ee
e
ee
e
βαψζ →→→→ bandaCM ,,,
dxxfxfxfxxxdx ∫∫ +⋅⋅−⋅⋅⋅−+⋅⋅⋅+⋅
−
=
−
=
β
α
β
α
ψζψζψζ
αβ
ε
αβ
εχ ))()(2)(22(
)(
1
)(
1
)( 222222
bp Precision p = 1/(2^bp)
0 1.0
1 0.5
2 0.25
3 0.125
4 0.0625
5 0.0313
6 0.0156
7 0.0078
8 0.0039
9 0.0020
10 9.7656e-004
11 4.8828e-004
12 2.4414e-004
13 1.2207e-004
14 6.1035e-005
15 3.0518e-005
16 1.5259e-005
17 7.6294e-006
18 3.8147e-006
Table 1
2
4. 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 1 log2 and log2 approx, 2 intervals for [0.5:1]
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-0.025
-0.02
-0.015
-0.01
-0.005
0
0.005
0.01
Approx Error
Figure 2 Approximation error, for log2 approx, 2 intervals for [0.5:1]
4
5. 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 3 log2 and log2 approx, 4 intervals for [0.5:1]
5
6. 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-7
-6
-5
-4
-3
-2
-1
0
1
2
3
x 10
-3
Approximation Error
Figure 4 Approximation Error, log2 approx, 4 intervals for [0.5:1]
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 5 log2 and log2 approx, 8 intervals for [0.5:1]
6
7. 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-2
-1.5
-1
-0.5
0
0.5
1
x 10
-3
Approximation Error
Figure 6 Approximation Error, log2 approx, 8 intervals for [0.5:1]
7
8. 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 7 log2 and log2 approx, 16 intervals for [0.5:1]
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-5
-4
-3
-2
-1
0
1
2
3
4
x 10
-4
Approximation Error
Figure 8 Approximation Error for log2 approx, 16 intervals for [0.5:1]
8
9. 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-1
-0.9
-0.8
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
0
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 9 log2 and log2 approx, 32 intervals for [0.5:1]
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-12
-10
-8
-6
-4
-2
0
2
4
6
x 10
-5
Approximation Error
Figure 10 Approximation Error, log2 approx, 32 intervals for [0.5:1]
9
10. 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-1
-0.9
-0.8
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
0
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 11 log2 and log2 approx, 64 intervals for [0.5:1]
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
x 10
-5
Approximation Error
Figure 12 Approximation Error, log2 approx, 64 intervals for [0.5:1]
10
11. 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-1
-0.9
-0.8
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
0
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 13 log2 and log2 approx, 128 intervals for [0.5:1]
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-8
-6
-4
-2
0
2
4
x 10
-6
Approximation Error
Figure 14 Approximation Error, log2 approx, 128 intervals for [0.5:1]
11
12. 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-1
-0.9
-0.8
-0.7
-0.6
-0.5
-0.4
-0.3
-0.2
-0.1
0
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 15 log2 and log2 approx, 256 intervals for [0.5:1]
0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1
-2
-1.5
-1
-0.5
0
0.5
1
x 10
-6
Approximation Error
Figure 16 Approximation Error, log2 approx, 256 intervals for [0.5:1]
12
13. Appendix II
1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 17 log2 and log2 approx, 2 intervals for [1:2]
13
14. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
-7
-6
-5
-4
-3
-2
-1
0
1
2
3
x 10
-3
Approximation Error
Figure 18 Approximation Error, log2 approx, 2 intervals for [1:2]
1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 19 Approximation Error, log2 approx, 4 intervals for [1:2]
14
15. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
-2
-1.5
-1
-0.5
0
0.5
1
x 10
-3
Approximation Error
Figure 20 log2 and log2 approx, 4 intervals for [1:2]
1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
0
0.2
0.4
0.6
0.8
1
1.2
1.4
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 21 Approximation Error, log2 approx, 8 intervals for [1:2]
15
16. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
-5
-4
-3
-2
-1
0
1
2
3
4
x 10
-4
Approximation Error
Figure 22 log2 and log2 approx, 8 intervals for [1:2]
16
17. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 23 log2 and log2 approx, 16 intervals for [1:2]
17
18. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
-12
-10
-8
-6
-4
-2
0
2
4
6
x 10
-5
Approximation Error
Figure 24 log2 and log2 approx, 16 intervals for [1:2]
18
19. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 25 log2 and log2 approx, 32 intervals for [1:2]
1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
-3
-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
x 10
-5
Approximation Error
Figure 26 log2 and log2 approx, 32 intervals for [1:2]
19
20. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 27 log2 and log2 approx, 64 intervals for [1:2]
1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
-8
-6
-4
-2
0
2
4
x 10
-6
Approximation Error
Figure 28 log2 and log2 approx, 64 intervals for [1:2]
20
21. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 29 log2 and log2 approx, 128 intervals for [1:2]
21
22. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
-5
-4
-3
-2
-1
0
1
2
3
x 10
-7
Approximation Error
Figure 30 log2 and log2 approx, 128 intervals for [1:2]
22
23. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1
LOG2 And LOG2 Approximation
log2
log2_approx
Figure 31 log2 and log2 approx, 256 intervals for [1:2]
23
24. 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2
-5
-4
-3
-2
-1
0
1
2
3
x 10
-7
Approximation Error
Figure 32 log2 and log2 approx, 128 intervals for [1:2]
24