Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\left(1 - x\right) \cdot y + x \cdot z
\]
↓
\[\left(y + y \cdot \left(-x\right)\right) + x \cdot z
\]
(FPCore (x y z) :precision binary64 (+ (* (- 1.0 x) y) (* x z))) ↓
(FPCore (x y z) :precision binary64 (+ (+ y (* y (- x))) (* x z))) double code(double x, double y, double z) {
return ((1.0 - x) * y) + (x * z);
}
↓
double code(double x, double y, double z) {
return (y + (y * -x)) + (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 = ((1.0d0 - 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 = (y + (y * -x)) + (x * z)
end function
public static double code(double x, double y, double z) {
return ((1.0 - x) * y) + (x * z);
}
↓
public static double code(double x, double y, double z) {
return (y + (y * -x)) + (x * z);
}
def code(x, y, z):
return ((1.0 - x) * y) + (x * z)
↓
def code(x, y, z):
return (y + (y * -x)) + (x * z)
function code(x, y, z)
return Float64(Float64(Float64(1.0 - x) * y) + Float64(x * z))
end
↓
function code(x, y, z)
return Float64(Float64(y + Float64(y * Float64(-x))) + Float64(x * z))
end
function tmp = code(x, y, z)
tmp = ((1.0 - x) * y) + (x * z);
end
↓
function tmp = code(x, y, z)
tmp = (y + (y * -x)) + (x * z);
end
code[x_, y_, z_] := N[(N[(N[(1.0 - x), $MachinePrecision] * y), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := N[(N[(y + N[(y * (-x)), $MachinePrecision]), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]
\left(1 - x\right) \cdot y + x \cdot z
↓
\left(y + y \cdot \left(-x\right)\right) + x \cdot z
Alternatives Alternative 1 Error 23.8 Cost 652
\[\begin{array}{l}
\mathbf{if}\;x \leq -3.8 \cdot 10^{-11}:\\
\;\;\;\;z \cdot x\\
\mathbf{elif}\;x \leq 1400000:\\
\;\;\;\;y\\
\mathbf{elif}\;x \leq 4.1 \cdot 10^{+166}:\\
\;\;\;\;x \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot x\\
\end{array}
\]
Alternative 2 Error 0.9 Cost 644
\[\begin{array}{l}
\mathbf{if}\;x \leq -100000:\\
\;\;\;\;y \cdot \left(-x\right) + x \cdot z\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;y + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(z - y\right) \cdot x\\
\end{array}
\]
Alternative 3 Error 12.2 Cost 584
\[\begin{array}{l}
t_0 := \left(z - y\right) \cdot x\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{-10}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-7}:\\
\;\;\;\;y\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 4 Error 0.9 Cost 584
\[\begin{array}{l}
t_0 := \left(z - y\right) \cdot x\\
\mathbf{if}\;x \leq -100000:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 1:\\
\;\;\;\;y + x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 5 Error 0.0 Cost 576
\[\left(1 - x\right) \cdot y + x \cdot z
\]
Alternative 6 Error 24.3 Cost 456
\[\begin{array}{l}
\mathbf{if}\;y \leq -3.6 \cdot 10^{-53}:\\
\;\;\;\;y\\
\mathbf{elif}\;y \leq 2.4 \cdot 10^{-48}:\\
\;\;\;\;z \cdot x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\]
Alternative 7 Error 34.9 Cost 64
\[y
\]