
(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 14 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(log(Float64(x + y)) + 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[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t
\end{array}
Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.00275) (+ (log z) (+ (log y) (* (log t) (- a 0.5)))) (- (* (+ a -0.5) (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00275) {
tmp = log(z) + (log(y) + (log(t) * (a - 0.5)));
} else {
tmp = ((a + -0.5) * 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 <= 0.00275d0) then
tmp = log(z) + (log(y) + (log(t) * (a - 0.5d0)))
else
tmp = ((a + (-0.5d0)) * 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 <= 0.00275) {
tmp = Math.log(z) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
} else {
tmp = ((a + -0.5) * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.00275: tmp = math.log(z) + (math.log(y) + (math.log(t) * (a - 0.5))) else: tmp = ((a + -0.5) * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.00275) tmp = Float64(log(z) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(Float64(a + -0.5) * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.00275) tmp = log(z) + (log(y) + (log(t) * (a - 0.5))); else tmp = ((a + -0.5) * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.00275], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.00275:\\
\;\;\;\;\log z + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t - t\\
\end{array}
\end{array}
if t < 0.0027499999999999998Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 70.9%
Taylor expanded in t around 0 69.7%
if 0.0027499999999999998 < t Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 70.3%
associate--l+70.3%
Simplified70.3%
Taylor expanded in t around inf 98.3%
neg-mul-198.3%
Simplified98.3%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (+ a -0.5) (log t)))) (if (<= t 0.00275) (+ t_1 (+ (log z) (log y))) (- t_1 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 <= 0.00275) {
tmp = t_1 + (log(z) + log(y));
} else {
tmp = t_1 - 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 <= 0.00275d0) then
tmp = t_1 + (log(z) + log(y))
else
tmp = t_1 - 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 <= 0.00275) {
tmp = t_1 + (Math.log(z) + Math.log(y));
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a + -0.5) * math.log(t) tmp = 0 if t <= 0.00275: tmp = t_1 + (math.log(z) + math.log(y)) else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a + -0.5) * log(t)) tmp = 0.0 if (t <= 0.00275) tmp = Float64(t_1 + Float64(log(z) + log(y))); else tmp = Float64(t_1 - 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 <= 0.00275) tmp = t_1 + (log(z) + log(y)); else tmp = t_1 - 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, 0.00275], N[(t$95$1 + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot \log t\\
\mathbf{if}\;t \leq 0.00275:\\
\;\;\;\;t_1 + \left(\log z + \log y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if t < 0.0027499999999999998Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 70.9%
associate--l+70.9%
Simplified70.9%
Taylor expanded in t around 0 69.7%
if 0.0027499999999999998 < t Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 70.3%
associate--l+70.3%
Simplified70.3%
Taylor expanded in t around inf 98.3%
neg-mul-198.3%
Simplified98.3%
Final simplification85.0%
(FPCore (x y z t a) :precision binary64 (+ (* (+ a -0.5) (log t)) (+ (log z) (- (log y) t))))
double code(double x, double y, double z, double t, double a) {
return ((a + -0.5) * log(t)) + (log(z) + (log(y) - 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 = ((a + (-0.5d0)) * log(t)) + (log(z) + (log(y) - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((a + -0.5) * Math.log(t)) + (Math.log(z) + (Math.log(y) - t));
}
def code(x, y, z, t, a): return ((a + -0.5) * math.log(t)) + (math.log(z) + (math.log(y) - t))
function code(x, y, z, t, a) return Float64(Float64(Float64(a + -0.5) * log(t)) + Float64(log(z) + Float64(log(y) - t))) end
function tmp = code(x, y, z, t, a) tmp = ((a + -0.5) * log(t)) + (log(z) + (log(y) - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.5\right) \cdot \log t + \left(\log z + \left(\log y - t\right)\right)
\end{array}
Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 70.5%
associate--l+70.6%
Simplified70.6%
Final simplification70.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (+ a -0.5) (log t))))
(if (<= a -2.35e-39)
(- t_1 t)
(if (<= a 1050.0)
(- (+ t_1 (log (* (+ x y) z))) t)
(+ (- (log y) t) (* a (log t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a + -0.5) * log(t);
double tmp;
if (a <= -2.35e-39) {
tmp = t_1 - t;
} else if (a <= 1050.0) {
tmp = (t_1 + log(((x + y) * z))) - t;
} else {
tmp = (log(y) - 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) :: t_1
real(8) :: tmp
t_1 = (a + (-0.5d0)) * log(t)
if (a <= (-2.35d-39)) then
tmp = t_1 - t
else if (a <= 1050.0d0) then
tmp = (t_1 + log(((x + y) * z))) - t
else
tmp = (log(y) - 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 t_1 = (a + -0.5) * Math.log(t);
double tmp;
if (a <= -2.35e-39) {
tmp = t_1 - t;
} else if (a <= 1050.0) {
tmp = (t_1 + Math.log(((x + y) * z))) - t;
} else {
tmp = (Math.log(y) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a + -0.5) * math.log(t) tmp = 0 if a <= -2.35e-39: tmp = t_1 - t elif a <= 1050.0: tmp = (t_1 + math.log(((x + y) * z))) - t else: tmp = (math.log(y) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a + -0.5) * log(t)) tmp = 0.0 if (a <= -2.35e-39) tmp = Float64(t_1 - t); elseif (a <= 1050.0) tmp = Float64(Float64(t_1 + log(Float64(Float64(x + y) * z))) - t); else tmp = Float64(Float64(log(y) - t) + Float64(a * log(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 (a <= -2.35e-39) tmp = t_1 - t; elseif (a <= 1050.0) tmp = (t_1 + log(((x + y) * z))) - t; else tmp = (log(y) - t) + (a * log(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[a, -2.35e-39], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[a, 1050.0], N[(N[(t$95$1 + N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot \log t\\
\mathbf{if}\;a \leq -2.35 \cdot 10^{-39}:\\
\;\;\;\;t_1 - t\\
\mathbf{elif}\;a \leq 1050:\\
\;\;\;\;\left(t_1 + \log \left(\left(x + y\right) \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if a < -2.3500000000000001e-39Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.3%
associate--l+79.3%
Simplified79.3%
Taylor expanded in t around inf 93.9%
neg-mul-193.9%
Simplified93.9%
if -2.3500000000000001e-39 < a < 1050Initial program 99.8%
associate--l+99.8%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
+-commutative99.7%
fma-udef99.7%
associate-+r+99.8%
+-commutative99.8%
associate-+r-99.8%
associate-+r-99.8%
sum-log79.1%
Applied egg-rr79.1%
if 1050 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 73.7%
associate-+r+73.7%
associate--l+73.7%
fma-def73.7%
sub-neg73.7%
metadata-eval73.7%
+-commutative73.7%
Simplified73.7%
Taylor expanded in a around inf 73.3%
*-commutative73.3%
Simplified73.3%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (log (* z (* y (pow t -0.5)))) t))
(t_2 (+ (- (log y) t) (* a (log t)))))
(if (<= a -1.65e-56)
t_2
(if (<= a 1.08e-189)
t_1
(if (<= a 2.45e-144)
(- (log (+ x y)) t)
(if (<= a 1.7e-17) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((z * (y * pow(t, -0.5)))) - t;
double t_2 = (log(y) - t) + (a * log(t));
double tmp;
if (a <= -1.65e-56) {
tmp = t_2;
} else if (a <= 1.08e-189) {
tmp = t_1;
} else if (a <= 2.45e-144) {
tmp = log((x + y)) - t;
} else if (a <= 1.7e-17) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = log((z * (y * (t ** (-0.5d0))))) - t
t_2 = (log(y) - t) + (a * log(t))
if (a <= (-1.65d-56)) then
tmp = t_2
else if (a <= 1.08d-189) then
tmp = t_1
else if (a <= 2.45d-144) then
tmp = log((x + y)) - t
else if (a <= 1.7d-17) then
tmp = t_1
else
tmp = t_2
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 * (y * Math.pow(t, -0.5)))) - t;
double t_2 = (Math.log(y) - t) + (a * Math.log(t));
double tmp;
if (a <= -1.65e-56) {
tmp = t_2;
} else if (a <= 1.08e-189) {
tmp = t_1;
} else if (a <= 2.45e-144) {
tmp = Math.log((x + y)) - t;
} else if (a <= 1.7e-17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((z * (y * math.pow(t, -0.5)))) - t t_2 = (math.log(y) - t) + (a * math.log(t)) tmp = 0 if a <= -1.65e-56: tmp = t_2 elif a <= 1.08e-189: tmp = t_1 elif a <= 2.45e-144: tmp = math.log((x + y)) - t elif a <= 1.7e-17: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(z * Float64(y * (t ^ -0.5)))) - t) t_2 = Float64(Float64(log(y) - t) + Float64(a * log(t))) tmp = 0.0 if (a <= -1.65e-56) tmp = t_2; elseif (a <= 1.08e-189) tmp = t_1; elseif (a <= 2.45e-144) tmp = Float64(log(Float64(x + y)) - t); elseif (a <= 1.7e-17) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((z * (y * (t ^ -0.5)))) - t; t_2 = (log(y) - t) + (a * log(t)); tmp = 0.0; if (a <= -1.65e-56) tmp = t_2; elseif (a <= 1.08e-189) tmp = t_1; elseif (a <= 2.45e-144) tmp = log((x + y)) - t; elseif (a <= 1.7e-17) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(z * N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.65e-56], t$95$2, If[LessEqual[a, 1.08e-189], t$95$1, If[LessEqual[a, 2.45e-144], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 1.7e-17], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(z \cdot \left(y \cdot {t}^{-0.5}\right)\right) - t\\
t_2 := \left(\log y - t\right) + a \cdot \log t\\
\mathbf{if}\;a \leq -1.65 \cdot 10^{-56}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 1.08 \cdot 10^{-189}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.45 \cdot 10^{-144}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{-17}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -1.64999999999999992e-56 or 1.6999999999999999e-17 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.6%
+-commutative99.6%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 75.2%
associate-+r+75.2%
associate--l+75.2%
fma-def75.3%
sub-neg75.3%
metadata-eval75.3%
+-commutative75.3%
Simplified75.3%
Taylor expanded in a around inf 72.7%
*-commutative72.7%
Simplified72.7%
if -1.64999999999999992e-56 < a < 1.08e-189 or 2.45000000000000005e-144 < a < 1.6999999999999999e-17Initial program 99.8%
associate--l+99.8%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 66.0%
associate-+r+66.0%
associate--l+65.9%
fma-def65.9%
sub-neg65.9%
metadata-eval65.9%
+-commutative65.9%
Simplified65.9%
Taylor expanded in a around 0 66.0%
rem-log-exp52.3%
exp-sum52.3%
rem-exp-log52.3%
exp-sum52.4%
rem-exp-log52.7%
*-commutative52.7%
exp-to-pow52.7%
Simplified52.7%
if 1.08e-189 < a < 2.45000000000000005e-144Initial program 99.9%
associate--l+99.9%
associate-+l+100.0%
+-commutative100.0%
fma-def100.0%
remove-double-neg100.0%
remove-double-neg100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf 78.4%
neg-mul-178.4%
Simplified78.4%
Final simplification66.5%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2.8e-39)
(- (* (+ a -0.5) (log t)) t)
(if (<= a 4.4e-15)
(+ (log (* (+ x y) z)) (- (* -0.5 (log t)) t))
(+ (- (log y) t) (* a (log t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2.8e-39) {
tmp = ((a + -0.5) * log(t)) - t;
} else if (a <= 4.4e-15) {
tmp = log(((x + y) * z)) + ((-0.5 * log(t)) - t);
} else {
tmp = (log(y) - 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 (a <= (-2.8d-39)) then
tmp = ((a + (-0.5d0)) * log(t)) - t
else if (a <= 4.4d-15) then
tmp = log(((x + y) * z)) + (((-0.5d0) * log(t)) - t)
else
tmp = (log(y) - 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 (a <= -2.8e-39) {
tmp = ((a + -0.5) * Math.log(t)) - t;
} else if (a <= 4.4e-15) {
tmp = Math.log(((x + y) * z)) + ((-0.5 * Math.log(t)) - t);
} else {
tmp = (Math.log(y) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -2.8e-39: tmp = ((a + -0.5) * math.log(t)) - t elif a <= 4.4e-15: tmp = math.log(((x + y) * z)) + ((-0.5 * math.log(t)) - t) else: tmp = (math.log(y) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2.8e-39) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) - t); elseif (a <= 4.4e-15) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(-0.5 * log(t)) - t)); else tmp = Float64(Float64(log(y) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -2.8e-39) tmp = ((a + -0.5) * log(t)) - t; elseif (a <= 4.4e-15) tmp = log(((x + y) * z)) + ((-0.5 * log(t)) - t); else tmp = (log(y) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2.8e-39], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 4.4e-15], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.8 \cdot 10^{-39}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t - t\\
\mathbf{elif}\;a \leq 4.4 \cdot 10^{-15}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(-0.5 \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if a < -2.8000000000000001e-39Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.3%
associate--l+79.3%
Simplified79.3%
Taylor expanded in t around inf 93.9%
neg-mul-193.9%
Simplified93.9%
if -2.8000000000000001e-39 < a < 4.39999999999999971e-15Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around 0 99.8%
associate-+r+99.8%
+-commutative99.8%
log-prod79.3%
associate--l+79.2%
*-commutative79.2%
+-commutative79.2%
Simplified79.2%
if 4.39999999999999971e-15 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.6%
+-commutative99.6%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.3%
associate-+r+71.3%
associate--l+71.3%
fma-def71.3%
sub-neg71.3%
metadata-eval71.3%
+-commutative71.3%
Simplified71.3%
Taylor expanded in a around inf 69.8%
*-commutative69.8%
Simplified69.8%
Final simplification81.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -7.5e-40)
(- (* (+ a -0.5) (log t)) t)
(if (<= a 5e-15)
(- (+ (log (* (+ x y) z)) (* -0.5 (log t))) t)
(+ (- (log y) t) (* a (log t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -7.5e-40) {
tmp = ((a + -0.5) * log(t)) - t;
} else if (a <= 5e-15) {
tmp = (log(((x + y) * z)) + (-0.5 * log(t))) - t;
} else {
tmp = (log(y) - 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 (a <= (-7.5d-40)) then
tmp = ((a + (-0.5d0)) * log(t)) - t
else if (a <= 5d-15) then
tmp = (log(((x + y) * z)) + ((-0.5d0) * log(t))) - t
else
tmp = (log(y) - 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 (a <= -7.5e-40) {
tmp = ((a + -0.5) * Math.log(t)) - t;
} else if (a <= 5e-15) {
tmp = (Math.log(((x + y) * z)) + (-0.5 * Math.log(t))) - t;
} else {
tmp = (Math.log(y) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -7.5e-40: tmp = ((a + -0.5) * math.log(t)) - t elif a <= 5e-15: tmp = (math.log(((x + y) * z)) + (-0.5 * math.log(t))) - t else: tmp = (math.log(y) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -7.5e-40) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) - t); elseif (a <= 5e-15) tmp = Float64(Float64(log(Float64(Float64(x + y) * z)) + Float64(-0.5 * log(t))) - t); else tmp = Float64(Float64(log(y) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -7.5e-40) tmp = ((a + -0.5) * log(t)) - t; elseif (a <= 5e-15) tmp = (log(((x + y) * z)) + (-0.5 * log(t))) - t; else tmp = (log(y) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -7.5e-40], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 5e-15], N[(N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{-40}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t - t\\
\mathbf{elif}\;a \leq 5 \cdot 10^{-15}:\\
\;\;\;\;\left(\log \left(\left(x + y\right) \cdot z\right) + -0.5 \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if a < -7.50000000000000069e-40Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.3%
associate--l+79.3%
Simplified79.3%
Taylor expanded in t around inf 93.9%
neg-mul-193.9%
Simplified93.9%
if -7.50000000000000069e-40 < a < 4.99999999999999999e-15Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around 0 99.8%
associate-+r+99.8%
+-commutative99.8%
log-prod79.3%
*-commutative79.3%
+-commutative79.3%
Simplified79.3%
if 4.99999999999999999e-15 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.6%
+-commutative99.6%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.3%
associate-+r+71.3%
associate--l+71.3%
fma-def71.3%
sub-neg71.3%
metadata-eval71.3%
+-commutative71.3%
Simplified71.3%
Taylor expanded in a around inf 69.8%
*-commutative69.8%
Simplified69.8%
Final simplification81.3%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.1e-40)
(- (* (+ a -0.5) (log t)) t)
(if (<= a 1.75e-15)
(- (+ (* -0.5 (log t)) (log (* y z))) t)
(+ (- (log y) t) (* a (log t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.1e-40) {
tmp = ((a + -0.5) * log(t)) - t;
} else if (a <= 1.75e-15) {
tmp = ((-0.5 * log(t)) + log((y * z))) - t;
} else {
tmp = (log(y) - 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 (a <= (-1.1d-40)) then
tmp = ((a + (-0.5d0)) * log(t)) - t
else if (a <= 1.75d-15) then
tmp = (((-0.5d0) * log(t)) + log((y * z))) - t
else
tmp = (log(y) - 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 (a <= -1.1e-40) {
tmp = ((a + -0.5) * Math.log(t)) - t;
} else if (a <= 1.75e-15) {
tmp = ((-0.5 * Math.log(t)) + Math.log((y * z))) - t;
} else {
tmp = (Math.log(y) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -1.1e-40: tmp = ((a + -0.5) * math.log(t)) - t elif a <= 1.75e-15: tmp = ((-0.5 * math.log(t)) + math.log((y * z))) - t else: tmp = (math.log(y) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1.1e-40) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) - t); elseif (a <= 1.75e-15) tmp = Float64(Float64(Float64(-0.5 * log(t)) + log(Float64(y * z))) - t); else tmp = Float64(Float64(log(y) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -1.1e-40) tmp = ((a + -0.5) * log(t)) - t; elseif (a <= 1.75e-15) tmp = ((-0.5 * log(t)) + log((y * z))) - t; else tmp = (log(y) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.1e-40], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 1.75e-15], N[(N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-40}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t - t\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{-15}:\\
\;\;\;\;\left(-0.5 \cdot \log t + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if a < -1.10000000000000004e-40Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.3%
associate--l+79.3%
Simplified79.3%
Taylor expanded in t around inf 93.9%
neg-mul-193.9%
Simplified93.9%
if -1.10000000000000004e-40 < a < 1.75e-15Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 62.7%
associate--l+62.7%
Simplified62.7%
Taylor expanded in a around 0 62.7%
associate-+r+62.7%
log-prod54.5%
*-commutative54.5%
Simplified54.5%
if 1.75e-15 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.6%
+-commutative99.6%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.3%
associate-+r+71.3%
associate--l+71.3%
fma-def71.3%
sub-neg71.3%
metadata-eval71.3%
+-commutative71.3%
Simplified71.3%
Taylor expanded in a around inf 69.8%
*-commutative69.8%
Simplified69.8%
Final simplification71.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 2.7e-72) (+ (* (+ a -0.5) (log t)) (log (* y z))) (+ (- (log y) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.7e-72) {
tmp = ((a + -0.5) * log(t)) + log((y * z));
} else {
tmp = (log(y) - 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 <= 2.7d-72) then
tmp = ((a + (-0.5d0)) * log(t)) + log((y * z))
else
tmp = (log(y) - 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 <= 2.7e-72) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log((y * z));
} else {
tmp = (Math.log(y) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.7e-72: tmp = ((a + -0.5) * math.log(t)) + math.log((y * z)) else: tmp = (math.log(y) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.7e-72) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(y * z))); else tmp = Float64(Float64(log(y) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2.7e-72) tmp = ((a + -0.5) * log(t)) + log((y * z)); else tmp = (log(y) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.7e-72], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.7 \cdot 10^{-72}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if t < 2.7e-72Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.9%
associate--l+71.9%
Simplified71.9%
Taylor expanded in t around 0 71.9%
log-prod57.7%
Simplified57.7%
if 2.7e-72 < t Initial program 99.7%
associate--l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 69.9%
associate-+r+69.9%
associate--l+69.9%
fma-def69.9%
sub-neg69.9%
metadata-eval69.9%
+-commutative69.9%
Simplified69.9%
Taylor expanded in a around inf 64.9%
*-commutative64.9%
Simplified64.9%
Final simplification62.5%
(FPCore (x y z t a) :precision binary64 (+ (- (log y) t) (* a (log t))))
double code(double x, double y, double z, double t, double a) {
return (log(y) - 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(y) - t) + (a * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) - t) + (a * Math.log(t));
}
def code(x, y, z, t, a): return (math.log(y) - t) + (a * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(log(y) - t) + Float64(a * log(t))) end
function tmp = code(x, y, z, t, a) tmp = (log(y) - t) + (a * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y - t\right) + a \cdot \log t
\end{array}
Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 70.6%
associate-+r+70.6%
associate--l+70.6%
fma-def70.6%
sub-neg70.6%
metadata-eval70.6%
+-commutative70.6%
Simplified70.6%
Taylor expanded in a around inf 60.2%
*-commutative60.2%
Simplified60.2%
Final simplification60.2%
(FPCore (x y z t a) :precision binary64 (- (* (+ a -0.5) (log t)) t))
double code(double x, double y, double z, double t, double a) {
return ((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 = ((a + (-0.5d0)) * log(t)) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return ((a + -0.5) * Math.log(t)) - t;
}
def code(x, y, z, t, a): return ((a + -0.5) * math.log(t)) - t
function code(x, y, z, t, a) return Float64(Float64(Float64(a + -0.5) * log(t)) - t) end
function tmp = code(x, y, z, t, a) tmp = ((a + -0.5) * log(t)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.5\right) \cdot \log t - t
\end{array}
Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 70.5%
associate--l+70.6%
Simplified70.6%
Taylor expanded in t around inf 80.7%
neg-mul-180.7%
Simplified80.7%
Final simplification80.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 7.6e+27) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 7.6e+27) {
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 <= 7.6d+27) 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 <= 7.6e+27) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 7.6e+27: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 7.6e+27) 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 <= 7.6e+27) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 7.6e+27], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.6 \cdot 10^{+27}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 7.60000000000000043e27Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 70.5%
associate--l+70.5%
Simplified70.5%
Taylor expanded in a around inf 54.9%
if 7.60000000000000043e27 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 70.6%
associate-+r+70.6%
associate--l+70.6%
fma-def70.6%
sub-neg70.6%
metadata-eval70.6%
+-commutative70.6%
Simplified70.6%
Taylor expanded in t around inf 75.2%
neg-mul-175.2%
Simplified75.2%
Final simplification64.9%
(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.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 70.6%
associate-+r+70.6%
associate--l+70.6%
fma-def70.6%
sub-neg70.6%
metadata-eval70.6%
+-commutative70.6%
Simplified70.6%
Taylor expanded in t around inf 39.5%
neg-mul-139.5%
Simplified39.5%
Final simplification39.5%
(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 2023240
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))