\[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 | 15.8 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := x - \frac{x}{z}\\
t_1 := \frac{y - x}{z}\\
\mathbf{if}\;x \leq -1 \cdot 10^{+95}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.9824960543428262 \cdot 10^{-13}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -3.7465699500117035 \cdot 10^{-186}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 6.909276276579414 \cdot 10^{-96}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 27.3 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.0093912781725423 \cdot 10^{+89}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.9824960543428262 \cdot 10^{-13}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;x \leq -3.7465699500117035 \cdot 10^{-186}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.909276276579414 \cdot 10^{-96}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 27.2 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.4511514355639413 \cdot 10^{+95}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.0474429914901988 \cdot 10^{-10}:\\
\;\;\;\;\frac{-x}{z}\\
\mathbf{elif}\;x \leq -3.7465699500117035 \cdot 10^{-186}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.909276276579414 \cdot 10^{-96}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 12.7 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -7.532411683885926 \cdot 10^{+30}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.246577876989021 \cdot 10^{+34}:\\
\;\;\;\;\frac{y - x}{z}\\
\mathbf{elif}\;z \leq 8.049445127029839 \cdot 10^{+65}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.120972819495425 \cdot 10^{+90}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 35.2 |
|---|
| Cost | 64 |
|---|
\[x
\]