\[x + \frac{y - x}{z}
\]
↓
\[x + \frac{y - x}{z}
\]
(FPCore (x y z) :precision binary64 (+ x (/ (- y x) z)))
↓
(FPCore (x y z) :precision binary64 (+ x (/ (- y x) z)))
double code(double x, double y, double z) {
return x + ((y - x) / z);
}
↓
double code(double x, double y, double z) {
return x + ((y - x) / z);
}
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y - x) / z)
end function
↓
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((y - x) / z)
end function
public static double code(double x, double y, double z) {
return x + ((y - x) / z);
}
↓
public static double code(double x, double y, double z) {
return x + ((y - x) / z);
}
def code(x, y, z):
return x + ((y - x) / z)
↓
def code(x, y, z):
return x + ((y - x) / z)
function code(x, y, z)
return Float64(x + Float64(Float64(y - x) / z))
end
↓
function code(x, y, z)
return Float64(x + Float64(Float64(y - x) / z))
end
function tmp = code(x, y, z)
tmp = x + ((y - x) / z);
end
↓
function tmp = code(x, y, z)
tmp = x + ((y - x) / z);
end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
x + \frac{y - x}{z}
↓
x + \frac{y - x}{z}
Alternatives
| Alternative 1 |
|---|
| Error | 12.3 |
|---|
| Cost | 850 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-11} \lor \neg \left(z \leq -2.7 \cdot 10^{-33} \lor \neg \left(z \leq -1.14 \cdot 10^{-185}\right) \land z \leq 1.4 \cdot 10^{-73}\right):\\
\;\;\;\;x + \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{z}\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 25.9 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.9 \cdot 10^{+83}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-21}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;x \leq -2.9 \cdot 10^{-91}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-33}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 24.4 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.52 \cdot 10^{+44}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.62 \cdot 10^{-180}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-67}:\\
\;\;\;\;\frac{-x}{z}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+81}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 6.9 |
|---|
| Cost | 585 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-92} \lor \neg \left(y \leq 3 \cdot 10^{-101}\right):\\
\;\;\;\;x + \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{z}\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 0.9 |
|---|
| Cost | 585 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 6 \cdot 10^{-5}\right):\\
\;\;\;\;x + \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{z}\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 34.6 |
|---|
| Cost | 64 |
|---|
\[x
\]