Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[x \cdot y + \left(1 - x\right) \cdot z
\]
↓
\[z - x \cdot \left(z - y\right)
\]
(FPCore (x y z) :precision binary64 (+ (* x y) (* (- 1.0 x) z))) ↓
(FPCore (x y z) :precision binary64 (- z (* x (- z y)))) double code(double x, double y, double z) {
return (x * y) + ((1.0 - x) * z);
}
↓
double code(double x, double y, double z) {
return z - (x * (z - y));
}
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) + ((1.0d0 - 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 = z - (x * (z - y))
end function
public static double code(double x, double y, double z) {
return (x * y) + ((1.0 - x) * z);
}
↓
public static double code(double x, double y, double z) {
return z - (x * (z - y));
}
def code(x, y, z):
return (x * y) + ((1.0 - x) * z)
↓
def code(x, y, z):
return z - (x * (z - y))
function code(x, y, z)
return Float64(Float64(x * y) + Float64(Float64(1.0 - x) * z))
end
↓
function code(x, y, z)
return Float64(z - Float64(x * Float64(z - y)))
end
function tmp = code(x, y, z)
tmp = (x * y) + ((1.0 - x) * z);
end
↓
function tmp = code(x, y, z)
tmp = z - (x * (z - y));
end
code[x_, y_, z_] := N[(N[(x * y), $MachinePrecision] + N[(N[(1.0 - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := N[(z - N[(x * N[(z - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot y + \left(1 - x\right) \cdot z
↓
z - x \cdot \left(z - y\right)
Alternatives Alternative 1 Error 12.7 Cost 848
\[\begin{array}{l}
t_0 := \left(y - z\right) \cdot x\\
t_1 := z \cdot \left(1 - x\right)\\
\mathbf{if}\;x \leq -0.38:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.75 \cdot 10^{-75}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-44}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 23.8 Cost 784
\[\begin{array}{l}
t_0 := z \cdot \left(-x\right)\\
\mathbf{if}\;x \leq -65000000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-53}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-43}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+176}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 3 Error 15.7 Cost 584
\[\begin{array}{l}
t_0 := z \cdot \left(1 - x\right)\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{-115}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{-128}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 4 Error 1.0 Cost 584
\[\begin{array}{l}
t_0 := \left(y - z\right) \cdot x\\
\mathbf{if}\;x \leq -59000000000000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;x \cdot y + z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 23.9 Cost 456
\[\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-53}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{-48}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;y \cdot x\\
\end{array}
\]
Alternative 6 Error 34.8 Cost 64
\[z
\]