Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[x + \left(y - x\right) \cdot z
\]
↓
\[y \cdot z + \left(1 - z\right) \cdot x
\]
(FPCore (x y z) :precision binary64 (+ x (* (- y x) z))) ↓
(FPCore (x y z) :precision binary64 (+ (* y z) (* (- 1.0 z) x))) double code(double x, double y, double z) {
return x + ((y - x) * z);
}
↓
double code(double x, double y, double z) {
return (y * z) + ((1.0 - z) * x);
}
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 = (y * z) + ((1.0d0 - z) * x)
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 (y * z) + ((1.0 - z) * x);
}
def code(x, y, z):
return x + ((y - x) * z)
↓
def code(x, y, z):
return (y * z) + ((1.0 - z) * x)
function code(x, y, z)
return Float64(x + Float64(Float64(y - x) * z))
end
↓
function code(x, y, z)
return Float64(Float64(y * z) + Float64(Float64(1.0 - z) * x))
end
function tmp = code(x, y, z)
tmp = x + ((y - x) * z);
end
↓
function tmp = code(x, y, z)
tmp = (y * z) + ((1.0 - z) * x);
end
code[x_, y_, z_] := N[(x + N[(N[(y - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]
↓
code[x_, y_, z_] := N[(N[(y * z), $MachinePrecision] + N[(N[(1.0 - z), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]
x + \left(y - x\right) \cdot z
↓
y \cdot z + \left(1 - z\right) \cdot x
Alternatives Alternative 1 Error 16.3 Cost 848
\[\begin{array}{l}
t_0 := \left(1 - z\right) \cdot x\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{-99}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-137}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-171}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;x \leq 9 \cdot 10^{-184}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 2 Error 24.1 Cost 652
\[\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{-24}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 13.2:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+121}:\\
\;\;\;\;z \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\]
Alternative 3 Error 12.0 Cost 584
\[\begin{array}{l}
t_0 := \left(y - x\right) \cdot z\\
\mathbf{if}\;z \leq -1.45 \cdot 10^{-23}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{-10}:\\
\;\;\;\;\left(1 - z\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\]
Alternative 4 Error 23.8 Cost 456
\[\begin{array}{l}
\mathbf{if}\;z \leq -9.6 \cdot 10^{-25}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{-9}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\]
Alternative 5 Error 0.0 Cost 448
\[x + \left(y - x\right) \cdot z
\]
Alternative 6 Error 34.9 Cost 64
\[x
\]