\[\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{x - y}{\frac{y}{\frac{x + y}{y}} + x \cdot \frac{x}{x + y}}
\]
(FPCore (x y) :precision binary64 (/ (* (- x y) (+ x y)) (+ (* x x) (* y y))))
↓
(FPCore (x y)
:precision binary64
(/ (- x y) (+ (/ y (/ (+ x y) y)) (* x (/ 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) / ((y / ((x + y) / y)) + (x * (x / (x + y))));
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = ((x - y) * (x + y)) / ((x * x) + (y * y))
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x - y) / ((y / ((x + y) / y)) + (x * (x / (x + y))))
end function
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) / ((y / ((x + y) / y)) + (x * (x / (x + y))));
}
def code(x, y):
return ((x - y) * (x + y)) / ((x * x) + (y * y))
↓
def code(x, y):
return (x - y) / ((y / ((x + y) / y)) + (x * (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(x - y) / Float64(Float64(y / Float64(Float64(x + y) / y)) + Float64(x * Float64(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) / ((y / ((x + y) / y)) + (x * (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[(x - y), $MachinePrecision] / N[(N[(y / N[(N[(x + y), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(x / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}
↓
\frac{x - y}{\frac{y}{\frac{x + y}{y}} + x \cdot \frac{x}{x + y}}
Alternatives
| Alternative 1 |
|---|
| Accuracy | 91.7% |
|---|
| Cost | 1620 |
|---|
\[\begin{array}{l}
t_0 := 1 + \frac{\frac{y}{\frac{x}{y}} \cdot -2}{x}\\
t_1 := \frac{\left(x - y\right) \cdot \left(x + y\right)}{x \cdot x + y \cdot y}\\
\mathbf{if}\;y \leq -2 \cdot 10^{+154}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq -2.8 \cdot 10^{-153}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{-198}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-175}:\\
\;\;\;\;\frac{x - y}{\left(y - x\right) + \frac{x \cdot x}{y}}\\
\mathbf{elif}\;y \leq 8.8 \cdot 10^{-163}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 82.6% |
|---|
| Cost | 1362 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.3 \cdot 10^{-111} \lor \neg \left(y \leq 8.5 \cdot 10^{-198} \lor \neg \left(y \leq 3.2 \cdot 10^{-175}\right) \land y \leq 4 \cdot 10^{-133}\right):\\
\;\;\;\;\frac{x - y}{\left(y - x\right) + \frac{x \cdot x}{y}}\\
\mathbf{else}:\\
\;\;\;\;1 + \frac{\frac{y}{\frac{x}{y}} \cdot -2}{x}\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 82.3% |
|---|
| Cost | 1233 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -2.8 \cdot 10^{-110}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-198} \lor \neg \left(y \leq 3.6 \cdot 10^{-175}\right) \land y \leq 3.3 \cdot 10^{-131}:\\
\;\;\;\;1 + \frac{\frac{y}{\frac{x}{y}} \cdot -2}{x}\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 100.0% |
|---|
| Cost | 1216 |
|---|
\[\frac{x - y}{x \cdot \frac{x}{x + y} + \frac{y}{1 + \frac{x}{y}}}
\]
| Alternative 5 |
|---|
| Accuracy | 82.1% |
|---|
| Cost | 592 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -5.6 \cdot 10^{-137}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-198}:\\
\;\;\;\;1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-175}:\\
\;\;\;\;-1\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-133}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;-1\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 66.8% |
|---|
| Cost | 64 |
|---|
\[-1
\]