
(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)) (fma (+ a -0.5) (log t) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + fma((a + -0.5), log(t), (log(z) - t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + fma(Float64(a + -0.5), log(t), Float64(log(z) - t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \mathsf{fma}\left(a + -0.5, \log t, \log z - t\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 106.0) (- (+ (* (log t) (- a 0.5)) (log (* y z))) t) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 106.0) {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
} else {
tmp = (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 (log(z) <= 106.0d0) then
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
else
tmp = (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 (Math.log(z) <= 106.0) {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 106.0: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 106.0) tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 106.0) tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 106.0], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 106:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if (log.f64 z) < 106Initial program 99.5%
associate--l+99.5%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 62.8%
Taylor expanded in z around inf 62.8%
mul-1-neg62.8%
log-rec62.8%
remove-double-neg62.8%
log-prod56.2%
Simplified56.2%
if 106 < (log.f64 z) Initial program 99.7%
associate--l+99.7%
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 62.9%
Taylor expanded in a around inf 77.9%
*-commutative77.9%
Simplified77.9%
Final simplification65.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log z) (log y))))
(if (<= t 0.0027)
(+ (* (log t) (- a 0.5)) t_1)
(+ (- t_1 t) (/ (log t) (/ 1.0 a))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) + log(y);
double tmp;
if (t <= 0.0027) {
tmp = (log(t) * (a - 0.5)) + t_1;
} else {
tmp = (t_1 - t) + (log(t) / (1.0 / a));
}
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.0027d0) then
tmp = (log(t) * (a - 0.5d0)) + t_1
else
tmp = (t_1 - t) + (log(t) / (1.0d0 / a))
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.0027) {
tmp = (Math.log(t) * (a - 0.5)) + t_1;
} else {
tmp = (t_1 - t) + (Math.log(t) / (1.0 / a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) + math.log(y) tmp = 0 if t <= 0.0027: tmp = (math.log(t) * (a - 0.5)) + t_1 else: tmp = (t_1 - t) + (math.log(t) / (1.0 / a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) + log(y)) tmp = 0.0 if (t <= 0.0027) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + t_1); else tmp = Float64(Float64(t_1 - t) + Float64(log(t) / Float64(1.0 / a))); 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.0027) tmp = (log(t) * (a - 0.5)) + t_1; else tmp = (t_1 - t) + (log(t) / (1.0 / a)); 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.0027], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(t$95$1 - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] / N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z + \log y\\
\mathbf{if}\;t \leq 0.0027:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - t\right) + \frac{\log t}{\frac{1}{a}}\\
\end{array}
\end{array}
if t < 0.0027000000000000001Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
remove-double-neg99.3%
remove-double-neg99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 56.5%
Taylor expanded in t around 0 56.3%
if 0.0027000000000000001 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
*-commutative99.9%
flip-+76.4%
associate-*r/75.7%
fma-neg75.7%
metadata-eval75.7%
metadata-eval75.7%
sub-neg75.7%
metadata-eval75.7%
Applied egg-rr75.7%
associate-/l*76.4%
Simplified76.4%
Taylor expanded in a around inf 98.6%
Taylor expanded in x around 0 68.6%
Final simplification62.4%
(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.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 2.1e-5) (+ (* (log t) (- a 0.5)) (+ (log z) (log y))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.1e-5) {
tmp = (log(t) * (a - 0.5)) + (log(z) + log(y));
} else {
tmp = (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.1d-5) then
tmp = (log(t) * (a - 0.5d0)) + (log(z) + log(y))
else
tmp = (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.1e-5) {
tmp = (Math.log(t) * (a - 0.5)) + (Math.log(z) + Math.log(y));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.1e-5: tmp = (math.log(t) * (a - 0.5)) + (math.log(z) + math.log(y)) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.1e-5) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(z) + log(y))); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2.1e-5) tmp = (log(t) * (a - 0.5)) + (log(z) + log(y)); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.1e-5], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.1 \cdot 10^{-5}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \left(\log z + \log y\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 2.09999999999999988e-5Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
remove-double-neg99.3%
remove-double-neg99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 56.2%
Taylor expanded in t around 0 56.0%
if 2.09999999999999988e-5 < 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 69.4%
Taylor expanded in a around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification77.2%
(FPCore (x y z t a) :precision binary64 (- (+ (* (log t) (- a 0.5)) (+ (log z) (log y))) t))
double code(double x, double y, double z, double t, double a) {
return ((log(t) * (a - 0.5)) + (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 = ((log(t) * (a - 0.5d0)) + (log(z) + log(y))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log(t) * (a - 0.5)) + (Math.log(z) + Math.log(y))) - t;
}
def code(x, y, z, t, a): return ((math.log(t) * (a - 0.5)) + (math.log(z) + math.log(y))) - t
function code(x, y, z, t, a) return Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(z) + log(y))) - t) end
function tmp = code(x, y, z, t, a) tmp = ((log(t) * (a - 0.5)) + (log(z) + log(y))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log t \cdot \left(a - 0.5\right) + \left(\log z + \log y\right)\right) - t
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 62.8%
Final simplification62.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ (log (* y z)) (* -0.5 (log t))) t))
(t_2 (- (* a (log t)) t)))
(if (<= a -6.6e-26)
t_2
(if (<= a -6.4e-192)
t_1
(if (<= a -1.6e-268)
(- (+ (log z) (log y)) t)
(if (<= a 0.00078) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (log((y * z)) + (-0.5 * log(t))) - t;
double t_2 = (a * log(t)) - t;
double tmp;
if (a <= -6.6e-26) {
tmp = t_2;
} else if (a <= -6.4e-192) {
tmp = t_1;
} else if (a <= -1.6e-268) {
tmp = (log(z) + log(y)) - t;
} else if (a <= 0.00078) {
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((y * z)) + ((-0.5d0) * log(t))) - t
t_2 = (a * log(t)) - t
if (a <= (-6.6d-26)) then
tmp = t_2
else if (a <= (-6.4d-192)) then
tmp = t_1
else if (a <= (-1.6d-268)) then
tmp = (log(z) + log(y)) - t
else if (a <= 0.00078d0) 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((y * z)) + (-0.5 * Math.log(t))) - t;
double t_2 = (a * Math.log(t)) - t;
double tmp;
if (a <= -6.6e-26) {
tmp = t_2;
} else if (a <= -6.4e-192) {
tmp = t_1;
} else if (a <= -1.6e-268) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else if (a <= 0.00078) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (math.log((y * z)) + (-0.5 * math.log(t))) - t t_2 = (a * math.log(t)) - t tmp = 0 if a <= -6.6e-26: tmp = t_2 elif a <= -6.4e-192: tmp = t_1 elif a <= -1.6e-268: tmp = (math.log(z) + math.log(y)) - t elif a <= 0.00078: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(log(Float64(y * z)) + Float64(-0.5 * log(t))) - t) t_2 = Float64(Float64(a * log(t)) - t) tmp = 0.0 if (a <= -6.6e-26) tmp = t_2; elseif (a <= -6.4e-192) tmp = t_1; elseif (a <= -1.6e-268) tmp = Float64(Float64(log(z) + log(y)) - t); elseif (a <= 0.00078) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (log((y * z)) + (-0.5 * log(t))) - t; t_2 = (a * log(t)) - t; tmp = 0.0; if (a <= -6.6e-26) tmp = t_2; elseif (a <= -6.4e-192) tmp = t_1; elseif (a <= -1.6e-268) tmp = (log(z) + log(y)) - t; elseif (a <= 0.00078) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -6.6e-26], t$95$2, If[LessEqual[a, -6.4e-192], t$95$1, If[LessEqual[a, -1.6e-268], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 0.00078], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\log \left(y \cdot z\right) + -0.5 \cdot \log t\right) - t\\
t_2 := a \cdot \log t - t\\
\mathbf{if}\;a \leq -6.6 \cdot 10^{-26}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -6.4 \cdot 10^{-192}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.6 \cdot 10^{-268}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{elif}\;a \leq 0.00078:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -6.5999999999999997e-26 or 7.79999999999999986e-4 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
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 67.9%
Taylor expanded in a around inf 97.5%
*-commutative97.5%
Simplified97.5%
if -6.5999999999999997e-26 < a < -6.4000000000000003e-192 or -1.5999999999999999e-268 < a < 7.79999999999999986e-4Initial program 99.4%
associate--l+99.4%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 54.8%
Taylor expanded in a around 0 54.7%
associate-+r+54.7%
+-commutative54.7%
log-prod43.6%
+-commutative43.6%
*-commutative43.6%
Simplified43.6%
if -6.4000000000000003e-192 < a < -1.5999999999999999e-268Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
*-commutative99.9%
flip-+99.9%
associate-*r/99.9%
fma-neg99.9%
metadata-eval99.9%
metadata-eval99.9%
sub-neg99.9%
metadata-eval99.9%
Applied egg-rr99.9%
associate-/l*99.9%
Simplified99.9%
Taylor expanded in a around inf 89.1%
Taylor expanded in x around 0 72.8%
Taylor expanded in a around 0 72.8%
Final simplification74.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (log (* z (* y (pow t -0.5)))) t)) (t_2 (- (* a (log t)) t)))
(if (<= a -4e-18)
t_2
(if (<= a -4.8e-186)
t_1
(if (<= a -3.5e-230)
(- (+ (log z) (log y)) t)
(if (<= a 0.00315) 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 = (a * log(t)) - t;
double tmp;
if (a <= -4e-18) {
tmp = t_2;
} else if (a <= -4.8e-186) {
tmp = t_1;
} else if (a <= -3.5e-230) {
tmp = (log(z) + log(y)) - t;
} else if (a <= 0.00315) {
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 = (a * log(t)) - t
if (a <= (-4d-18)) then
tmp = t_2
else if (a <= (-4.8d-186)) then
tmp = t_1
else if (a <= (-3.5d-230)) then
tmp = (log(z) + log(y)) - t
else if (a <= 0.00315d0) 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 = (a * Math.log(t)) - t;
double tmp;
if (a <= -4e-18) {
tmp = t_2;
} else if (a <= -4.8e-186) {
tmp = t_1;
} else if (a <= -3.5e-230) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else if (a <= 0.00315) {
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 = (a * math.log(t)) - t tmp = 0 if a <= -4e-18: tmp = t_2 elif a <= -4.8e-186: tmp = t_1 elif a <= -3.5e-230: tmp = (math.log(z) + math.log(y)) - t elif a <= 0.00315: 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(a * log(t)) - t) tmp = 0.0 if (a <= -4e-18) tmp = t_2; elseif (a <= -4.8e-186) tmp = t_1; elseif (a <= -3.5e-230) tmp = Float64(Float64(log(z) + log(y)) - t); elseif (a <= 0.00315) 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 = (a * log(t)) - t; tmp = 0.0; if (a <= -4e-18) tmp = t_2; elseif (a <= -4.8e-186) tmp = t_1; elseif (a <= -3.5e-230) tmp = (log(z) + log(y)) - t; elseif (a <= 0.00315) 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[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -4e-18], t$95$2, If[LessEqual[a, -4.8e-186], t$95$1, If[LessEqual[a, -3.5e-230], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 0.00315], 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 := a \cdot \log t - t\\
\mathbf{if}\;a \leq -4 \cdot 10^{-18}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq -4.8 \cdot 10^{-186}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -3.5 \cdot 10^{-230}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{elif}\;a \leq 0.00315:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if a < -4.0000000000000003e-18 or 0.00315 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
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 68.1%
Taylor expanded in a around inf 97.5%
*-commutative97.5%
Simplified97.5%
if -4.0000000000000003e-18 < a < -4.80000000000000006e-186 or -3.49999999999999988e-230 < a < 0.00315Initial program 99.4%
associate--l+99.4%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 54.3%
Taylor expanded in a around 0 54.1%
Taylor expanded in z around inf 54.1%
mul-1-neg54.1%
log-rec54.1%
remove-double-neg54.1%
+-commutative54.1%
*-commutative54.1%
fma-udef54.1%
rem-log-exp42.8%
exp-sum39.4%
rem-exp-log39.4%
fma-udef39.4%
exp-sum39.4%
*-lft-identity39.4%
*-commutative39.4%
exp-to-pow39.7%
unpow139.7%
*-commutative39.7%
exp-to-pow39.7%
Simplified39.7%
if -4.80000000000000006e-186 < a < -3.49999999999999988e-230Initial program 100.0%
associate--l+100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
*-commutative100.0%
flip-+100.0%
associate-*r/100.0%
fma-neg100.0%
metadata-eval100.0%
metadata-eval100.0%
sub-neg100.0%
metadata-eval100.0%
Applied egg-rr100.0%
associate-/l*100.0%
Simplified100.0%
Taylor expanded in a around inf 91.1%
Taylor expanded in x around 0 80.0%
Taylor expanded in a around 0 80.0%
Final simplification71.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.8e-5) (+ (* (+ a -0.5) (log t)) (log (* z (+ x y)))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.8e-5) {
tmp = ((a + -0.5) * log(t)) + log((z * (x + y)));
} else {
tmp = (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 <= 1.8d-5) then
tmp = ((a + (-0.5d0)) * log(t)) + log((z * (x + y)))
else
tmp = (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 <= 1.8e-5) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log((z * (x + y)));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.8e-5: tmp = ((a + -0.5) * math.log(t)) + math.log((z * (x + y))) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.8e-5) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(z * Float64(x + y)))); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.8e-5) tmp = ((a + -0.5) * log(t)) + log((z * (x + y))); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.8e-5], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.8 \cdot 10^{-5}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(z \cdot \left(x + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 1.80000000000000005e-5Initial program 99.3%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around 0 98.5%
+-commutative98.5%
log-prod76.2%
+-commutative76.2%
Simplified76.2%
if 1.80000000000000005e-5 < 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 69.4%
Taylor expanded in a around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1250.0) (not (<= a 1.9))) (- (* a (log t)) t) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1250.0) || !(a <= 1.9)) {
tmp = (a * log(t)) - 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 <= (-1250.0d0)) .or. (.not. (a <= 1.9d0))) then
tmp = (a * log(t)) - 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 <= -1250.0) || !(a <= 1.9)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1250.0) or not (a <= 1.9): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1250.0) || !(a <= 1.9)) tmp = Float64(Float64(a * log(t)) - 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 <= -1250.0) || ~((a <= 1.9))) tmp = (a * log(t)) - t; else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1250.0], N[Not[LessEqual[a, 1.9]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1250 \lor \neg \left(a \leq 1.9\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -1250 or 1.8999999999999999 < 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 70.9%
Taylor expanded in a around inf 98.7%
*-commutative98.7%
Simplified98.7%
if -1250 < a < 1.8999999999999999Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
*-commutative99.5%
flip-+99.5%
associate-*r/99.5%
fma-neg99.5%
metadata-eval99.5%
metadata-eval99.5%
sub-neg99.5%
metadata-eval99.5%
Applied egg-rr99.5%
associate-/l*99.5%
Simplified99.5%
Taylor expanded in a around inf 56.8%
Taylor expanded in x around 0 37.7%
Taylor expanded in a around 0 37.7%
Final simplification68.0%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (log t)))) (if (<= t 2.1e-5) (+ (log (+ x y)) t_1) (- t_1 t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (t <= 2.1e-5) {
tmp = log((x + y)) + t_1;
} 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 * log(t)
if (t <= 2.1d-5) then
tmp = log((x + y)) + t_1
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 * Math.log(t);
double tmp;
if (t <= 2.1e-5) {
tmp = Math.log((x + y)) + t_1;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if t <= 2.1e-5: tmp = math.log((x + y)) + t_1 else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (t <= 2.1e-5) tmp = Float64(log(Float64(x + y)) + t_1); else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (t <= 2.1e-5) tmp = log((x + y)) + t_1; else tmp = t_1 - t; 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.1e-5], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;t \leq 2.1 \cdot 10^{-5}:\\
\;\;\;\;\log \left(x + y\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if t < 2.09999999999999988e-5Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
remove-double-neg99.3%
remove-double-neg99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in a around inf 55.7%
*-commutative55.7%
Simplified55.7%
if 2.09999999999999988e-5 < 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 69.4%
Taylor expanded in a around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1250.0) (not (<= a 6.5e-13))) (- (* a (log t)) t) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1250.0) || !(a <= 6.5e-13)) {
tmp = (a * log(t)) - 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 <= (-1250.0d0)) .or. (.not. (a <= 6.5d-13))) then
tmp = (a * log(t)) - 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 <= -1250.0) || !(a <= 6.5e-13)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1250.0) or not (a <= 6.5e-13): tmp = (a * math.log(t)) - t else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1250.0) || !(a <= 6.5e-13)) tmp = Float64(Float64(a * log(t)) - 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 <= -1250.0) || ~((a <= 6.5e-13))) tmp = (a * log(t)) - t; else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1250.0], N[Not[LessEqual[a, 6.5e-13]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1250 \lor \neg \left(a \leq 6.5 \cdot 10^{-13}\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -1250 or 6.49999999999999957e-13 < 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 71.1%
Taylor expanded in a around inf 98.0%
*-commutative98.0%
Simplified98.0%
if -1250 < a < 6.49999999999999957e-13Initial program 99.5%
associate--l+99.5%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 56.1%
neg-mul-156.1%
Simplified56.1%
Taylor expanded in x around 0 37.4%
Final simplification67.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -29000000000.0) (not (<= a 6.5e-13))) (* a (log t)) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -29000000000.0) || !(a <= 6.5e-13)) {
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 <= (-29000000000.0d0)) .or. (.not. (a <= 6.5d-13))) 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 <= -29000000000.0) || !(a <= 6.5e-13)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -29000000000.0) or not (a <= 6.5e-13): 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 <= -29000000000.0) || !(a <= 6.5e-13)) 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 <= -29000000000.0) || ~((a <= 6.5e-13))) tmp = a * log(t); else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -29000000000.0], N[Not[LessEqual[a, 6.5e-13]], $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 -29000000000 \lor \neg \left(a \leq 6.5 \cdot 10^{-13}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -2.9e10 or 6.49999999999999957e-13 < a Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
*-commutative99.7%
flip-+58.4%
associate-*r/56.8%
fma-neg56.8%
metadata-eval56.8%
metadata-eval56.8%
sub-neg56.8%
metadata-eval56.8%
Applied egg-rr56.8%
associate-/l*58.3%
Simplified58.3%
Taylor expanded in a around inf 98.4%
Taylor expanded in x around 0 70.3%
Taylor expanded in a around inf 76.0%
if -2.9e10 < a < 6.49999999999999957e-13Initial program 99.5%
associate--l+99.5%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 56.1%
neg-mul-156.1%
Simplified56.1%
Taylor expanded in x around 0 37.6%
Final simplification56.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0025) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0025) {
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 <= 0.0025d0) 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 <= 0.0025) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0025: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0025) 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 <= 0.0025) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0025], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0025:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 0.00250000000000000005Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
remove-double-neg99.3%
remove-double-neg99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around inf 9.8%
neg-mul-19.8%
Simplified9.8%
Taylor expanded in t around 0 9.8%
if 0.00250000000000000005 < 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 69.2%
Taylor expanded in t around inf 70.8%
neg-mul-170.8%
Simplified70.8%
Final simplification40.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 8e+35) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 8e+35) {
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 <= 8d+35) 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 <= 8e+35) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 8e+35: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 8e+35) 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 <= 8e+35) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 8e+35], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8 \cdot 10^{+35}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 7.9999999999999997e35Initial program 99.4%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
*-commutative99.4%
flip-+80.2%
associate-*r/79.5%
fma-neg79.5%
metadata-eval79.5%
metadata-eval79.5%
sub-neg79.5%
metadata-eval79.5%
Applied egg-rr79.5%
associate-/l*80.2%
Simplified80.2%
Taylor expanded in a around inf 60.5%
Taylor expanded in x around 0 43.1%
Taylor expanded in a around inf 51.2%
if 7.9999999999999997e35 < 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 68.4%
Taylor expanded in t around inf 77.6%
neg-mul-177.6%
Simplified77.6%
Final simplification62.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%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 62.8%
Taylor expanded in t around inf 36.5%
neg-mul-136.5%
Simplified36.5%
Final simplification36.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 2023185
(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))))