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 83.2% Cost 13452
\[\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \sqrt[3]{{y}^{6} \cdot 0.004629629629629629}\\
\mathbf{if}\;y \leq -1 \cdot 10^{+55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+54}:\\
\;\;\;\;\cos x \cdot \left(1 + t_0\right)\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{+101}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+133}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(-0.08333333333333333, y \cdot \left(x \cdot x\right), y \cdot 0.16666666666666666\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;\left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_0}\\
\mathbf{else}:\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot \left(\cos x \cdot y\right)\right)\\
\end{array}
\]
Alternative 3 Accuracy 84.3% Cost 7508
\[\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot \left(\cos x \cdot y\right)\right)\\
t_1 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - 0.16666666666666666 \cdot \left(y \cdot y\right)}\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -270000000000:\\
\;\;\;\;y \cdot \left(-0.08333333333333333 \cdot \left(y \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{+30}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 4 Accuracy 84.7% Cost 7508
\[\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot \left(\cos x \cdot y\right)\right)\\
t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{+85}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -150000000000:\\
\;\;\;\;y \cdot \left(-0.08333333333333333 \cdot \left(y \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+60}:\\
\;\;\;\;\cos x \cdot \left(1 + t_1\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Accuracy 84.7% Cost 7508
\[\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot \left(\cos x \cdot y\right)\right)\\
t_1 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_1}\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{+85}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -270000000000:\\
\;\;\;\;y \cdot \mathsf{fma}\left(-0.08333333333333333, y \cdot \left(x \cdot x\right), y \cdot 0.16666666666666666\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+60}:\\
\;\;\;\;\cos x \cdot \left(1 + t_1\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 6 Accuracy 78.4% Cost 6992
\[\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_0}\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq -180000000000:\\
\;\;\;\;y \cdot \left(-0.08333333333333333 \cdot \left(y \cdot \left(x \cdot x\right)\right)\right)\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+30}:\\
\;\;\;\;\cos x\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 7 Accuracy 55.1% Cost 2136
\[\begin{array}{l}
t_0 := 0.16666666666666666 \cdot \left(y \cdot y\right)\\
t_1 := y \cdot \left(-0.08333333333333333 \cdot \left(y \cdot \left(x \cdot x\right)\right)\right)\\
t_2 := \left(1 - \left(y \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot 0.027777777777777776\right)\right) \cdot \frac{1}{1 - t_0}\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+154}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{+85}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq -210000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{+101}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+133}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+154}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 8 Accuracy 48.1% Cost 708
\[\begin{array}{l}
\mathbf{if}\;x \leq 3.9 \cdot 10^{+118}:\\
\;\;\;\;1 + 0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-0.08333333333333333 \cdot \left(y \cdot \left(x \cdot x\right)\right)\right)\\
\end{array}
\]
Alternative 9 Accuracy 47.0% Cost 585
\[\begin{array}{l}
\mathbf{if}\;y \leq -9.2 \cdot 10^{-7} \lor \neg \left(y \leq 235000000000\right):\\
\;\;\;\;0.16666666666666666 \cdot \left(y \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 10 Accuracy 47.2% Cost 448
\[1 + 0.16666666666666666 \cdot \left(y \cdot y\right)
\]
Alternative 11 Accuracy 28.5% Cost 64
\[1
\]