fortran-iv.f
1 ! @section Synopsis
2 !
3 ! FORTRAN IV intrinsic library functions for VIF.
4 !
5 ! @author J. Marcel van der Veer
6 !
7 ! @section copyright
8 !
9 ! This file is part of VIF - vintage fortran compiler.
10 ! Copyright 2020-2022 J. Marcel van der Veer <algol68g@xs4all.nl>.
11 !
12 ! @section license
13 !
14 ! This program is free software; you can redistribute it and/or modify it
15 ! under the terms of the gnu general public license as published by the
16 ! free software foundation; either version 3 of the license, or
17 ! (at your option) any later version.
18 !
19 ! This program is distributed in the hope that it will be useful, but
20 ! without any warranty; without even the implied warranty of merchantability
21 ! or fitness for a particular purpose. See the GNU general public license for
22 ! more details. you should have received a copy of the GNU general public
23 ! license along with this program. If not, see <http://www.gnu.org/licenses/>.
24
25 ! Intrinsic FORTRAN IV library functions.
26 ! Applied when an intrinsic function is passed as a subprogram argument.
27
28 ! real*4
29
30 real*4 function sqrtf (x)
31 implicit real*4 (a-z)
32 sqrtf = sqrt (x)
33 return
34 end
35
36 real*4 function expf (x)
37 implicit real*4 (a-z)
38 expf = exp (x)
39 return
40 end
41
42 real*4 function logf (x)
43 implicit real*4 (a-z)
44 logf = log (x)
45 return
46 end
47
48 real*4 function log10f (x)
49 implicit real*4 (a-z)
50 log10f = log10 (x)
51 return
52 end
53
54 real*4 function sinf (x)
55 implicit real*4 (a-z)
56 sinf = sin (x)
57 return
58 end
59
60 real*4 function asinf (x)
61 implicit real*4 (a-z)
62 asinf = asin (x)
63 return
64 end
65
66 real*4 function acosf (x)
67 implicit real*4 (a-z)
68 acosf = acos (x)
69 return
70 end
71
72 real*4 function cosf (x)
73 implicit real*4 (a-z)
74 cosf = cos (x)
75 return
76 end
77
78 real*4 function tanf (x)
79 implicit real*4 (a-z)
80 tanf = tan (x)
81 return
82 end
83
84 real*4 function atanf (x)
85 implicit real*4 (a-z)
86 atanf = atan (x)
87 return
88 end
89
90 real*4 function atan2f (x, y)
91 implicit real*4 (a-z)
92 atan2f = atan2 (x, y)
93 return
94 end
95
96 ! real*8
97
98 real*8 function dsqrt (x)
99 implicit real*8 (a-z)
100 dsqrt = sqrt (x)
101 return
102 end
103
104 real*8 function dexp (x)
105 implicit real*8 (a-z)
106 dexp = exp (x)
107 return
108 end
109
110 real*8 function dlog (x)
111 implicit real*8 (a-z)
112 dlog = log (x)
113 return
114 end
115
116 real*8 function dlog10 (x)
117 implicit real*8 (a-z)
118 dlog10 = log10 (x)
119 return
120 end
121
122 real*8 function dsin (x)
123 implicit real*8 (a-z)
124 dsin = sin (x)
125 return
126 end
127
128 real*8 function dasin (x)
129 implicit real*8 (a-z)
130 dasin = asin (x)
131 return
132 end
133
134 real*8 function dacos (x)
135 implicit real*8 (a-z)
136 dacos = acos (x)
137 return
138 end
139
140 real*8 function dcos (x)
141 implicit real*8 (a-z)
142 dcos = cos (x)
143 return
144 end
145
146 real*8 function dtan (x)
147 implicit real*8 (a-z)
148 dtan = tan (x)
149 return
150 end
151
152 real*8 function datan (x)
153 implicit real*8 (a-z)
154 datan = atan (x)
155 return
156 end
157
158 real*8 function datan2 (x, y)
159 implicit real*8 (a-z)
160 datan2 = atan2 (x, y)
161 return
162 end
163
164 ! real*16
165
166 real*16 function qsqrt (x)
167 implicit real*16 (a-z)
168 qsqrt = sqrt (x)
169 return
170 end
171
172 real*16 function qexp (x)
173 implicit real*16 (a-z)
174 qexp = exp (x)
175 return
176 end
177
178 real*16 function qlog (x)
179 implicit real*16 (a-z)
180 qlog = log (x)
181 return
182 end
183
184 real*16 function qlog10 (x)
185 implicit real*16 (a-z)
186 qlog10 = log10 (x)
187 return
188 end
189
190 real*16 function qsin (x)
191 implicit real*16 (a-z)
192 qsin = sin (x)
193 return
194 end
195
196 real*16 function qasin (x)
197 implicit real*16 (a-z)
198 qasin = asin (x)
199 return
200 end
201
202 real*16 function qacos (x)
203 implicit real*16 (a-z)
204 qacos = acos (x)
205 return
206 end
207
208 real*16 function qcos (x)
209 implicit real*16 (a-z)
210 qcos = cos (x)
211 return
212 end
213
214 real*16 function qtan (x)
215 implicit real*16 (a-z)
216 qtan = tan (x)
217 return
218 end
219
220 real*16 function qatan (x)
221 implicit real*16 (a-z)
222 qatan = atan (x)
223 return
224 end
225
226 real*16 function qatan2 (x, y)
227 implicit real*16 (a-z)
228 qatan2 = atan2 (x, y)
229 return
230 end
231
232 ! real*32
233
234 real*32 function xsqrt (x)
235 implicit real*32 (a-z)
236 xsqrt = sqrt (x)
237 return
238 end
239
240 real*32 function xexp (x)
241 implicit real*32 (a-z)
242 xexp = exp (x)
243 return
244 end
245
246 real*32 function xlog (x)
247 implicit real*32 (a-z)
248 xlog = log (x)
249 return
250 end
251
252 real*32 function xlog10 (x)
253 implicit real*32 (a-z)
254 xlog10 = log10 (x)
255 return
256 end
257
258 real*32 function xsin (x)
259 implicit real*32 (a-z)
260 xsin = sin (x)
261 return
262 end
263
264 real*32 function xasin (x)
265 implicit real*32 (a-z)
266 xasin = asin (x)
267 return
268 end
269
270 real*32 function xacos (x)
271 implicit real*32 (a-z)
272 xacos = acos (x)
273 return
274 end
275
276 real*32 function xcos (x)
277 implicit real*32 (a-z)
278 xcos = cos (x)
279 return
280 end
281
282 real*32 function xtan (x)
283 implicit real*32 (a-z)
284 xtan = tan (x)
285 return
286 end
287
288 real*32 function xatan (x)
289 implicit real*32 (a-z)
290 xatan = atan (x)
291 return
292 end
293
294 real*32 function xatan2 (x, y)
295 implicit real*32 (a-z)
296 xatan2 = atan2 (x, y)
297 return
298 end
299
300 ! complex*8
301
302 complex*8 function csqrtf (x)
303 implicit complex*8 (a-z)
304 csqrtf = sqrt (x)
305 return
306 end
307
308 complex*8 function cexpf (x)
309 implicit complex*8 (a-z)
310 cexpf = exp (x)
311 return
312 end
313
314 complex*8 function clogf (x)
315 implicit complex*8 (a-z)
316 clogf = log (x)
317 return
318 end
319
320 complex*8 function csinf (x)
321 implicit complex*8 (a-z)
322 csinf = sin (x)
323 return
324 end
325
326 complex*8 function ccosf (x)
327 implicit complex*8 (a-z)
328 ccosf = cos (x)
329 return
330 end
331
332 complex*8 function ctanf (x)
333 implicit complex*8 (a-z)
334 ctanf = tan (x)
335 return
336 end
337
338 ! complex*16
339
340 complex*16 function cdsqrt (x)
341 implicit complex*16 (a-z)
342 cdsqrt = sqrt (x)
343 return
344 end
345
346 complex*16 function cdexp (x)
347 implicit complex*16 (a-z)
348 cdexp = exp (x)
349 return
350 end
351
352 complex*16 function cdlog (x)
353 implicit complex*16 (a-z)
354 cdlog = log (x)
355 return
356 end
357
358 complex*16 function cdsin (x)
359 implicit complex*16 (a-z)
360 cdsin = sin (x)
361 return
362 end
363
364 complex*16 function cdcos (x)
365 implicit complex*16 (a-z)
366 cdcos = cos (x)
367 return
368 end
369
370 complex*16 function cdtan (x)
371 implicit complex*16 (a-z)
372 cdtan = tan (x)
373 return
374 end
375
376 ! complex*32
377
378 complex*32 function cqsqrt (x)
379 implicit complex*32 (a-z)
380 cqsqrt = sqrt (x)
381 return
382 end
383
384 complex*32 function cqexp (x)
385 implicit complex*32 (a-z)
386 cqexp = exp (x)
387 return
388 end
389
390 complex*32 function cqlog (x)
391 implicit complex*32 (a-z)
392 cqlog = log (x)
393 return
394 end
395
396 complex*32 function cqsin (x)
397 implicit complex*32 (a-z)
398 cqsin = sin (x)
399 return
400 end
401
402 complex*32 function cqcos (x)
403 implicit complex*32 (a-z)
404 cqcos = cos (x)
405 return
406 end
407
408 complex*32 function cqtan (x)
409 implicit complex*32 (a-z)
410 cqtan = tan (x)
411 return
412 end
413
414 ! complex*64
415
416 complex*64 function cxsqrt (x)
417 implicit complex*64 (a-z)
418 cxsqrt = sqrt (x)
419 return
420 end
421
422 complex*64 function cxexp (x)
423 implicit complex*64 (a-z)
424 cxexp = exp (x)
425 return
426 end
427
428 complex*64 function cxlog (x)
429 implicit complex*64 (a-z)
430 cxlog = log (x)
431 return
432 end
433
434 complex*64 function cxsin (x)
435 implicit complex*64 (a-z)
436 cxsin = sin (x)
437 return
438 end
439
440 complex*64 function cxcos (x)
441 implicit complex*64 (a-z)
442 cxcos = cos (x)
443 return
444 end
445
446 complex*64 function cxtan (x)
447 implicit complex*64 (a-z)
448 cxtan = tan (x)
449 return
450 end
© 2002-2024 J.M. van der Veer (jmvdveer@xs4all.nl)
|