\[\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}
\]
↓
\[\begin{array}{l}
t_0 := \mathsf{hypot}\left(x, y + y\right)\\
{\left(\frac{x}{\mathsf{hypot}\left(x, y \cdot 2\right)}\right)}^{2} + \frac{\left(y + y\right) \cdot \left(\frac{y}{t_0} \cdot -2\right)}{t_0}
\end{array}
\]
(FPCore (x y)
:precision binary64
(/ (- (* x x) (* (* y 4.0) y)) (+ (* x x) (* (* y 4.0) y))))
↓
(FPCore (x y)
:precision binary64
(let* ((t_0 (hypot x (+ y y))))
(+
(pow (/ x (hypot x (* y 2.0))) 2.0)
(/ (* (+ y y) (* (/ y t_0) -2.0)) t_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) {
double t_0 = hypot(x, (y + y));
return pow((x / hypot(x, (y * 2.0))), 2.0) + (((y + y) * ((y / t_0) * -2.0)) / t_0);
}
public static double code(double x, double y) {
return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
}
↓
public static double code(double x, double y) {
double t_0 = Math.hypot(x, (y + y));
return Math.pow((x / Math.hypot(x, (y * 2.0))), 2.0) + (((y + y) * ((y / t_0) * -2.0)) / t_0);
}
def code(x, y):
return ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y))
↓
def code(x, y):
t_0 = math.hypot(x, (y + y))
return math.pow((x / math.hypot(x, (y * 2.0))), 2.0) + (((y + y) * ((y / t_0) * -2.0)) / t_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)
t_0 = hypot(x, Float64(y + y))
return Float64((Float64(x / hypot(x, Float64(y * 2.0))) ^ 2.0) + Float64(Float64(Float64(y + y) * Float64(Float64(y / t_0) * -2.0)) / t_0))
end
function tmp = code(x, y)
tmp = ((x * x) - ((y * 4.0) * y)) / ((x * x) + ((y * 4.0) * y));
end
↓
function tmp = code(x, y)
t_0 = hypot(x, (y + y));
tmp = ((x / hypot(x, (y * 2.0))) ^ 2.0) + (((y + y) * ((y / t_0) * -2.0)) / t_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_] := Block[{t$95$0 = N[Sqrt[x ^ 2 + N[(y + y), $MachinePrecision] ^ 2], $MachinePrecision]}, N[(N[Power[N[(x / N[Sqrt[x ^ 2 + N[(y * 2.0), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] + N[(N[(N[(y + y), $MachinePrecision] * N[(N[(y / t$95$0), $MachinePrecision] * -2.0), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]), $MachinePrecision]]
\frac{x \cdot x - \left(y \cdot 4\right) \cdot y}{x \cdot x + \left(y \cdot 4\right) \cdot y}
↓
\begin{array}{l}
t_0 := \mathsf{hypot}\left(x, y + y\right)\\
{\left(\frac{x}{\mathsf{hypot}\left(x, y \cdot 2\right)}\right)}^{2} + \frac{\left(y + y\right) \cdot \left(\frac{y}{t_0} \cdot -2\right)}{t_0}
\end{array}
Alternatives
| Alternative 1 |
|---|
| Error | 0.1 |
|---|
| Cost | 26688 |
|---|
\[\begin{array}{l}
t_0 := \mathsf{hypot}\left(x, y \cdot 2\right)\\
{\left(\frac{x}{t_0}\right)}^{2} - {\left(\frac{y \cdot 2}{t_0}\right)}^{2}
\end{array}
\]
| Alternative 2 |
|---|
| Error | 12.7 |
|---|
| Cost | 21068 |
|---|
\[\begin{array}{l}
t_0 := \mathsf{hypot}\left(x, y \cdot 2\right)\\
t_1 := {\left(\frac{x}{t_0}\right)}^{2}\\
t_2 := t_1 - \mathsf{fma}\left(\frac{x}{y} \cdot \frac{x}{y}, -0.25, 1\right)\\
t_3 := x \cdot x + y \cdot \left(y \cdot -4\right)\\
\mathbf{if}\;x \cdot x \leq 0:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot x \leq 10^{-101}:\\
\;\;\;\;\frac{t_3}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\
\mathbf{elif}\;x \cdot x \leq 10^{-7}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+291}:\\
\;\;\;\;\frac{t_3}{{t_0}^{2}}\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(\frac{y}{x} \cdot \frac{y}{x}\right) \cdot -4\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 12.7 |
|---|
| Cost | 14928 |
|---|
\[\begin{array}{l}
t_0 := x \cdot x + y \cdot \left(y \cdot -4\right)\\
t_1 := \mathsf{hypot}\left(x, y \cdot 2\right)\\
\mathbf{if}\;x \cdot x \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\
\mathbf{elif}\;x \cdot x \leq 10^{-101}:\\
\;\;\;\;\frac{t_0}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\
\mathbf{elif}\;x \cdot x \leq 10^{-7}:\\
\;\;\;\;-1 + x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right)\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+291}:\\
\;\;\;\;\frac{t_0}{{t_1}^{2}}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{x}{t_1}\right)}^{2} + \left(\frac{y}{x} \cdot \frac{y}{x}\right) \cdot -4\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 12.7 |
|---|
| Cost | 14800 |
|---|
\[\begin{array}{l}
t_0 := x \cdot x + y \cdot \left(y \cdot -4\right)\\
\mathbf{if}\;x \cdot x \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\
\mathbf{elif}\;x \cdot x \leq 10^{-101}:\\
\;\;\;\;\frac{t_0}{x \cdot x + y \cdot \left(y \cdot 4\right)}\\
\mathbf{elif}\;x \cdot x \leq 10^{-7}:\\
\;\;\;\;-1 + x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right)\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+291}:\\
\;\;\;\;\frac{t_0}{{\left(\mathsf{hypot}\left(x, y \cdot 2\right)\right)}^{2}}\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right)\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 12.7 |
|---|
| Cost | 7236 |
|---|
\[\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)}\\
\mathbf{if}\;x \cdot x \leq 0:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{\frac{y}{x}}, \frac{0.5}{y}, -1\right)\\
\mathbf{elif}\;x \cdot x \leq 10^{-101}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot x \leq 10^{-7}:\\
\;\;\;\;-1 + x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right)\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+291}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right)\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 12.8 |
|---|
| 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 := -1 + x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right)\\
\mathbf{if}\;x \cdot x \leq 0:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot x \leq 10^{-101}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \cdot x \leq 10^{-7}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \cdot x \leq 2 \cdot 10^{+291}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;1 + y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right)\\
\end{array}
\]
| Alternative 7 |
|---|
| Error | 16.3 |
|---|
| Cost | 1496 |
|---|
\[\begin{array}{l}
t_0 := 1 + y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right)\\
\mathbf{if}\;y \leq -6.101664348091817 \cdot 10^{+62}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -2.389624658687178 \cdot 10^{+36}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -2.417153638885234:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 7.1456437241885864 \cdot 10^{-130}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 6.40699827568335 \cdot 10^{-104}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 674288824.1166409:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 8 |
|---|
| Error | 16.1 |
|---|
| Cost | 1496 |
|---|
\[\begin{array}{l}
t_0 := -1 + x \cdot \left(\frac{x}{y} \cdot \frac{0.5}{y}\right)\\
t_1 := 1 + y \cdot \left(-8 \cdot \frac{\frac{y}{x}}{x}\right)\\
\mathbf{if}\;y \leq -6.101664348091817 \cdot 10^{+62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq -2.389624658687178 \cdot 10^{+36}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -2.417153638885234:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 7.1456437241885864 \cdot 10^{-130}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 6.40699827568335 \cdot 10^{-104}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 674288824.1166409:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 9 |
|---|
| Error | 17.3 |
|---|
| Cost | 856 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -6.101664348091817 \cdot 10^{+62}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -2.389624658687178 \cdot 10^{+36}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq -1148218555260301800:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 1.4804286115285545 \cdot 10^{-156}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 6.40699827568335 \cdot 10^{-104}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 674288824.1166409:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 10 |
|---|
| Error | 31.6 |
|---|
| Cost | 64 |
|---|
\[1
\]