- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
my variables are declared as
integer, parameter :: varsize = 8
real(varsize), allocatable :: myarray (:,:,:)
and I need to compute using some trigonometric functions with as maximum precision as possible
shoud I use dcos, dsin, dacos,... functions insteed of sin, cos.... ?
what will be the difference in precision (significant numbers after point) in the both cases ?
thank you !
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The generic intrinsics (since 30 years ago) such as sin, cos automatically adjust to the kind of the argument, so
sin(myarray)
will give you the identical library function as the style prior to 30 years ago
dsin(myarray)
except that the latter probably breaks when varsize changes. The specific kind number 8 of course works for Intel compilers but not all other brands. This gives you about 16 significant decimal precision (see spacing(x), since 20 years ago), counting before and after decimal point.
ifort, and several other compilers, also have quad precision math libraries which come in for varsize=selected_real_kind(30), at a cost in performance.
sin(myarray)
will give you the identical library function as the style prior to 30 years ago
dsin(myarray)
except that the latter probably breaks when varsize changes. The specific kind number 8 of course works for Intel compilers but not all other brands. This gives you about 16 significant decimal precision (see spacing(x), since 20 years ago), counting before and after decimal point.
ifort, and several other compilers, also have quad precision math libraries which come in for varsize=selected_real_kind(30), at a cost in performance.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page