
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ 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)) + Float64(fma(Float64(a + -0.5), log(t), log(z)) - t)) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\mathsf{fma}\left(a + -0.5, \log t, \log z\right) - t\right)
\end{array}
Initial program 99.5%
associate--l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r-99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -2000000.0)
(- (+ (log y) t_1) t)
(if (<= (- a 0.5) -0.4)
(- (+ (log y) (+ (log z) (* -0.5 (log t)))) t)
(- t_1 t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -2000000.0) {
tmp = (log(y) + t_1) - t;
} else if ((a - 0.5) <= -0.4) {
tmp = (log(y) + (log(z) + (-0.5 * log(t)))) - t;
} 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 ((a - 0.5d0) <= (-2000000.0d0)) then
tmp = (log(y) + t_1) - t
else if ((a - 0.5d0) <= (-0.4d0)) then
tmp = (log(y) + (log(z) + ((-0.5d0) * log(t)))) - t
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 ((a - 0.5) <= -2000000.0) {
tmp = (Math.log(y) + t_1) - t;
} else if ((a - 0.5) <= -0.4) {
tmp = (Math.log(y) + (Math.log(z) + (-0.5 * Math.log(t)))) - t;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -2000000.0: tmp = (math.log(y) + t_1) - t elif (a - 0.5) <= -0.4: tmp = (math.log(y) + (math.log(z) + (-0.5 * math.log(t)))) - t else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -2000000.0) tmp = Float64(Float64(log(y) + t_1) - t); elseif (Float64(a - 0.5) <= -0.4) tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(-0.5 * log(t)))) - t); 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 ((a - 0.5) <= -2000000.0) tmp = (log(y) + t_1) - t; elseif ((a - 0.5) <= -0.4) tmp = (log(y) + (log(z) + (-0.5 * log(t)))) - t; 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[N[(a - 0.5), $MachinePrecision], -2000000.0], N[(N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -2000000:\\
\;\;\;\;\left(\log y + t_1\right) - t\\
\mathbf{elif}\;a - 0.5 \leq -0.4:\\
\;\;\;\;\left(\log y + \left(\log z + -0.5 \cdot \log t\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2e6Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r-99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in a around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 72.8%
log-pow5.6%
associate--l+5.6%
remove-double-neg5.6%
log-rec5.6%
mul-1-neg5.6%
associate--l+5.6%
log-pow72.8%
mul-1-neg72.8%
log-rec72.8%
remove-double-neg72.8%
*-commutative72.8%
Simplified72.8%
if -2e6 < (-.f64 a 1/2) < -0.40000000000000002Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r-99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 61.6%
Taylor expanded in a around 0 61.4%
*-commutative61.4%
Simplified61.4%
if -0.40000000000000002 < (-.f64 a 1/2) Initial program 99.6%
Taylor expanded in x around 0 65.9%
remove-double-neg65.9%
log-rec65.9%
mul-1-neg65.9%
+-commutative65.9%
associate--l+65.9%
mul-1-neg65.9%
log-rec65.9%
remove-double-neg65.9%
Simplified65.9%
Taylor expanded in t around inf 99.6%
neg-mul-199.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
mul-1-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-rgt-out99.6%
sub-neg99.6%
distribute-rgt-out99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in a around inf 99.6%
*-commutative99.6%
Simplified99.6%
Final simplification74.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -14000.0)
(- (+ (log y) t_1) t)
(if (<= a 0.96)
(+ (+ (log z) (- (log y) t)) (* -0.5 (log t)))
(- t_1 t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -14000.0) {
tmp = (log(y) + t_1) - t;
} else if (a <= 0.96) {
tmp = (log(z) + (log(y) - t)) + (-0.5 * log(t));
} 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 (a <= (-14000.0d0)) then
tmp = (log(y) + t_1) - t
else if (a <= 0.96d0) then
tmp = (log(z) + (log(y) - t)) + ((-0.5d0) * log(t))
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 (a <= -14000.0) {
tmp = (Math.log(y) + t_1) - t;
} else if (a <= 0.96) {
tmp = (Math.log(z) + (Math.log(y) - t)) + (-0.5 * Math.log(t));
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -14000.0: tmp = (math.log(y) + t_1) - t elif a <= 0.96: tmp = (math.log(z) + (math.log(y) - t)) + (-0.5 * math.log(t)) else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -14000.0) tmp = Float64(Float64(log(y) + t_1) - t); elseif (a <= 0.96) tmp = Float64(Float64(log(z) + Float64(log(y) - t)) + Float64(-0.5 * log(t))); 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 (a <= -14000.0) tmp = (log(y) + t_1) - t; elseif (a <= 0.96) tmp = (log(z) + (log(y) - t)) + (-0.5 * log(t)); 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[a, -14000.0], N[(N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 0.96], N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -14000:\\
\;\;\;\;\left(\log y + t_1\right) - t\\
\mathbf{elif}\;a \leq 0.96:\\
\;\;\;\;\left(\log z + \left(\log y - t\right)\right) + -0.5 \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if a < -14000Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r-99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in a around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 72.8%
log-pow5.6%
associate--l+5.6%
remove-double-neg5.6%
log-rec5.6%
mul-1-neg5.6%
associate--l+5.6%
log-pow72.8%
mul-1-neg72.8%
log-rec72.8%
remove-double-neg72.8%
*-commutative72.8%
Simplified72.8%
if -14000 < a < 0.95999999999999996Initial program 99.3%
Taylor expanded in x around 0 61.6%
remove-double-neg61.6%
log-rec61.6%
mul-1-neg61.6%
+-commutative61.6%
associate--l+61.6%
mul-1-neg61.6%
log-rec61.6%
remove-double-neg61.6%
Simplified61.6%
Taylor expanded in a around 0 61.4%
if 0.95999999999999996 < a Initial program 99.6%
Taylor expanded in x around 0 65.9%
remove-double-neg65.9%
log-rec65.9%
mul-1-neg65.9%
+-commutative65.9%
associate--l+65.9%
mul-1-neg65.9%
log-rec65.9%
remove-double-neg65.9%
Simplified65.9%
Taylor expanded in t around inf 99.6%
neg-mul-199.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
mul-1-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-rgt-out99.6%
sub-neg99.6%
distribute-rgt-out99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in a around inf 99.6%
*-commutative99.6%
Simplified99.6%
Final simplification74.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -14000.0)
(- (+ (log y) t_1) t)
(if (<= a 0.006) (- (+ (log y) (log (* z (pow t -0.5)))) t) (- t_1 t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -14000.0) {
tmp = (log(y) + t_1) - t;
} else if (a <= 0.006) {
tmp = (log(y) + log((z * pow(t, -0.5)))) - t;
} 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 (a <= (-14000.0d0)) then
tmp = (log(y) + t_1) - t
else if (a <= 0.006d0) then
tmp = (log(y) + log((z * (t ** (-0.5d0))))) - t
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 (a <= -14000.0) {
tmp = (Math.log(y) + t_1) - t;
} else if (a <= 0.006) {
tmp = (Math.log(y) + Math.log((z * Math.pow(t, -0.5)))) - t;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -14000.0: tmp = (math.log(y) + t_1) - t elif a <= 0.006: tmp = (math.log(y) + math.log((z * math.pow(t, -0.5)))) - t else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -14000.0) tmp = Float64(Float64(log(y) + t_1) - t); elseif (a <= 0.006) tmp = Float64(Float64(log(y) + log(Float64(z * (t ^ -0.5)))) - t); 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 (a <= -14000.0) tmp = (log(y) + t_1) - t; elseif (a <= 0.006) tmp = (log(y) + log((z * (t ^ -0.5)))) - t; 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[a, -14000.0], N[(N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 0.006], N[(N[(N[Log[y], $MachinePrecision] + N[Log[N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -14000:\\
\;\;\;\;\left(\log y + t_1\right) - t\\
\mathbf{elif}\;a \leq 0.006:\\
\;\;\;\;\left(\log y + \log \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if a < -14000Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r-99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in a around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 72.8%
log-pow5.6%
associate--l+5.6%
remove-double-neg5.6%
log-rec5.6%
mul-1-neg5.6%
associate--l+5.6%
log-pow72.8%
mul-1-neg72.8%
log-rec72.8%
remove-double-neg72.8%
*-commutative72.8%
Simplified72.8%
if -14000 < a < 0.0060000000000000001Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r-99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 61.6%
Taylor expanded in a around 0 61.4%
*-commutative61.4%
Simplified61.4%
add-log-exp61.4%
sum-log56.3%
exp-to-pow56.3%
Applied egg-rr56.3%
if 0.0060000000000000001 < a Initial program 99.6%
Taylor expanded in x around 0 65.9%
remove-double-neg65.9%
log-rec65.9%
mul-1-neg65.9%
+-commutative65.9%
associate--l+65.9%
mul-1-neg65.9%
log-rec65.9%
remove-double-neg65.9%
Simplified65.9%
Taylor expanded in t around inf 99.6%
neg-mul-199.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
mul-1-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-rgt-out99.6%
sub-neg99.6%
distribute-rgt-out99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in a around inf 99.6%
*-commutative99.6%
Simplified99.6%
Final simplification71.9%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (- (log y) t)) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return (log(z) + (log(y) - t)) + (log(t) * (a - 0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) + (log(y) - t)) + (log(t) * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + (Math.log(y) - t)) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return (math.log(z) + (math.log(y) - t)) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(log(z) + Float64(log(y) - t)) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + (log(y) - t)) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \left(\log y - t\right)\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.5%
Taylor expanded in x around 0 66.4%
remove-double-neg66.4%
log-rec66.4%
mul-1-neg66.4%
+-commutative66.4%
associate--l+66.4%
mul-1-neg66.4%
log-rec66.4%
remove-double-neg66.4%
Simplified66.4%
Final simplification66.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -2000000.0)
(- (+ (log y) t_1) t)
(if (<= (- a 0.5) -0.4) (- (log (* y (* z (pow t -0.5)))) t) (- t_1 t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -2000000.0) {
tmp = (log(y) + t_1) - t;
} else if ((a - 0.5) <= -0.4) {
tmp = log((y * (z * pow(t, -0.5)))) - t;
} 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 ((a - 0.5d0) <= (-2000000.0d0)) then
tmp = (log(y) + t_1) - t
else if ((a - 0.5d0) <= (-0.4d0)) then
tmp = log((y * (z * (t ** (-0.5d0))))) - t
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 ((a - 0.5) <= -2000000.0) {
tmp = (Math.log(y) + t_1) - t;
} else if ((a - 0.5) <= -0.4) {
tmp = Math.log((y * (z * Math.pow(t, -0.5)))) - t;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -2000000.0: tmp = (math.log(y) + t_1) - t elif (a - 0.5) <= -0.4: tmp = math.log((y * (z * math.pow(t, -0.5)))) - t else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -2000000.0) tmp = Float64(Float64(log(y) + t_1) - t); elseif (Float64(a - 0.5) <= -0.4) tmp = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t); 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 ((a - 0.5) <= -2000000.0) tmp = (log(y) + t_1) - t; elseif ((a - 0.5) <= -0.4) tmp = log((y * (z * (t ^ -0.5)))) - t; 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[N[(a - 0.5), $MachinePrecision], -2000000.0], N[(N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4], N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -2000000:\\
\;\;\;\;\left(\log y + t_1\right) - t\\
\mathbf{elif}\;a - 0.5 \leq -0.4:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2e6Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r-99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in a around inf 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around 0 72.8%
log-pow5.6%
associate--l+5.6%
remove-double-neg5.6%
log-rec5.6%
mul-1-neg5.6%
associate--l+5.6%
log-pow72.8%
mul-1-neg72.8%
log-rec72.8%
remove-double-neg72.8%
*-commutative72.8%
Simplified72.8%
if -2e6 < (-.f64 a 1/2) < -0.40000000000000002Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r-99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in a around 0 98.3%
associate-+r+98.4%
log-prod80.7%
+-commutative80.7%
Simplified80.7%
Taylor expanded in y around inf 61.3%
associate-+r+61.4%
+-commutative61.4%
mul-1-neg61.4%
log-rec61.4%
remove-double-neg61.4%
log-prod46.2%
+-commutative46.2%
*-commutative46.2%
Simplified46.2%
+-commutative46.2%
log-prod61.4%
associate-+r+61.4%
add-log-exp56.2%
sum-log43.8%
exp-sum43.9%
add-exp-log44.0%
exp-to-pow44.1%
Applied egg-rr44.1%
if -0.40000000000000002 < (-.f64 a 1/2) Initial program 99.6%
Taylor expanded in x around 0 65.9%
remove-double-neg65.9%
log-rec65.9%
mul-1-neg65.9%
+-commutative65.9%
associate--l+65.9%
mul-1-neg65.9%
log-rec65.9%
remove-double-neg65.9%
Simplified65.9%
Taylor expanded in t around inf 99.6%
neg-mul-199.6%
Simplified99.6%
Taylor expanded in t around 0 99.6%
mul-1-neg99.6%
+-commutative99.6%
sub-neg99.6%
metadata-eval99.6%
+-commutative99.6%
distribute-rgt-out99.6%
sub-neg99.6%
distribute-rgt-out99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in a around inf 99.6%
*-commutative99.6%
Simplified99.6%
Final simplification66.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (* (+ a -0.5) (log t)) t))) (if (<= z 6.5e+81) (+ (log (* (+ x y) z)) t_1) t_1)))
double code(double x, double y, double z, double t, double a) {
double t_1 = ((a + -0.5) * log(t)) - t;
double tmp;
if (z <= 6.5e+81) {
tmp = log(((x + y) * z)) + t_1;
} 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 + (-0.5d0)) * log(t)) - t
if (z <= 6.5d+81) then
tmp = log(((x + y) * z)) + t_1
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 + -0.5) * Math.log(t)) - t;
double tmp;
if (z <= 6.5e+81) {
tmp = Math.log(((x + y) * z)) + t_1;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = ((a + -0.5) * math.log(t)) - t tmp = 0 if z <= 6.5e+81: tmp = math.log(((x + y) * z)) + t_1 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(Float64(a + -0.5) * log(t)) - t) tmp = 0.0 if (z <= 6.5e+81) tmp = Float64(log(Float64(Float64(x + y) * z)) + t_1); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = ((a + -0.5) * log(t)) - t; tmp = 0.0; if (z <= 6.5e+81) tmp = log(((x + y) * z)) + t_1; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[z, 6.5e+81], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot \log t - t\\
\mathbf{if}\;z \leq 6.5 \cdot 10^{+81}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < 6.4999999999999996e81Initial program 99.4%
associate-+l-99.4%
+-commutative99.4%
sum-log95.1%
sub-neg95.1%
metadata-eval95.1%
Applied egg-rr95.1%
if 6.4999999999999996e81 < z Initial program 99.7%
Taylor expanded in x around 0 65.9%
remove-double-neg65.9%
log-rec65.9%
mul-1-neg65.9%
+-commutative65.9%
associate--l+65.9%
mul-1-neg65.9%
log-rec65.9%
remove-double-neg65.9%
Simplified65.9%
Taylor expanded in t around inf 85.5%
neg-mul-185.5%
Simplified85.5%
Taylor expanded in t around 0 85.5%
mul-1-neg85.5%
+-commutative85.5%
sub-neg85.5%
metadata-eval85.5%
+-commutative85.5%
distribute-rgt-out85.5%
sub-neg85.5%
distribute-rgt-out85.5%
+-commutative85.5%
Simplified85.5%
Final simplification91.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0115) (+ (log (* y z)) (* (log t) (- a 0.5))) (- (+ (log y) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0115) {
tmp = log((y * z)) + (log(t) * (a - 0.5));
} else {
tmp = (log(y) + (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 <= 0.0115d0) then
tmp = log((y * z)) + (log(t) * (a - 0.5d0))
else
tmp = (log(y) + (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 <= 0.0115) {
tmp = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
} else {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0115: tmp = math.log((y * z)) + (math.log(t) * (a - 0.5)) else: tmp = (math.log(y) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0115) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(Float64(log(y) + Float64(a * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.0115) tmp = log((y * z)) + (log(t) * (a - 0.5)); else tmp = (log(y) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0115], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0115:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 0.0115Initial program 99.1%
Taylor expanded in x around 0 62.0%
remove-double-neg62.0%
log-rec62.0%
mul-1-neg62.0%
+-commutative62.0%
associate--l+62.0%
mul-1-neg62.0%
log-rec62.0%
remove-double-neg62.0%
Simplified62.0%
Taylor expanded in t around 0 61.7%
log-prod49.8%
Simplified49.8%
if 0.0115 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r-99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 99.5%
*-commutative99.5%
Simplified99.5%
Taylor expanded in x around 0 70.4%
log-pow32.4%
associate--l+32.4%
remove-double-neg32.4%
log-rec32.4%
mul-1-neg32.4%
associate--l+32.4%
log-pow70.4%
mul-1-neg70.4%
log-rec70.4%
remove-double-neg70.4%
*-commutative70.4%
Simplified70.4%
Final simplification60.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 3.4e-5) (+ (log (* y z)) (* (log t) (- a 0.5))) (+ (log (+ x y)) (- (* a (log t)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.4e-5) {
tmp = log((y * z)) + (log(t) * (a - 0.5));
} else {
tmp = log((x + y)) + ((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 <= 3.4d-5) then
tmp = log((y * z)) + (log(t) * (a - 0.5d0))
else
tmp = log((x + y)) + ((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 <= 3.4e-5) {
tmp = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
} else {
tmp = Math.log((x + y)) + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.4e-5: tmp = math.log((y * z)) + (math.log(t) * (a - 0.5)) else: tmp = math.log((x + y)) + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.4e-5) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(log(Float64(x + y)) + Float64(Float64(a * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.4e-5) tmp = log((y * z)) + (log(t) * (a - 0.5)); else tmp = log((x + y)) + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.4e-5], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.4 \cdot 10^{-5}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 3.4e-5Initial program 99.1%
Taylor expanded in x around 0 62.0%
remove-double-neg62.0%
log-rec62.0%
mul-1-neg62.0%
+-commutative62.0%
associate--l+62.0%
mul-1-neg62.0%
log-rec62.0%
remove-double-neg62.0%
Simplified62.0%
Taylor expanded in t around 0 61.7%
log-prod49.8%
Simplified49.8%
if 3.4e-5 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r-99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 99.5%
*-commutative99.5%
Simplified99.5%
Final simplification74.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t 1.12e+20) (and (not (<= t 3e+63)) (<= t 1.22e+100))) (* (log t) (- a 0.5)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 1.12e+20) || (!(t <= 3e+63) && (t <= 1.22e+100))) {
tmp = log(t) * (a - 0.5);
} 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 <= 1.12d+20) .or. (.not. (t <= 3d+63)) .and. (t <= 1.22d+100)) then
tmp = log(t) * (a - 0.5d0)
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 <= 1.12e+20) || (!(t <= 3e+63) && (t <= 1.22e+100))) {
tmp = Math.log(t) * (a - 0.5);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= 1.12e+20) or (not (t <= 3e+63) and (t <= 1.22e+100)): tmp = math.log(t) * (a - 0.5) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= 1.12e+20) || (!(t <= 3e+63) && (t <= 1.22e+100))) tmp = Float64(log(t) * Float64(a - 0.5)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= 1.12e+20) || (~((t <= 3e+63)) && (t <= 1.22e+100))) tmp = log(t) * (a - 0.5); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, 1.12e+20], And[N[Not[LessEqual[t, 3e+63]], $MachinePrecision], LessEqual[t, 1.22e+100]]], N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.12 \cdot 10^{+20} \lor \neg \left(t \leq 3 \cdot 10^{+63}\right) \land t \leq 1.22 \cdot 10^{+100}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.12e20 or 2.99999999999999999e63 < t < 1.21999999999999995e100Initial program 99.2%
Taylor expanded in x around 0 64.7%
remove-double-neg64.7%
log-rec64.7%
mul-1-neg64.7%
+-commutative64.7%
associate--l+64.7%
mul-1-neg64.7%
log-rec64.7%
remove-double-neg64.7%
Simplified64.7%
Taylor expanded in t around inf 65.9%
neg-mul-165.9%
Simplified65.9%
Taylor expanded in t around 0 62.0%
if 1.12e20 < t < 2.99999999999999999e63 or 1.21999999999999995e100 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r-99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 77.2%
neg-mul-177.2%
Simplified77.2%
Final simplification68.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2000000.0) (not (<= a 1e+37))) (* a (log t)) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2000000.0) || !(a <= 1e+37)) {
tmp = a * log(t);
} else {
tmp = log((x + y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2000000.0d0)) .or. (.not. (a <= 1d+37))) then
tmp = a * log(t)
else
tmp = log((x + y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2000000.0) || !(a <= 1e+37)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2000000.0) or not (a <= 1e+37): tmp = a * math.log(t) else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2000000.0) || !(a <= 1e+37)) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(x + y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2000000.0) || ~((a <= 1e+37))) tmp = a * log(t); else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2000000.0], N[Not[LessEqual[a, 1e+37]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2000000 \lor \neg \left(a \leq 10^{+37}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -2e6 or 9.99999999999999954e36 < a Initial program 99.7%
Taylor expanded in x around 0 69.9%
remove-double-neg69.9%
log-rec69.9%
mul-1-neg69.9%
+-commutative69.9%
associate--l+69.9%
mul-1-neg69.9%
log-rec69.9%
remove-double-neg69.9%
Simplified69.9%
Taylor expanded in a around inf 79.2%
*-commutative79.2%
Simplified79.2%
if -2e6 < a < 9.99999999999999954e36Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r-99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in a around inf 57.9%
*-commutative57.9%
Simplified57.9%
Taylor expanded in a around 0 55.6%
+-commutative55.6%
Simplified55.6%
Final simplification67.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0195) (+ t (* (+ a -0.5) (log t))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0195) {
tmp = t + ((a + -0.5) * log(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 (t <= 0.0195d0) then
tmp = t + ((a + (-0.5d0)) * log(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 (t <= 0.0195) {
tmp = t + ((a + -0.5) * Math.log(t));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0195: tmp = t + ((a + -0.5) * math.log(t)) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0195) tmp = Float64(t + Float64(Float64(a + -0.5) * log(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 (t <= 0.0195) tmp = t + ((a + -0.5) * log(t)); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0195], N[(t + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0195:\\
\;\;\;\;t + \left(a + -0.5\right) \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 0.0195Initial program 99.1%
Taylor expanded in x around 0 62.0%
remove-double-neg62.0%
log-rec62.0%
mul-1-neg62.0%
+-commutative62.0%
associate--l+62.0%
mul-1-neg62.0%
log-rec62.0%
remove-double-neg62.0%
Simplified62.0%
Taylor expanded in t around inf 60.0%
neg-mul-160.0%
Simplified60.0%
Taylor expanded in t around 0 60.0%
mul-1-neg60.0%
+-commutative60.0%
sub-neg60.0%
metadata-eval60.0%
+-commutative60.0%
distribute-rgt-out60.0%
sub-neg60.0%
distribute-rgt-out60.0%
+-commutative60.0%
Simplified60.0%
sub-neg60.0%
add-sqr-sqrt0.0%
sqrt-unprod60.0%
sqr-neg60.0%
sqrt-unprod60.0%
add-sqr-sqrt60.0%
Applied egg-rr60.0%
if 0.0195 < t Initial program 99.9%
Taylor expanded in x around 0 70.8%
remove-double-neg70.8%
log-rec70.8%
mul-1-neg70.8%
+-commutative70.8%
associate--l+70.8%
mul-1-neg70.8%
log-rec70.8%
remove-double-neg70.8%
Simplified70.8%
Taylor expanded in t around inf 99.5%
neg-mul-199.5%
Simplified99.5%
Taylor expanded in t around 0 99.5%
mul-1-neg99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
distribute-rgt-out99.5%
sub-neg99.5%
distribute-rgt-out99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in a around inf 99.5%
*-commutative99.5%
Simplified99.5%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2000000.0) (not (<= a 1e+37))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2000000.0) || !(a <= 1e+37)) {
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 ((a <= (-2000000.0d0)) .or. (.not. (a <= 1d+37))) 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 ((a <= -2000000.0) || !(a <= 1e+37)) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2000000.0) or not (a <= 1e+37): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2000000.0) || !(a <= 1e+37)) 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 ((a <= -2000000.0) || ~((a <= 1e+37))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2000000.0], N[Not[LessEqual[a, 1e+37]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2000000 \lor \neg \left(a \leq 10^{+37}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -2e6 or 9.99999999999999954e36 < a Initial program 99.7%
Taylor expanded in x around 0 69.9%
remove-double-neg69.9%
log-rec69.9%
mul-1-neg69.9%
+-commutative69.9%
associate--l+69.9%
mul-1-neg69.9%
log-rec69.9%
remove-double-neg69.9%
Simplified69.9%
Taylor expanded in a around inf 79.2%
*-commutative79.2%
Simplified79.2%
if -2e6 < a < 9.99999999999999954e36Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r-99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around inf 50.3%
neg-mul-150.3%
Simplified50.3%
Final simplification65.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.00045) (* (log t) (- a 0.5)) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00045) {
tmp = log(t) * (a - 0.5);
} 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 <= 0.00045d0) then
tmp = log(t) * (a - 0.5d0)
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 <= 0.00045) {
tmp = Math.log(t) * (a - 0.5);
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.00045: tmp = math.log(t) * (a - 0.5) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.00045) tmp = Float64(log(t) * Float64(a - 0.5)); 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 <= 0.00045) tmp = log(t) * (a - 0.5); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.00045], N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.00045:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 4.4999999999999999e-4Initial program 99.1%
Taylor expanded in x around 0 62.0%
remove-double-neg62.0%
log-rec62.0%
mul-1-neg62.0%
+-commutative62.0%
associate--l+62.0%
mul-1-neg62.0%
log-rec62.0%
remove-double-neg62.0%
Simplified62.0%
Taylor expanded in t around inf 60.0%
neg-mul-160.0%
Simplified60.0%
Taylor expanded in t around 0 60.0%
if 4.4999999999999999e-4 < t Initial program 99.9%
Taylor expanded in x around 0 70.8%
remove-double-neg70.8%
log-rec70.8%
mul-1-neg70.8%
+-commutative70.8%
associate--l+70.8%
mul-1-neg70.8%
log-rec70.8%
remove-double-neg70.8%
Simplified70.8%
Taylor expanded in t around inf 99.5%
neg-mul-199.5%
Simplified99.5%
Taylor expanded in t around 0 99.5%
mul-1-neg99.5%
+-commutative99.5%
sub-neg99.5%
metadata-eval99.5%
+-commutative99.5%
distribute-rgt-out99.5%
sub-neg99.5%
distribute-rgt-out99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in a around inf 99.5%
*-commutative99.5%
Simplified99.5%
Final simplification79.6%
(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.5%
Taylor expanded in x around 0 66.4%
remove-double-neg66.4%
log-rec66.4%
mul-1-neg66.4%
+-commutative66.4%
associate--l+66.4%
mul-1-neg66.4%
log-rec66.4%
remove-double-neg66.4%
Simplified66.4%
Taylor expanded in t around inf 79.6%
neg-mul-179.6%
Simplified79.6%
Taylor expanded in t around 0 79.6%
mul-1-neg79.6%
+-commutative79.6%
sub-neg79.6%
metadata-eval79.6%
+-commutative79.6%
distribute-rgt-out79.6%
sub-neg79.6%
distribute-rgt-out79.6%
+-commutative79.6%
Simplified79.6%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.92) (* -0.5 (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.92) {
tmp = -0.5 * 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 <= 0.92d0) then
tmp = (-0.5d0) * 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 <= 0.92) {
tmp = -0.5 * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.92: tmp = -0.5 * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.92) tmp = Float64(-0.5 * log(t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.92) tmp = -0.5 * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.92], N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.92:\\
\;\;\;\;-0.5 \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 0.92000000000000004Initial program 99.1%
Taylor expanded in x around 0 62.3%
remove-double-neg62.3%
log-rec62.3%
mul-1-neg62.3%
+-commutative62.3%
associate--l+62.3%
mul-1-neg62.3%
log-rec62.3%
remove-double-neg62.3%
Simplified62.3%
Taylor expanded in t around inf 60.3%
neg-mul-160.3%
Simplified60.3%
Taylor expanded in t around 0 60.3%
Taylor expanded in a around 0 8.4%
*-commutative8.4%
Simplified8.4%
if 0.92000000000000004 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r-99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 68.9%
neg-mul-168.9%
Simplified68.9%
Final simplification38.2%
(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.5%
associate--l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r-99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 35.3%
neg-mul-135.3%
Simplified35.3%
Final simplification35.3%
(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 2023271
(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))))