
(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 16 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 (- z 1.0) (log1p (- y)) (- (* (+ x -1.0) (log y)) t)))
double code(double x, double y, double z, double t) {
return fma((z - 1.0), log1p(-y), (((x + -1.0) * log(y)) - t));
}
function code(x, y, z, t) return fma(Float64(z - 1.0), log1p(Float64(-y)), Float64(Float64(Float64(x + -1.0) * log(y)) - t)) end
code[x_, y_, z_, t_] := N[(N[(z - 1.0), $MachinePrecision] * N[Log[1 + (-y)], $MachinePrecision] + N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(z - 1, \mathsf{log1p}\left(-y\right), \left(x + -1\right) \cdot \log y - t\right)
\end{array}
Initial program 88.5%
+-commutative88.5%
associate--l+88.5%
fma-def88.5%
sub-neg88.5%
log1p-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (+ (* (log1p (- y)) (- z 1.0)) (- (* (log (/ 1.0 y)) (- 1.0 x)) t)))
double code(double x, double y, double z, double t) {
return (log1p(-y) * (z - 1.0)) + ((log((1.0 / y)) * (1.0 - x)) - t);
}
public static double code(double x, double y, double z, double t) {
return (Math.log1p(-y) * (z - 1.0)) + ((Math.log((1.0 / y)) * (1.0 - x)) - t);
}
def code(x, y, z, t): return (math.log1p(-y) * (z - 1.0)) + ((math.log((1.0 / y)) * (1.0 - x)) - t)
function code(x, y, z, t) return Float64(Float64(log1p(Float64(-y)) * Float64(z - 1.0)) + Float64(Float64(log(Float64(1.0 / y)) * Float64(1.0 - x)) - t)) end
code[x_, y_, z_, t_] := N[(N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{log1p}\left(-y\right) \cdot \left(z - 1\right) + \left(\log \left(\frac{1}{y}\right) \cdot \left(1 - x\right) - t\right)
\end{array}
Initial program 88.5%
associate--l+88.5%
+-commutative88.5%
associate-+l-88.5%
*-commutative88.5%
*-commutative88.5%
sub-neg88.5%
metadata-eval88.5%
sub-neg88.5%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (<= (+ x -1.0) -1.0)))
(if (or t_1 (not t_1))
(- (* (+ x -1.0) (log y)) t)
(- (* y (- 1.0 z)) (+ (log y) t)))))
double code(double x, double y, double z, double t) {
int t_1 = (x + -1.0) <= -1.0;
double tmp;
if (t_1 || !t_1) {
tmp = ((x + -1.0) * log(y)) - 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
logical :: t_1
real(8) :: tmp
t_1 = (x + (-1.0d0)) <= (-1.0d0)
if (t_1 .or. (.not. t_1)) then
tmp = ((x + (-1.0d0)) * log(y)) - 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) {
boolean t_1 = (x + -1.0) <= -1.0;
double tmp;
if (t_1 || !t_1) {
tmp = ((x + -1.0) * Math.log(y)) - t;
} else {
tmp = (y * (1.0 - z)) - (Math.log(y) + t);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + -1.0) <= -1.0 tmp = 0 if t_1 or not t_1: tmp = ((x + -1.0) * math.log(y)) - t else: tmp = (y * (1.0 - z)) - (math.log(y) + t) return tmp
function code(x, y, z, t) t_1 = Float64(x + -1.0) <= -1.0 tmp = 0.0 if (t_1 || !t_1) tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t); else tmp = Float64(Float64(y * Float64(1.0 - z)) - Float64(log(y) + t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + -1.0) <= -1.0; tmp = 0.0; if (t_1 || ~(t_1)) tmp = ((x + -1.0) * log(y)) - t; else tmp = (y * (1.0 - z)) - (log(y) + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = LessEqual[N[(x + -1.0), $MachinePrecision], -1.0]}, If[Or[t$95$1, N[Not[t$95$1], $MachinePrecision]], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + -1 \leq -1\\
\mathbf{if}\;t_1 \lor \neg t_1:\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(1 - z\right) - \left(\log y + t\right)\\
\end{array}
\end{array}
if (-.f64 x 1) < -1 or -1 < (-.f64 x 1) Initial program 88.5%
Taylor expanded in y around 0 87.0%
if -1 < (-.f64 x 1) < -1Initial program 88.5%
associate--l+88.5%
+-commutative88.5%
associate-+l-88.5%
*-commutative88.5%
*-commutative88.5%
sub-neg88.5%
metadata-eval88.5%
sub-neg88.5%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 68.8%
+-commutative68.8%
Simplified68.8%
Taylor expanded in y around 0 68.0%
associate-*r*68.0%
*-commutative68.0%
sub-neg68.0%
metadata-eval68.0%
+-commutative68.0%
distribute-lft-in68.0%
metadata-eval68.0%
neg-mul-168.0%
Simplified68.0%
Final simplification87.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (<= (+ x -1.0) -1.0)))
(if t_1
(- (* (log (/ 1.0 y)) (- 1.0 x)) t)
(if t_1 (- (* y (- 1.0 z)) (+ (log y) t)) (- (* (+ x -1.0) (log y)) t)))))
double code(double x, double y, double z, double t) {
int t_1 = (x + -1.0) <= -1.0;
double tmp;
if (t_1) {
tmp = (log((1.0 / y)) * (1.0 - x)) - t;
} else if (t_1) {
tmp = (y * (1.0 - z)) - (log(y) + t);
} else {
tmp = ((x + -1.0) * 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
logical :: t_1
real(8) :: tmp
t_1 = (x + (-1.0d0)) <= (-1.0d0)
if (t_1) then
tmp = (log((1.0d0 / y)) * (1.0d0 - x)) - t
else if (t_1) then
tmp = (y * (1.0d0 - z)) - (log(y) + t)
else
tmp = ((x + (-1.0d0)) * log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
boolean t_1 = (x + -1.0) <= -1.0;
double tmp;
if (t_1) {
tmp = (Math.log((1.0 / y)) * (1.0 - x)) - t;
} else if (t_1) {
tmp = (y * (1.0 - z)) - (Math.log(y) + t);
} else {
tmp = ((x + -1.0) * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + -1.0) <= -1.0 tmp = 0 if t_1: tmp = (math.log((1.0 / y)) * (1.0 - x)) - t elif t_1: tmp = (y * (1.0 - z)) - (math.log(y) + t) else: tmp = ((x + -1.0) * math.log(y)) - t return tmp
function code(x, y, z, t) t_1 = Float64(x + -1.0) <= -1.0 tmp = 0.0 if (t_1) tmp = Float64(Float64(log(Float64(1.0 / y)) * Float64(1.0 - x)) - t); elseif (t_1) tmp = Float64(Float64(y * Float64(1.0 - z)) - Float64(log(y) + t)); else tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + -1.0) <= -1.0; tmp = 0.0; if (t_1) tmp = (log((1.0 / y)) * (1.0 - x)) - t; elseif (t_1) tmp = (y * (1.0 - z)) - (log(y) + t); else tmp = ((x + -1.0) * log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = LessEqual[N[(x + -1.0), $MachinePrecision], -1.0]}, If[t$95$1, N[(N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] * N[(1.0 - x), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[t$95$1, N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + -1 \leq -1\\
\mathbf{if}\;t_1:\\
\;\;\;\;\log \left(\frac{1}{y}\right) \cdot \left(1 - x\right) - t\\
\mathbf{elif}\;t_1:\\
\;\;\;\;y \cdot \left(1 - z\right) - \left(\log y + t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\
\end{array}
\end{array}
if (-.f64 x 1) < -1Initial program 87.0%
Taylor expanded in y around 0 84.9%
Taylor expanded in y around inf 84.9%
if -1 < (-.f64 x 1) < -1Initial program 88.5%
associate--l+88.5%
+-commutative88.5%
associate-+l-88.5%
*-commutative88.5%
*-commutative88.5%
sub-neg88.5%
metadata-eval88.5%
sub-neg88.5%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 68.8%
+-commutative68.8%
Simplified68.8%
Taylor expanded in y around 0 68.0%
associate-*r*68.0%
*-commutative68.0%
sub-neg68.0%
metadata-eval68.0%
+-commutative68.0%
distribute-lft-in68.0%
metadata-eval68.0%
neg-mul-168.0%
Simplified68.0%
if -1 < (-.f64 x 1) Initial program 92.7%
Taylor expanded in y around 0 92.7%
Final simplification87.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- y (log y))) (t_2 (* x (log y))))
(if (<= t -56000000000.0)
(- t)
(if (<= t -7.5e-219)
t_2
(if (<= t -1.62e-281)
t_1
(if (<= t 4.8e-55)
t_2
(if (<= t 1.26e-34)
(* y (- 1.0 z))
(if (<= t 400.0) t_1 (- t)))))))))
double code(double x, double y, double z, double t) {
double t_1 = y - log(y);
double t_2 = x * log(y);
double tmp;
if (t <= -56000000000.0) {
tmp = -t;
} else if (t <= -7.5e-219) {
tmp = t_2;
} else if (t <= -1.62e-281) {
tmp = t_1;
} else if (t <= 4.8e-55) {
tmp = t_2;
} else if (t <= 1.26e-34) {
tmp = y * (1.0 - z);
} else if (t <= 400.0) {
tmp = t_1;
} else {
tmp = -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) :: t_2
real(8) :: tmp
t_1 = y - log(y)
t_2 = x * log(y)
if (t <= (-56000000000.0d0)) then
tmp = -t
else if (t <= (-7.5d-219)) then
tmp = t_2
else if (t <= (-1.62d-281)) then
tmp = t_1
else if (t <= 4.8d-55) then
tmp = t_2
else if (t <= 1.26d-34) then
tmp = y * (1.0d0 - z)
else if (t <= 400.0d0) then
tmp = t_1
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = y - Math.log(y);
double t_2 = x * Math.log(y);
double tmp;
if (t <= -56000000000.0) {
tmp = -t;
} else if (t <= -7.5e-219) {
tmp = t_2;
} else if (t <= -1.62e-281) {
tmp = t_1;
} else if (t <= 4.8e-55) {
tmp = t_2;
} else if (t <= 1.26e-34) {
tmp = y * (1.0 - z);
} else if (t <= 400.0) {
tmp = t_1;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): t_1 = y - math.log(y) t_2 = x * math.log(y) tmp = 0 if t <= -56000000000.0: tmp = -t elif t <= -7.5e-219: tmp = t_2 elif t <= -1.62e-281: tmp = t_1 elif t <= 4.8e-55: tmp = t_2 elif t <= 1.26e-34: tmp = y * (1.0 - z) elif t <= 400.0: tmp = t_1 else: tmp = -t return tmp
function code(x, y, z, t) t_1 = Float64(y - log(y)) t_2 = Float64(x * log(y)) tmp = 0.0 if (t <= -56000000000.0) tmp = Float64(-t); elseif (t <= -7.5e-219) tmp = t_2; elseif (t <= -1.62e-281) tmp = t_1; elseif (t <= 4.8e-55) tmp = t_2; elseif (t <= 1.26e-34) tmp = Float64(y * Float64(1.0 - z)); elseif (t <= 400.0) tmp = t_1; else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = y - log(y); t_2 = x * log(y); tmp = 0.0; if (t <= -56000000000.0) tmp = -t; elseif (t <= -7.5e-219) tmp = t_2; elseif (t <= -1.62e-281) tmp = t_1; elseif (t <= 4.8e-55) tmp = t_2; elseif (t <= 1.26e-34) tmp = y * (1.0 - z); elseif (t <= 400.0) tmp = t_1; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -56000000000.0], (-t), If[LessEqual[t, -7.5e-219], t$95$2, If[LessEqual[t, -1.62e-281], t$95$1, If[LessEqual[t, 4.8e-55], t$95$2, If[LessEqual[t, 1.26e-34], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 400.0], t$95$1, (-t)]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \log y\\
t_2 := x \cdot \log y\\
\mathbf{if}\;t \leq -56000000000:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq -7.5 \cdot 10^{-219}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.62 \cdot 10^{-281}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.26 \cdot 10^{-34}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{elif}\;t \leq 400:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -5.6e10 or 400 < t Initial program 95.0%
associate--l+95.0%
+-commutative95.0%
associate-+l-95.0%
*-commutative95.0%
*-commutative95.0%
sub-neg95.0%
metadata-eval95.0%
sub-neg95.0%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 74.8%
neg-mul-174.8%
Simplified74.8%
if -5.6e10 < t < -7.4999999999999996e-219 or -1.6200000000000001e-281 < t < 4.79999999999999983e-55Initial program 85.4%
associate--l+85.4%
+-commutative85.4%
associate-+l-85.4%
*-commutative85.4%
*-commutative85.4%
sub-neg85.4%
metadata-eval85.4%
sub-neg85.4%
log1p-def99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 50.0%
if -7.4999999999999996e-219 < t < -1.6200000000000001e-281 or 1.26000000000000009e-34 < t < 400Initial program 90.8%
associate--l+90.8%
+-commutative90.8%
associate-+l-90.8%
*-commutative90.8%
*-commutative90.8%
sub-neg90.8%
metadata-eval90.8%
sub-neg90.8%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 82.3%
+-commutative82.3%
Simplified82.3%
Taylor expanded in y around 0 77.7%
associate-*r*77.7%
*-commutative77.7%
sub-neg77.7%
metadata-eval77.7%
+-commutative77.7%
distribute-lft-in77.7%
metadata-eval77.7%
neg-mul-177.7%
Simplified77.7%
Taylor expanded in z around 0 67.2%
Taylor expanded in t around 0 62.2%
if 4.79999999999999983e-55 < t < 1.26000000000000009e-34Initial program 35.7%
associate--l+35.7%
+-commutative35.7%
associate-+l-35.7%
*-commutative35.7%
*-commutative35.7%
sub-neg35.7%
metadata-eval35.7%
sub-neg35.7%
log1p-def100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
neg-sub0100.0%
associate--r-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 89.0%
+-commutative89.0%
Simplified89.0%
Taylor expanded in y around 0 89.0%
associate-*r*89.0%
*-commutative89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
distribute-lft-in89.0%
metadata-eval89.0%
neg-mul-189.0%
Simplified89.0%
Taylor expanded in y around inf 68.1%
Final simplification63.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (- (log y)) t)) (t_2 (* (+ x -1.0) (log y))))
(if (<= t -48000000.0)
t_1
(if (<= t 4.5e-55)
t_2
(if (<= t 2e-34)
(- (* y (- 1.0 z)) (log y))
(if (<= t 1.3e-11) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = -log(y) - t;
double t_2 = (x + -1.0) * log(y);
double tmp;
if (t <= -48000000.0) {
tmp = t_1;
} else if (t <= 4.5e-55) {
tmp = t_2;
} else if (t <= 2e-34) {
tmp = (y * (1.0 - z)) - log(y);
} else if (t <= 1.3e-11) {
tmp = t_2;
} else {
tmp = t_1;
}
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) :: t_2
real(8) :: tmp
t_1 = -log(y) - t
t_2 = (x + (-1.0d0)) * log(y)
if (t <= (-48000000.0d0)) then
tmp = t_1
else if (t <= 4.5d-55) then
tmp = t_2
else if (t <= 2d-34) then
tmp = (y * (1.0d0 - z)) - log(y)
else if (t <= 1.3d-11) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -Math.log(y) - t;
double t_2 = (x + -1.0) * Math.log(y);
double tmp;
if (t <= -48000000.0) {
tmp = t_1;
} else if (t <= 4.5e-55) {
tmp = t_2;
} else if (t <= 2e-34) {
tmp = (y * (1.0 - z)) - Math.log(y);
} else if (t <= 1.3e-11) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -math.log(y) - t t_2 = (x + -1.0) * math.log(y) tmp = 0 if t <= -48000000.0: tmp = t_1 elif t <= 4.5e-55: tmp = t_2 elif t <= 2e-34: tmp = (y * (1.0 - z)) - math.log(y) elif t <= 1.3e-11: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-log(y)) - t) t_2 = Float64(Float64(x + -1.0) * log(y)) tmp = 0.0 if (t <= -48000000.0) tmp = t_1; elseif (t <= 4.5e-55) tmp = t_2; elseif (t <= 2e-34) tmp = Float64(Float64(y * Float64(1.0 - z)) - log(y)); elseif (t <= 1.3e-11) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -log(y) - t; t_2 = (x + -1.0) * log(y); tmp = 0.0; if (t <= -48000000.0) tmp = t_1; elseif (t <= 4.5e-55) tmp = t_2; elseif (t <= 2e-34) tmp = (y * (1.0 - z)) - log(y); elseif (t <= 1.3e-11) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -48000000.0], t$95$1, If[LessEqual[t, 4.5e-55], t$95$2, If[LessEqual[t, 2e-34], N[(N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision] - N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.3e-11], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\log y\right) - t\\
t_2 := \left(x + -1\right) \cdot \log y\\
\mathbf{if}\;t \leq -48000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-55}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-34}:\\
\;\;\;\;y \cdot \left(1 - z\right) - \log y\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-11}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.8e7 or 1.3e-11 < t Initial program 95.1%
Taylor expanded in y around 0 94.8%
Taylor expanded in x around 0 76.7%
mul-1-neg76.7%
Simplified76.7%
if -4.8e7 < t < 4.4999999999999997e-55 or 1.99999999999999986e-34 < t < 1.3e-11Initial program 85.9%
Taylor expanded in y around 0 83.2%
Taylor expanded in t around 0 82.6%
if 4.4999999999999997e-55 < t < 1.99999999999999986e-34Initial program 35.7%
associate--l+35.7%
+-commutative35.7%
associate-+l-35.7%
*-commutative35.7%
*-commutative35.7%
sub-neg35.7%
metadata-eval35.7%
sub-neg35.7%
log1p-def100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
neg-sub0100.0%
associate--r-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 89.0%
+-commutative89.0%
Simplified89.0%
Taylor expanded in y around 0 89.0%
associate-*r*89.0%
*-commutative89.0%
sub-neg89.0%
metadata-eval89.0%
+-commutative89.0%
distribute-lft-in89.0%
metadata-eval89.0%
neg-mul-189.0%
Simplified89.0%
Taylor expanded in t around 0 89.0%
Final simplification80.0%
(FPCore (x y z t) :precision binary64 (- (- (* (+ x -1.0) (log y)) (* y (- z 1.0))) t))
double code(double x, double y, double z, double t) {
return (((x + -1.0) * log(y)) - (y * (z - 1.0))) - 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 - 1.0d0))) - t
end function
public static double code(double x, double y, double z, double t) {
return (((x + -1.0) * Math.log(y)) - (y * (z - 1.0))) - t;
}
def code(x, y, z, t): return (((x + -1.0) * math.log(y)) - (y * (z - 1.0))) - t
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x + -1.0) * log(y)) - Float64(y * Float64(z - 1.0))) - t) end
function tmp = code(x, y, z, t) tmp = (((x + -1.0) * log(y)) - (y * (z - 1.0))) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(y * N[(z - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + -1\right) \cdot \log y - y \cdot \left(z - 1\right)\right) - t
\end{array}
Initial program 88.5%
associate--l+88.5%
+-commutative88.5%
associate-+l-88.5%
*-commutative88.5%
*-commutative88.5%
sub-neg88.5%
metadata-eval88.5%
sub-neg88.5%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around 0 99.0%
Simplified99.0%
Final simplification99.0%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.2e+189) (not (<= z 1.22e+154))) (- (* (log1p (- y)) (- z 1.0)) t) (- (* (+ x -1.0) (log y)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.2e+189) || !(z <= 1.22e+154)) {
tmp = (log1p(-y) * (z - 1.0)) - t;
} else {
tmp = ((x + -1.0) * log(y)) - t;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.2e+189) || !(z <= 1.22e+154)) {
tmp = (Math.log1p(-y) * (z - 1.0)) - t;
} else {
tmp = ((x + -1.0) * Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.2e+189) or not (z <= 1.22e+154): tmp = (math.log1p(-y) * (z - 1.0)) - t else: tmp = ((x + -1.0) * math.log(y)) - t return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.2e+189) || !(z <= 1.22e+154)) tmp = Float64(Float64(log1p(Float64(-y)) * Float64(z - 1.0)) - t); else tmp = Float64(Float64(Float64(x + -1.0) * log(y)) - t); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.2e+189], N[Not[LessEqual[z, 1.22e+154]], $MachinePrecision]], N[(N[(N[Log[1 + (-y)], $MachinePrecision] * N[(z - 1.0), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+189} \lor \neg \left(z \leq 1.22 \cdot 10^{+154}\right):\\
\;\;\;\;\mathsf{log1p}\left(-y\right) \cdot \left(z - 1\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(x + -1\right) \cdot \log y - t\\
\end{array}
\end{array}
if z < -1.2e189 or 1.22e154 < z Initial program 57.5%
associate--l+57.5%
+-commutative57.5%
associate-+l-57.5%
*-commutative57.5%
*-commutative57.5%
sub-neg57.5%
metadata-eval57.5%
sub-neg57.5%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 74.3%
if -1.2e189 < z < 1.22e154Initial program 96.4%
Taylor expanded in y around 0 95.5%
Final simplification91.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2.5e+18)
t_1
(if (<= x 7.5)
(- (- (log y)) t)
(if (or (<= x 3.6e+31) (not (<= x 7.8e+124))) t_1 (- t))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2.5e+18) {
tmp = t_1;
} else if (x <= 7.5) {
tmp = -log(y) - t;
} else if ((x <= 3.6e+31) || !(x <= 7.8e+124)) {
tmp = t_1;
} else {
tmp = -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.5d+18)) then
tmp = t_1
else if (x <= 7.5d0) then
tmp = -log(y) - t
else if ((x <= 3.6d+31) .or. (.not. (x <= 7.8d+124))) then
tmp = t_1
else
tmp = -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.5e+18) {
tmp = t_1;
} else if (x <= 7.5) {
tmp = -Math.log(y) - t;
} else if ((x <= 3.6e+31) || !(x <= 7.8e+124)) {
tmp = t_1;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2.5e+18: tmp = t_1 elif x <= 7.5: tmp = -math.log(y) - t elif (x <= 3.6e+31) or not (x <= 7.8e+124): tmp = t_1 else: tmp = -t return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2.5e+18) tmp = t_1; elseif (x <= 7.5) tmp = Float64(Float64(-log(y)) - t); elseif ((x <= 3.6e+31) || !(x <= 7.8e+124)) tmp = t_1; else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2.5e+18) tmp = t_1; elseif (x <= 7.5) tmp = -log(y) - t; elseif ((x <= 3.6e+31) || ~((x <= 7.8e+124))) tmp = t_1; else tmp = -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.5e+18], t$95$1, If[LessEqual[x, 7.5], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], If[Or[LessEqual[x, 3.6e+31], N[Not[LessEqual[x, 7.8e+124]], $MachinePrecision]], t$95$1, (-t)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.5:\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+31} \lor \neg \left(x \leq 7.8 \cdot 10^{+124}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if x < -2.5e18 or 7.5 < x < 3.59999999999999996e31 or 7.8000000000000001e124 < x Initial program 94.6%
associate--l+94.6%
+-commutative94.6%
associate-+l-94.6%
*-commutative94.6%
*-commutative94.6%
sub-neg94.6%
metadata-eval94.6%
sub-neg94.6%
log1p-def99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 74.3%
if -2.5e18 < x < 7.5Initial program 84.2%
Taylor expanded in y around 0 82.9%
Taylor expanded in x around 0 81.0%
mul-1-neg81.0%
Simplified81.0%
if 3.59999999999999996e31 < x < 7.8000000000000001e124Initial program 87.2%
associate--l+87.2%
+-commutative87.2%
associate-+l-87.2%
*-commutative87.2%
*-commutative87.2%
sub-neg87.2%
metadata-eval87.2%
sub-neg87.2%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 57.8%
neg-mul-157.8%
Simplified57.8%
Final simplification76.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= t -38000000000.0)
(- t)
(if (<= t 4.8e-55)
t_1
(if (<= t 6.4e-34) (* y (- 1.0 z)) (if (<= t 1.8e+40) t_1 (- t)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (t <= -38000000000.0) {
tmp = -t;
} else if (t <= 4.8e-55) {
tmp = t_1;
} else if (t <= 6.4e-34) {
tmp = y * (1.0 - z);
} else if (t <= 1.8e+40) {
tmp = t_1;
} else {
tmp = -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 (t <= (-38000000000.0d0)) then
tmp = -t
else if (t <= 4.8d-55) then
tmp = t_1
else if (t <= 6.4d-34) then
tmp = y * (1.0d0 - z)
else if (t <= 1.8d+40) then
tmp = t_1
else
tmp = -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 (t <= -38000000000.0) {
tmp = -t;
} else if (t <= 4.8e-55) {
tmp = t_1;
} else if (t <= 6.4e-34) {
tmp = y * (1.0 - z);
} else if (t <= 1.8e+40) {
tmp = t_1;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if t <= -38000000000.0: tmp = -t elif t <= 4.8e-55: tmp = t_1 elif t <= 6.4e-34: tmp = y * (1.0 - z) elif t <= 1.8e+40: tmp = t_1 else: tmp = -t return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (t <= -38000000000.0) tmp = Float64(-t); elseif (t <= 4.8e-55) tmp = t_1; elseif (t <= 6.4e-34) tmp = Float64(y * Float64(1.0 - z)); elseif (t <= 1.8e+40) tmp = t_1; else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (t <= -38000000000.0) tmp = -t; elseif (t <= 4.8e-55) tmp = t_1; elseif (t <= 6.4e-34) tmp = y * (1.0 - z); elseif (t <= 1.8e+40) tmp = t_1; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -38000000000.0], (-t), If[LessEqual[t, 4.8e-55], t$95$1, If[LessEqual[t, 6.4e-34], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e+40], t$95$1, (-t)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;t \leq -38000000000:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 4.8 \cdot 10^{-55}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.4 \cdot 10^{-34}:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -3.8e10 or 1.79999999999999998e40 < t Initial program 95.5%
associate--l+95.5%
+-commutative95.5%
associate-+l-95.5%
*-commutative95.5%
*-commutative95.5%
sub-neg95.5%
metadata-eval95.5%
sub-neg95.5%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 77.9%
neg-mul-177.9%
Simplified77.9%
if -3.8e10 < t < 4.79999999999999983e-55 or 6.40000000000000005e-34 < t < 1.79999999999999998e40Initial program 86.2%
associate--l+86.2%
+-commutative86.2%
associate-+l-86.2%
*-commutative86.2%
*-commutative86.2%
sub-neg86.2%
metadata-eval86.2%
sub-neg86.2%
log1p-def99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-def99.8%
neg-sub099.8%
associate--r-99.8%
neg-sub099.8%
+-commutative99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around inf 46.4%
if 4.79999999999999983e-55 < t < 6.40000000000000005e-34Initial program 42.1%
associate--l+42.1%
+-commutative42.1%
associate-+l-42.1%
*-commutative42.1%
*-commutative42.1%
sub-neg42.1%
metadata-eval42.1%
sub-neg42.1%
log1p-def100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-def100.0%
neg-sub0100.0%
associate--r-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 90.1%
+-commutative90.1%
Simplified90.1%
Taylor expanded in y around 0 90.1%
associate-*r*90.1%
*-commutative90.1%
sub-neg90.1%
metadata-eval90.1%
+-commutative90.1%
distribute-lft-in90.1%
metadata-eval90.1%
neg-mul-190.1%
Simplified90.1%
Taylor expanded in y around inf 61.6%
Final simplification60.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -7000000.0) (not (<= t 1.3e-11))) (- (- (log y)) t) (* (+ x -1.0) (log y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7000000.0) || !(t <= 1.3e-11)) {
tmp = -log(y) - t;
} else {
tmp = (x + -1.0) * log(y);
}
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 <= (-7000000.0d0)) .or. (.not. (t <= 1.3d-11))) then
tmp = -log(y) - t
else
tmp = (x + (-1.0d0)) * log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7000000.0) || !(t <= 1.3e-11)) {
tmp = -Math.log(y) - t;
} else {
tmp = (x + -1.0) * Math.log(y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -7000000.0) or not (t <= 1.3e-11): tmp = -math.log(y) - t else: tmp = (x + -1.0) * math.log(y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -7000000.0) || !(t <= 1.3e-11)) tmp = Float64(Float64(-log(y)) - t); else tmp = Float64(Float64(x + -1.0) * log(y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -7000000.0) || ~((t <= 1.3e-11))) tmp = -log(y) - t; else tmp = (x + -1.0) * log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7000000.0], N[Not[LessEqual[t, 1.3e-11]], $MachinePrecision]], N[((-N[Log[y], $MachinePrecision]) - t), $MachinePrecision], N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7000000 \lor \neg \left(t \leq 1.3 \cdot 10^{-11}\right):\\
\;\;\;\;\left(-\log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(x + -1\right) \cdot \log y\\
\end{array}
\end{array}
if t < -7e6 or 1.3e-11 < t Initial program 95.1%
Taylor expanded in y around 0 94.8%
Taylor expanded in x around 0 76.7%
mul-1-neg76.7%
Simplified76.7%
if -7e6 < t < 1.3e-11Initial program 82.5%
Taylor expanded in y around 0 80.0%
Taylor expanded in t around 0 79.5%
Final simplification78.2%
(FPCore (x y z t) :precision binary64 (- (* (+ x -1.0) (log y)) t))
double code(double x, double y, double z, double t) {
return ((x + -1.0) * 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 + (-1.0d0)) * log(y)) - t
end function
public static double code(double x, double y, double z, double t) {
return ((x + -1.0) * Math.log(y)) - t;
}
def code(x, y, z, t): return ((x + -1.0) * math.log(y)) - t
function code(x, y, z, t) return Float64(Float64(Float64(x + -1.0) * log(y)) - t) end
function tmp = code(x, y, z, t) tmp = ((x + -1.0) * log(y)) - t; end
code[x_, y_, z_, t_] := N[(N[(N[(x + -1.0), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(x + -1\right) \cdot \log y - t
\end{array}
Initial program 88.5%
Taylor expanded in y around 0 87.0%
Final simplification87.0%
(FPCore (x y z t) :precision binary64 (if (<= t -1000000000.0) (- t) (if (<= t 600.0) (* y (- 1.0 z)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1000000000.0) {
tmp = -t;
} else if (t <= 600.0) {
tmp = y * (1.0 - z);
} else {
tmp = -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 (t <= (-1000000000.0d0)) then
tmp = -t
else if (t <= 600.0d0) then
tmp = y * (1.0d0 - z)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1000000000.0) {
tmp = -t;
} else if (t <= 600.0) {
tmp = y * (1.0 - z);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1000000000.0: tmp = -t elif t <= 600.0: tmp = y * (1.0 - z) else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1000000000.0) tmp = Float64(-t); elseif (t <= 600.0) tmp = Float64(y * Float64(1.0 - z)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1000000000.0) tmp = -t; elseif (t <= 600.0) tmp = y * (1.0 - z); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1000000000.0], (-t), If[LessEqual[t, 600.0], N[(y * N[(1.0 - z), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1000000000:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 600:\\
\;\;\;\;y \cdot \left(1 - z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -1e9 or 600 < t Initial program 95.0%
associate--l+95.0%
+-commutative95.0%
associate-+l-95.0%
*-commutative95.0%
*-commutative95.0%
sub-neg95.0%
metadata-eval95.0%
sub-neg95.0%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 74.8%
neg-mul-174.8%
Simplified74.8%
if -1e9 < t < 600Initial program 82.8%
associate--l+82.8%
+-commutative82.8%
associate-+l-82.8%
*-commutative82.8%
*-commutative82.8%
sub-neg82.8%
metadata-eval82.8%
sub-neg82.8%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 57.8%
+-commutative57.8%
Simplified57.8%
Taylor expanded in y around 0 56.2%
associate-*r*56.2%
*-commutative56.2%
sub-neg56.2%
metadata-eval56.2%
+-commutative56.2%
distribute-lft-in56.2%
metadata-eval56.2%
neg-mul-156.2%
Simplified56.2%
Taylor expanded in y around inf 20.3%
Final simplification45.6%
(FPCore (x y z t) :precision binary64 (if (<= t -4100000000.0) (- t) (if (<= t 510.0) (* z (- y)) (- t))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4100000000.0) {
tmp = -t;
} else if (t <= 510.0) {
tmp = z * -y;
} else {
tmp = -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 (t <= (-4100000000.0d0)) then
tmp = -t
else if (t <= 510.0d0) then
tmp = z * -y
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -4100000000.0) {
tmp = -t;
} else if (t <= 510.0) {
tmp = z * -y;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -4100000000.0: tmp = -t elif t <= 510.0: tmp = z * -y else: tmp = -t return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -4100000000.0) tmp = Float64(-t); elseif (t <= 510.0) tmp = Float64(z * Float64(-y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -4100000000.0) tmp = -t; elseif (t <= 510.0) tmp = z * -y; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -4100000000.0], (-t), If[LessEqual[t, 510.0], N[(z * (-y)), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4100000000:\\
\;\;\;\;-t\\
\mathbf{elif}\;t \leq 510:\\
\;\;\;\;z \cdot \left(-y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < -4.1e9 or 510 < t Initial program 95.0%
associate--l+95.0%
+-commutative95.0%
associate-+l-95.0%
*-commutative95.0%
*-commutative95.0%
sub-neg95.0%
metadata-eval95.0%
sub-neg95.0%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 74.8%
neg-mul-174.8%
Simplified74.8%
if -4.1e9 < t < 510Initial program 82.8%
associate--l+82.8%
+-commutative82.8%
associate-+l-82.8%
*-commutative82.8%
*-commutative82.8%
sub-neg82.8%
metadata-eval82.8%
sub-neg82.8%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 57.8%
+-commutative57.8%
Simplified57.8%
Taylor expanded in y around 0 56.2%
associate-*r*56.2%
*-commutative56.2%
sub-neg56.2%
metadata-eval56.2%
+-commutative56.2%
distribute-lft-in56.2%
metadata-eval56.2%
neg-mul-156.2%
Simplified56.2%
Taylor expanded in z around inf 19.6%
mul-1-neg19.6%
*-commutative19.6%
distribute-rgt-neg-in19.6%
Simplified19.6%
Final simplification45.2%
(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 88.5%
associate--l+88.5%
+-commutative88.5%
associate-+l-88.5%
*-commutative88.5%
*-commutative88.5%
sub-neg88.5%
metadata-eval88.5%
sub-neg88.5%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 36.4%
neg-mul-136.4%
Simplified36.4%
Final simplification36.4%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
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
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 88.5%
associate--l+88.5%
+-commutative88.5%
associate-+l-88.5%
*-commutative88.5%
*-commutative88.5%
sub-neg88.5%
metadata-eval88.5%
sub-neg88.5%
log1p-def99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-def99.9%
neg-sub099.9%
associate--r-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 68.8%
+-commutative68.8%
Simplified68.8%
Taylor expanded in y around 0 68.0%
associate-*r*68.0%
*-commutative68.0%
sub-neg68.0%
metadata-eval68.0%
+-commutative68.0%
distribute-lft-in68.0%
metadata-eval68.0%
neg-mul-168.0%
Simplified68.0%
Taylor expanded in z around 0 56.1%
Taylor expanded in y around inf 3.0%
Final simplification3.0%
herbie shell --seed 2023200
(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))