double code(double x, double y, double z) {
double tmp;
if (x <= -8e-168) {
tmp = x + (x * (y / z));
} else if (x <= 0.00016) {
tmp = x + (y * (x / z));
} else {
tmp = x / (z / (y + z));
}
return tmp;
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * (y + z)) / z
end function
↓
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (x <= (-8d-168)) then
tmp = x + (x * (y / z))
else if (x <= 0.00016d0) then
tmp = x + (y * (x / z))
else
tmp = x / (z / (y + z))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return (x * (y + z)) / z;
}
↓
public static double code(double x, double y, double z) {
double tmp;
if (x <= -8e-168) {
tmp = x + (x * (y / z));
} else if (x <= 0.00016) {
tmp = x + (y * (x / z));
} else {
tmp = x / (z / (y + z));
}
return tmp;
}
def code(x, y, z):
return (x * (y + z)) / z
↓
def code(x, y, z):
tmp = 0
if x <= -8e-168:
tmp = x + (x * (y / z))
elif x <= 0.00016:
tmp = x + (y * (x / z))
else:
tmp = x / (z / (y + z))
return tmp
function code(x, y, z)
return Float64(Float64(x * Float64(y + z)) / z)
end
↓
function code(x, y, z)
tmp = 0.0
if (x <= -8e-168)
tmp = Float64(x + Float64(x * Float64(y / z)));
elseif (x <= 0.00016)
tmp = Float64(x + Float64(y * Float64(x / z)));
else
tmp = Float64(x / Float64(z / Float64(y + z)));
end
return tmp
end
function tmp = code(x, y, z)
tmp = (x * (y + z)) / z;
end
↓
function tmp_2 = code(x, y, z)
tmp = 0.0;
if (x <= -8e-168)
tmp = x + (x * (y / z));
elseif (x <= 0.00016)
tmp = x + (y * (x / z));
else
tmp = x / (z / (y + z));
end
tmp_2 = tmp;
end
herbie shell --seed 2023088
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))