autoDiffExponential.f90 Source File

This File Depends On

sourcefile~~autodiffexponential.f90~~EfferentGraph sourcefile~autodiffexponential.f90 autoDiffExponential.f90 sourcefile~kinds.f90 kinds.f90 sourcefile~kinds.f90->sourcefile~autodiffexponential.f90 sourcefile~autodifftype.f90 autoDiffType.f90 sourcefile~kinds.f90->sourcefile~autodifftype.f90 sourcefile~autodifftype.f90->sourcefile~autodiffexponential.f90
Help

Files Dependent On This One

sourcefile~~autodiffexponential.f90~~AfferentGraph sourcefile~autodiffexponential.f90 autoDiffExponential.f90 sourcefile~autodiff.f90 autoDiff.f90 sourcefile~autodiffexponential.f90->sourcefile~autodiff.f90 sourcefile~testautodiff.f90 testAutoDiff.f90 sourcefile~autodiff.f90->sourcefile~testautodiff.f90
Help


Source Code

 module autoDiffExponential_mod
	!! @todo
	!! Add cosh and sinh
	use kinds_mod
	use autoDiffType_mod
	implicit none
	private
	
	! Exponential
	interface exp
		module procedure exp_a
	end interface
	public::exp
	
	! Logarithm
	interface log
		module procedure log_a
	end interface
	public::log
	
	interface log10
		module procedure log10_a
	end interface
	public::log10
	
contains

	!===============!
	!= Exponential =!
	!===============!

	elemental function exp_a(u) result(o)
		type(ad_t),intent(in)::u
		type(ad_t)::o
		
		o = ad_t( exp(u%val()) , exp(u%val())*u%grad() )
	end function exp_a

	!=============!
	!= Logarithm =!
	!=============!

	elemental function log_a(u) result(o)
		type(ad_t),intent(in)::u
		type(ad_t)::o
		
		o = ad_t( log(u%val()) , u%grad()/u%val() )
	end function log_a

	elemental function log10_a(u) result(o)
		type(ad_t),intent(in)::u
		type(ad_t)::o
		
		o = ad_t( log(u%val())/log10(E) , (u%grad()/u%val())/log10(E) )
	end function log10_a

end module autoDiffExponential_mod