Simulated optics experiment/Data analysis: Difference between revisions

(Added Ratfor.)
Line 1,337:
 
Ratfor itself is a mix of Fortran syntax and C syntax. It was once, in a sense, the "Unix dialect of FORTRAN". (It was expanded into "Extended Fortran Language" but I do not remember what that added. I encountered EFL in System V Release 3.)
 
This program does the analysis in what might be the most efficient way possible. It uses very small constant space.
 
<syntaxhighlight lang="ratfor">
Line 1,492 ⟶ 1,494:
end
</syntaxhighlight>
 
{{out}}
Outputs may look different, due to implementation-dependent behavior of formatted output.
 
Here is output after compiling with gfortran:
<pre>
 
light pulse events 100000
 
correlation coefs
0.0° 22.5° -0.707806
0.0° 67.5° +0.705415
45.0° 22.5° +0.712377
45.0° 67.5° +0.718882
 
CHSH contrast +2.844480
2*sqrt(2) = nominal +2.828427
difference +0.016053
 
CHSH violation +0.844480
 
</pre>
But here is output after compiling with f2c:
<pre>
 
light pulse events 100000
 
correlation coefs
.0° 22.5° -.707806
.0° 67.5° +.705415
45.0° 22.5° +.712377
45.0° 67.5° +.718882
 
CHSH contrast +2.844480
2*sqrt(2) = nominal +2.828427
difference +.016053
 
CHSH violation +.844480
 
</pre>
Getting f2c formatted output to print what I would prefer to see is not worth my effort. Probably, if one is using f2c, it is better simply to remove the "SP" that add + signs ahead of numbers.
 
=={{header|Wren}}==
1,448

edits