\[\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+155}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-152}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-165}:\\
\;\;\;\;1 + \frac{\frac{-2 \cdot y}{x} \cdot y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot x - y \cdot y}{\mathsf{fma}\left(x, x, y \cdot y\right)}\\
\end{array}
\]
(FPCore (x y) :precision binary64 (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))
↓
(FPCore (x y)
:precision binary64
(if (<= y -2e+155)
-1.0
(if (<= y -3.3e-152)
(/ (* (- x y) (+ x y)) (+ (* x x) (* y y)))
(if (<= y 6.4e-165)
(+ 1.0 (/ (* (/ (* -2.0 y) x) y) x))
(/ (- (* x x) (* y y)) (fma x x (* y y)))))))double code(double x, double y) {
return ((x - y) * (x + y)) / ((x * x) + (y * y));
}
↓
double code(double x, double y) {
double tmp;
if (y <= -2e+155) {
tmp = -1.0;
} else if (y <= -3.3e-152) {
tmp = ((x - y) * (x + y)) / ((x * x) + (y * y));
} else if (y <= 6.4e-165) {
tmp = 1.0 + ((((-2.0 * y) / x) * y) / x);
} else {
tmp = ((x * x) - (y * y)) / fma(x, x, (y * y));
}
return tmp;
}
function code(x, y)
return Float64(Float64(Float64(x - y) * Float64(x + y)) / Float64(Float64(x * x) + Float64(y * y)))
end
↓
function code(x, y)
tmp = 0.0
if (y <= -2e+155)
tmp = -1.0;
elseif (y <= -3.3e-152)
tmp = Float64(Float64(Float64(x - y) * Float64(x + y)) / Float64(Float64(x * x) + Float64(y * y)));
elseif (y <= 6.4e-165)
tmp = Float64(1.0 + Float64(Float64(Float64(Float64(-2.0 * y) / x) * y) / x));
else
tmp = Float64(Float64(Float64(x * x) - Float64(y * y)) / fma(x, x, Float64(y * y)));
end
return tmp
end
code[x_, y_] := N[(N[(N[(x - y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := If[LessEqual[y, -2e+155], -1.0, If[LessEqual[y, -3.3e-152], N[(N[(N[(x - y), $MachinePrecision] * N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e-165], N[(1.0 + N[(N[(N[(N[(-2.0 * y), $MachinePrecision] / x), $MachinePrecision] * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] - N[(y * y), $MachinePrecision]), $MachinePrecision] / N[(x * x + N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}
↓
\begin{array}{l}
\mathbf{if}\;y \leq -2 \cdot 10^{+155}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -3.3 \cdot 10^{-152}:\\
\;\;\;\;\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-165}:\\
\;\;\;\;1 + \frac{\frac{-2 \cdot y}{x} \cdot y}{x}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot x - y \cdot y}{\mathsf{fma}\left(x, x, y \cdot y\right)}\\
\end{array}