Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{\cosh x \cdot \frac{y}{x}}{z}
\]
↓
\[\begin{array}{l}
t_0 := \frac{y}{z} \cdot \left(x \cdot 0.5 + \frac{1}{x}\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 10^{-20}:\\
\;\;\;\;\frac{\frac{\cosh x}{\frac{x}{y}}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
(FPCore (x y z) :precision binary64 (/ (* (cosh x) (/ y x)) z)) ↓
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* (/ y z) (+ (* x 0.5) (/ 1.0 x)))))
(if (<= y -1e-15) t_0 (if (<= y 1e-20) (/ (/ (cosh x) (/ x y)) z) t_0)))) double code(double x, double y, double z) {
return (cosh(x) * (y / x)) / z;
}
↓
double code(double x, double y, double z) {
double t_0 = (y / z) * ((x * 0.5) + (1.0 / x));
double tmp;
if (y <= -1e-15) {
tmp = t_0;
} else if (y <= 1e-20) {
tmp = (cosh(x) / (x / y)) / z;
} else {
tmp = t_0;
}
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 = (cosh(x) * (y / x)) / 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) :: t_0
real(8) :: tmp
t_0 = (y / z) * ((x * 0.5d0) + (1.0d0 / x))
if (y <= (-1d-15)) then
tmp = t_0
else if (y <= 1d-20) then
tmp = (cosh(x) / (x / y)) / z
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return (Math.cosh(x) * (y / x)) / z;
}
↓
public static double code(double x, double y, double z) {
double t_0 = (y / z) * ((x * 0.5) + (1.0 / x));
double tmp;
if (y <= -1e-15) {
tmp = t_0;
} else if (y <= 1e-20) {
tmp = (Math.cosh(x) / (x / y)) / z;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z):
return (math.cosh(x) * (y / x)) / z
↓
def code(x, y, z):
t_0 = (y / z) * ((x * 0.5) + (1.0 / x))
tmp = 0
if y <= -1e-15:
tmp = t_0
elif y <= 1e-20:
tmp = (math.cosh(x) / (x / y)) / z
else:
tmp = t_0
return tmp
function code(x, y, z)
return Float64(Float64(cosh(x) * Float64(y / x)) / z)
end
↓
function code(x, y, z)
t_0 = Float64(Float64(y / z) * Float64(Float64(x * 0.5) + Float64(1.0 / x)))
tmp = 0.0
if (y <= -1e-15)
tmp = t_0;
elseif (y <= 1e-20)
tmp = Float64(Float64(cosh(x) / Float64(x / y)) / z);
else
tmp = t_0;
end
return tmp
end
function tmp = code(x, y, z)
tmp = (cosh(x) * (y / x)) / z;
end
↓
function tmp_2 = code(x, y, z)
t_0 = (y / z) * ((x * 0.5) + (1.0 / x));
tmp = 0.0;
if (y <= -1e-15)
tmp = t_0;
elseif (y <= 1e-20)
tmp = (cosh(x) / (x / y)) / z;
else
tmp = t_0;
end
tmp_2 = tmp;
end
code[x_, y_, z_] := N[(N[(N[Cosh[x], $MachinePrecision] * N[(y / x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
↓
code[x_, y_, z_] := Block[{t$95$0 = N[(N[(y / z), $MachinePrecision] * N[(N[(x * 0.5), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1e-15], t$95$0, If[LessEqual[y, 1e-20], N[(N[(N[Cosh[x], $MachinePrecision] / N[(x / y), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision], t$95$0]]]
\frac{\cosh x \cdot \frac{y}{x}}{z}
↓
\begin{array}{l}
t_0 := \frac{y}{z} \cdot \left(x \cdot 0.5 + \frac{1}{x}\right)\\
\mathbf{if}\;y \leq -1 \cdot 10^{-15}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 10^{-20}:\\
\;\;\;\;\frac{\frac{\cosh x}{\frac{x}{y}}}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}