
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (fma (+ a -0.5) (log t) (log (+ x y)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + fma((a + -0.5), log(t), log((x + y)));
}
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + fma(Float64(a + -0.5), log(t), log(Float64(x + y)))) end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \mathsf{fma}\left(a + -0.5, \log t, \log \left(x + y\right)\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(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.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r-99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (+ (+ (- (log z) t) (log (+ x y))) (* (+ a -0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log(z) - t) + log((x + y))) + ((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(z) - t) + log((x + y))) + ((a + (-0.5d0)) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log(z) - t) + Math.log((x + y))) + ((a + -0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log(z) - t) + math.log((x + y))) + ((a + -0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(z) - t) + log(Float64(x + y))) + Float64(Float64(a + -0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log(z) - t) + log((x + y))) + ((a + -0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log z - t\right) + \log \left(x + y\right)\right) + \left(a + -0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
cancel-sign-sub99.6%
cancel-sign-sub-inv99.6%
associate--l+99.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 (or (<= a -0.085) (not (<= a 0.72))) (- (+ (log y) (* a (log t))) t) (+ (log z) (- (log (* y (pow t -0.5))) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.085) || !(a <= 0.72)) {
tmp = (log(y) + (a * log(t))) - t;
} else {
tmp = log(z) + (log((y * pow(t, -0.5))) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-0.085d0)) .or. (.not. (a <= 0.72d0))) then
tmp = (log(y) + (a * log(t))) - t
else
tmp = log(z) + (log((y * (t ** (-0.5d0)))) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.085) || !(a <= 0.72)) {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
} else {
tmp = Math.log(z) + (Math.log((y * Math.pow(t, -0.5))) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.085) or not (a <= 0.72): tmp = (math.log(y) + (a * math.log(t))) - t else: tmp = math.log(z) + (math.log((y * math.pow(t, -0.5))) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.085) || !(a <= 0.72)) tmp = Float64(Float64(log(y) + Float64(a * log(t))) - t); else tmp = Float64(log(z) + Float64(log(Float64(y * (t ^ -0.5))) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.085) || ~((a <= 0.72))) tmp = (log(y) + (a * log(t))) - t; else tmp = log(z) + (log((y * (t ^ -0.5))) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.085], N[Not[LessEqual[a, 0.72]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.085 \lor \neg \left(a \leq 0.72\right):\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log z + \left(\log \left(y \cdot {t}^{-0.5}\right) - t\right)\\
\end{array}
\end{array}
if a < -0.0850000000000000061 or 0.71999999999999997 < a Initial 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 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in x around 0 74.3%
if -0.0850000000000000061 < a < 0.71999999999999997Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 73.7%
Taylor expanded in a around 0 73.3%
*-commutative73.3%
Simplified73.3%
associate-+l-73.3%
add-log-exp73.3%
pow-to-exp73.3%
sum-log61.6%
Applied egg-rr61.6%
Final simplification67.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 580.0) (+ (log y) (+ (log 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 <= 580.0) {
tmp = log(y) + (log(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 <= 580.0d0) then
tmp = log(y) + (log(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 <= 580.0) {
tmp = Math.log(y) + (Math.log(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 <= 580.0: tmp = math.log(y) + (math.log(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 <= 580.0) tmp = Float64(log(y) + Float64(log(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 <= 580.0) tmp = log(y) + (log(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, 580.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(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 580:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 580Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 68.5%
Taylor expanded in t around 0 67.8%
if 580 < 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.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in x around 0 79.1%
Final simplification73.5%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 74.0%
Final simplification74.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -6.8e+28)
t_1
(if (<= a 4.2e-228)
(- (log (+ x y)) t)
(if (<= a 1.05e-153)
(+ (log (* z y)) (* -0.5 (log t)))
(if (<= a 8e+91) (- (log y) t) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -6.8e+28) {
tmp = t_1;
} else if (a <= 4.2e-228) {
tmp = log((x + y)) - t;
} else if (a <= 1.05e-153) {
tmp = log((z * y)) + (-0.5 * log(t));
} else if (a <= 8e+91) {
tmp = log(y) - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (a <= (-6.8d+28)) then
tmp = t_1
else if (a <= 4.2d-228) then
tmp = log((x + y)) - t
else if (a <= 1.05d-153) then
tmp = log((z * y)) + ((-0.5d0) * log(t))
else if (a <= 8d+91) then
tmp = log(y) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (a <= -6.8e+28) {
tmp = t_1;
} else if (a <= 4.2e-228) {
tmp = Math.log((x + y)) - t;
} else if (a <= 1.05e-153) {
tmp = Math.log((z * y)) + (-0.5 * Math.log(t));
} else if (a <= 8e+91) {
tmp = Math.log(y) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -6.8e+28: tmp = t_1 elif a <= 4.2e-228: tmp = math.log((x + y)) - t elif a <= 1.05e-153: tmp = math.log((z * y)) + (-0.5 * math.log(t)) elif a <= 8e+91: tmp = math.log(y) - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -6.8e+28) tmp = t_1; elseif (a <= 4.2e-228) tmp = Float64(log(Float64(x + y)) - t); elseif (a <= 1.05e-153) tmp = Float64(log(Float64(z * y)) + Float64(-0.5 * log(t))); elseif (a <= 8e+91) tmp = Float64(log(y) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (a <= -6.8e+28) tmp = t_1; elseif (a <= 4.2e-228) tmp = log((x + y)) - t; elseif (a <= 1.05e-153) tmp = log((z * y)) + (-0.5 * log(t)); elseif (a <= 8e+91) tmp = log(y) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.8e+28], t$95$1, If[LessEqual[a, 4.2e-228], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 1.05e-153], N[(N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8e+91], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -6.8 \cdot 10^{+28}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{-228}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-153}:\\
\;\;\;\;\log \left(z \cdot y\right) + -0.5 \cdot \log t\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+91}:\\
\;\;\;\;\log y - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -6.8e28 or 8.00000000000000064e91 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 75.5%
Taylor expanded in a around inf 83.6%
*-commutative83.6%
Simplified83.6%
if -6.8e28 < a < 4.19999999999999982e-228Initial program 99.6%
associate--l+99.6%
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 65.8%
*-commutative65.8%
Simplified65.8%
Taylor expanded in a around 0 64.4%
+-commutative64.4%
Simplified64.4%
if 4.19999999999999982e-228 < a < 1.05000000000000002e-153Initial program 99.0%
associate--l+99.0%
+-commutative99.0%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 81.6%
Taylor expanded in a around 0 81.6%
*-commutative81.6%
Simplified81.6%
Taylor expanded in t around 0 68.7%
associate-+r+68.9%
log-prod61.5%
*-commutative61.5%
Simplified61.5%
if 1.05000000000000002e-153 < a < 8.00000000000000064e91Initial program 99.6%
associate--l+99.6%
associate-+l+99.5%
+-commutative99.5%
associate-+r-99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in a around inf 75.4%
*-commutative75.4%
Simplified75.4%
Taylor expanded in x around 0 63.0%
Taylor expanded in a around 0 54.9%
Final simplification70.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -5.8e+32)
t_1
(if (<= a 2.8e-43)
(- (log (/ y (/ (sqrt t) z))) t)
(if (<= a 4e+91) (- (+ t_1 (log x)) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -5.8e+32) {
tmp = t_1;
} else if (a <= 2.8e-43) {
tmp = log((y / (sqrt(t) / z))) - t;
} else if (a <= 4e+91) {
tmp = (t_1 + log(x)) - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (a <= (-5.8d+32)) then
tmp = t_1
else if (a <= 2.8d-43) then
tmp = log((y / (sqrt(t) / z))) - t
else if (a <= 4d+91) then
tmp = (t_1 + log(x)) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (a <= -5.8e+32) {
tmp = t_1;
} else if (a <= 2.8e-43) {
tmp = Math.log((y / (Math.sqrt(t) / z))) - t;
} else if (a <= 4e+91) {
tmp = (t_1 + Math.log(x)) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -5.8e+32: tmp = t_1 elif a <= 2.8e-43: tmp = math.log((y / (math.sqrt(t) / z))) - t elif a <= 4e+91: tmp = (t_1 + math.log(x)) - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -5.8e+32) tmp = t_1; elseif (a <= 2.8e-43) tmp = Float64(log(Float64(y / Float64(sqrt(t) / z))) - t); elseif (a <= 4e+91) tmp = Float64(Float64(t_1 + log(x)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (a <= -5.8e+32) tmp = t_1; elseif (a <= 2.8e-43) tmp = log((y / (sqrt(t) / z))) - t; elseif (a <= 4e+91) tmp = (t_1 + log(x)) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5.8e+32], t$95$1, If[LessEqual[a, 2.8e-43], N[(N[Log[N[(y / N[(N[Sqrt[t], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 4e+91], N[(N[(t$95$1 + N[Log[x], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -5.8 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-43}:\\
\;\;\;\;\log \left(\frac{y}{\frac{\sqrt{t}}{z}}\right) - t\\
\mathbf{elif}\;a \leq 4 \cdot 10^{+91}:\\
\;\;\;\;\left(t_1 + \log x\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -5.80000000000000006e32 or 4.00000000000000032e91 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 75.5%
Taylor expanded in a around inf 83.6%
*-commutative83.6%
Simplified83.6%
if -5.80000000000000006e32 < a < 2.7999999999999998e-43Initial 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 a around 0 97.9%
associate-+r+97.8%
+-commutative97.8%
log-prod72.6%
*-commutative72.6%
+-commutative72.6%
Simplified72.6%
Taylor expanded in z around 0 97.9%
associate-+r+97.8%
+-commutative97.8%
log-prod72.6%
log-pow72.6%
log-prod66.5%
associate-*l*66.6%
Simplified66.6%
Taylor expanded in x around 0 47.9%
*-un-lft-identity47.9%
log-prod47.9%
metadata-eval47.9%
*-commutative47.9%
sqrt-div47.9%
metadata-eval47.9%
un-div-inv47.9%
Applied egg-rr47.9%
+-lft-identity47.9%
associate-/l*49.9%
Simplified49.9%
if 2.7999999999999998e-43 < a < 4.00000000000000032e91Initial program 99.7%
associate--l+99.7%
associate-+l+99.6%
+-commutative99.6%
associate-+r-99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in y around 0 81.9%
Final simplification67.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.62e-12) (+ (* (+ a -0.5) (log t)) (log (* z (+ x y)))) (- (+ (log y) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.62e-12) {
tmp = ((a + -0.5) * log(t)) + log((z * (x + y)));
} 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 <= 1.62d-12) then
tmp = ((a + (-0.5d0)) * log(t)) + log((z * (x + y)))
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 <= 1.62e-12) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log((z * (x + y)));
} else {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.62e-12: tmp = ((a + -0.5) * math.log(t)) + math.log((z * (x + y))) else: tmp = (math.log(y) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.62e-12) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(z * Float64(x + y)))); 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 <= 1.62e-12) tmp = ((a + -0.5) * log(t)) + log((z * (x + y))); else tmp = (log(y) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.62e-12], 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[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.62 \cdot 10^{-12}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(z \cdot \left(x + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 1.62e-12Initial program 99.2%
cancel-sign-sub99.2%
cancel-sign-sub-inv99.2%
associate--l+99.2%
remove-double-neg99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in t around 0 99.1%
log-prod75.7%
+-commutative75.7%
Simplified75.7%
if 1.62e-12 < 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 98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 78.8%
Final simplification77.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 9.5e+17) (- (+ (* (log t) (- a 0.5)) (log (* z y))) t) (- (+ (log y) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 9.5e+17) {
tmp = ((log(t) * (a - 0.5)) + log((z * y))) - t;
} 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 <= 9.5d+17) then
tmp = ((log(t) * (a - 0.5d0)) + log((z * y))) - t
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 <= 9.5e+17) {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((z * y))) - t;
} else {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 9.5e+17: tmp = ((math.log(t) * (a - 0.5)) + math.log((z * y))) - t else: tmp = (math.log(y) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 9.5e+17) tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(z * y))) - t); 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 <= 9.5e+17) tmp = ((log(t) * (a - 0.5)) + log((z * y))) - t; else tmp = (log(y) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 9.5e+17], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $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 9.5 \cdot 10^{+17}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(z \cdot y\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 9.5e17Initial program 99.2%
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%
add-cbrt-cube64.1%
pow364.1%
+-commutative64.1%
fma-udef64.1%
associate--l+64.1%
associate-+r+64.1%
+-commutative64.1%
fma-def64.1%
associate-+r-64.1%
sum-log45.1%
Applied egg-rr45.1%
Taylor expanded in x around 0 55.5%
if 9.5e17 < 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.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 79.2%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.044) (not (<= a 7e-44))) (- (+ (log y) (* a (log t))) t) (- (log (/ y (/ (sqrt t) z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.044) || !(a <= 7e-44)) {
tmp = (log(y) + (a * log(t))) - t;
} else {
tmp = log((y / (sqrt(t) / z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-0.044d0)) .or. (.not. (a <= 7d-44))) then
tmp = (log(y) + (a * log(t))) - t
else
tmp = log((y / (sqrt(t) / z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.044) || !(a <= 7e-44)) {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
} else {
tmp = Math.log((y / (Math.sqrt(t) / z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.044) or not (a <= 7e-44): tmp = (math.log(y) + (a * math.log(t))) - t else: tmp = math.log((y / (math.sqrt(t) / z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.044) || !(a <= 7e-44)) tmp = Float64(Float64(log(y) + Float64(a * log(t))) - t); else tmp = Float64(log(Float64(y / Float64(sqrt(t) / z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.044) || ~((a <= 7e-44))) tmp = (log(y) + (a * log(t))) - t; else tmp = log((y / (sqrt(t) / z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.044], N[Not[LessEqual[a, 7e-44]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y / N[(N[Sqrt[t], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.044 \lor \neg \left(a \leq 7 \cdot 10^{-44}\right):\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{y}{\frac{\sqrt{t}}{z}}\right) - t\\
\end{array}
\end{array}
if a < -0.043999999999999997 or 6.9999999999999995e-44 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.6%
+-commutative99.6%
associate-+r-99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 96.8%
*-commutative96.8%
Simplified96.8%
Taylor expanded in x around 0 73.6%
if -0.043999999999999997 < a < 6.9999999999999995e-44Initial 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 a around 0 99.3%
associate-+r+99.2%
+-commutative99.2%
log-prod73.9%
*-commutative73.9%
+-commutative73.9%
Simplified73.9%
Taylor expanded in z around 0 99.3%
associate-+r+99.2%
+-commutative99.2%
log-prod73.9%
log-pow73.9%
log-prod67.5%
associate-*l*67.7%
Simplified67.7%
Taylor expanded in x around 0 49.8%
*-un-lft-identity49.8%
log-prod49.8%
metadata-eval49.8%
*-commutative49.8%
sqrt-div49.8%
metadata-eval49.8%
un-div-inv49.8%
Applied egg-rr49.8%
+-lft-identity49.8%
associate-/l*51.8%
Simplified51.8%
Final simplification63.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -9.2e+34)
t_1
(if (<= a 1.8e-43)
(- (log (/ y (/ (sqrt t) z))) t)
(if (<= a 1.52e+93) (- (log y) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -9.2e+34) {
tmp = t_1;
} else if (a <= 1.8e-43) {
tmp = log((y / (sqrt(t) / z))) - t;
} else if (a <= 1.52e+93) {
tmp = log(y) - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (a <= (-9.2d+34)) then
tmp = t_1
else if (a <= 1.8d-43) then
tmp = log((y / (sqrt(t) / z))) - t
else if (a <= 1.52d+93) then
tmp = log(y) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (a <= -9.2e+34) {
tmp = t_1;
} else if (a <= 1.8e-43) {
tmp = Math.log((y / (Math.sqrt(t) / z))) - t;
} else if (a <= 1.52e+93) {
tmp = Math.log(y) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -9.2e+34: tmp = t_1 elif a <= 1.8e-43: tmp = math.log((y / (math.sqrt(t) / z))) - t elif a <= 1.52e+93: tmp = math.log(y) - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -9.2e+34) tmp = t_1; elseif (a <= 1.8e-43) tmp = Float64(log(Float64(y / Float64(sqrt(t) / z))) - t); elseif (a <= 1.52e+93) tmp = Float64(log(y) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (a <= -9.2e+34) tmp = t_1; elseif (a <= 1.8e-43) tmp = log((y / (sqrt(t) / z))) - t; elseif (a <= 1.52e+93) tmp = log(y) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -9.2e+34], t$95$1, If[LessEqual[a, 1.8e-43], N[(N[Log[N[(y / N[(N[Sqrt[t], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 1.52e+93], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -9.2 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-43}:\\
\;\;\;\;\log \left(\frac{y}{\frac{\sqrt{t}}{z}}\right) - t\\
\mathbf{elif}\;a \leq 1.52 \cdot 10^{+93}:\\
\;\;\;\;\log y - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -9.1999999999999993e34 or 1.52e93 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 75.5%
Taylor expanded in a around inf 83.6%
*-commutative83.6%
Simplified83.6%
if -9.1999999999999993e34 < a < 1.7999999999999999e-43Initial 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 a around 0 97.9%
associate-+r+97.8%
+-commutative97.8%
log-prod72.6%
*-commutative72.6%
+-commutative72.6%
Simplified72.6%
Taylor expanded in z around 0 97.9%
associate-+r+97.8%
+-commutative97.8%
log-prod72.6%
log-pow72.6%
log-prod66.5%
associate-*l*66.6%
Simplified66.6%
Taylor expanded in x around 0 47.9%
*-un-lft-identity47.9%
log-prod47.9%
metadata-eval47.9%
*-commutative47.9%
sqrt-div47.9%
metadata-eval47.9%
un-div-inv47.9%
Applied egg-rr47.9%
+-lft-identity47.9%
associate-/l*49.9%
Simplified49.9%
if 1.7999999999999999e-43 < a < 1.52e93Initial program 99.7%
associate--l+99.7%
associate-+l+99.6%
+-commutative99.6%
associate-+r-99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in x around 0 70.6%
Taylor expanded in a around 0 55.8%
Final simplification64.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 2.3e-12) (+ (* (+ a -0.5) (log t)) (log (* z y))) (- (+ (log y) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.3e-12) {
tmp = ((a + -0.5) * log(t)) + log((z * y));
} 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 <= 2.3d-12) then
tmp = ((a + (-0.5d0)) * log(t)) + log((z * y))
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 <= 2.3e-12) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log((z * y));
} else {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.3e-12: tmp = ((a + -0.5) * math.log(t)) + math.log((z * y)) else: tmp = (math.log(y) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.3e-12) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(z * y))); 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 <= 2.3e-12) tmp = ((a + -0.5) * log(t)) + log((z * y)); else tmp = (log(y) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.3e-12], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * y), $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 2.3 \cdot 10^{-12}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 2.29999999999999989e-12Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 67.6%
Taylor expanded in t around 0 67.5%
associate-+r+67.5%
log-prod53.7%
+-commutative53.7%
sub-neg53.7%
metadata-eval53.7%
Simplified53.7%
if 2.29999999999999989e-12 < 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 98.2%
*-commutative98.2%
Simplified98.2%
Taylor expanded in x around 0 78.8%
Final simplification66.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.14e+39) (not (<= a 3.1e+91))) (* a (log t)) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.14e+39) || !(a <= 3.1e+91)) {
tmp = a * log(t);
} else {
tmp = log((x + y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.14d+39)) .or. (.not. (a <= 3.1d+91))) then
tmp = a * log(t)
else
tmp = log((x + y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.14e+39) || !(a <= 3.1e+91)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.14e+39) or not (a <= 3.1e+91): tmp = a * math.log(t) else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.14e+39) || !(a <= 3.1e+91)) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(x + y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.14e+39) || ~((a <= 3.1e+91))) tmp = a * log(t); else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.14e+39], N[Not[LessEqual[a, 3.1e+91]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.14 \cdot 10^{+39} \lor \neg \left(a \leq 3.1 \cdot 10^{+91}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -1.1399999999999999e39 or 3.09999999999999998e91 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 75.5%
Taylor expanded in a around inf 83.6%
*-commutative83.6%
Simplified83.6%
if -1.1399999999999999e39 < a < 3.09999999999999998e91Initial 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 a around inf 64.8%
*-commutative64.8%
Simplified64.8%
Taylor expanded in a around 0 60.3%
+-commutative60.3%
Simplified60.3%
Final simplification70.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.4e+27) (not (<= a 2.95e+91))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.4e+27) || !(a <= 2.95e+91)) {
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 <= (-7.4d+27)) .or. (.not. (a <= 2.95d+91))) 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 <= -7.4e+27) || !(a <= 2.95e+91)) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.4e+27) or not (a <= 2.95e+91): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.4e+27) || !(a <= 2.95e+91)) 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 <= -7.4e+27) || ~((a <= 2.95e+91))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.4e+27], N[Not[LessEqual[a, 2.95e+91]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.4 \cdot 10^{+27} \lor \neg \left(a \leq 2.95 \cdot 10^{+91}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -7.40000000000000004e27 or 2.9500000000000001e91 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 75.5%
Taylor expanded in a around inf 83.6%
*-commutative83.6%
Simplified83.6%
if -7.40000000000000004e27 < a < 2.9500000000000001e91Initial 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 54.9%
neg-mul-154.9%
Simplified54.9%
Final simplification66.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.35e+37) (not (<= a 2.35e+92))) (* a (log t)) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.35e+37) || !(a <= 2.35e+92)) {
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 <= (-1.35d+37)) .or. (.not. (a <= 2.35d+92))) 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 <= -1.35e+37) || !(a <= 2.35e+92)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.35e+37) or not (a <= 2.35e+92): 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 <= -1.35e+37) || !(a <= 2.35e+92)) 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 <= -1.35e+37) || ~((a <= 2.35e+92))) tmp = a * log(t); else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.35e+37], N[Not[LessEqual[a, 2.35e+92]], $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 -1.35 \cdot 10^{+37} \lor \neg \left(a \leq 2.35 \cdot 10^{+92}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -1.34999999999999993e37 or 2.35e92 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 75.5%
Taylor expanded in a around inf 83.6%
*-commutative83.6%
Simplified83.6%
if -1.34999999999999993e37 < a < 2.35e92Initial 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 a around inf 64.8%
*-commutative64.8%
Simplified64.8%
Taylor expanded in x around 0 52.8%
Taylor expanded in a around 0 49.3%
Final simplification63.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 235.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 235.0) {
tmp = log((x + y));
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 235.0d0) then
tmp = log((x + y))
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 235.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 235.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 235.0) tmp = log(Float64(x + y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 235.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 235.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 235:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 235Initial program 99.2%
associate--l+99.2%
associate-+l+99.2%
+-commutative99.2%
associate-+r-99.2%
fma-def99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in a around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in a around 0 9.2%
+-commutative9.2%
Simplified9.2%
Taylor expanded in t around 0 9.2%
+-commutative9.2%
Simplified9.2%
if 235 < 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 75.6%
neg-mul-175.6%
Simplified75.6%
Final simplification42.4%
(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%
associate-+r-99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in t around inf 39.1%
neg-mul-139.1%
Simplified39.1%
Final simplification39.1%
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t)))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log((x + y)) + ((log(z) - t) + ((a - 0.5d0) * log(t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) + ((Math.log(z) - t) + ((a - 0.5) * Math.log(t)));
}
def code(x, y, z, t, a): return math.log((x + y)) + ((math.log(z) - t) + ((a - 0.5) * math.log(t)))
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(Float64(log(z) - t) + Float64(Float64(a - 0.5) * log(t)))) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t))); end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right)
\end{array}
herbie shell --seed 2023293
(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))))