(FPCore (i n)
:precision binary64
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n))))
↓
(FPCore (i n)
:precision binary64
(if (<= i -2.9e-6)
(* 100.0 (/ (- (exp i) 1.0) (/ i n)))
(if (<= i 7.2)
(+ (* i (- (* 50.0 n) 50.0)) (* 100.0 n))
(if (<= i 2.9e+258)
(* (/ (* (pow n 2.0) (- (log i) (log n))) i) 100.0)
(if (<= i 1.4e+298)
(* 100.0 (/ (- (pow (+ 1.0 (/ i n)) n) 1.0) (/ i n)))
(* 100.0 (/ i (/ i n))))))))
double code(double i, double n) {
return 100.0 * ((pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
↓
double code(double i, double n) {
double tmp;
if (i <= -2.9e-6) {
tmp = 100.0 * ((exp(i) - 1.0) / (i / n));
} else if (i <= 7.2) {
tmp = (i * ((50.0 * n) - 50.0)) + (100.0 * n);
} else if (i <= 2.9e+258) {
tmp = ((pow(n, 2.0) * (log(i) - log(n))) / i) * 100.0;
} else if (i <= 1.4e+298) {
tmp = 100.0 * ((pow((1.0 + (i / n)), n) - 1.0) / (i / n));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
code = 100.0d0 * ((((1.0d0 + (i / n)) ** n) - 1.0d0) / (i / n))
end function
↓
real(8) function code(i, n)
real(8), intent (in) :: i
real(8), intent (in) :: n
real(8) :: tmp
if (i <= (-2.9d-6)) then
tmp = 100.0d0 * ((exp(i) - 1.0d0) / (i / n))
else if (i <= 7.2d0) then
tmp = (i * ((50.0d0 * n) - 50.0d0)) + (100.0d0 * n)
else if (i <= 2.9d+258) then
tmp = (((n ** 2.0d0) * (log(i) - log(n))) / i) * 100.0d0
else if (i <= 1.4d+298) then
tmp = 100.0d0 * ((((1.0d0 + (i / n)) ** n) - 1.0d0) / (i / n))
else
tmp = 100.0d0 * (i / (i / n))
end if
code = tmp
end function
public static double code(double i, double n) {
return 100.0 * ((Math.pow((1.0 + (i / n)), n) - 1.0) / (i / n));
}
↓
public static double code(double i, double n) {
double tmp;
if (i <= -2.9e-6) {
tmp = 100.0 * ((Math.exp(i) - 1.0) / (i / n));
} else if (i <= 7.2) {
tmp = (i * ((50.0 * n) - 50.0)) + (100.0 * n);
} else if (i <= 2.9e+258) {
tmp = ((Math.pow(n, 2.0) * (Math.log(i) - Math.log(n))) / i) * 100.0;
} else if (i <= 1.4e+298) {
tmp = 100.0 * ((Math.pow((1.0 + (i / n)), n) - 1.0) / (i / n));
} else {
tmp = 100.0 * (i / (i / n));
}
return tmp;
}
def code(i, n):
return 100.0 * ((math.pow((1.0 + (i / n)), n) - 1.0) / (i / n))
↓
def code(i, n):
tmp = 0
if i <= -2.9e-6:
tmp = 100.0 * ((math.exp(i) - 1.0) / (i / n))
elif i <= 7.2:
tmp = (i * ((50.0 * n) - 50.0)) + (100.0 * n)
elif i <= 2.9e+258:
tmp = ((math.pow(n, 2.0) * (math.log(i) - math.log(n))) / i) * 100.0
elif i <= 1.4e+298:
tmp = 100.0 * ((math.pow((1.0 + (i / n)), n) - 1.0) / (i / n))
else:
tmp = 100.0 * (i / (i / n))
return tmp
function code(i, n)
return Float64(100.0 * Float64(Float64((Float64(1.0 + Float64(i / n)) ^ n) - 1.0) / Float64(i / n)))
end