\[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.4 |
|---|
| Cost | 1376 |
|---|
\[\begin{array}{l}
t_0 := x + \frac{y}{z}\\
t_1 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{-22}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -6.4 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.4 \cdot 10^{-98}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.4 \cdot 10^{-123}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.9 \cdot 10^{-151}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-110}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{-79}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{-47}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 23.7 |
|---|
| Cost | 1248 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -1.15 \cdot 10^{+39}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{-99}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-120}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-143}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 1.68 \cdot 10^{-108}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 6.3 \cdot 10^{-74}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 3.9 \cdot 10^{-47}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+37}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 7.2 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := x + \frac{y}{z}\\
\mathbf{if}\;y \leq -4 \cdot 10^{-77}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;y \leq 1.62 \cdot 10^{-74}:\\
\;\;\;\;x - \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 0.9 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := x + \frac{y}{z}\\
\mathbf{if}\;z \leq -23000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1:\\
\;\;\;\;\frac{y - x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 23.4 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+38}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 34.7 |
|---|
| Cost | 64 |
|---|
\[x
\]