\[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 | 23.6 |
|---|
| Cost | 984 |
|---|
\[\begin{array}{l}
t_0 := \frac{-x}{z}\\
\mathbf{if}\;z \leq -1078442090978667.1:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-33}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq -1.5 \cdot 10^{-145}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq -1.42 \cdot 10^{-257}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{elif}\;z \leq 7.145327490310939 \cdot 10^{-21}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 4.471307065727807 \cdot 10^{+46}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 2 |
|---|
| Error | 1.0 |
|---|
| Cost | 712 |
|---|
\[\begin{array}{l}
t_0 := x + \frac{y}{z}\\
\mathbf{if}\;z \leq -1078442090978667.1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 0.005794332881450441:\\
\;\;\;\;\frac{y}{z} - \frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 3 |
|---|
| Error | 12.3 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
\mathbf{if}\;z \leq -1078442090978667.1:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.471307065727807 \cdot 10^{+46}:\\
\;\;\;\;\frac{y - x}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 4 |
|---|
| Error | 1.0 |
|---|
| Cost | 584 |
|---|
\[\begin{array}{l}
t_0 := x + \frac{y}{z}\\
\mathbf{if}\;z \leq -1078442090978667.1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 0.005794332881450441:\\
\;\;\;\;\frac{y - x}{z}\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
| Alternative 5 |
|---|
| Error | 25.7 |
|---|
| Cost | 456 |
|---|
\[\begin{array}{l}
\mathbf{if}\;x \leq -1.1152614112099902 \cdot 10^{+29}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.5576815460756178 \cdot 10^{+38}:\\
\;\;\;\;\frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\]
| Alternative 6 |
|---|
| Error | 35.1 |
|---|
| Cost | 64 |
|---|
\[x
\]