\[\frac{x \cdot 100}{x + y}
\]
↓
\[\frac{100}{x + y} \cdot x
\]
(FPCore (x y) :precision binary64 (/ (* x 100.0) (+ x y)))
↓
(FPCore (x y) :precision binary64 (* (/ 100.0 (+ x y)) x))
double code(double x, double y) {
return (x * 100.0) / (x + y);
}
↓
double code(double x, double y) {
return (100.0 / (x + y)) * x;
}
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (x * 100.0d0) / (x + y)
end function
↓
real(8) function code(x, y)
real(8), intent (in) :: x
real(8), intent (in) :: y
code = (100.0d0 / (x + y)) * x
end function
public static double code(double x, double y) {
return (x * 100.0) / (x + y);
}
↓
public static double code(double x, double y) {
return (100.0 / (x + y)) * x;
}
def code(x, y):
return (x * 100.0) / (x + y)
↓
def code(x, y):
return (100.0 / (x + y)) * x
function code(x, y)
return Float64(Float64(x * 100.0) / Float64(x + y))
end
↓
function code(x, y)
return Float64(Float64(100.0 / Float64(x + y)) * x)
end
function tmp = code(x, y)
tmp = (x * 100.0) / (x + y);
end
↓
function tmp = code(x, y)
tmp = (100.0 / (x + y)) * x;
end
code[x_, y_] := N[(N[(x * 100.0), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_] := N[(N[(100.0 / N[(x + y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{x \cdot 100}{x + y}
↓
\frac{100}{x + y} \cdot x
Alternatives
| Alternative 1 |
|---|
| Error | 17.2 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := 100 \cdot \frac{x}{y}\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{-37}:\\
\;\;\;\;100\\
\mathbf{elif}\;x \leq 6 \cdot 10^{-71}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.56 \cdot 10^{+59}:\\
\;\;\;\;100\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+117}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;100\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 17.3 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := \frac{100}{y} \cdot x\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{-41}:\\
\;\;\;\;100\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{-72}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+59}:\\
\;\;\;\;100\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+117}:\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;100\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 17.2 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-38}:\\
\;\;\;\;100\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-72}:\\
\;\;\;\;\frac{x}{0.01 \cdot y}\\
\mathbf{elif}\;x \leq 9.8 \cdot 10^{+58}:\\
\;\;\;\;100\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+117}:\\
\;\;\;\;\frac{100}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;100\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 17.3 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -9.8 \cdot 10^{-39}:\\
\;\;\;\;100\\
\mathbf{elif}\;x \leq 2.85 \cdot 10^{-74}:\\
\;\;\;\;\frac{x}{0.01 \cdot y}\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+59}:\\
\;\;\;\;\frac{x \cdot 100}{x}\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+117}:\\
\;\;\;\;\frac{100}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;100\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 17.2 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{-37}:\\
\;\;\;\;100\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{-73}:\\
\;\;\;\;\frac{x \cdot 100}{y}\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+59}:\\
\;\;\;\;\frac{x \cdot 100}{x}\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+117}:\\
\;\;\;\;\frac{100}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;100\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 31.9 |
|---|
| Cost | 64 |
|---|
\[100
\]