
(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 16 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 (+ 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}
Initial program 99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -2e+55)
t_1
(if (<= (- a 0.5) 2e+34)
(+ (log y) (- (log z) (+ t (* 0.5 (log t)))))
(if (or (<= (- a 0.5) 1e+234) (not (<= (- a 0.5) 5e+290)))
(- (+ (log (* y z)) (* (- a 0.5) (log t))) t)
t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -2e+55) {
tmp = t_1;
} else if ((a - 0.5) <= 2e+34) {
tmp = log(y) + (log(z) - (t + (0.5 * log(t))));
} else if (((a - 0.5) <= 1e+234) || !((a - 0.5) <= 5e+290)) {
tmp = (log((y * z)) + ((a - 0.5) * log(t))) - t;
} else {
tmp = t_1;
}
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 ((a - 0.5d0) <= (-2d+55)) then
tmp = t_1
else if ((a - 0.5d0) <= 2d+34) then
tmp = log(y) + (log(z) - (t + (0.5d0 * log(t))))
else if (((a - 0.5d0) <= 1d+234) .or. (.not. ((a - 0.5d0) <= 5d+290))) then
tmp = (log((y * z)) + ((a - 0.5d0) * log(t))) - t
else
tmp = t_1
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 ((a - 0.5) <= -2e+55) {
tmp = t_1;
} else if ((a - 0.5) <= 2e+34) {
tmp = Math.log(y) + (Math.log(z) - (t + (0.5 * Math.log(t))));
} else if (((a - 0.5) <= 1e+234) || !((a - 0.5) <= 5e+290)) {
tmp = (Math.log((y * z)) + ((a - 0.5) * Math.log(t))) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -2e+55: tmp = t_1 elif (a - 0.5) <= 2e+34: tmp = math.log(y) + (math.log(z) - (t + (0.5 * math.log(t)))) elif ((a - 0.5) <= 1e+234) or not ((a - 0.5) <= 5e+290): tmp = (math.log((y * z)) + ((a - 0.5) * math.log(t))) - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -2e+55) tmp = t_1; elseif (Float64(a - 0.5) <= 2e+34) tmp = Float64(log(y) + Float64(log(z) - Float64(t + Float64(0.5 * log(t))))); elseif ((Float64(a - 0.5) <= 1e+234) || !(Float64(a - 0.5) <= 5e+290)) tmp = Float64(Float64(log(Float64(y * z)) + Float64(Float64(a - 0.5) * log(t))) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -2e+55) tmp = t_1; elseif ((a - 0.5) <= 2e+34) tmp = log(y) + (log(z) - (t + (0.5 * log(t)))); elseif (((a - 0.5) <= 1e+234) || ~(((a - 0.5) <= 5e+290))) tmp = (log((y * z)) + ((a - 0.5) * log(t))) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+55], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], 2e+34], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(t + N[(0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], 1e+234], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 5e+290]], $MachinePrecision]], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a - 0.5 \leq 2 \cdot 10^{+34}:\\
\;\;\;\;\log y + \left(\log z - \left(t + 0.5 \cdot \log t\right)\right)\\
\mathbf{elif}\;a - 0.5 \leq 10^{+234} \lor \neg \left(a - 0.5 \leq 5 \cdot 10^{+290}\right):\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \left(a - 0.5\right) \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -2.00000000000000002e55 or 1.00000000000000002e234 < (-.f64 a #s(literal 1/2 binary64)) < 4.9999999999999998e290Initial 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 x around 0 81.0%
Taylor expanded in a around inf 82.5%
if -2.00000000000000002e55 < (-.f64 a #s(literal 1/2 binary64)) < 1.99999999999999989e34Initial 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 x around 0 63.0%
Taylor expanded in a around 0 58.6%
associate--l+58.5%
Simplified58.5%
if 1.99999999999999989e34 < (-.f64 a #s(literal 1/2 binary64)) < 1.00000000000000002e234 or 4.9999999999999998e290 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate-+r-99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
fma-undefine99.6%
associate-+r-99.6%
sum-log90.9%
Applied egg-rr90.9%
Taylor expanded in x around 0 70.6%
Final simplification66.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- a 0.5) (log t))))
(if (<= t 2.4e-7)
(+ (+ (log z) (log y)) t_1)
(if (<= t 8.4e+96)
(- (+ (log (* y z)) t_1) t)
(- (+ (log z) (+ (log y) (* (log t) -0.5))) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a - 0.5) * log(t);
double tmp;
if (t <= 2.4e-7) {
tmp = (log(z) + log(y)) + t_1;
} else if (t <= 8.4e+96) {
tmp = (log((y * z)) + t_1) - t;
} else {
tmp = (log(z) + (log(y) + (log(t) * -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 = (a - 0.5d0) * log(t)
if (t <= 2.4d-7) then
tmp = (log(z) + log(y)) + t_1
else if (t <= 8.4d+96) then
tmp = (log((y * z)) + t_1) - t
else
tmp = (log(z) + (log(y) + (log(t) * (-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 = (a - 0.5) * Math.log(t);
double tmp;
if (t <= 2.4e-7) {
tmp = (Math.log(z) + Math.log(y)) + t_1;
} else if (t <= 8.4e+96) {
tmp = (Math.log((y * z)) + t_1) - t;
} else {
tmp = (Math.log(z) + (Math.log(y) + (Math.log(t) * -0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a - 0.5) * math.log(t) tmp = 0 if t <= 2.4e-7: tmp = (math.log(z) + math.log(y)) + t_1 elif t <= 8.4e+96: tmp = (math.log((y * z)) + t_1) - t else: tmp = (math.log(z) + (math.log(y) + (math.log(t) * -0.5))) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a - 0.5) * log(t)) tmp = 0.0 if (t <= 2.4e-7) tmp = Float64(Float64(log(z) + log(y)) + t_1); elseif (t <= 8.4e+96) tmp = Float64(Float64(log(Float64(y * z)) + t_1) - t); else tmp = Float64(Float64(log(z) + Float64(log(y) + Float64(log(t) * -0.5))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a - 0.5) * log(t); tmp = 0.0; if (t <= 2.4e-7) tmp = (log(z) + log(y)) + t_1; elseif (t <= 8.4e+96) tmp = (log((y * z)) + t_1) - t; else tmp = (log(z) + (log(y) + (log(t) * -0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 2.4e-7], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 8.4e+96], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot \log t\\
\mathbf{if}\;t \leq 2.4 \cdot 10^{-7}:\\
\;\;\;\;\left(\log z + \log y\right) + t\_1\\
\mathbf{elif}\;t \leq 8.4 \cdot 10^{+96}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + t\_1\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \left(\log y + \log t \cdot -0.5\right)\right) - t\\
\end{array}
\end{array}
if t < 2.39999999999999979e-7Initial program 99.4%
associate-+l-99.4%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-undefine99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in x around 0 64.6%
Taylor expanded in t around 0 64.4%
if 2.39999999999999979e-7 < t < 8.4000000000000005e96Initial program 99.6%
associate-+r-99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
fma-undefine99.5%
associate-+r-99.6%
sum-log72.4%
Applied egg-rr72.4%
Taylor expanded in x around 0 57.5%
if 8.4000000000000005e96 < t Initial program 100.0%
Taylor expanded in a around 0 84.5%
+-commutative84.5%
Simplified84.5%
Taylor expanded in x around 0 60.9%
Final simplification62.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (log z) (log y)))) (if (<= t 0.42) (+ t_1 (* (- a 0.5) (log t))) (+ t_1 (- (* a (log t)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) + log(y);
double tmp;
if (t <= 0.42) {
tmp = t_1 + ((a - 0.5) * log(t));
} else {
tmp = t_1 + ((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) :: t_1
real(8) :: tmp
t_1 = log(z) + log(y)
if (t <= 0.42d0) then
tmp = t_1 + ((a - 0.5d0) * log(t))
else
tmp = t_1 + ((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 t_1 = Math.log(z) + Math.log(y);
double tmp;
if (t <= 0.42) {
tmp = t_1 + ((a - 0.5) * Math.log(t));
} else {
tmp = t_1 + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) + math.log(y) tmp = 0 if t <= 0.42: tmp = t_1 + ((a - 0.5) * math.log(t)) else: tmp = t_1 + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) + log(y)) tmp = 0.0 if (t <= 0.42) tmp = Float64(t_1 + Float64(Float64(a - 0.5) * log(t))); else tmp = Float64(t_1 + Float64(Float64(a * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) + log(y); tmp = 0.0; if (t <= 0.42) tmp = t_1 + ((a - 0.5) * log(t)); else tmp = t_1 + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 0.42], N[(t$95$1 + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z + \log y\\
\mathbf{if}\;t \leq 0.42:\\
\;\;\;\;t\_1 + \left(a - 0.5\right) \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 0.419999999999999984Initial program 99.4%
associate-+l-99.4%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-undefine99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in x around 0 64.4%
Taylor expanded in t around 0 63.6%
if 0.419999999999999984 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 76.4%
Taylor expanded in a around inf 75.7%
mul-1-neg75.7%
Simplified75.7%
Final simplification69.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- a 0.5) (log t))))
(if (<= t 2.2e-7)
(+ (+ (log z) (log y)) t_1)
(if (<= t 2.7e+96) (- (+ (log (* y z)) t_1) t) (- t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a - 0.5) * log(t);
double tmp;
if (t <= 2.2e-7) {
tmp = (log(z) + log(y)) + t_1;
} else if (t <= 2.7e+96) {
tmp = (log((y * z)) + t_1) - 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) :: t_1
real(8) :: tmp
t_1 = (a - 0.5d0) * log(t)
if (t <= 2.2d-7) then
tmp = (log(z) + log(y)) + t_1
else if (t <= 2.7d+96) then
tmp = (log((y * z)) + t_1) - 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 t_1 = (a - 0.5) * Math.log(t);
double tmp;
if (t <= 2.2e-7) {
tmp = (Math.log(z) + Math.log(y)) + t_1;
} else if (t <= 2.7e+96) {
tmp = (Math.log((y * z)) + t_1) - t;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a - 0.5) * math.log(t) tmp = 0 if t <= 2.2e-7: tmp = (math.log(z) + math.log(y)) + t_1 elif t <= 2.7e+96: tmp = (math.log((y * z)) + t_1) - t else: tmp = -t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a - 0.5) * log(t)) tmp = 0.0 if (t <= 2.2e-7) tmp = Float64(Float64(log(z) + log(y)) + t_1); elseif (t <= 2.7e+96) tmp = Float64(Float64(log(Float64(y * z)) + t_1) - t); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a - 0.5) * log(t); tmp = 0.0; if (t <= 2.2e-7) tmp = (log(z) + log(y)) + t_1; elseif (t <= 2.7e+96) tmp = (log((y * z)) + t_1) - t; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 2.2e-7], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 2.7e+96], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], (-t)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot \log t\\
\mathbf{if}\;t \leq 2.2 \cdot 10^{-7}:\\
\;\;\;\;\left(\log z + \log y\right) + t\_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+96}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + t\_1\right) - t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 2.2000000000000001e-7Initial program 99.4%
associate-+l-99.4%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-undefine99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in x around 0 64.6%
Taylor expanded in t around 0 64.4%
if 2.2000000000000001e-7 < t < 2.70000000000000022e96Initial program 99.6%
associate-+r-99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
fma-undefine99.5%
associate-+r-99.6%
sum-log72.4%
Applied egg-rr72.4%
Taylor expanded in x around 0 57.5%
if 2.70000000000000022e96 < t Initial program 100.0%
Taylor expanded in t around inf 84.5%
neg-mul-184.5%
Simplified84.5%
Final simplification70.6%
(FPCore (x y z t a) :precision binary64 (+ (+ (log (+ x y)) (- (log z) t)) (* (log t) (+ a -0.5))))
double code(double x, double y, double z, double t, double a) {
return (log((x + y)) + (log(z) - 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((x + y)) + (log(z) - 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((x + y)) + (Math.log(z) - t)) + (Math.log(t) * (a + -0.5));
}
def code(x, y, z, t, a): return (math.log((x + y)) + (math.log(z) - t)) + (math.log(t) * (a + -0.5))
function code(x, y, z, t, a) return Float64(Float64(log(Float64(x + y)) + Float64(log(z) - t)) + Float64(log(t) * Float64(a + -0.5))) end
function tmp = code(x, y, z, t, a) tmp = (log((x + y)) + (log(z) - t)) + (log(t) * (a + -0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \log t \cdot \left(a + -0.5\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (log y)) (- (* (- a 0.5) (log t)) t)))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) + (((a - 0.5) * log(t)) - 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) + log(y)) + (((a - 0.5d0) * log(t)) - t)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + Math.log(y)) + (((a - 0.5) * Math.log(t)) - t);
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) + (((a - 0.5) * math.log(t)) - t)
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) + Float64(Float64(Float64(a - 0.5) * log(t)) - t)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) + (((a - 0.5) * log(t)) - t); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) + \left(\left(a - 0.5\right) \cdot \log t - t\right)
\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 x around 0 70.4%
Final simplification70.4%
(FPCore (x y z t a) :precision binary64 (+ (log y) (- (+ (log z) (* (log t) (+ a -0.5))) t)))
double code(double x, double y, double z, double t, double a) {
return log(y) + ((log(z) + (log(t) * (a + -0.5))) - 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(y) + ((log(z) + (log(t) * (a + (-0.5d0)))) - t)
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log(y) + ((Math.log(z) + (Math.log(t) * (a + -0.5))) - t);
}
def code(x, y, z, t, a): return math.log(y) + ((math.log(z) + (math.log(t) * (a + -0.5))) - t)
function code(x, y, z, t, a) return Float64(log(y) + Float64(Float64(log(z) + Float64(log(t) * Float64(a + -0.5))) - t)) end
function tmp = code(x, y, z, t, a) tmp = log(y) + ((log(z) + (log(t) * (a + -0.5))) - t); end
code[x_, y_, z_, t_, a_] := N[(N[Log[y], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log y + \left(\left(\log z + \log t \cdot \left(a + -0.5\right)\right) - t\right)
\end{array}
Initial program 99.6%
Taylor expanded in x around 0 70.4%
associate--l+70.4%
remove-double-neg70.4%
log-rec70.4%
mul-1-neg70.4%
mul-1-neg70.4%
log-rec70.4%
remove-double-neg70.4%
sub-neg70.4%
metadata-eval70.4%
+-commutative70.4%
Simplified70.4%
Final simplification70.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))) (t_2 (- (log (* y (* z (pow t -0.5)))) t)))
(if (<= a -4.6e+44)
t_1
(if (<= a 3.5e-185)
t_2
(if (<= a 1.85e-115)
(+ (log (+ x y)) (- (log z) t))
(if (<= a 1.06e+40) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double t_2 = log((y * (z * pow(t, -0.5)))) - t;
double tmp;
if (a <= -4.6e+44) {
tmp = t_1;
} else if (a <= 3.5e-185) {
tmp = t_2;
} else if (a <= 1.85e-115) {
tmp = log((x + y)) + (log(z) - t);
} else if (a <= 1.06e+40) {
tmp = t_2;
} else {
tmp = t_1;
}
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) :: t_2
real(8) :: tmp
t_1 = a * log(t)
t_2 = log((y * (z * (t ** (-0.5d0))))) - t
if (a <= (-4.6d+44)) then
tmp = t_1
else if (a <= 3.5d-185) then
tmp = t_2
else if (a <= 1.85d-115) then
tmp = log((x + y)) + (log(z) - t)
else if (a <= 1.06d+40) 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 a) {
double t_1 = a * Math.log(t);
double t_2 = Math.log((y * (z * Math.pow(t, -0.5)))) - t;
double tmp;
if (a <= -4.6e+44) {
tmp = t_1;
} else if (a <= 3.5e-185) {
tmp = t_2;
} else if (a <= 1.85e-115) {
tmp = Math.log((x + y)) + (Math.log(z) - t);
} else if (a <= 1.06e+40) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) t_2 = math.log((y * (z * math.pow(t, -0.5)))) - t tmp = 0 if a <= -4.6e+44: tmp = t_1 elif a <= 3.5e-185: tmp = t_2 elif a <= 1.85e-115: tmp = math.log((x + y)) + (math.log(z) - t) elif a <= 1.06e+40: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) t_2 = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t) tmp = 0.0 if (a <= -4.6e+44) tmp = t_1; elseif (a <= 3.5e-185) tmp = t_2; elseif (a <= 1.85e-115) tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); elseif (a <= 1.06e+40) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); t_2 = log((y * (z * (t ^ -0.5)))) - t; tmp = 0.0; if (a <= -4.6e+44) tmp = t_1; elseif (a <= 3.5e-185) tmp = t_2; elseif (a <= 1.85e-115) tmp = log((x + y)) + (log(z) - t); elseif (a <= 1.06e+40) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -4.6e+44], t$95$1, If[LessEqual[a, 3.5e-185], t$95$2, If[LessEqual[a, 1.85e-115], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.06e+40], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{if}\;a \leq -4.6 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-185}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{-115}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\mathbf{elif}\;a \leq 1.06 \cdot 10^{+40}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.60000000000000009e44 or 1.05999999999999996e40 < a 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 x around 0 81.8%
Taylor expanded in a around inf 78.6%
if -4.60000000000000009e44 < a < 3.4999999999999998e-185 or 1.85e-115 < a < 1.05999999999999996e40Initial program 99.6%
Taylor expanded in a around 0 92.4%
+-commutative92.4%
Simplified92.4%
Taylor expanded in x around 0 56.9%
*-un-lft-identity56.9%
*-commutative56.9%
add-log-exp52.9%
sum-log44.9%
exp-sum44.9%
add-exp-log45.0%
*-commutative45.0%
exp-to-pow45.0%
Applied egg-rr45.0%
*-rgt-identity45.0%
Simplified45.0%
if 3.4999999999999998e-185 < a < 1.85e-115Initial program 100.0%
associate-+l-100.0%
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 78.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.8e+44) (not (<= a 7.2e+21))) (* a (log t)) (- (+ (* (log t) -0.5) (log (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e+44) || !(a <= 7.2e+21)) {
tmp = a * log(t);
} else {
tmp = ((log(t) * -0.5) + log((y * z))) - 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 <= (-4.8d+44)) .or. (.not. (a <= 7.2d+21))) then
tmp = a * log(t)
else
tmp = ((log(t) * (-0.5d0)) + log((y * z))) - 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 <= -4.8e+44) || !(a <= 7.2e+21)) {
tmp = a * Math.log(t);
} else {
tmp = ((Math.log(t) * -0.5) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.8e+44) or not (a <= 7.2e+21): tmp = a * math.log(t) else: tmp = ((math.log(t) * -0.5) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.8e+44) || !(a <= 7.2e+21)) tmp = Float64(a * log(t)); else tmp = Float64(Float64(Float64(log(t) * -0.5) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.8e+44) || ~((a <= 7.2e+21))) tmp = a * log(t); else tmp = ((log(t) * -0.5) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.8e+44], N[Not[LessEqual[a, 7.2e+21]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{+44} \lor \neg \left(a \leq 7.2 \cdot 10^{+21}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot -0.5 + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -4.80000000000000026e44 or 7.2e21 < a 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 x around 0 82.4%
Taylor expanded in a around inf 75.9%
if -4.80000000000000026e44 < a < 7.2e21Initial program 99.6%
associate-+r-99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
fma-undefine99.6%
associate-+r-99.6%
sum-log76.6%
Applied egg-rr76.6%
Taylor expanded in a around 0 72.9%
Taylor expanded in x around 0 45.4%
+-commutative45.4%
*-commutative45.4%
*-commutative45.4%
Simplified45.4%
Final simplification59.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 3.1e+96) (+ (log (* (+ x y) z)) (- (* (log t) (+ a -0.5)) t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.1e+96) {
tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - 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 <= 3.1d+96) then
tmp = log(((x + y) * z)) + ((log(t) * (a + (-0.5d0))) - 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 <= 3.1e+96) {
tmp = Math.log(((x + y) * z)) + ((Math.log(t) * (a + -0.5)) - t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.1e+96: tmp = math.log(((x + y) * z)) + ((math.log(t) * (a + -0.5)) - t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.1e+96) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(log(t) * Float64(a + -0.5)) - t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.1e+96) tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.1e+96], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.1 \cdot 10^{+96}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 3.0999999999999998e96Initial program 99.4%
associate-+l-99.4%
sum-log79.2%
sub-neg79.2%
metadata-eval79.2%
*-commutative79.2%
Applied egg-rr79.2%
if 3.0999999999999998e96 < t Initial program 100.0%
Taylor expanded in t around inf 84.5%
neg-mul-184.5%
Simplified84.5%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.5e+53) (not (<= a 2.2e+35))) (* a (log t)) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.5e+53) || !(a <= 2.2e+35)) {
tmp = a * log(t);
} else {
tmp = log((x + y)) + (log(z) - 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 <= (-5.5d+53)) .or. (.not. (a <= 2.2d+35))) then
tmp = a * log(t)
else
tmp = log((x + y)) + (log(z) - 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 <= -5.5e+53) || !(a <= 2.2e+35)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) + (Math.log(z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.5e+53) or not (a <= 2.2e+35): tmp = a * math.log(t) else: tmp = math.log((x + y)) + (math.log(z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.5e+53) || !(a <= 2.2e+35)) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.5e+53) || ~((a <= 2.2e+35))) tmp = a * log(t); else tmp = log((x + y)) + (log(z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.5e+53], N[Not[LessEqual[a, 2.2e+35]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+53} \lor \neg \left(a \leq 2.2 \cdot 10^{+35}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\end{array}
\end{array}
if a < -5.49999999999999975e53 or 2.1999999999999999e35 < a 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 x around 0 81.0%
Taylor expanded in a around inf 80.4%
if -5.49999999999999975e53 < a < 2.1999999999999999e35Initial 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 59.6%
Final simplification67.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 7e+96) (- (+ (log (* y z)) (* (- a 0.5) (log t))) t) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 7e+96) {
tmp = (log((y * z)) + ((a - 0.5) * log(t))) - 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 <= 7d+96) then
tmp = (log((y * z)) + ((a - 0.5d0) * log(t))) - 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 <= 7e+96) {
tmp = (Math.log((y * z)) + ((a - 0.5) * Math.log(t))) - t;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 7e+96: tmp = (math.log((y * z)) + ((a - 0.5) * math.log(t))) - t else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 7e+96) tmp = Float64(Float64(log(Float64(y * z)) + Float64(Float64(a - 0.5) * log(t))) - t); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 7e+96) tmp = (log((y * z)) + ((a - 0.5) * log(t))) - t; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 7e+96], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7 \cdot 10^{+96}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \left(a - 0.5\right) \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 6.9999999999999998e96Initial program 99.4%
associate-+r-99.4%
+-commutative99.4%
sub-neg99.4%
metadata-eval99.4%
fma-undefine99.4%
associate-+r-99.4%
sum-log79.2%
Applied egg-rr79.2%
Taylor expanded in x around 0 53.5%
if 6.9999999999999998e96 < t Initial program 100.0%
Taylor expanded in t around inf 84.5%
neg-mul-184.5%
Simplified84.5%
Final simplification64.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.32e+54) (not (<= a 1.35e+42))) (* a (log t)) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.32e+54) || !(a <= 1.35e+42)) {
tmp = a * log(t);
} else {
tmp = (log(z) + 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 <= (-1.32d+54)) .or. (.not. (a <= 1.35d+42))) then
tmp = a * log(t)
else
tmp = (log(z) + 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 <= -1.32e+54) || !(a <= 1.35e+42)) {
tmp = a * Math.log(t);
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.32e+54) or not (a <= 1.35e+42): tmp = a * math.log(t) else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.32e+54) || !(a <= 1.35e+42)) tmp = Float64(a * log(t)); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.32e+54) || ~((a <= 1.35e+42))) tmp = a * log(t); else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.32e+54], N[Not[LessEqual[a, 1.35e+42]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.32 \cdot 10^{+54} \lor \neg \left(a \leq 1.35 \cdot 10^{+42}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -1.3200000000000001e54 or 1.35e42 < a 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 x around 0 81.0%
Taylor expanded in a around inf 80.4%
if -1.3200000000000001e54 < a < 1.35e42Initial 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 x around 0 63.4%
Taylor expanded in t around inf 43.4%
Final simplification58.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 5.6e+31) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 5.6e+31) {
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 <= 5.6d+31) 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 <= 5.6e+31) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 5.6e+31: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 5.6e+31) 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 <= 5.6e+31) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 5.6e+31], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.6 \cdot 10^{+31}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 5.60000000000000034e31Initial program 99.4%
associate-+l-99.4%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-undefine99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in x around 0 65.5%
Taylor expanded in a around inf 51.6%
if 5.60000000000000034e31 < t Initial program 99.9%
Taylor expanded in t around inf 79.6%
neg-mul-179.6%
Simplified79.6%
(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%
Taylor expanded in t around inf 39.1%
neg-mul-139.1%
Simplified39.1%
(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 2024100
(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))))