Skip to content

Dot2 product with error free transformation (EFT) in Fortran 90

Notifications You must be signed in to change notification settings

yanxchen/eftdotf90

Repository files navigation

EFT Dot Fortran

Files:

  • eftdot.f90: EFT dot source file
  • test*.f90: example to call dot2
  • test*.py, test*.gp: borrowed from libeft, for automatic testing

Usage:

# compile lib and mod
$ make
# run testing and plot for single
$ make test_s
# run testing and plot for double
$ make test_d

Non-installation usage:

Codes in eftdot.f90 can be directly copied and used anywhere.

An example to call dot2_s for calculating dot product in single precision while emulating double precision:

    integer, parameter :: n = 3
    ! single precision
    real(kind=sp) :: x(n), y(n), result
    
    x = [1.0_sp, 2.0_sp, 3.0_sp]
    y = [4.0_sp, 5.0_sp, 6.0_sp]
    
    ! calculate dot product using dot2_s
    call dot2_s(x, y, n, result)

About

Dot2 product with error free transformation (EFT) in Fortran 90

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published