Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{x \cdot \left(\frac{x}{y} + 1\right)}{x + 1}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;x \leq -2954784032016266:\\
\;\;\;\;1 + \frac{x + -1}{y}\\
\mathbf{elif}\;x \leq 8766795.636704825:\\
\;\;\;\;\frac{x + x \cdot \frac{x}{y}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y}\\
\end{array}
\]
(FPCore (x y) :precision binary64 (/ (* x (+ (/ x y) 1.0)) (+ x 1.0))) ↓
(FPCore (x y)
:precision binary64
(if (<= x -2954784032016266.0)
(+ 1.0 (/ (+ x -1.0) y))
(if (<= x 8766795.636704825)
(/ (+ x (* x (/ x y))) (+ x 1.0))
(+ 1.0 (/ x y))))) double code(double x, double y) {
return (x * ((x / y) + 1.0)) / (x + 1.0);
}
↓
double code(double x, double y) {
double tmp;
if (x <= -2954784032016266.0) {
tmp = 1.0 + ((x + -1.0) / y);
} else if (x <= 8766795.636704825) {
tmp = (x + (x * (x / y))) / (x + 1.0);
} else {
tmp = 1.0 + (x / y);
}
return tmp;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * ((x / y) + 1.0d0)) / (x + 1.0d0)
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: tmp
if (x <= (-2954784032016266.0d0)) then
tmp = 1.0d0 + ((x + (-1.0d0)) / y)
else if (x <= 8766795.636704825d0) then
tmp = (x + (x * (x / y))) / (x + 1.0d0)
else
tmp = 1.0d0 + (x / y)
end if
code = tmp
end function
public static double code(double x, double y) {
return (x * ((x / y) + 1.0)) / (x + 1.0);
}
↓
public static double code(double x, double y) {
double tmp;
if (x <= -2954784032016266.0) {
tmp = 1.0 + ((x + -1.0) / y);
} else if (x <= 8766795.636704825) {
tmp = (x + (x * (x / y))) / (x + 1.0);
} else {
tmp = 1.0 + (x / y);
}
return tmp;
}
def code(x, y):
return (x * ((x / y) + 1.0)) / (x + 1.0)
↓
def code(x, y):
tmp = 0
if x <= -2954784032016266.0:
tmp = 1.0 + ((x + -1.0) / y)
elif x <= 8766795.636704825:
tmp = (x + (x * (x / y))) / (x + 1.0)
else:
tmp = 1.0 + (x / y)
return tmp
function code(x, y)
return Float64(Float64(x * Float64(Float64(x / y) + 1.0)) / Float64(x + 1.0))
end
↓
function code(x, y)
tmp = 0.0
if (x <= -2954784032016266.0)
tmp = Float64(1.0 + Float64(Float64(x + -1.0) / y));
elseif (x <= 8766795.636704825)
tmp = Float64(Float64(x + Float64(x * Float64(x / y))) / Float64(x + 1.0));
else
tmp = Float64(1.0 + Float64(x / y));
end
return tmp
end
function tmp = code(x, y)
tmp = (x * ((x / y) + 1.0)) / (x + 1.0);
end
↓
function tmp_2 = code(x, y)
tmp = 0.0;
if (x <= -2954784032016266.0)
tmp = 1.0 + ((x + -1.0) / y);
elseif (x <= 8766795.636704825)
tmp = (x + (x * (x / y))) / (x + 1.0);
else
tmp = 1.0 + (x / y);
end
tmp_2 = tmp;
end
code[x_, y_] := N[(N[(x * N[(N[(x / y), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := If[LessEqual[x, -2954784032016266.0], N[(1.0 + N[(N[(x + -1.0), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8766795.636704825], N[(N[(x + N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 + N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\frac{x \cdot \left(\frac{x}{y} + 1\right)}{x + 1}
↓
\begin{array}{l}
\mathbf{if}\;x \leq -2954784032016266:\\
\;\;\;\;1 + \frac{x + -1}{y}\\
\mathbf{elif}\;x \leq 8766795.636704825:\\
\;\;\;\;\frac{x + x \cdot \frac{x}{y}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y}\\
\end{array}
Alternatives Alternative 1 Error 0.1 Cost 968
\[\begin{array}{l}
\mathbf{if}\;x \leq -2954784032016266:\\
\;\;\;\;1 + \frac{x + -1}{y}\\
\mathbf{elif}\;x \leq 43834224986894050:\\
\;\;\;\;\frac{x + \frac{x}{\frac{y}{x}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y}\\
\end{array}
\]
Alternative 2 Error 1.7 Cost 840
\[\begin{array}{l}
t_0 := 1 + \frac{x + -1}{y}\\
\mathbf{if}\;x \leq -391764256296.16785:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 0.0018699366583554077:\\
\;\;\;\;x + x \cdot \left(\frac{x}{y} - x\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 3 Error 20.0 Cost 720
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+134}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;x \leq -2.302593520506833 \cdot 10^{+22}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq -391764256296.16785:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;x \leq 7.234194828708834 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\]
Alternative 4 Error 0.1 Cost 704
\[\frac{x}{x + 1} \cdot \left(1 + \frac{x}{y}\right)
\]
Alternative 5 Error 10.5 Cost 584
\[\begin{array}{l}
t_0 := 1 + \frac{x}{y}\\
\mathbf{if}\;x \leq -391764256296.16785:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 7.234194828708834 \cdot 10^{-6}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 6 Error 9.7 Cost 584
\[\begin{array}{l}
t_0 := 1 + \frac{x}{y}\\
\mathbf{if}\;x \leq -391764256296.16785:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 8766795.636704825:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 7 Error 9.7 Cost 584
\[\begin{array}{l}
\mathbf{if}\;x \leq -391764256296.16785:\\
\;\;\;\;1 + \frac{x + -1}{y}\\
\mathbf{elif}\;x \leq 8766795.636704825:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{x}{y}\\
\end{array}
\]
Alternative 8 Error 28.2 Cost 328
\[\begin{array}{l}
\mathbf{if}\;x \leq -243963859682639.4:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 0.0018699366583554077:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 9 Error 53.5 Cost 64
\[1
\]