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 25.6 Cost 784
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{-123}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{-90}:\\
\;\;\;\;y \cdot x\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+137}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+162}:\\
\;\;\;\;z \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
Alternative 2 Error 15.9 Cost 584
\[\begin{array}{l}
t_0 := z \cdot \left(1 - x\right)\\
\mathbf{if}\;z \leq -2.9 \cdot 10^{-131}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-99}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 3 Error 13.6 Cost 584
\[\begin{array}{l}
t_0 := z \cdot \left(1 - x\right)\\
\mathbf{if}\;z \leq -5.6 \cdot 10^{-125}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 2.5 \cdot 10^{-96}:\\
\;\;\;\;\left(y - z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 4 Error 0.9 Cost 584
\[\begin{array}{l}
t_0 := \left(y - z\right) \cdot x\\
\mathbf{if}\;x \leq -1:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-11}:\\
\;\;\;\;y \cdot x + z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 25.3 Cost 456
\[\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{-125}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq 2.15 \cdot 10^{-94}:\\
\;\;\;\;y \cdot x\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\]
Alternative 6 Error 34.9 Cost 64
\[z
\]