\[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 | 25.3 |
|---|
| Cost | 1116 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -1.2363509024586953 \cdot 10^{+82}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -9.442626709414045 \cdot 10^{+67}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq -2.7130267880177272:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-185}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-51}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 9.195067326920118 \cdot 10^{+124}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 12.4 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.2363509024586953 \cdot 10^{+82}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -9.442626709414045 \cdot 10^{+67}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq -58720789392398.31:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 7.017836178030848 \cdot 10^{+81}:\\
\;\;\;\;\frac{y - x}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 12.4 |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.2363509024586953 \cdot 10^{+82}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -9.442626709414045 \cdot 10^{+67}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq -58720789392398.31:\\
\;\;\;\;x - \frac{x}{z}\\
\mathbf{elif}\;z \leq 7.017836178030848 \cdot 10^{+81}:\\
\;\;\;\;\frac{y - x}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 24.6 |
|---|
| Cost | 720 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1.2363509024586953 \cdot 10^{+82}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -9.442626709414045 \cdot 10^{+67}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq -58720789392398.31:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 9.195067326920118 \cdot 10^{+124}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 34.7 |
|---|
| Cost | 64 |
|---|
\[x
\]