Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\frac{x - y}{x + y}
\]
↓
\[\frac{x}{x + y} + \frac{-1}{\frac{x + y}{y}}
\]
(FPCore (x y) :precision binary64 (/ (- x y) (+ x y))) ↓
(FPCore (x y) :precision binary64 (+ (/ x (+ x y)) (/ -1.0 (/ (+ x y) y)))) double code(double x, double y) {
return (x - y) / (x + y);
}
↓
double code(double x, double y) {
return (x / (x + y)) + (-1.0 / ((x + y) / y));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / (x + y)
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x / (x + y)) + ((-1.0d0) / ((x + y) / y))
end function
public static double code(double x, double y) {
return (x - y) / (x + y);
}
↓
public static double code(double x, double y) {
return (x / (x + y)) + (-1.0 / ((x + y) / y));
}
def code(x, y):
return (x - y) / (x + y)
↓
def code(x, y):
return (x / (x + y)) + (-1.0 / ((x + y) / y))
function code(x, y)
return Float64(Float64(x - y) / Float64(x + y))
end
↓
function code(x, y)
return Float64(Float64(x / Float64(x + y)) + Float64(-1.0 / Float64(Float64(x + y) / y)))
end
function tmp = code(x, y)
tmp = (x - y) / (x + y);
end
↓
function tmp = code(x, y)
tmp = (x / (x + y)) + (-1.0 / ((x + y) / y));
end
code[x_, y_] := N[(N[(x - y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := N[(N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x - y}{x + y}
↓
\frac{x}{x + y} + \frac{-1}{\frac{x + y}{y}}
Alternatives Alternative 1 Error 16.4 Cost 1240
\[\begin{array}{l}
t_0 := 2 \cdot \frac{x}{y} + -1\\
\mathbf{if}\;y \leq -1.12 \cdot 10^{+95}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{x + y}\\
\mathbf{elif}\;y \leq -1.22 \cdot 10^{+39}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-52}:\\
\;\;\;\;1 + -2 \cdot \frac{y}{x}\\
\mathbf{elif}\;y \leq 600000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+19}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 16.6 Cost 1176
\[\begin{array}{l}
t_0 := \frac{-y}{x + y}\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+96}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{+62}:\\
\;\;\;\;\frac{x}{x + y}\\
\mathbf{elif}\;y \leq -1.14 \cdot 10^{+39}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-45}:\\
\;\;\;\;1 - \frac{y}{x}\\
\mathbf{elif}\;y \leq 38000000:\\
\;\;\;\;\frac{x}{y} + -1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+19}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 3 Error 16.3 Cost 1176
\[\begin{array}{l}
t_0 := \frac{-y}{x + y}\\
\mathbf{if}\;y \leq -1.3 \cdot 10^{+93}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{+61}:\\
\;\;\;\;\frac{x}{x + y}\\
\mathbf{elif}\;y \leq -1 \cdot 10^{+40}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{-45}:\\
\;\;\;\;1 + -2 \cdot \frac{y}{x}\\
\mathbf{elif}\;y \leq 27000000:\\
\;\;\;\;\frac{x}{y} + -1\\
\mathbf{elif}\;y \leq 1.36 \cdot 10^{+20}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 4 Error 16.5 Cost 1112
\[\begin{array}{l}
t_0 := \frac{x}{y} + -1\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+93}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -3.5 \cdot 10^{+68}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{+39}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-45}:\\
\;\;\;\;1 - \frac{y}{x}\\
\mathbf{elif}\;y \leq 215000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.15 \cdot 10^{+20}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 16.5 Cost 1112
\[\begin{array}{l}
t_0 := \frac{x}{y} + -1\\
\mathbf{if}\;y \leq -1.2 \cdot 10^{+93}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -4.2 \cdot 10^{+61}:\\
\;\;\;\;\frac{x}{x + y}\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{+38}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-45}:\\
\;\;\;\;1 - \frac{y}{x}\\
\mathbf{elif}\;y \leq 88000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+20}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 6 Error 16.9 Cost 856
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.2 \cdot 10^{+93}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -4 \cdot 10^{+62}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -1.15 \cdot 10^{+39}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-46}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 200000000:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 1.75 \cdot 10^{+20}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
Alternative 7 Error 16.8 Cost 856
\[\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{+94}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -4.4 \cdot 10^{+62}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -5.5 \cdot 10^{+38}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{-45}:\\
\;\;\;\;1 - \frac{y}{x}\\
\mathbf{elif}\;y \leq 61000000:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+19}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
Alternative 8 Error 0.0 Cost 704
\[\frac{x}{x + y} - \frac{y}{x + y}
\]
Alternative 9 Error 0.0 Cost 448
\[\frac{x - y}{x + y}
\]
Alternative 10 Error 32.2 Cost 64
\[-1
\]