Skip to content

Commit cc9df61

Browse files
committed
start specs
1 parent bf1ce2f commit cc9df61

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

doc/specs/stdlib_intrinsics.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: intrinsics
3+
---
4+
5+
# The `stdlib_intrinsics` module
6+
7+
[TOC]
8+
9+
## Introduction
10+
11+
The `stdlib_intrinsics` module provides replacements for some of the well known intrinsic functions found in Fortran compilers for which either a faster and/or more accurate implementation is found which has also proven of interest to the Fortran community.
12+
13+
<!-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -->
14+
### `fsum` function
15+
16+
#### Description
17+
18+
The `fsum` function can replace the intrinsic `sum` for 1D `real` or `complex` arrays. It follows a chunked implementation which maximaxes vectorization potential as well as reducing the round-off error.
19+
20+
#### Syntax
21+
22+
`res = ` [[stdlib_intrinsics(module):fsum(interface)]] ` (x [,mask] )`
23+
24+
#### Status
25+
26+
Experimental
27+
28+
#### Class
29+
30+
Pure function.
31+
32+
#### Argument(s)
33+
34+
`x`: 1D array of either `real` or `complex` type. This argument is `intent(in)`.
35+
`mask`: 1D array of `logical` values. This argument is `intent(in)`.
36+
37+
#### Output value or Result value
38+
39+
The output is a scalar of `type` and `kind` same as to that of `x`.
40+
41+
#### Example
42+
43+
```fortran
44+
{!example/math/example_intrinsics_sum.f90!}
45+
```

0 commit comments

Comments
 (0)