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 -2.9 \cdot 10^{+58} \lor \neg \left(x \leq 5 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{\frac{1}{x}}{e^{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(e^{x}\right)}^{\log \left(\frac{x}{x + y}\right)}}{x}\\
\end{array}
\]
(FPCore (x y) :precision binary64 (/ (exp (* x (log (/ x (+ x y))))) x)) ↓
(FPCore (x y)
:precision binary64
(if (or (<= x -2.9e+58) (not (<= x 5e-8)))
(/ (/ 1.0 x) (exp y))
(/ (pow (exp x) (log (/ x (+ x 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 <= -2.9e+58) || !(x <= 5e-8)) {
tmp = (1.0 / x) / exp(y);
} else {
tmp = pow(exp(x), log((x / (x + 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 <= (-2.9d+58)) .or. (.not. (x <= 5d-8))) then
tmp = (1.0d0 / x) / exp(y)
else
tmp = (exp(x) ** log((x / (x + 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 <= -2.9e+58) || !(x <= 5e-8)) {
tmp = (1.0 / x) / Math.exp(y);
} else {
tmp = Math.pow(Math.exp(x), Math.log((x / (x + 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 <= -2.9e+58) or not (x <= 5e-8):
tmp = (1.0 / x) / math.exp(y)
else:
tmp = math.pow(math.exp(x), math.log((x / (x + 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 <= -2.9e+58) || !(x <= 5e-8))
tmp = Float64(Float64(1.0 / x) / exp(y));
else
tmp = Float64((exp(x) ^ log(Float64(x / Float64(x + 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 <= -2.9e+58) || ~((x <= 5e-8)))
tmp = (1.0 / x) / exp(y);
else
tmp = (exp(x) ^ log((x / (x + 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[Or[LessEqual[x, -2.9e+58], N[Not[LessEqual[x, 5e-8]], $MachinePrecision]], N[(N[(1.0 / x), $MachinePrecision] / N[Exp[y], $MachinePrecision]), $MachinePrecision], N[(N[Power[N[Exp[x], $MachinePrecision], N[Log[N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] / x), $MachinePrecision]]
\frac{e^{x \cdot \log \left(\frac{x}{x + y}\right)}}{x}
↓
\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+58} \lor \neg \left(x \leq 5 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{\frac{1}{x}}{e^{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(e^{x}\right)}^{\log \left(\frac{x}{x + y}\right)}}{x}\\
\end{array}
Alternatives Alternative 1 Accuracy 99.4% Cost 19977
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+58} \lor \neg \left(x \leq 5 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{\frac{1}{x}}{e^{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(e^{x}\right)}^{\log \left(\frac{x}{x + y}\right)}}{x}\\
\end{array}
\]
Alternative 2 Accuracy 99.3% Cost 6985
\[\begin{array}{l}
\mathbf{if}\;x \leq -17 \lor \neg \left(x \leq 5 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{\frac{1}{x}}{e^{y}}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\]
Alternative 3 Accuracy 99.3% Cost 6921
\[\begin{array}{l}
\mathbf{if}\;x \leq -17 \lor \neg \left(x \leq 5 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{e^{-y}}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{x}\\
\end{array}
\]
Alternative 4 Accuracy 82.2% Cost 712
\[\begin{array}{l}
\mathbf{if}\;x \leq -17:\\
\;\;\;\;\frac{\left(y + -1\right) \cdot \left(y + -1\right)}{x}\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+54}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1}{x \cdot y}\\
\end{array}
\]
Alternative 5 Accuracy 82.3% Cost 712
\[\begin{array}{l}
\mathbf{if}\;x \leq -17:\\
\;\;\;\;\frac{\frac{x - x \cdot y}{x}}{x}\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1}{x \cdot y}\\
\end{array}
\]
Alternative 6 Accuracy 78.1% Cost 580
\[\begin{array}{l}
\mathbf{if}\;x \leq 7.5 \cdot 10^{+54}:\\
\;\;\;\;\frac{1}{x}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{1}{x \cdot y}\\
\end{array}
\]
Alternative 7 Accuracy 4.2% Cost 192
\[y + y
\]
Alternative 8 Accuracy 74.4% Cost 192
\[\frac{1}{x}
\]
Alternative 9 Accuracy 2.9% Cost 128
\[-y
\]