Math FPCore C Julia Wolfram TeX \[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}
\]
↓
\[\sqrt[3]{{\left(\frac{\mathsf{fma}\left(y, 2, x\right)}{\mathsf{hypot}\left(x, y + y\right)}\right)}^{3}} \cdot \frac{x + y \cdot -2}{\mathsf{hypot}\left(x, y \cdot 2\right)}
\]
(FPCore (x y)
:precision binary64
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y)))) ↓
(FPCore (x y)
:precision binary64
(*
(cbrt (pow (/ (fma y 2.0 x) (hypot x (+ y y))) 3.0))
(/ (+ x (* y -2.0)) (hypot x (* y 2.0))))) double code(double x, double y) {
return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
}
↓
double code(double x, double y) {
return cbrt(pow((fma(y, 2.0, x) / hypot(x, (y + y))), 3.0)) * ((x + (y * -2.0)) / hypot(x, (y * 2.0)));
}
function code(x, y)
return Float64(Float64(Float64(x * x) - Float64(Float64(y * 4.0) * y)) / Float64(Float64(x * x) + Float64(Float64(y * 4.0) * y)))
end
↓
function code(x, y)
return Float64(cbrt((Float64(fma(y, 2.0, x) / hypot(x, Float64(y + y))) ^ 3.0)) * Float64(Float64(x + Float64(y * -2.0)) / hypot(x, Float64(y * 2.0))))
end
code[x_, y_] := N[(N[(N[(x * x), $MachinePrecision] - N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] / N[(N[(x * x), $MachinePrecision] + N[(N[(y * 4.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := N[(N[Power[N[Power[N[(N[(y * 2.0 + x), $MachinePrecision] / N[Sqrt[x ^ 2 + N[(y + y), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision], 1/3], $MachinePrecision] * N[(N[(x + N[(y * -2.0), $MachinePrecision]), $MachinePrecision] / N[Sqrt[x ^ 2 + N[(y * 2.0), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}
↓
\sqrt[3]{{\left(\frac{\mathsf{fma}\left(y, 2, x\right)}{\mathsf{hypot}\left(x, y + y\right)}\right)}^{3}} \cdot \frac{x + y \cdot -2}{\mathsf{hypot}\left(x, y \cdot 2\right)}
Alternatives Alternative 1 Error 0.0 Cost 20416
\[\begin{array}{l}
t_0 := \mathsf{hypot}\left(x, y \cdot 2\right)\\
\frac{x + y \cdot -2}{t_0} \cdot \frac{\mathsf{fma}\left(y, 2, x\right)}{t_0}
\end{array}
\]
Alternative 2 Error 12.7 Cost 2256
\[\begin{array}{l}
t_0 := \frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\
t_1 := \frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.5 + -1\\
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-119}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot x \leq 10^{-64}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot x \leq 10^{-18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot x \leq 10^{+253}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot -4}{\frac{x}{\frac{y}{x}}}\\
\end{array}
\]
Alternative 3 Error 12.7 Cost 2256
\[\begin{array}{l}
t_0 := \frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.5 + -1\\
t_1 := x \cdot x + y \cdot \left(y \cdot 4\right)\\
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-119}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot x \leq 10^{-64}:\\
\;\;\;\;\frac{\left(x + y \cdot -2\right) \cdot \left(x - y \cdot -2\right)}{t_1}\\
\mathbf{elif}\;x \cdot x \leq 10^{-18}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot x \leq 10^{+253}:\\
\;\;\;\;\frac{x \cdot x + y \cdot \left(y \cdot -4\right)}{t_1}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot -4}{\frac{x}{\frac{y}{x}}}\\
\end{array}
\]
Alternative 4 Error 15.8 Cost 1484
\[\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-116}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \leq 4 \cdot 10^{-98}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+38}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot -4}{\frac{x}{\frac{y}{x}}}\\
\end{array}
\]
Alternative 5 Error 15.5 Cost 1484
\[\begin{array}{l}
t_0 := \frac{\frac{x}{y}}{\frac{y}{x}} \cdot 0.5 + -1\\
\mathbf{if}\;x \cdot x \leq 5 \cdot 10^{-116}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot x \leq 4 \cdot 10^{-98}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+38}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot -4}{\frac{x}{\frac{y}{x}}}\\
\end{array}
\]
Alternative 6 Error 16.0 Cost 844
\[\begin{array}{l}
\mathbf{if}\;x \cdot x \leq 2 \cdot 10^{-114}:\\
\;\;\;\;-1\\
\mathbf{elif}\;x \cdot x \leq 2.6 \cdot 10^{-98}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \cdot x \leq 3.2 \cdot 10^{+38}:\\
\;\;\;\;-1\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
Alternative 7 Error 31.9 Cost 64
\[-1
\]