OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gfortran.dg/] [pr41212.f90] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 694 jeremybenn
! { dg-do run }
2
! { dg-options "-O2" }
3
program m
4
   double precision :: y,z
5
   call b(1.0d0,y,z)
6
   if (ABS (z - 1.213) > 0.1) call abort
7
contains
8
     subroutine b( x, y, z)
9
       implicit none
10
       double precision :: x,y,z
11
       integer :: i, k
12
       double precision :: h, r
13
 
14
       y = 1.0d0
15
       z = 0.0d0
16
 
17
       h = 0
18
       DO k = 1,10
19
          h = h + 1.0d0/k
20
 
21
          r = 1
22
          DO i = 1,k
23
             r = (x/(2*i) ) * r
24
          END DO
25
 
26
          y = y + (-1)**k * r
27
          z = z + (-1)**(k+1) * h * r
28
 
29
          IF ( ABS(2*k/x*r) < 1d-6 ) EXIT
30
       END DO
31
 
32
       z = 2*y
33
     end subroutine b
34
end program m

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.