Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\cos x \cdot \frac{\sinh y}{y}
\]
↓
\[\cos x \cdot \frac{\sinh y}{y}
\]
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y))) ↓
(FPCore (x y) :precision binary64 (* (cos x) (/ (sinh y) y))) double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
↓
double code(double x, double y) {
return cos(x) * (sinh(y) / y);
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = cos(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
↓
public static double code(double x, double y) {
return Math.cos(x) * (Math.sinh(y) / y);
}
def code(x, y):
return math.cos(x) * (math.sinh(y) / y)
↓
def code(x, y):
return math.cos(x) * (math.sinh(y) / y)
function code(x, y)
return Float64(cos(x) * Float64(sinh(y) / y))
end
↓
function code(x, y)
return Float64(cos(x) * Float64(sinh(y) / y))
end
function tmp = code(x, y)
tmp = cos(x) * (sinh(y) / y);
end
↓
function tmp = code(x, y)
tmp = cos(x) * (sinh(y) / y);
end
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := N[(N[Cos[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\cos x \cdot \frac{\sinh y}{y}
↓
\cos x \cdot \frac{\sinh y}{y}
Alternatives Alternative 1 Accuracy 100.0% Cost 13120
\[\cos x \cdot \frac{\sinh y}{y}
\]
Alternative 2 Accuracy 84.9% Cost 7376
\[\begin{array}{l}
t_0 := y \cdot \left(0.16666666666666666 \cdot \left(\cos x \cdot y\right)\right)\\
t_1 := \frac{1}{\frac{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}{1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)}}\\
\mathbf{if}\;y \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.1 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+68}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 3 Accuracy 85.2% Cost 7376
\[\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := y \cdot \left(0.16666666666666666 \cdot \left(\cos x \cdot y\right)\right)\\
t_2 := \frac{1}{\frac{1 - t_0}{1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)}}\\
\mathbf{if}\;y \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{+44}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+73}:\\
\;\;\;\;\cos x \cdot \left(1 + t_0\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 4 Accuracy 78.9% Cost 6860
\[\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \frac{1}{\frac{1 - t_0}{1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)}}\\
\mathbf{if}\;y \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.12 \cdot 10^{+44}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+66}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;1 + t_0\\
\end{array}
\]
Alternative 5 Accuracy 56.2% Cost 1608
\[\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{if}\;y \leq -1.32 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+154}:\\
\;\;\;\;\frac{1}{\frac{1 - t_0}{1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)}}\\
\mathbf{else}:\\
\;\;\;\;1 + t_0\\
\end{array}
\]
Alternative 6 Accuracy 47.1% Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \lor \neg \left(y \leq 2.5\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 7 Accuracy 47.2% Cost 448
\[1 + 0.16666666666666666 \cdot \left(y \cdot y\right)
\]
Alternative 8 Accuracy 29.2% Cost 64
\[1
\]