From 53796fce7a6ea194981bb9165b22df95b5724eb7 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Sun, 8 May 2022 19:57:25 +0200 Subject: [PATCH] trustworthy reference --- src/polynomials.f90 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/polynomials.f90 b/src/polynomials.f90 index 46e338b19..c883528ca 100644 --- a/src/polynomials.f90 +++ b/src/polynomials.f90 @@ -94,6 +94,7 @@ end function polynomial_from_dict !-------------------------------------------------------------------------------------------------- !> @brief Evaluate a Polynomial. +!> @details https://nvlpubs.nist.gov/nistpubs/jres/71b/jresv71bn1p11_a1b.pdf (eq. 1.2) !-------------------------------------------------------------------------------------------------- pure function eval(self,x) result(y) @@ -101,15 +102,15 @@ pure function eval(self,x) result(y) real(pReal), intent(in) :: x real(pReal) :: y - integer :: i + integer :: o y = self%coef(ubound(self%coef,1)) - do i = ubound(self%coef,1)-1, 0, -1 + do o = ubound(self%coef,1)-1, 0, -1 #ifndef __INTEL_LLVM_COMPILER - y = y*(x-self%x_ref) +self%coef(i) + y = y*(x-self%x_ref) +self%coef(o) #else - y = IEEE_FMA(y,x-self%x_ref,self%coef(i)) + y = IEEE_FMA(y,x-self%x_ref,self%coef(o)) #endif enddo