\[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 |
|---|
| Accuracy | 62.4% |
|---|
| Cost | 984 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -2 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{-48}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-104}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-103}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 4.1 \cdot 10^{-31}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+27}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 2 |
|---|
| Accuracy | 80.6% |
|---|
| Cost | 848 |
|---|
\[\begin{array}{l}
t_0 := x + \frac{y}{z}\\
t_1 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{-62}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -3.15 \cdot 10^{-105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{-98}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-31}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Accuracy | 87.9% |
|---|
| Cost | 585 |
|---|
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.5 \cdot 10^{-201} \lor \neg \left(y \leq 4.6 \cdot 10^{-53}\right):\\
\;\;\;\;x + \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{x}{z}\\
\end{array}
\]
| Alternative 4 |
|---|
| Accuracy | 98.6% |
|---|
| Cost | 585 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1 \lor \neg \left(z \leq 1\right):\\
\;\;\;\;x + \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - x}{z}\\
\end{array}
\]
| Alternative 5 |
|---|
| Accuracy | 62.6% |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+26}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+25}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 6 |
|---|
| Accuracy | 44.8% |
|---|
| Cost | 64 |
|---|
\[x
\]