real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
code = c0 * sqrt((a / (v * l)))
end function
↓
real(8) function code(c0, a, v, l)
real(8), intent (in) :: c0
real(8), intent (in) :: a
real(8), intent (in) :: v
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = c0 * sqrt((a / (v * l)))
if (t_0 <= (-1d-228)) then
tmp = t_0
else if (t_0 <= 5d-192) then
tmp = c0 * sqrt(((a / l) / v))
else if (t_0 <= 2d+215) then
tmp = t_0
else
tmp = c0 * sqrt(((a - (a - (a / v))) / l))
end if
code = tmp
end function
public static double code(double c0, double A, double V, double l) {
return c0 * Math.sqrt((A / (V * l)));
}
↓
public static double code(double c0, double A, double V, double l) {
double t_0 = c0 * Math.sqrt((A / (V * l)));
double tmp;
if (t_0 <= -1e-228) {
tmp = t_0;
} else if (t_0 <= 5e-192) {
tmp = c0 * Math.sqrt(((A / l) / V));
} else if (t_0 <= 2e+215) {
tmp = t_0;
} else {
tmp = c0 * Math.sqrt(((A - (A - (A / V))) / l));
}
return tmp;
}
def code(c0, A, V, l):
return c0 * math.sqrt((A / (V * l)))
if (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < -1.00000000000000003e-228 or 5.0000000000000001e-192 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 1.99999999999999981e215
Initial program 8.9
\[c0 \cdot \sqrt{\frac{A}{V \cdot \ell}}
\]
if -1.00000000000000003e-228 < (*.f64 c0 (sqrt.f64 (/.f64 A (*.f64 V l)))) < 5.0000000000000001e-192