\[\left(0 < x \land x < 1\right) \land y < 1\]
\[\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}
\]
↓
\[\frac{\frac{x - y}{\mathsf{hypot}\left(y, x\right)}}{\frac{\mathsf{hypot}\left(y, x\right)}{x + y}}
\]
(FPCore (x y) :precision binary64 (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))
↓
(FPCore (x y)
:precision binary64
(/ (/ (- x y) (hypot y x)) (/ (hypot y x) (+ x y))))
double code(double x, double y) {
return ((x - y) * (x + y)) / ((x * x) + (y * y));
}
↓
double code(double x, double y) {
return ((x - y) / hypot(y, x)) / (hypot(y, x) / (x + y));
}
public static double code(double x, double y) {
return ((x - y) * (x + y)) / ((x * x) + (y * y));
}
↓
public static double code(double x, double y) {
return ((x - y) / Math.hypot(y, x)) / (Math.hypot(y, x) / (x + y));
}
def code(x, y):
return ((x - y) * (x + y)) / ((x * x) + (y * y))
↓
def code(x, y):
return ((x - y) / math.hypot(y, x)) / (math.hypot(y, x) / (x + y))
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)
return Float64(Float64(Float64(x - y) / hypot(y, x)) / Float64(hypot(y, x) / Float64(x + y)))
end
function tmp = code(x, y)
tmp = ((x - y) * (x + y)) / ((x * x) + (y * y));
end
↓
function tmp = code(x, y)
tmp = ((x - y) / hypot(y, x)) / (hypot(y, x) / (x + y));
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_] := N[(N[(N[(x - y), $MachinePrecision] / N[Sqrt[y ^ 2 + x ^ 2], $MachinePrecision]), $MachinePrecision] / N[(N[Sqrt[y ^ 2 + x ^ 2], $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}
↓
\frac{\frac{x - y}{\mathsf{hypot}\left(y, x\right)}}{\frac{\mathsf{hypot}\left(y, x\right)}{x + y}}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 92.5% |
|---|
| Cost | 1357 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1 \cdot 10^{+154}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -1.55 \cdot 10^{-162} \lor \neg \left(y \leq 6.6 \cdot 10^{-193}\right):\\
\;\;\;\;\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot -2}{x} \cdot \frac{y}{x}\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 82.6% |
|---|
| Cost | 969 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-135} \lor \neg \left(y \leq 6.6 \cdot 10^{-106}\right):\\
\;\;\;\;-1 + \frac{x}{y} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{y \cdot -2}{x} \cdot \frac{y}{x}\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 82.7% |
|---|
| Cost | 968 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.2 \cdot 10^{-136}:\\
\;\;\;\;-1 + 2 \cdot \frac{\frac{x}{y}}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq 1.3 \cdot 10^{-105}:\\
\;\;\;\;1 + \frac{y \cdot -2}{x} \cdot \frac{y}{x}\\
\mathbf{else}:\\
\;\;\;\;-1 + \frac{x}{y} \cdot \frac{x}{y}\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 82.6% |
|---|
| Cost | 841 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -1.75 \cdot 10^{-181} \lor \neg \left(y \leq 9.2 \cdot 10^{-115}\right):\\
\;\;\;\;-1 + \frac{x}{y} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 81.8% |
|---|
| Cost | 328 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.4 \cdot 10^{-181}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 1.25 \cdot 10^{-105}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 67.0% |
|---|
| Cost | 64 |
|---|
\[-1
\]