
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (fma (+ a -0.5) (log t) (log (+ x y)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + fma((a + -0.5), log(t), log((x + y)));
}
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + fma(Float64(a + -0.5), log(t), log(Float64(x + y)))) end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \mathsf{fma}\left(a + -0.5, \log t, \log \left(x + y\right)\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log z) (log (+ x y)))))
(if (or (<= t_1 -750.0) (not (<= t_1 700.0)))
(+ (- (log z) t) (* a (log t)))
(- (+ (log (* z y)) (* (log t) (- a 0.5))) t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) + log((x + y));
double tmp;
if ((t_1 <= -750.0) || !(t_1 <= 700.0)) {
tmp = (log(z) - t) + (a * log(t));
} else {
tmp = (log((z * y)) + (log(t) * (a - 0.5))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(z) + log((x + y))
if ((t_1 <= (-750.0d0)) .or. (.not. (t_1 <= 700.0d0))) then
tmp = (log(z) - t) + (a * log(t))
else
tmp = (log((z * y)) + (log(t) * (a - 0.5d0))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(z) + Math.log((x + y));
double tmp;
if ((t_1 <= -750.0) || !(t_1 <= 700.0)) {
tmp = (Math.log(z) - t) + (a * Math.log(t));
} else {
tmp = (Math.log((z * y)) + (Math.log(t) * (a - 0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) + math.log((x + y)) tmp = 0 if (t_1 <= -750.0) or not (t_1 <= 700.0): tmp = (math.log(z) - t) + (a * math.log(t)) else: tmp = (math.log((z * y)) + (math.log(t) * (a - 0.5))) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) + log(Float64(x + y))) tmp = 0.0 if ((t_1 <= -750.0) || !(t_1 <= 700.0)) tmp = Float64(Float64(log(z) - t) + Float64(a * log(t))); else tmp = Float64(Float64(log(Float64(z * y)) + Float64(log(t) * Float64(a - 0.5))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) + log((x + y)); tmp = 0.0; if ((t_1 <= -750.0) || ~((t_1 <= 700.0))) tmp = (log(z) - t) + (a * log(t)); else tmp = (log((z * y)) + (log(t) * (a - 0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -750.0], N[Not[LessEqual[t$95$1, 700.0]], $MachinePrecision]], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z + \log \left(x + y\right)\\
\mathbf{if}\;t\_1 \leq -750 \lor \neg \left(t\_1 \leq 700\right):\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(z \cdot y\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -750 or 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 99.8%
Taylor expanded in a around inf 78.6%
if -750 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
+-commutative99.6%
fma-undefine99.6%
metadata-eval99.6%
sub-neg99.6%
associate-+r+99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
fma-define99.5%
+-commutative99.5%
sum-log99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 62.2%
Final simplification66.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 185.0) (+ (log (+ x y)) (+ (log z) (* (log t) (- a 0.5)))) (* t (+ (/ (* a (log t)) t) -1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 185.0) {
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = t * (((a * log(t)) / t) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 185.0d0) then
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = t * (((a * log(t)) / t) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 185.0) {
tmp = Math.log((x + y)) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = t * (((a * Math.log(t)) / t) + -1.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 185.0: tmp = math.log((x + y)) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = t * (((a * math.log(t)) / t) + -1.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 185.0) tmp = Float64(log(Float64(x + y)) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(t * Float64(Float64(Float64(a * log(t)) / t) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 185.0) tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5))); else tmp = t * (((a * log(t)) / t) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 185.0], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 185:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a \cdot \log t}{t} + -1\right)\\
\end{array}
\end{array}
if t < 185Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in t around 0 98.4%
if 185 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
fma-undefine99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
fma-define99.9%
+-commutative99.9%
sum-log74.4%
Applied egg-rr74.4%
Taylor expanded in t around inf 74.4%
sub-neg74.4%
+-commutative74.4%
mul-1-neg74.4%
unsub-neg74.4%
+-commutative74.4%
log-rec74.4%
associate-/l*74.4%
sub-neg74.4%
metadata-eval74.4%
metadata-eval74.4%
Simplified74.4%
Taylor expanded in a around inf 98.2%
Final simplification98.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 185.0) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (* t (+ (/ (* a (log t)) t) -1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 185.0) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = t * (((a * log(t)) / t) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 185.0d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = t * (((a * log(t)) / t) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 185.0) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = t * (((a * Math.log(t)) / t) + -1.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 185.0: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = t * (((a * math.log(t)) / t) + -1.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 185.0) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(t * Float64(Float64(Float64(a * log(t)) / t) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 185.0) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = t * (((a * log(t)) / t) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 185.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 185:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a \cdot \log t}{t} + -1\right)\\
\end{array}
\end{array}
if t < 185Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in t around 0 98.4%
Taylor expanded in x around 0 57.7%
associate--l+57.6%
Simplified57.6%
if 185 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
fma-undefine99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
fma-define99.9%
+-commutative99.9%
sum-log74.4%
Applied egg-rr74.4%
Taylor expanded in t around inf 74.4%
sub-neg74.4%
+-commutative74.4%
mul-1-neg74.4%
unsub-neg74.4%
+-commutative74.4%
log-rec74.4%
associate-/l*74.4%
sub-neg74.4%
metadata-eval74.4%
metadata-eval74.4%
Simplified74.4%
Taylor expanded in a around inf 98.2%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 185.0) (+ (log z) (+ (log y) (* (log t) (- a 0.5)))) (* t (+ (/ (* a (log t)) t) -1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 185.0) {
tmp = log(z) + (log(y) + (log(t) * (a - 0.5)));
} else {
tmp = t * (((a * log(t)) / t) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 185.0d0) then
tmp = log(z) + (log(y) + (log(t) * (a - 0.5d0)))
else
tmp = t * (((a * log(t)) / t) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 185.0) {
tmp = Math.log(z) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
} else {
tmp = t * (((a * Math.log(t)) / t) + -1.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 185.0: tmp = math.log(z) + (math.log(y) + (math.log(t) * (a - 0.5))) else: tmp = t * (((a * math.log(t)) / t) + -1.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 185.0) tmp = Float64(log(z) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(t * Float64(Float64(Float64(a * log(t)) / t) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 185.0) tmp = log(z) + (log(y) + (log(t) * (a - 0.5))); else tmp = t * (((a * log(t)) / t) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 185.0], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 185:\\
\;\;\;\;\log z + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{a \cdot \log t}{t} + -1\right)\\
\end{array}
\end{array}
if t < 185Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in x around 0 58.1%
Taylor expanded in t around 0 57.7%
remove-double-neg57.7%
log-rec57.7%
mul-1-neg57.7%
+-commutative57.7%
associate--l+57.6%
mul-1-neg57.6%
log-rec57.6%
remove-double-neg57.6%
Simplified57.6%
if 185 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
fma-undefine99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
fma-define99.9%
+-commutative99.9%
sum-log74.4%
Applied egg-rr74.4%
Taylor expanded in t around inf 74.4%
sub-neg74.4%
+-commutative74.4%
mul-1-neg74.4%
unsub-neg74.4%
+-commutative74.4%
log-rec74.4%
associate-/l*74.4%
sub-neg74.4%
metadata-eval74.4%
metadata-eval74.4%
Simplified74.4%
Taylor expanded in a around inf 98.2%
Final simplification79.7%
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log z) (log (+ x y))) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log(z) + log((x + y))) - t) + (log(t) * (a - 0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log(z) + log((x + y))) - t) + (log(t) * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log(z) + Math.log((x + y))) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log(z) + math.log((x + y))) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(z) + log(Float64(x + y))) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log(z) + log((x + y))) - t) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[z], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log z + \log \left(x + y\right)\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 66.4%
Final simplification66.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 3.6e-23) (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) (+ (- (log z) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.6e-23) {
tmp = log((z * (x + y))) + (log(t) * (a - 0.5));
} else {
tmp = (log(z) - t) + (a * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 3.6d-23) then
tmp = log((z * (x + y))) + (log(t) * (a - 0.5d0))
else
tmp = (log(z) - t) + (a * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.6e-23) {
tmp = Math.log((z * (x + y))) + (Math.log(t) * (a - 0.5));
} else {
tmp = (Math.log(z) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.6e-23: tmp = math.log((z * (x + y))) + (math.log(t) * (a - 0.5)) else: tmp = (math.log(z) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.6e-23) tmp = Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(Float64(log(z) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.6e-23) tmp = log((z * (x + y))) + (log(t) * (a - 0.5)); else tmp = (log(z) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.6e-23], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.6 \cdot 10^{-23}:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if t < 3.5999999999999998e-23Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in t around 0 99.2%
associate-+r-99.2%
sum-log76.2%
Applied egg-rr76.2%
if 3.5999999999999998e-23 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 99.9%
Taylor expanded in a around inf 96.6%
Final simplification87.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (log t)))) (if (<= t 185.0) (+ (log (+ x y)) t_1) (* t (+ (/ t_1 t) -1.0)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (t <= 185.0) {
tmp = log((x + y)) + t_1;
} else {
tmp = t * ((t_1 / t) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (t <= 185.0d0) then
tmp = log((x + y)) + t_1
else
tmp = t * ((t_1 / t) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (t <= 185.0) {
tmp = Math.log((x + y)) + t_1;
} else {
tmp = t * ((t_1 / t) + -1.0);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if t <= 185.0: tmp = math.log((x + y)) + t_1 else: tmp = t * ((t_1 / t) + -1.0) return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (t <= 185.0) tmp = Float64(log(Float64(x + y)) + t_1); else tmp = Float64(t * Float64(Float64(t_1 / t) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (t <= 185.0) tmp = log((x + y)) + t_1; else tmp = t * ((t_1 / t) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 185.0], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], N[(t * N[(N[(t$95$1 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;t \leq 185:\\
\;\;\;\;\log \left(x + y\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{t\_1}{t} + -1\right)\\
\end{array}
\end{array}
if t < 185Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in a around inf 55.3%
*-commutative55.3%
Simplified55.3%
if 185 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
fma-undefine99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
fma-define99.9%
+-commutative99.9%
sum-log74.4%
Applied egg-rr74.4%
Taylor expanded in t around inf 74.4%
sub-neg74.4%
+-commutative74.4%
mul-1-neg74.4%
unsub-neg74.4%
+-commutative74.4%
log-rec74.4%
associate-/l*74.4%
sub-neg74.4%
metadata-eval74.4%
metadata-eval74.4%
Simplified74.4%
Taylor expanded in a around inf 98.2%
Final simplification78.6%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (* a (log t))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (a * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) - t) + (a * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (a * Math.log(t));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (a * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(a * log(t))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (a * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + a \cdot \log t
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 99.6%
Taylor expanded in a around inf 78.2%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t 105000.0) (and (not (<= t 1e+36)) (<= t 1e+61))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 105000.0) || (!(t <= 1e+36) && (t <= 1e+61))) {
tmp = a * log(t);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= 105000.0d0) .or. (.not. (t <= 1d+36)) .and. (t <= 1d+61)) then
tmp = a * log(t)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 105000.0) || (!(t <= 1e+36) && (t <= 1e+61))) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= 105000.0) or (not (t <= 1e+36) and (t <= 1e+61)): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= 105000.0) || (!(t <= 1e+36) && (t <= 1e+61))) tmp = Float64(a * log(t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= 105000.0) || (~((t <= 1e+36)) && (t <= 1e+61))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, 105000.0], And[N[Not[LessEqual[t, 1e+36]], $MachinePrecision], LessEqual[t, 1e+61]]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 105000 \lor \neg \left(t \leq 10^{+36}\right) \land t \leq 10^{+61}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 105000 or 1.00000000000000004e36 < t < 9.99999999999999949e60Initial program 99.3%
associate-+l-99.3%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in x around 0 58.8%
Taylor expanded in a around inf 53.1%
*-commutative53.1%
Simplified53.1%
if 105000 < t < 1.00000000000000004e36 or 9.99999999999999949e60 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 79.3%
neg-mul-179.3%
Simplified79.3%
Taylor expanded in t around inf 79.3%
neg-mul-179.3%
Simplified79.3%
Final simplification65.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.95e+39) (not (<= a 1.1e+16))) (* a (log t)) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.95e+39) || !(a <= 1.1e+16)) {
tmp = a * log(t);
} else {
tmp = log((x + y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.95d+39)) .or. (.not. (a <= 1.1d+16))) then
tmp = a * log(t)
else
tmp = log((x + y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.95e+39) || !(a <= 1.1e+16)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.95e+39) or not (a <= 1.1e+16): tmp = a * math.log(t) else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.95e+39) || !(a <= 1.1e+16)) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(x + y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.95e+39) || ~((a <= 1.1e+16))) tmp = a * log(t); else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.95e+39], N[Not[LessEqual[a, 1.1e+16]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+39} \lor \neg \left(a \leq 1.1 \cdot 10^{+16}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -1.95e39 or 1.1e16 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 71.3%
Taylor expanded in a around inf 74.1%
*-commutative74.1%
Simplified74.1%
if -1.95e39 < a < 1.1e16Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 58.7%
neg-mul-158.7%
Simplified58.7%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 2.6e-33) (* a (log t)) (* t (+ -1.0 (* a (/ (log t) t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.6e-33) {
tmp = a * log(t);
} else {
tmp = t * (-1.0 + (a * (log(t) / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 2.6d-33) then
tmp = a * log(t)
else
tmp = t * ((-1.0d0) + (a * (log(t) / t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.6e-33) {
tmp = a * Math.log(t);
} else {
tmp = t * (-1.0 + (a * (Math.log(t) / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.6e-33: tmp = a * math.log(t) else: tmp = t * (-1.0 + (a * (math.log(t) / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.6e-33) tmp = Float64(a * log(t)); else tmp = Float64(t * Float64(-1.0 + Float64(a * Float64(log(t) / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2.6e-33) tmp = a * log(t); else tmp = t * (-1.0 + (a * (log(t) / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.6e-33], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(t * N[(-1.0 + N[(a * N[(N[Log[t], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.6 \cdot 10^{-33}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(-1 + a \cdot \frac{\log t}{t}\right)\\
\end{array}
\end{array}
if t < 2.59999999999999994e-33Initial program 99.2%
associate-+l-99.2%
associate--l+99.1%
sub-neg99.1%
+-commutative99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
fma-undefine99.1%
sub-neg99.1%
+-commutative99.1%
distribute-neg-in99.1%
metadata-eval99.1%
metadata-eval99.1%
unsub-neg99.1%
Simplified99.1%
Taylor expanded in x around 0 57.5%
Taylor expanded in a around inf 47.5%
*-commutative47.5%
Simplified47.5%
if 2.59999999999999994e-33 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
fma-undefine99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
fma-define99.9%
+-commutative99.9%
sum-log74.0%
Applied egg-rr74.0%
Taylor expanded in t around inf 74.0%
sub-neg74.0%
+-commutative74.0%
mul-1-neg74.0%
unsub-neg74.0%
+-commutative74.0%
log-rec74.0%
associate-/l*74.0%
sub-neg74.0%
metadata-eval74.0%
metadata-eval74.0%
Simplified74.0%
Taylor expanded in a around inf 95.2%
associate-/l*95.1%
Simplified95.1%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (log t)))) (if (<= t 2.5e-32) t_1 (* t (+ (/ t_1 t) -1.0)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (t <= 2.5e-32) {
tmp = t_1;
} else {
tmp = t * ((t_1 / t) + -1.0);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (t <= 2.5d-32) then
tmp = t_1
else
tmp = t * ((t_1 / t) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (t <= 2.5e-32) {
tmp = t_1;
} else {
tmp = t * ((t_1 / t) + -1.0);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if t <= 2.5e-32: tmp = t_1 else: tmp = t * ((t_1 / t) + -1.0) return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (t <= 2.5e-32) tmp = t_1; else tmp = Float64(t * Float64(Float64(t_1 / t) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (t <= 2.5e-32) tmp = t_1; else tmp = t * ((t_1 / t) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 2.5e-32], t$95$1, N[(t * N[(N[(t$95$1 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;t \leq 2.5 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{t\_1}{t} + -1\right)\\
\end{array}
\end{array}
if t < 2.5e-32Initial program 99.2%
associate-+l-99.2%
associate--l+99.1%
sub-neg99.1%
+-commutative99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
fma-undefine99.1%
sub-neg99.1%
+-commutative99.1%
distribute-neg-in99.1%
metadata-eval99.1%
metadata-eval99.1%
unsub-neg99.1%
Simplified99.1%
Taylor expanded in x around 0 57.5%
Taylor expanded in a around inf 47.5%
*-commutative47.5%
Simplified47.5%
if 2.5e-32 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
+-commutative99.9%
fma-undefine99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r+99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
fma-define99.9%
+-commutative99.9%
sum-log74.0%
Applied egg-rr74.0%
Taylor expanded in t around inf 74.0%
sub-neg74.0%
+-commutative74.0%
mul-1-neg74.0%
unsub-neg74.0%
+-commutative74.0%
log-rec74.0%
associate-/l*74.0%
sub-neg74.0%
metadata-eval74.0%
metadata-eval74.0%
Simplified74.0%
Taylor expanded in a around inf 95.2%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.3e+38) (not (<= a 2.75e+17))) (* a (log t)) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.3e+38) || !(a <= 2.75e+17)) {
tmp = a * log(t);
} else {
tmp = log(y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.3d+38)) .or. (.not. (a <= 2.75d+17))) then
tmp = a * log(t)
else
tmp = log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.3e+38) || !(a <= 2.75e+17)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.3e+38) or not (a <= 2.75e+17): tmp = a * math.log(t) else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.3e+38) || !(a <= 2.75e+17)) tmp = Float64(a * log(t)); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.3e+38) || ~((a <= 2.75e+17))) tmp = a * log(t); else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.3e+38], N[Not[LessEqual[a, 2.75e+17]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+38} \lor \neg \left(a \leq 2.75 \cdot 10^{+17}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -2.3000000000000001e38 or 2.75e17 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 71.3%
Taylor expanded in a around inf 74.1%
*-commutative74.1%
Simplified74.1%
if -2.3000000000000001e38 < a < 2.75e17Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 58.7%
neg-mul-158.7%
Simplified58.7%
Taylor expanded in x around 0 44.1%
Final simplification57.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 185.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 185.0) {
tmp = log((x + y));
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 185.0d0) then
tmp = log((x + y))
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 185.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 185.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 185.0) tmp = log(Float64(x + y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 185.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 185.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 185:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 185Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in t around inf 9.5%
neg-mul-19.5%
Simplified9.5%
Taylor expanded in t around 0 9.5%
if 185 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 72.9%
neg-mul-172.9%
Simplified72.9%
Taylor expanded in t around inf 73.0%
neg-mul-173.0%
Simplified73.0%
Final simplification44.0%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 43.9%
neg-mul-143.9%
Simplified43.9%
Taylor expanded in t around inf 40.9%
neg-mul-140.9%
Simplified40.9%
Final simplification40.9%
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t)))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log((x + y)) + ((log(z) - t) + ((a - 0.5d0) * log(t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) + ((Math.log(z) - t) + ((a - 0.5) * Math.log(t)));
}
def code(x, y, z, t, a): return math.log((x + y)) + ((math.log(z) - t) + ((a - 0.5) * math.log(t)))
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(Float64(log(z) - t) + Float64(Float64(a - 0.5) * log(t)))) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t))); end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right)
\end{array}
herbie shell --seed 2024078
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))