Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
expx
!gfortran, gcc version 5.4.0 20160609 program epsilon implicit none integer, parameter :: DP=8, SP=4 real(DP) :: eps_d, x_d, xa, x real(SP) :: eps_s, x_s read *,x_d,x_s !x_d=4.0_DP !x_s=4.0_SP print *,"x_d=",x_d print *,"x_s=",x_s eps_d=1.0_DP eps_s=1.0_SP do while (1.0_SP+eps_s .gt. 1.0_SP) eps_s=eps_s/2 end do do while (1.0_DP+eps_d .gt. 1.0_DP) eps_d=eps_d/2 end do print *,"single precision epsilon=",eps_s print *,"double precision epsilon=",eps_d x_d=x_d+eps_d x_s=x_s+eps_s print *,"x_d+eps_d=",x_d print *,"x_s+eps_s=",x_s xa=5.5_DP x=1.0-xa+(xa*xa)/2.0-(xa*xa*xa)/6.0+(xa*xa*xa*xa)/24.0-(xa*xa*xa*xa*xa)/120.0+ & (xa*xa*xa*xa*xa*xa)/720.0-(xa*xa*xa*xa*xa*xa*xa)/5040.0+ & (xa*xa*xa*xa*xa*xa*xa*xa)/40320.0-(xa*xa*xa*xa*xa*xa*xa*xa*xa)/362880.0+ & (xa*xa*xa*xa*xa*xa*xa*xa*xa*xa)/3628800.0 print *,x x=1.0+xa+(xa*xa)/2.0+(xa*xa*xa)/6.0+(xa*xa*xa*xa)/24.0+(xa*xa*xa*xa*xa)/120.0+ & (xa*xa*xa*xa*xa*xa)/720.0+(xa*xa*xa*xa*xa*xa*xa)/5040.0+ & (xa*xa*xa*xa*xa*xa*xa*xa)/40320.0+(xa*xa*xa*xa*xa*xa*xa*xa*xa)/362880.0+ & (xa*xa*xa*xa*xa*xa*xa*xa*xa*xa)/3628800.0 print *,1.0/x,exp(-xa) end program epsilon
run
|
edit
|
history
|
help
0
A_002 GUASSIAN ELIMINATION METHOD
G b
Regression
Jánošík 2018
Prime
my_second_code
Taylors method of three order
Check identity matrix or not?
Gauss pivot elimination
euler-cromer