Math FPCore C Fortran Java Python Julia MATLAB Wolfram TeX \[\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
\]
↓
\[\left(\left(-0.5 \cdot \left({y}^{2} \cdot z\right) + \left(-0.3333333333333333 \cdot \left(z \cdot {y}^{3}\right) - y \cdot z\right)\right) + x \cdot \log y\right) - t
\]
(FPCore (x y z t)
:precision binary64
(- (+ (* x (log y)) (* z (log (- 1.0 y)))) t)) ↓
(FPCore (x y z t)
:precision binary64
(-
(+
(+
(* -0.5 (* (pow y 2.0) z))
(- (* -0.3333333333333333 (* z (pow y 3.0))) (* y z)))
(* x (log y)))
t)) double code(double x, double y, double z, double t) {
return ((x * log(y)) + (z * log((1.0 - y)))) - t;
}
↓
double code(double x, double y, double z, double t) {
return (((-0.5 * (pow(y, 2.0) * z)) + ((-0.3333333333333333 * (z * pow(y, 3.0))) - (y * z))) + (x * log(y))) - t;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * log(y)) + (z * log((1.0d0 - y)))) - t
end function
↓
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((((-0.5d0) * ((y ** 2.0d0) * z)) + (((-0.3333333333333333d0) * (z * (y ** 3.0d0))) - (y * z))) + (x * log(y))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((x * Math.log(y)) + (z * Math.log((1.0 - y)))) - t;
}
↓
public static double code(double x, double y, double z, double t) {
return (((-0.5 * (Math.pow(y, 2.0) * z)) + ((-0.3333333333333333 * (z * Math.pow(y, 3.0))) - (y * z))) + (x * Math.log(y))) - t;
}
def code(x, y, z, t):
return ((x * math.log(y)) + (z * math.log((1.0 - y)))) - t
↓
def code(x, y, z, t):
return (((-0.5 * (math.pow(y, 2.0) * z)) + ((-0.3333333333333333 * (z * math.pow(y, 3.0))) - (y * z))) + (x * math.log(y))) - t
function code(x, y, z, t)
return Float64(Float64(Float64(x * log(y)) + Float64(z * log(Float64(1.0 - y)))) - t)
end
↓
function code(x, y, z, t)
return Float64(Float64(Float64(Float64(-0.5 * Float64((y ^ 2.0) * z)) + Float64(Float64(-0.3333333333333333 * Float64(z * (y ^ 3.0))) - Float64(y * z))) + Float64(x * log(y))) - t)
end
function tmp = code(x, y, z, t)
tmp = ((x * log(y)) + (z * log((1.0 - y)))) - t;
end
↓
function tmp = code(x, y, z, t)
tmp = (((-0.5 * ((y ^ 2.0) * z)) + ((-0.3333333333333333 * (z * (y ^ 3.0))) - (y * z))) + (x * log(y))) - t;
end
code[x_, y_, z_, t_] := N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
↓
code[x_, y_, z_, t_] := N[(N[(N[(N[(-0.5 * N[(N[Power[y, 2.0], $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] + N[(N[(-0.3333333333333333 * N[(z * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\left(x \cdot \log y + z \cdot \log \left(1 - y\right)\right) - t
↓
\left(\left(-0.5 \cdot \left({y}^{2} \cdot z\right) + \left(-0.3333333333333333 \cdot \left(z \cdot {y}^{3}\right) - y \cdot z\right)\right) + x \cdot \log y\right) - t
Alternatives Alternative 1 Error 0.1 Cost 19712
\[\mathsf{fma}\left(z, \mathsf{log1p}\left(-y\right), x \cdot \log y - t\right)
\]
Alternative 2 Error 9.0 Cost 7380
\[\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t_1 - y \cdot z\\
t_3 := t_1 - t\\
\mathbf{if}\;z \leq -1.6183436434399383 \cdot 10^{+263}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq -6.835687924195195 \cdot 10^{+167}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 2.9342281253659834 \cdot 10^{+154}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;z \leq 3.7569719895179107 \cdot 10^{+202}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.258415033976312 \cdot 10^{+236}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-y\right) - t\\
\end{array}
\]
Alternative 3 Error 0.3 Cost 7360
\[\left(y \cdot \left(-0.5 \cdot \left(y \cdot z\right) - z\right) + x \cdot \log y\right) - t
\]
Alternative 4 Error 6.2 Cost 6984
\[\begin{array}{l}
t_1 := x \cdot \log y - t\\
\mathbf{if}\;x \leq -2.428285371177199 \cdot 10^{-40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.1792494140917817 \cdot 10^{-126}:\\
\;\;\;\;z \cdot \left(\left(y \cdot y\right) \cdot \left(-0.5 + y \cdot -0.3333333333333333\right) - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 5 Error 0.5 Cost 6976
\[x \cdot \log y - \left(y \cdot z + t\right)
\]
Alternative 6 Error 14.3 Cost 6856
\[\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.7440234057405707 \cdot 10^{+109}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.081841202474604 \cdot 10^{+77}:\\
\;\;\;\;z \cdot \left(\left(y \cdot y\right) \cdot \left(-0.5 + y \cdot -0.3333333333333333\right) - y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\]
Alternative 7 Error 27.1 Cost 960
\[z \cdot \left(\left(y \cdot y\right) \cdot \left(-0.5 + y \cdot -0.3333333333333333\right) - y\right) - t
\]
Alternative 8 Error 27.2 Cost 704
\[z \cdot \left(y \cdot \left(y \cdot -0.5\right) - y\right) - t
\]
Alternative 9 Error 32.9 Cost 520
\[\begin{array}{l}
\mathbf{if}\;t \leq -2.533013990074557 \cdot 10^{-97}:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 6.026838816709749 \cdot 10^{-141}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\]
Alternative 10 Error 33.0 Cost 520
\[\begin{array}{l}
\mathbf{if}\;t \leq -2.533013990074557 \cdot 10^{-97}:\\
\;\;\;\;y \cdot z - t\\
\mathbf{elif}\;t \leq 6.026838816709749 \cdot 10^{-141}:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\]
Alternative 11 Error 27.4 Cost 384
\[z \cdot \left(-y\right) - t
\]
Alternative 12 Error 36.5 Cost 128
\[-t
\]