Nrel Code running on Arduino mega

Dear all,

I am trying to run below code on arduino MEGA & MPIDE 0023 version of IDE. for programming.
I am looking for formula to calculate sun elevation angle from below data .I have download into excel sheet by providing required latitude and longitude in to solar calculator

Solar calculator:
https://www.nrel.gov/midc/solpos/solpos.html

If some one can help me to run below code. I know that there some code like heliostat available for arduino platform which working properly without any problem. The below code gives us accuracy about +/- 0.0003 . I am using
Question are:
How to calculate Elevation Angle from zenith and azimuth angle.
what is refer Top. azimuth angle (westward from S) & Top. azimuth angle (eastward from N) from image
What is converted elevation formula to determine elevation angle from east to west.[/li][/list]

test1_pde.zip (12.6 KB)

I run the code on Visual studio. The result i am getting totally different . Is there any way where i can include double precion floating point library.
I have two boards arduino mega and chipkit Uno32. For chipkit uno 32 the result almost equal and i found in both controller result of zenith and azimuth is constant. Where when run on Visual studio Show different as expecting one.

Here i am attaching output file from chipkit uno32 run on MPIDE ide and visualstudio c++. I also run on mplab IDE . the result is same as Visual studio.
I know that they are running on Double precision floating library and not directly run on controller.I would like to know if i want to run the program exactly what i need to do

visual-ss-result.JPG