-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48fd57b
commit c6695ab
Showing
40 changed files
with
1,509 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
INTEGER FUNCTION abs_r1fp32() RESULT(r) | ||
USE FEQParse | ||
use iso_fortran_env | ||
IMPLICIT NONE | ||
integer, parameter :: N=1000 | ||
TYPE(EquationParser) :: f | ||
CHARACTER(LEN=1), DIMENSION(1:3) :: independentVars | ||
CHARACTER(LEN=30) :: eqChar | ||
REAL(real32) :: x(1:N,1:3) | ||
REAL(real32) :: feval(1:N) | ||
REAL(real32) :: fexact(1:N) | ||
integer :: i | ||
|
||
! Specify the independent variables | ||
independentVars = (/ 'x', 'y', 'z' /) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \abs( x )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar, independentVars) | ||
|
||
x = 0.0_real32 | ||
do i = 1,N | ||
x(i,1) = -1.0_real32 + (2.0_real32)/REAL(N,real32)*REAL(i-1,real32) | ||
fexact(i) = abs(x(i,1)) | ||
enddo | ||
|
||
! Evaluate the equation | ||
feval = f % evaluate( x ) | ||
IF( MAXVAL(ABS(feval-fexact)) <= epsilon(1.0_real32) )THEN | ||
r = 0 | ||
ELSE | ||
r = 1 | ||
ENDIF | ||
|
||
! Clean up memory | ||
CALL f % Destruct() | ||
|
||
END FUNCTION abs_r1fp32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
INTEGER FUNCTION abs_r1fp64() RESULT(r) | ||
USE FEQParse | ||
use iso_fortran_env | ||
IMPLICIT NONE | ||
integer, parameter :: N=1000 | ||
TYPE(EquationParser) :: f | ||
CHARACTER(LEN=1), DIMENSION(1:3) :: independentVars | ||
CHARACTER(LEN=30) :: eqChar | ||
REAL(real64) :: x(1:N,1:3) | ||
REAL(real64) :: feval(1:N) | ||
REAL(real64) :: fexact(1:N) | ||
integer :: i | ||
|
||
! Specify the independent variables | ||
independentVars = (/ 'x', 'y', 'z' /) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \abs( x )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar, independentVars) | ||
|
||
x = 0.0_real64 | ||
do i = 1,N | ||
x(i,1) = -1.0_real64 + (2.0_real64)/REAL(N,real64)*REAL(i-1,real64) | ||
fexact(i) = abs(x(i,1)) | ||
enddo | ||
|
||
! Evaluate the equation | ||
feval = f % evaluate( x ) | ||
IF( MAXVAL(ABS(feval-fexact)) <= epsilon(1.0) )THEN | ||
r = 0 | ||
ELSE | ||
r = 1 | ||
ENDIF | ||
|
||
! Clean up memory | ||
CALL f % Destruct() | ||
|
||
END FUNCTION abs_r1fp64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
INTEGER FUNCTION abs_sfp32() RESULT(r) | ||
USE FEQParse | ||
use iso_fortran_env | ||
IMPLICIT NONE | ||
integer, parameter :: N=1000 | ||
TYPE(EquationParser) :: f | ||
CHARACTER(LEN=1), DIMENSION(1:3) :: independentVars | ||
CHARACTER(LEN=30) :: eqChar | ||
REAL(real32) :: x(1:3) | ||
REAL(real32) :: feval | ||
REAL(real32) :: fexact | ||
integer :: i | ||
|
||
! Specify the independent variables | ||
independentVars = (/ 'x', 'y', 'z' /) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \abs( x )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar, independentVars) | ||
|
||
x = 0.0_real32 | ||
fexact = abs(x(1)) | ||
|
||
! Evaluate the equation | ||
feval = f % evaluate( x ) | ||
IF( (ABS(feval-fexact)) <= epsilon(1.0_real32) )THEN | ||
r = 0 | ||
ELSE | ||
r = 1 | ||
ENDIF | ||
|
||
! Clean up memory | ||
CALL f % Destruct() | ||
|
||
END FUNCTION abs_sfp32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
INTEGER FUNCTION abs_sfp64() RESULT(r) | ||
USE FEQParse | ||
use iso_fortran_env | ||
IMPLICIT NONE | ||
integer, parameter :: N=1000 | ||
TYPE(EquationParser) :: f | ||
CHARACTER(LEN=1), DIMENSION(1:3) :: independentVars | ||
CHARACTER(LEN=30) :: eqChar | ||
REAL(real64) :: x(1:3) | ||
REAL(real64) :: feval | ||
REAL(real64) :: fexact | ||
integer :: i | ||
|
||
! Specify the independent variables | ||
independentVars = (/ 'x', 'y', 'z' /) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \abs( x )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar, independentVars) | ||
|
||
x = 0.0_real64 | ||
fexact = abs(x(1)) | ||
|
||
! Evaluate the equation | ||
feval = f % evaluate( x ) | ||
IF( (ABS(feval-fexact)) <= epsilon(1.0_real64) )THEN | ||
r = 0 | ||
ELSE | ||
r = 1 | ||
ENDIF | ||
|
||
! Clean up memory | ||
CALL f % Destruct() | ||
|
||
END FUNCTION abs_sfp64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
INTEGER FUNCTION acos_r1fp32() RESULT(r) | ||
USE FEQParse | ||
use iso_fortran_env | ||
IMPLICIT NONE | ||
integer, parameter :: N=1000 | ||
TYPE(EquationParser) :: f | ||
CHARACTER(LEN=1), DIMENSION(1:3) :: independentVars | ||
CHARACTER(LEN=30) :: eqChar | ||
REAL(real32) :: x(1:N,1:3) | ||
REAL(real32) :: feval(1:N) | ||
REAL(real32) :: fexact(1:N) | ||
integer :: i | ||
|
||
! Specify the independent variables | ||
independentVars = (/ 'x', 'y', 'z' /) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \acos( x )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar, independentVars) | ||
|
||
x = 0.0_real32 | ||
do i = 1,N | ||
x(i,1) = -1.0_real32 + (2.0_real32)/REAL(N,real32)*REAL(i-1,real32) | ||
fexact(i) = acos(x(i,1)) | ||
enddo | ||
|
||
! Evaluate the equation | ||
feval = f % evaluate( x ) | ||
IF( MAXVAL(ABS(feval-fexact)) <= epsilon(1.0_real32) )THEN | ||
r = 0 | ||
ELSE | ||
r = 1 | ||
ENDIF | ||
|
||
! Clean up memory | ||
CALL f % Destruct() | ||
|
||
END FUNCTION acos_r1fp32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
INTEGER FUNCTION acos_r1fp64() RESULT(r) | ||
USE FEQParse | ||
use iso_fortran_env | ||
IMPLICIT NONE | ||
integer, parameter :: N=1000 | ||
TYPE(EquationParser) :: f | ||
CHARACTER(LEN=1), DIMENSION(1:3) :: independentVars | ||
CHARACTER(LEN=30) :: eqChar | ||
REAL(real64) :: x(1:N,1:3) | ||
REAL(real64) :: feval(1:N) | ||
REAL(real64) :: fexact(1:N) | ||
integer :: i | ||
|
||
! Specify the independent variables | ||
independentVars = (/ 'x', 'y', 'z' /) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \acos( x )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar, independentVars) | ||
|
||
x = 0.0_real64 | ||
do i = 1,N | ||
x(i,1) = -1.0_real64 + (2.0_real64)/REAL(N,real64)*REAL(i-1,real64) | ||
fexact(i) = acos(x(i,1)) | ||
enddo | ||
|
||
! Evaluate the equation | ||
feval = f % evaluate( x ) | ||
IF( MAXVAL(ABS(feval-fexact)) <= epsilon(1.0) )THEN | ||
r = 0 | ||
ELSE | ||
r = 1 | ||
ENDIF | ||
|
||
! Clean up memory | ||
CALL f % Destruct() | ||
|
||
END FUNCTION acos_r1fp64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
INTEGER FUNCTION acos_sfp32() RESULT(r) | ||
USE FEQParse | ||
use iso_fortran_env | ||
IMPLICIT NONE | ||
integer, parameter :: N=1000 | ||
TYPE(EquationParser) :: f | ||
CHARACTER(LEN=1), DIMENSION(1:3) :: independentVars | ||
CHARACTER(LEN=30) :: eqChar | ||
REAL(real32) :: x(1:3) | ||
REAL(real32) :: feval | ||
REAL(real32) :: fexact | ||
integer :: i | ||
|
||
! Specify the independent variables | ||
independentVars = (/ 'x', 'y', 'z' /) | ||
|
||
! Specify an equation string that we want to evaluate | ||
eqChar = 'f = \acos( x )' | ||
|
||
! Create the EquationParser object | ||
f = EquationParser(eqChar, independentVars) | ||
|
||
x = 0.0_real32 | ||
fexact = acos(x(1)) | ||
|
||
! Evaluate the equation | ||
feval = f % evaluate( x ) | ||
IF( (ABS(feval-fexact)) <= epsilon(1.0_real32) )THEN | ||
r = 0 | ||
ELSE | ||
r = 1 | ||
ENDIF | ||
|
||
! Clean up memory | ||
CALL f % Destruct() | ||
|
||
END FUNCTION acos_sfp32 |
Oops, something went wrong.