Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+49}:\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{{\left(e^{x}\right)}^{\log \left(\frac{x}{x + y}\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}
\]
(FPCore (x y) :precision binary64 (/ (exp (* x (log (/ x (+ x y))))) x)) ↓
(FPCore (x y)
:precision binary64
(if (<= x -4e+49)
(/ 1.0 (* x (exp y)))
(if (<= x 4.2e-30)
(/ (pow (exp x) (log (/ x (+ x y)))) x)
(/ (exp (- y)) x)))) double code(double x, double y) {
return exp((x * log((x / (x + y))))) / x;
}
↓
double code(double x, double y) {
double tmp;
if (x <= -4e+49) {
tmp = 1.0 / (x * exp(y));
} else if (x <= 4.2e-30) {
tmp = pow(exp(x), log((x / (x + y)))) / x;
} else {
tmp = exp(-y) / x;
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = exp((x * log((x / (x + y))))) / x
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-4d+49)) then
tmp = 1.0d0 / (x * exp(y))
else if (x <= 4.2d-30) then
tmp = (exp(x) ** log((x / (x + y)))) / x
else
tmp = exp(-y) / x
end if
code = tmp
end function
public static double code(double x, double y) {
return Math.exp((x * Math.log((x / (x + y))))) / x;
}
↓
public static double code(double x, double y) {
double tmp;
if (x <= -4e+49) {
tmp = 1.0 / (x * Math.exp(y));
} else if (x <= 4.2e-30) {
tmp = Math.pow(Math.exp(x), Math.log((x / (x + y)))) / x;
} else {
tmp = Math.exp(-y) / x;
}
return tmp;
}
def code(x, y):
return math.exp((x * math.log((x / (x + y))))) / x
↓
def code(x, y):
tmp = 0
if x <= -4e+49:
tmp = 1.0 / (x * math.exp(y))
elif x <= 4.2e-30:
tmp = math.pow(math.exp(x), math.log((x / (x + y)))) / x
else:
tmp = math.exp(-y) / x
return tmp
function code(x, y)
return Float64(exp(Float64(x * log(Float64(x / Float64(x + y))))) / x)
end
↓
function code(x, y)
tmp = 0.0
if (x <= -4e+49)
tmp = Float64(1.0 / Float64(x * exp(y)));
elseif (x <= 4.2e-30)
tmp = Float64((exp(x) ^ log(Float64(x / Float64(x + y)))) / x);
else
tmp = Float64(exp(Float64(-y)) / x);
end
return tmp
end
function tmp = code(x, y)
tmp = exp((x * log((x / (x + y))))) / x;
end
↓
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -4e+49)
tmp = 1.0 / (x * exp(y));
elseif (x <= 4.2e-30)
tmp = (exp(x) ^ log((x / (x + y)))) / x;
else
tmp = exp(-y) / x;
end
tmp_2 = tmp;
end
code[x_, y_] := N[(N[Exp[N[(x * N[Log[N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]
↓
code[x_, y_] := If[LessEqual[x, -4e+49], N[(1.0 / N[(x * N[Exp[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e-30], N[(N[Power[N[Exp[x], $MachinePrecision], N[Log[N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision], N[(N[Exp[(-y)], $MachinePrecision] / x), $MachinePrecision]]]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
↓
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+49}:\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{{\left(e^{x}\right)}^{\log \left(\frac{x}{x + y}\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}
Alternatives Alternative 1 Accuracy 99.1% Cost 19976
\[\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+49}:\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{{\left(e^{x}\right)}^{\log \left(\frac{x}{x + y}\right)}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}
\]
Alternative 2 Accuracy 98.5% Cost 6921
\[\begin{array}{l}
\mathbf{if}\;x \leq -480000000000 \lor \neg \left(x \leq 4.2 \cdot 10^{-30}\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\]
Alternative 3 Accuracy 98.5% Cost 6920
\[\begin{array}{l}
\mathbf{if}\;x \leq -480000000000:\\
\;\;\;\;\frac{1}{x \cdot e^{y}}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-30}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-y}}{x}\\
\end{array}
\]
Alternative 4 Accuracy 77.5% Cost 836
\[\begin{array}{l}
\mathbf{if}\;x \leq -540000000000:\\
\;\;\;\;\frac{1 - y \cdot y}{x \cdot \left(y + 1\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\]
Alternative 5 Accuracy 79.8% Cost 708
\[\begin{array}{l}
\mathbf{if}\;x \leq -480000000000:\\
\;\;\;\;\frac{\frac{x - x \cdot y}{x}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\]
Alternative 6 Accuracy 77.4% Cost 584
\[\begin{array}{l}
\mathbf{if}\;y \leq 2.6 \cdot 10^{+14}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+211}:\\
\;\;\;\;\frac{x}{x \cdot x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\]
Alternative 7 Accuracy 75.8% Cost 192
\[\frac{1}{x}
\]