
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - 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 - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))
double code(double x, double y, double z, double t) {
return (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - 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 - 1.0d0) * log(y)) + ((z - 1.0d0) * log((1.0d0 - y)))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x - 1.0) * Math.log(y)) + ((z - 1.0) * Math.log((1.0 - y)))) - t;
}
def code(x, y, z, t): return (((x - 1.0) * math.log(y)) + ((z - 1.0) * math.log((1.0 - y)))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x - 1.0) * log(y)) + Float64(Float64(z - 1.0) * log(Float64(1.0 - y)))) - t) end
function tmp = code(x, y, z, t) tmp = (((x - 1.0) * log(y)) + ((z - 1.0) * log((1.0 - y)))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x - 1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(z - 1.0), $MachinePrecision] * N[Log[N[(1.0 - y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - 1\right) \cdot \log y + \left(z - 1\right) \cdot \log \left(1 - y\right)\right) - t
\end{array}
(FPCore (x y z t) :precision binary64 (fma (+ x -1.0) (log y) (- (* (log1p (- y)) (+ -1.0 z)) t)))
double code(double x, double y, double z, double t) {
return fma((x + -1.0), log(y), ((log1p(-y) * (-1.0 + z)) - t));
}
function code(x, y, z, t) return fma(Float64(x + -1.0), log(y), Float64(Float64(log1p(Float64(-y)) * Float64(-1.0 + z)) - t)) end
code[x_, y_, z_, t_] := N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(N[(N[Log[1 + (-y)], $MachinePrecision] * N[(-1.0 + z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x + -1, \log y, \mathsf{log1p}\left(-y\right) \cdot \left(-1 + z\right) - t\right)
\end{array}
Initial program 89.7%
associate--l+89.7%
fma-def89.7%
sub-neg89.7%
metadata-eval89.7%
sub-neg89.7%
metadata-eval89.7%
sub-neg89.7%
log1p-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (+ (- (* (+ x -1.0) (log y)) (* -0.5 (* (pow y 2.0) (- 1.0 z)))) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return ((((x + -1.0) * log(y)) - (-0.5 * (pow(y, 2.0) * (1.0 - z)))) + (y * (1.0 - z))) - 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 + (-1.0d0)) * log(y)) - ((-0.5d0) * ((y ** 2.0d0) * (1.0d0 - z)))) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return ((((x + -1.0) * Math.log(y)) - (-0.5 * (Math.pow(y, 2.0) * (1.0 - z)))) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return ((((x + -1.0) * math.log(y)) - (-0.5 * (math.pow(y, 2.0) * (1.0 - z)))) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(Float64(x + -1.0) * log(y)) - Float64(-0.5 * Float64((y ^ 2.0) * Float64(1.0 - z)))) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = ((((x + -1.0) * log(y)) - (-0.5 * ((y ^ 2.0) * (1.0 - z)))) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(-0.5 * N[(N[Power[y, 2.0], $MachinePrecision] * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + -1\right) \cdot \log y - -0.5 \cdot \left({y}^{2} \cdot \left(1 - z\right)\right)\right) + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 89.7%
Taylor expanded in y around 0 99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (fma (+ x -1.0) (log y) (- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
return fma((x + -1.0), log(y), ((y * (1.0 - z)) - t));
}
function code(x, y, z, t) return fma(Float64(x + -1.0), log(y), Float64(Float64(y * Float64(1.0 - z)) - t)) end
code[x_, y_, z_, t_] := N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision] + N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x + -1, \log y, y \cdot \left(1 - z\right) - t\right)
\end{array}
Initial program 89.7%
associate--l+89.7%
fma-def89.7%
sub-neg89.7%
metadata-eval89.7%
sub-neg89.7%
metadata-eval89.7%
sub-neg89.7%
log1p-def99.9%
Simplified99.9%
Taylor expanded in y around 0 99.2%
distribute-lft-out99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
+-commutative99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ x -1.0) -5e+22) (not (<= (+ x -1.0) -0.9999996))) (- (- (* x (log y)) (* y z)) t) (- (- (- (log y)) (* y z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -5e+22) || !((x + -1.0) <= -0.9999996)) {
tmp = ((x * log(y)) - (y * z)) - t;
} else {
tmp = (-log(y) - (y * z)) - t;
}
return tmp;
}
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
real(8) :: tmp
if (((x + (-1.0d0)) <= (-5d+22)) .or. (.not. ((x + (-1.0d0)) <= (-0.9999996d0)))) then
tmp = ((x * log(y)) - (y * z)) - t
else
tmp = (-log(y) - (y * z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -5e+22) || !((x + -1.0) <= -0.9999996)) {
tmp = ((x * Math.log(y)) - (y * z)) - t;
} else {
tmp = (-Math.log(y) - (y * z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x + -1.0) <= -5e+22) or not ((x + -1.0) <= -0.9999996): tmp = ((x * math.log(y)) - (y * z)) - t else: tmp = (-math.log(y) - (y * z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x + -1.0) <= -5e+22) || !(Float64(x + -1.0) <= -0.9999996)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(y * z)) - t); else tmp = Float64(Float64(Float64(-log(y)) - Float64(y * z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x + -1.0) <= -5e+22) || ~(((x + -1.0) <= -0.9999996))) tmp = ((x * log(y)) - (y * z)) - t; else tmp = (-log(y) - (y * z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x + -1.0), $MachinePrecision], -5e+22], N[Not[LessEqual[N[(x + -1.0), $MachinePrecision], -0.9999996]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[((-N[Log[y], $MachinePrecision]) - N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + -1 \leq -5 \cdot 10^{+22} \lor \neg \left(x + -1 \leq -0.9999996\right):\\
\;\;\;\;\left(x \cdot \log y - y \cdot z\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\log y\right) - y \cdot z\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -4.9999999999999996e22 or -0.99999959999999999 < (-.f64 x 1) Initial program 93.1%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
mul-1-neg99.7%
sub-neg99.7%
metadata-eval99.7%
sub0-neg99.7%
associate-+r-99.7%
+-rgt-identity99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 98.7%
*-commutative98.7%
Simplified98.7%
if -4.9999999999999996e22 < (-.f64 x 1) < -0.99999959999999999Initial program 87.0%
Taylor expanded in y around 0 99.0%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
mul-1-neg98.8%
sub-neg98.8%
metadata-eval98.8%
sub0-neg98.8%
associate-+r-98.8%
+-rgt-identity98.8%
+-commutative98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in z around inf 98.2%
Taylor expanded in x around 0 97.9%
mul-1-neg98.5%
Simplified97.9%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ x -1.0) -5e+22) (not (<= (+ x -1.0) -0.9999996))) (- (- (* x (log y)) (* y z)) t) (- (- (* y (- 1.0 z)) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -5e+22) || !((x + -1.0) <= -0.9999996)) {
tmp = ((x * log(y)) - (y * z)) - t;
} else {
tmp = ((y * (1.0 - z)) - log(y)) - t;
}
return tmp;
}
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
real(8) :: tmp
if (((x + (-1.0d0)) <= (-5d+22)) .or. (.not. ((x + (-1.0d0)) <= (-0.9999996d0)))) then
tmp = ((x * log(y)) - (y * z)) - t
else
tmp = ((y * (1.0d0 - z)) - log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -5e+22) || !((x + -1.0) <= -0.9999996)) {
tmp = ((x * Math.log(y)) - (y * z)) - t;
} else {
tmp = ((y * (1.0 - z)) - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x + -1.0) <= -5e+22) or not ((x + -1.0) <= -0.9999996): tmp = ((x * math.log(y)) - (y * z)) - t else: tmp = ((y * (1.0 - z)) - math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x + -1.0) <= -5e+22) || !(Float64(x + -1.0) <= -0.9999996)) tmp = Float64(Float64(Float64(x * log(y)) - Float64(y * z)) - t); else tmp = Float64(Float64(Float64(y * Float64(1.0 - z)) - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x + -1.0) <= -5e+22) || ~(((x + -1.0) <= -0.9999996))) tmp = ((x * log(y)) - (y * z)) - t; else tmp = ((y * (1.0 - z)) - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x + -1.0), $MachinePrecision], -5e+22], N[Not[LessEqual[N[(x + -1.0), $MachinePrecision], -0.9999996]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + -1 \leq -5 \cdot 10^{+22} \lor \neg \left(x + -1 \leq -0.9999996\right):\\
\;\;\;\;\left(x \cdot \log y - y \cdot z\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot \left(1 - z\right) - \log y\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -4.9999999999999996e22 or -0.99999959999999999 < (-.f64 x 1) Initial program 93.1%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
mul-1-neg99.7%
sub-neg99.7%
metadata-eval99.7%
sub0-neg99.7%
associate-+r-99.7%
+-rgt-identity99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 98.7%
*-commutative98.7%
Simplified98.7%
if -4.9999999999999996e22 < (-.f64 x 1) < -0.99999959999999999Initial program 87.0%
Taylor expanded in y around 0 99.0%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
mul-1-neg98.8%
sub-neg98.8%
metadata-eval98.8%
sub0-neg98.8%
associate-+r-98.8%
+-rgt-identity98.8%
+-commutative98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 98.5%
mul-1-neg98.5%
Simplified98.5%
Final simplification98.6%
(FPCore (x y z t) :precision binary64 (if (or (<= (+ x -1.0) -5e+22) (not (<= (+ x -1.0) -1.0))) (- (* (+ x -1.0) (log y)) t) (- (- (- (log y)) (* y z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -5e+22) || !((x + -1.0) <= -1.0)) {
tmp = ((x + -1.0) * log(y)) - t;
} else {
tmp = (-log(y) - (y * z)) - t;
}
return tmp;
}
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
real(8) :: tmp
if (((x + (-1.0d0)) <= (-5d+22)) .or. (.not. ((x + (-1.0d0)) <= (-1.0d0)))) then
tmp = ((x + (-1.0d0)) * log(y)) - t
else
tmp = (-log(y) - (y * z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (((x + -1.0) <= -5e+22) || !((x + -1.0) <= -1.0)) {
tmp = ((x + -1.0) * Math.log(y)) - t;
} else {
tmp = (-Math.log(y) - (y * z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if ((x + -1.0) <= -5e+22) or not ((x + -1.0) <= -1.0): tmp = ((x + -1.0) * math.log(y)) - t else: tmp = (-math.log(y) - (y * z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((Float64(x + -1.0) <= -5e+22) || !(Float64(x + -1.0) <= -1.0)) tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t); else tmp = Float64(Float64(Float64(-log(y)) - Float64(y * z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (((x + -1.0) <= -5e+22) || ~(((x + -1.0) <= -1.0))) tmp = ((x + -1.0) * log(y)) - t; else tmp = (-log(y) - (y * z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[N[(x + -1.0), $MachinePrecision], -5e+22], N[Not[LessEqual[N[(x + -1.0), $MachinePrecision], -1.0]], $MachinePrecision]], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[((-N[Log[y], $MachinePrecision]) - N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + -1 \leq -5 \cdot 10^{+22} \lor \neg \left(x + -1 \leq -1\right):\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(-\log y\right) - y \cdot z\right) - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -4.9999999999999996e22 or -1 < (-.f64 x 1) Initial program 93.2%
associate--l+93.2%
fma-def93.2%
sub-neg93.2%
metadata-eval93.2%
sub-neg93.2%
metadata-eval93.2%
sub-neg93.2%
log1p-def99.8%
Simplified99.8%
Taylor expanded in y around 0 93.2%
if -4.9999999999999996e22 < (-.f64 x 1) < -1Initial program 86.8%
Taylor expanded in y around 0 98.9%
Taylor expanded in y around 0 98.7%
+-commutative98.7%
sub-neg98.7%
metadata-eval98.7%
mul-1-neg98.7%
sub-neg98.7%
metadata-eval98.7%
sub0-neg98.7%
associate-+r-98.7%
+-rgt-identity98.7%
+-commutative98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in z around inf 98.2%
Taylor expanded in x around 0 98.2%
mul-1-neg98.7%
Simplified98.2%
Final simplification95.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2.05e+139)
t_1
(if (<= x -2.5e+58)
(- (* y (- 1.0 z)) t)
(if (or (<= x -1.16e+20) (not (<= x 9.5e+18)))
t_1
(- (- y (log y)) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2.05e+139) {
tmp = t_1;
} else if (x <= -2.5e+58) {
tmp = (y * (1.0 - z)) - t;
} else if ((x <= -1.16e+20) || !(x <= 9.5e+18)) {
tmp = t_1;
} else {
tmp = (y - log(y)) - t;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-2.05d+139)) then
tmp = t_1
else if (x <= (-2.5d+58)) then
tmp = (y * (1.0d0 - z)) - t
else if ((x <= (-1.16d+20)) .or. (.not. (x <= 9.5d+18))) then
tmp = t_1
else
tmp = (y - log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if (x <= -2.05e+139) {
tmp = t_1;
} else if (x <= -2.5e+58) {
tmp = (y * (1.0 - z)) - t;
} else if ((x <= -1.16e+20) || !(x <= 9.5e+18)) {
tmp = t_1;
} else {
tmp = (y - Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2.05e+139: tmp = t_1 elif x <= -2.5e+58: tmp = (y * (1.0 - z)) - t elif (x <= -1.16e+20) or not (x <= 9.5e+18): tmp = t_1 else: tmp = (y - math.log(y)) - t return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2.05e+139) tmp = t_1; elseif (x <= -2.5e+58) tmp = Float64(Float64(y * Float64(1.0 - z)) - t); elseif ((x <= -1.16e+20) || !(x <= 9.5e+18)) tmp = t_1; else tmp = Float64(Float64(y - log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2.05e+139) tmp = t_1; elseif (x <= -2.5e+58) tmp = (y * (1.0 - z)) - t; elseif ((x <= -1.16e+20) || ~((x <= 9.5e+18))) tmp = t_1; else tmp = (y - log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.05e+139], t$95$1, If[LessEqual[x, -2.5e+58], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[x, -1.16e+20], N[Not[LessEqual[x, 9.5e+18]], $MachinePrecision]], t$95$1, N[(N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.05 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.5 \cdot 10^{+58}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\mathbf{elif}\;x \leq -1.16 \cdot 10^{+20} \lor \neg \left(x \leq 9.5 \cdot 10^{+18}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y - \log y\right) - t\\
\end{array}
\end{array}
if x < -2.0500000000000001e139 or -2.49999999999999993e58 < x < -1.16e20 or 9.5e18 < x Initial program 94.3%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
mul-1-neg99.7%
sub-neg99.7%
metadata-eval99.7%
sub0-neg99.7%
associate-+r-99.7%
+-rgt-identity99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 79.7%
*-commutative79.7%
Simplified79.7%
if -2.0500000000000001e139 < x < -2.49999999999999993e58Initial program 88.2%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
sub0-neg99.9%
associate-+r-99.9%
+-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 63.6%
if -1.16e20 < x < 9.5e18Initial program 87.2%
Taylor expanded in y around 0 99.0%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
mul-1-neg98.8%
sub-neg98.8%
metadata-eval98.8%
sub0-neg98.8%
associate-+r-98.8%
+-rgt-identity98.8%
+-commutative98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 96.6%
mul-1-neg96.6%
Simplified96.6%
Taylor expanded in z around 0 83.7%
mul-1-neg83.7%
mul-1-neg83.7%
Simplified83.7%
Final simplification81.0%
(FPCore (x y z t) :precision binary64 (- (+ (* (+ x -1.0) (log y)) (* y (- 1.0 z))) t))
double code(double x, double y, double z, double t) {
return (((x + -1.0) * log(y)) + (y * (1.0 - z))) - 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 + (-1.0d0)) * log(y)) + (y * (1.0d0 - z))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x + -1.0) * Math.log(y)) + (y * (1.0 - z))) - t;
}
def code(x, y, z, t): return (((x + -1.0) * math.log(y)) + (y * (1.0 - z))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x + -1.0) * log(y)) + Float64(y * Float64(1.0 - z))) - t) end
function tmp = code(x, y, z, t) tmp = (((x + -1.0) * log(y)) + (y * (1.0 - z))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + -1\right) \cdot \log y + y \cdot \left(1 - z\right)\right) - t
\end{array}
Initial program 89.7%
Taylor expanded in y around 0 99.3%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
sub-neg99.2%
metadata-eval99.2%
sub0-neg99.2%
associate-+r-99.2%
+-rgt-identity99.2%
+-commutative99.2%
+-commutative99.2%
Simplified99.2%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.7e+139)
t_1
(if (<= x -1.8e+63)
(- (* y (- 1.0 z)) t)
(if (or (<= x -2.7e+20) (not (<= x 6.2e+19))) t_1 (- (- (log y)) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.7e+139) {
tmp = t_1;
} else if (x <= -1.8e+63) {
tmp = (y * (1.0 - z)) - t;
} else if ((x <= -2.7e+20) || !(x <= 6.2e+19)) {
tmp = t_1;
} else {
tmp = -log(y) - t;
}
return tmp;
}
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
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-1.7d+139)) then
tmp = t_1
else if (x <= (-1.8d+63)) then
tmp = (y * (1.0d0 - z)) - t
else if ((x <= (-2.7d+20)) .or. (.not. (x <= 6.2d+19))) then
tmp = t_1
else
tmp = -log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if (x <= -1.7e+139) {
tmp = t_1;
} else if (x <= -1.8e+63) {
tmp = (y * (1.0 - z)) - t;
} else if ((x <= -2.7e+20) || !(x <= 6.2e+19)) {
tmp = t_1;
} else {
tmp = -Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.7e+139: tmp = t_1 elif x <= -1.8e+63: tmp = (y * (1.0 - z)) - t elif (x <= -2.7e+20) or not (x <= 6.2e+19): tmp = t_1 else: tmp = -math.log(y) - t return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.7e+139) tmp = t_1; elseif (x <= -1.8e+63) tmp = Float64(Float64(y * Float64(1.0 - z)) - t); elseif ((x <= -2.7e+20) || !(x <= 6.2e+19)) tmp = t_1; else tmp = Float64(Float64(-log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1.7e+139) tmp = t_1; elseif (x <= -1.8e+63) tmp = (y * (1.0 - z)) - t; elseif ((x <= -2.7e+20) || ~((x <= 6.2e+19))) tmp = t_1; else tmp = -log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e+139], t$95$1, If[LessEqual[x, -1.8e+63], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[x, -2.7e+20], N[Not[LessEqual[x, 6.2e+19]], $MachinePrecision]], t$95$1, N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+139}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{+63}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{+20} \lor \neg \left(x \leq 6.2 \cdot 10^{+19}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(-\log y\right) - t\\
\end{array}
\end{array}
if x < -1.7000000000000001e139 or -1.79999999999999999e63 < x < -2.7e20 or 6.2e19 < x Initial program 94.3%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
mul-1-neg99.7%
sub-neg99.7%
metadata-eval99.7%
sub0-neg99.7%
associate-+r-99.7%
+-rgt-identity99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 79.7%
*-commutative79.7%
Simplified79.7%
if -1.7000000000000001e139 < x < -1.79999999999999999e63Initial program 88.2%
Taylor expanded in y around 0 99.9%
Taylor expanded in y around 0 99.9%
+-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
mul-1-neg99.9%
sub-neg99.9%
metadata-eval99.9%
sub0-neg99.9%
associate-+r-99.9%
+-rgt-identity99.9%
+-commutative99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 63.6%
if -2.7e20 < x < 6.2e19Initial program 87.2%
Taylor expanded in y around 0 99.0%
Taylor expanded in y around 0 98.8%
+-commutative98.8%
sub-neg98.8%
metadata-eval98.8%
mul-1-neg98.8%
sub-neg98.8%
metadata-eval98.8%
sub0-neg98.8%
associate-+r-98.8%
+-rgt-identity98.8%
+-commutative98.8%
+-commutative98.8%
Simplified98.8%
Taylor expanded in x around 0 96.6%
mul-1-neg96.6%
Simplified96.6%
Taylor expanded in y around 0 83.2%
mul-1-neg83.2%
Simplified83.2%
Final simplification80.7%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.7e+139)
(not
(or (<= x -2.3e+58) (and (not (<= x -1.95e+22)) (<= x 3.5e+47)))))
(* x (log y))
(- (* y (- 1.0 z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.7e+139) || !((x <= -2.3e+58) || (!(x <= -1.95e+22) && (x <= 3.5e+47)))) {
tmp = x * log(y);
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
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
real(8) :: tmp
if ((x <= (-1.7d+139)) .or. (.not. (x <= (-2.3d+58)) .or. (.not. (x <= (-1.95d+22))) .and. (x <= 3.5d+47))) then
tmp = x * log(y)
else
tmp = (y * (1.0d0 - z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.7e+139) || !((x <= -2.3e+58) || (!(x <= -1.95e+22) && (x <= 3.5e+47)))) {
tmp = x * Math.log(y);
} else {
tmp = (y * (1.0 - z)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.7e+139) or not ((x <= -2.3e+58) or (not (x <= -1.95e+22) and (x <= 3.5e+47))): tmp = x * math.log(y) else: tmp = (y * (1.0 - z)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.7e+139) || !((x <= -2.3e+58) || (!(x <= -1.95e+22) && (x <= 3.5e+47)))) tmp = Float64(x * log(y)); else tmp = Float64(Float64(y * Float64(1.0 - z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.7e+139) || ~(((x <= -2.3e+58) || (~((x <= -1.95e+22)) && (x <= 3.5e+47))))) tmp = x * log(y); else tmp = (y * (1.0 - z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.7e+139], N[Not[Or[LessEqual[x, -2.3e+58], And[N[Not[LessEqual[x, -1.95e+22]], $MachinePrecision], LessEqual[x, 3.5e+47]]]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{+139} \lor \neg \left(x \leq -2.3 \cdot 10^{+58} \lor \neg \left(x \leq -1.95 \cdot 10^{+22}\right) \land x \leq 3.5 \cdot 10^{+47}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - t\\
\end{array}
\end{array}
if x < -1.7000000000000001e139 or -2.30000000000000002e58 < x < -1.9500000000000001e22 or 3.50000000000000015e47 < x Initial program 94.8%
Taylor expanded in y around 0 99.7%
Taylor expanded in y around 0 99.7%
+-commutative99.7%
sub-neg99.7%
metadata-eval99.7%
mul-1-neg99.7%
sub-neg99.7%
metadata-eval99.7%
sub0-neg99.7%
associate-+r-99.7%
+-rgt-identity99.7%
+-commutative99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 83.5%
*-commutative83.5%
Simplified83.5%
if -1.7000000000000001e139 < x < -2.30000000000000002e58 or -1.9500000000000001e22 < x < 3.50000000000000015e47Initial program 87.4%
Taylor expanded in y around 0 99.1%
Taylor expanded in y around 0 99.0%
+-commutative99.0%
sub-neg99.0%
metadata-eval99.0%
mul-1-neg99.0%
sub-neg99.0%
metadata-eval99.0%
sub0-neg99.0%
associate-+r-99.0%
+-rgt-identity99.0%
+-commutative99.0%
+-commutative99.0%
Simplified99.0%
Taylor expanded in y around inf 64.4%
Final simplification70.3%
(FPCore (x y z t) :precision binary64 (- (- (* (+ x -1.0) (log y)) (* y z)) t))
double code(double x, double y, double z, double t) {
return (((x + -1.0) * log(y)) - (y * z)) - 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 + (-1.0d0)) * log(y)) - (y * z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x + -1.0) * Math.log(y)) - (y * z)) - t;
}
def code(x, y, z, t): return (((x + -1.0) * math.log(y)) - (y * z)) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x + -1.0) * log(y)) - Float64(y * z)) - t) end
function tmp = code(x, y, z, t) tmp = (((x + -1.0) * log(y)) - (y * z)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y * z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + -1\right) \cdot \log y - y \cdot z\right) - t
\end{array}
Initial program 89.7%
Taylor expanded in y around 0 99.3%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
sub-neg99.2%
metadata-eval99.2%
sub0-neg99.2%
associate-+r-99.2%
+-rgt-identity99.2%
+-commutative99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in z around inf 98.9%
Final simplification98.9%
(FPCore (x y z t) :precision binary64 (if (<= z 9.5e+231) (- (* (+ x -1.0) (log y)) t) (- (* y (- z)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 9.5e+231) {
tmp = ((x + -1.0) * log(y)) - t;
} else {
tmp = (y * -z) - t;
}
return tmp;
}
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
real(8) :: tmp
if (z <= 9.5d+231) then
tmp = ((x + (-1.0d0)) * log(y)) - t
else
tmp = (y * -z) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 9.5e+231) {
tmp = ((x + -1.0) * Math.log(y)) - t;
} else {
tmp = (y * -z) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 9.5e+231: tmp = ((x + -1.0) * math.log(y)) - t else: tmp = (y * -z) - t return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 9.5e+231) tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t); else tmp = Float64(Float64(y * Float64(-z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 9.5e+231) tmp = ((x + -1.0) * log(y)) - t; else tmp = (y * -z) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 9.5e+231], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * (-z)), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 9.5 \cdot 10^{+231}:\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right) - t\\
\end{array}
\end{array}
if z < 9.5000000000000002e231Initial program 92.7%
associate--l+92.7%
fma-def92.7%
sub-neg92.7%
metadata-eval92.7%
sub-neg92.7%
metadata-eval92.7%
sub-neg92.7%
log1p-def99.9%
Simplified99.9%
Taylor expanded in y around 0 92.0%
if 9.5000000000000002e231 < z Initial program 45.4%
Taylor expanded in y around 0 95.6%
Taylor expanded in y around 0 95.2%
+-commutative95.2%
sub-neg95.2%
metadata-eval95.2%
mul-1-neg95.2%
sub-neg95.2%
metadata-eval95.2%
sub0-neg95.2%
associate-+r-95.2%
+-rgt-identity95.2%
+-commutative95.2%
+-commutative95.2%
Simplified95.2%
Taylor expanded in z around inf 83.4%
mul-1-neg83.4%
distribute-rgt-neg-in83.4%
Simplified83.4%
Final simplification91.4%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5e-44) (not (<= t 1.1e+20))) (- t) (* y (- 1.0 z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5e-44) || !(t <= 1.1e+20)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
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
real(8) :: tmp
if ((t <= (-5d-44)) .or. (.not. (t <= 1.1d+20))) then
tmp = -t
else
tmp = y * (1.0d0 - z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5e-44) || !(t <= 1.1e+20)) {
tmp = -t;
} else {
tmp = y * (1.0 - z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5e-44) or not (t <= 1.1e+20): tmp = -t else: tmp = y * (1.0 - z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5e-44) || !(t <= 1.1e+20)) tmp = Float64(-t); else tmp = Float64(y * Float64(1.0 - z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5e-44) || ~((t <= 1.1e+20))) tmp = -t; else tmp = y * (1.0 - z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5e-44], N[Not[LessEqual[t, 1.1e+20]], $MachinePrecision]], (-t), N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-44} \lor \neg \left(t \leq 1.1 \cdot 10^{+20}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\end{array}
\end{array}
if t < -5.00000000000000039e-44 or 1.1e20 < t Initial program 95.1%
associate--l+95.1%
fma-def95.1%
sub-neg95.1%
metadata-eval95.1%
sub-neg95.1%
metadata-eval95.1%
sub-neg95.1%
log1p-def99.9%
Simplified99.9%
Taylor expanded in t around inf 69.7%
mul-1-neg69.7%
Simplified69.7%
if -5.00000000000000039e-44 < t < 1.1e20Initial program 83.2%
Taylor expanded in y around 0 98.6%
Taylor expanded in y around 0 98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
mul-1-neg98.5%
sub-neg98.5%
metadata-eval98.5%
sub0-neg98.5%
associate-+r-98.5%
+-rgt-identity98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in x around 0 55.4%
mul-1-neg55.4%
Simplified55.4%
Taylor expanded in y around inf 20.0%
Final simplification47.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5e-44) (not (<= t 1.1e+20))) (- t) (* y (- z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5e-44) || !(t <= 1.1e+20)) {
tmp = -t;
} else {
tmp = y * -z;
}
return tmp;
}
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
real(8) :: tmp
if ((t <= (-5d-44)) .or. (.not. (t <= 1.1d+20))) then
tmp = -t
else
tmp = y * -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5e-44) || !(t <= 1.1e+20)) {
tmp = -t;
} else {
tmp = y * -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5e-44) or not (t <= 1.1e+20): tmp = -t else: tmp = y * -z return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5e-44) || !(t <= 1.1e+20)) tmp = Float64(-t); else tmp = Float64(y * Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -5e-44) || ~((t <= 1.1e+20))) tmp = -t; else tmp = y * -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5e-44], N[Not[LessEqual[t, 1.1e+20]], $MachinePrecision]], (-t), N[(y * (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5 \cdot 10^{-44} \lor \neg \left(t \leq 1.1 \cdot 10^{+20}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(-z\right)\\
\end{array}
\end{array}
if t < -5.00000000000000039e-44 or 1.1e20 < t Initial program 95.1%
associate--l+95.1%
fma-def95.1%
sub-neg95.1%
metadata-eval95.1%
sub-neg95.1%
metadata-eval95.1%
sub-neg95.1%
log1p-def99.9%
Simplified99.9%
Taylor expanded in t around inf 69.7%
mul-1-neg69.7%
Simplified69.7%
if -5.00000000000000039e-44 < t < 1.1e20Initial program 83.2%
Taylor expanded in y around 0 98.6%
Taylor expanded in y around 0 98.5%
+-commutative98.5%
sub-neg98.5%
metadata-eval98.5%
mul-1-neg98.5%
sub-neg98.5%
metadata-eval98.5%
sub0-neg98.5%
associate-+r-98.5%
+-rgt-identity98.5%
+-commutative98.5%
+-commutative98.5%
Simplified98.5%
Taylor expanded in z around inf 98.1%
Taylor expanded in y around inf 19.3%
associate-*r*19.3%
mul-1-neg19.3%
Simplified19.3%
Final simplification46.9%
(FPCore (x y z t) :precision binary64 (- (* y (- 1.0 z)) t))
double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) - 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 = (y * (1.0d0 - z)) - t
end function
public static double code(double x, double y, double z, double t) {
return (y * (1.0 - z)) - t;
}
def code(x, y, z, t): return (y * (1.0 - z)) - t
function code(x, y, z, t) return Float64(Float64(y * Float64(1.0 - z)) - t) end
function tmp = code(x, y, z, t) tmp = (y * (1.0 - z)) - t; end
code[x_, y_, z_, t_] := N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \left(1 - z\right) - t
\end{array}
Initial program 89.7%
Taylor expanded in y around 0 99.3%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
sub-neg99.2%
metadata-eval99.2%
sub0-neg99.2%
associate-+r-99.2%
+-rgt-identity99.2%
+-commutative99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in y around inf 49.6%
Final simplification49.6%
(FPCore (x y z t) :precision binary64 (- (* z (- y)) t))
double code(double x, double y, double z, double t) {
return (z * -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 = (z * -y) - t
end function
public static double code(double x, double y, double z, double t) {
return (z * -y) - t;
}
def code(x, y, z, t): return (z * -y) - t
function code(x, y, z, t) return Float64(Float64(z * Float64(-y)) - t) end
function tmp = code(x, y, z, t) tmp = (z * -y) - t; end
code[x_, y_, z_, t_] := N[(N[(z * (-y)), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(-y\right) - t
\end{array}
Initial program 89.7%
Taylor expanded in y around 0 99.3%
Taylor expanded in y around 0 99.2%
+-commutative99.2%
sub-neg99.2%
metadata-eval99.2%
mul-1-neg99.2%
sub-neg99.2%
metadata-eval99.2%
sub0-neg99.2%
associate-+r-99.2%
+-rgt-identity99.2%
+-commutative99.2%
+-commutative99.2%
Simplified99.2%
Taylor expanded in z around inf 49.4%
mul-1-neg49.4%
distribute-rgt-neg-in49.4%
Simplified49.4%
Final simplification49.4%
(FPCore (x y z t) :precision binary64 (- t))
double code(double x, double y, double z, double t) {
return -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 = -t
end function
public static double code(double x, double y, double z, double t) {
return -t;
}
def code(x, y, z, t): return -t
function code(x, y, z, t) return Float64(-t) end
function tmp = code(x, y, z, t) tmp = -t; end
code[x_, y_, z_, t_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 89.7%
associate--l+89.7%
fma-def89.7%
sub-neg89.7%
metadata-eval89.7%
sub-neg89.7%
metadata-eval89.7%
sub-neg89.7%
log1p-def99.9%
Simplified99.9%
Taylor expanded in t around inf 39.5%
mul-1-neg39.5%
Simplified39.5%
Final simplification39.5%
herbie shell --seed 2023301
(FPCore (x y z t)
:name "Statistics.Distribution.Beta:$cdensity from math-functions-0.1.5.2"
:precision binary64
(- (+ (* (- x 1.0) (log y)) (* (- z 1.0) (log (- 1.0 y)))) t))