No. All this extensions are compatible with the C standard as
I have explained thousand times in this newsgroup.
Note that the C standard does NOT forbid extensions
By the same logic, this is C code, since GCC compiles it:
PROGRAM STEFACC
C NUMERICAL METHODS: FORTRAN Programs, (c) John H. Mathews 1994
C To accompany the text:
C NUMERICAL METHODS for Mathematics, Science and Engineering, 2nd
Ed, 1992
C Prentice Hall, Englewood Cliffs, New Jersey, 07632, U.S.A.
C This free software is complements of the author.
C
C Algorithm 2.7 (Steffensen's Acceleration).
C Section 2.5, Aitken's Process & Steffensen's & Muller's Methods,
Page 96
C
PARAMETER(Delta=5E-6,Epsilon=5E-6,Max=99)
INTEGER Cond,K
REAL Dp,P0,P3
CHARACTER ANS*1
EXTERNAL F,F1
10 CALL INPUT(P0)
CALL STEFFEN(F,F1,P0,Delta,Epsilon,Max,P3,Dp,Cond,K)
CALL RESULTS(P0,P3,Dp,Cond,K)
WRITE(9,*)' '
WRITE(9,*)'WANT TO TRY ANOTHER STARTING VALUE ? <Y/N> '
READ(9,'(A)') ANS
IF (ANS.EQ.'Y' .OR. ANS.EQ.'y') GOTO 10
STOP
END
REAL FUNCTION F(X)
REAL X
F=X*X*X-3*X+2
RETURN
END
REAL FUNCTION F1(X)
REAL X
F1=3*X*X-3
RETURN
END
SUBROUTINE PRINTFUN
WRITE(9,*)'F(X) = X*X*X-3*X+2'
RETURN
END
SUBROUTINE STEFFEN(F,F1,P0,Delta,Epsilon,Max,P3,Dp,Cond,K)
PARAMETER(Small=1E-20)
INTEGER Cond,K,Max
REAL D1,D2,Delta,DF0,DF1,Dp,Epsilon,P0,P1,P2,P3,Pold,RelErr,Y3
EXTERNAL F,F1
Pold=P0
K=0
Cond=0
P3=P0
P2=P0+1
P1=P0+2
100 continue
IF ((K.LT.Max).AND.(Cond.EQ.0)) then
P0=P3
DF0=F1(P0)
IF (DF0.NE.0) THEN
P1=P0 - F(P0)/DF0
ELSE
Cond=1
Dp=P3-P2
P3=P0
ENDIF
DF1=F1(P1)
IF (DF1.EQ.0) THEN
Cond=1
Dp=P1-P0
P3=P1
ELSE
P2=P1 - F(P1)/DF1
D1=(P1-P0)*(P1-P0)
D2=P2-2*P1+P0
IF (D2.EQ.0) THEN
Cond=1
Dp=P2-P1
P3=P2
ELSE
P3=P0-D1/D2
Dp=P3-P2
ENDIF
Y3=F(P3)
RelErr=ABS(Dp)/(ABS(P3)+Small)
IF (RelErr.LT.Delta) then
Cond=2
endif
IF (ABS(Y3).LT.Epsilon) then
Cond=3
endif
IF ((Cond.EQ.2).AND.(ABS(Y3).LT.Epsilon)) then
Cond=4
endif
ENDIF
K=K+1
WRITE(9,1000) K,P3,P3
goto 100
ENDIF
P0=Pold
PAUSE
RETURN
1000 FORMAT(I2,4X,F15.7,4X,F15.7)
END
SUBROUTINE XSTEFFEN(F,F1,P0,Delta,Epsilon,Max,P3,Dp,Cond,K)
C This subroutine uses simulated WHILE loop(s).
PARAMETER(Small=1E-20)
INTEGER Cond,K,Max
REAL D1,D2,Delta,DF0,DF1,Dp,Epsilon,P0,P1,P2,P3,Pold,RelErr,Y3
EXTERNAL F,F1
Pold=P0
K=0
Cond=0
P3=P0
P2=P0+1
P1=P0+2
10 IF ((K.LT.Max).AND.(Cond.EQ.0)) THEN
P0=P3
DF0=F1(P0)
IF (DF0.NE.0) THEN
P1=P0 - F(P0)/DF0
ELSE
Cond=1
Dp=P3-P2
P3=P0
ENDIF
DF1=F1(P1)
IF (DF1.EQ.0) THEN
Cond=1
Dp=P1-P0
P3=P1
ELSE
P2=P1 - F(P1)/DF1
D1=(P1-P0)*(P1-P0)
D2=P2-2*P1+P0
IF (D2.EQ.0) THEN
Cond=1
Dp=P2-P1
P3=P2
ELSE
P3=P0-D1/D2
Dp=P3-P2
ENDIF
Y3=F(P3)
RelErr=ABS(Dp)/(ABS(P3)+Small)
IF (RelErr.LT.Delta) then
Cond=2
endif
IF (ABS(Y3).LT.Epsilon) then
Cond=3
endif
IF ((RelErr.LT.Delta).AND.(ABS(Y3).LT.Epsilon)) then
Cond=4
endif
ENDIF
K=K+1
WRITE(9,1000) K,P3,P3
GOTO 10
ENDIF
P0=Pold
PAUSE
RETURN
1000 FORMAT(I2,4X,F15.7,4X,F15.7)
END
SUBROUTINE INPUT(P0)
INTEGER I
REAL P0
DO 10 I=1,18
WRITE(9,*)' '
10 CONTINUE
WRITE(9,*)' '
WRITE(9,*)'STEFFENSEN`S ACCELERATION OF THE NEWTON-RAPHSON'
WRITE(9,*)' '
WRITE(9,*)'METHOD IS USED TO FIND A ZERO OF THE FUNCTION'
WRITE(9,*)' '
CALL PRINTFUN
WRITE(9,*)' '
WRITE(9,*)'ONE INITIAL APPROXIMATION P0 IS NEEDED.'
WRITE(9,*)' '
WRITE(9,*)'ENTER P0 = '
READ(9,*) P0
WRITE(9,*)' '
RETURN
END
SUBROUTINE RESULTS(P0,P3,Dp,Cond,K)
INTEGER Cond,I,K
REAL P0,P3,Dp
DO 10 I=1,15
WRITE(9,*)' '
10 CONTINUE
WRITE(9,*)'STEFFENSEN`S ACCELERATION OF THE NEWTON-RAPHSON'
WRITE(9,*)' '
WRITE(9,*)'METHOD WAS USED TO FIND A ZERO OF THE FUNCTION'
WRITE(9,*)' '
CALL PRINTFUN
WRITE(9,*)' '
WRITE(9,*)'STARTING WITH THE APPROXIMATION P0 =',P0
WRITE(9,*)' '
WRITE(9,*)'AFTER ',K,' ITERATIONS AN APPROXIMATE VALUE OF THE
ZERO
+ IS'
WRITE(9,*)' '
WRITE(9,*)' P =',P3
WRITE(9,*)' '
WRITE(9,*)' DP =',ABS(Dp),' IS AN ESTIMATE OF THE ACCURACY.'
WRITE(9,*)' '
WRITE(9,*)' F(',P3,' ) =',F(P3)
WRITE(9,*)' '
IF (F(P3).EQ.0) THEN
WRITE(9,*)'THE COMPUTED FUNCTION VALUE IS EXACTLY ZERO!'
WRITE(9,*)' '
ENDIF
IF (Cond.EQ.0) THEN
WRITE(9,*)'CONVERGENCE IS DOUBTFUL BECAUSE'
WRITE(9,*)' '
WRITE(9,*)'THE MAXIMUM NUMBER OF ITERATIONS WAS EXCEEDED.'
ELSEIF (Cond.EQ.1) THEN
WRITE(9,*)'CONVERGENCE IS DOUBTFUL. DIVISION BY ZERO WAS
ENCOUNT
+ERED.'
ELSEIF (Cond.EQ.2) THEN
WRITE(9,*)'THE APPROXIMATION P IS WITHIN THE DESIRED
TOLERANCE.'
ELSEIF (Cond.EQ.3) THEN
WRITE(9,*)'THE FUNCTION VALUE F(P) IS WITHIN THE DESIRED
TOLERAN
+CE.'
ELSEIF (Cond.EQ.4) THEN
WRITE(9,*)'THE APPROXIMATION P AND THE FUNCTION VALUE '
WRITE(9,*)'F(P) ARE BOTH WITHIN THE DESIRED TOLERANCES.'
ENDIF
RETURN
END