Math FPCore C Julia Wolfram TeX \[\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
\]
↓
\[\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+53}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y} - y\right)\\
\mathbf{elif}\;z \leq 1.2481875845995409 \cdot 10^{-26}:\\
\;\;\;\;0.5 \cdot \left(y + x \cdot \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \mathsf{fma}\left(\frac{z}{y}, -z, y\right)\\
\end{array}
\]
(FPCore (x y z)
:precision binary64
(/ (- (+ (* x x) (* y y)) (* z z)) (* y 2.0))) ↓
(FPCore (x y z)
:precision binary64
(if (<= z -6.4e+53)
(* -0.5 (- (* z (/ z y)) y))
(if (<= z 1.2481875845995409e-26)
(* 0.5 (+ y (* x (/ x y))))
(* 0.5 (fma (/ z y) (- z) y))))) double code(double x, double y, double z) {
return (((x * x) + (y * y)) - (z * z)) / (y * 2.0);
}
↓
double code(double x, double y, double z) {
double tmp;
if (z <= -6.4e+53) {
tmp = -0.5 * ((z * (z / y)) - y);
} else if (z <= 1.2481875845995409e-26) {
tmp = 0.5 * (y + (x * (x / y)));
} else {
tmp = 0.5 * fma((z / y), -z, y);
}
return tmp;
}
function code(x, y, z)
return Float64(Float64(Float64(Float64(x * x) + Float64(y * y)) - Float64(z * z)) / Float64(y * 2.0))
end
↓
function code(x, y, z)
tmp = 0.0
if (z <= -6.4e+53)
tmp = Float64(-0.5 * Float64(Float64(z * Float64(z / y)) - y));
elseif (z <= 1.2481875845995409e-26)
tmp = Float64(0.5 * Float64(y + Float64(x * Float64(x / y))));
else
tmp = Float64(0.5 * fma(Float64(z / y), Float64(-z), y));
end
return tmp
end
code[x_, y_, z_] := N[(N[(N[(N[(x * x), $MachinePrecision] + N[(y * y), $MachinePrecision]), $MachinePrecision] - N[(z * z), $MachinePrecision]), $MachinePrecision] / N[(y * 2.0), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := If[LessEqual[z, -6.4e+53], N[(-0.5 * N[(N[(z * N[(z / y), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2481875845995409e-26], N[(0.5 * N[(y + N[(x * N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(z / y), $MachinePrecision] * (-z) + y), $MachinePrecision]), $MachinePrecision]]]
\frac{\left(x \cdot x + y \cdot y\right) - z \cdot z}{y \cdot 2}
↓
\begin{array}{l}
\mathbf{if}\;z \leq -6.4 \cdot 10^{+53}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y} - y\right)\\
\mathbf{elif}\;z \leq 1.2481875845995409 \cdot 10^{-26}:\\
\;\;\;\;0.5 \cdot \left(y + x \cdot \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \mathsf{fma}\left(\frac{z}{y}, -z, y\right)\\
\end{array}
Alternatives Alternative 1 Error 14.9 Cost 1356
\[\begin{array}{l}
t_0 := -0.5 \cdot \left(z \cdot \frac{z}{y} - y\right)\\
\mathbf{if}\;x \cdot x \leq 1000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+19}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\
\mathbf{elif}\;x \cdot x \leq 10^{+266}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\frac{0.5}{\frac{\frac{y}{x}}{x}}\\
\end{array}
\]
Alternative 2 Error 10.4 Cost 1104
\[\begin{array}{l}
t_0 := 0.5 \cdot \left(y + \frac{x \cdot x}{y}\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{+152}:\\
\;\;\;\;\frac{0.5}{\frac{\frac{y}{x}}{x}}\\
\mathbf{elif}\;x \leq -6.195987470923665 \cdot 10^{-110}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5.208812741092519 \cdot 10^{-25}:\\
\;\;\;\;-0.5 \cdot \left(z \cdot \frac{z}{y} - y\right)\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+153}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\]
Alternative 3 Error 7.6 Cost 840
\[\begin{array}{l}
t_0 := -0.5 \cdot \left(z \cdot \frac{z}{y} - y\right)\\
\mathbf{if}\;z \leq -6.4 \cdot 10^{+53}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.2481875845995409 \cdot 10^{-26}:\\
\;\;\;\;0.5 \cdot \left(y + x \cdot \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 4 Error 23.6 Cost 712
\[\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{-30}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-84}:\\
\;\;\;\;\frac{0.5}{\frac{y}{x \cdot x}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\]
Alternative 5 Error 23.0 Cost 712
\[\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{-30}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-84}:\\
\;\;\;\;\frac{0.5}{\frac{\frac{y}{x}}{x}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\]
Alternative 6 Error 23.0 Cost 712
\[\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{-30}:\\
\;\;\;\;y \cdot 0.5\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-84}:\\
\;\;\;\;0.5 \cdot \frac{x}{\frac{y}{x}}\\
\mathbf{else}:\\
\;\;\;\;y \cdot 0.5\\
\end{array}
\]
Alternative 7 Error 27.3 Cost 192
\[y \cdot 0.5
\]