
(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 19 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-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (- (log z) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.112) (not (<= a 3.6))) (- (* a (log t)) t) (+ (- (log z) t) (log (* y (pow t -0.5))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.112) || !(a <= 3.6)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(z) - t) + log((y * pow(t, -0.5)));
}
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.112d0)) .or. (.not. (a <= 3.6d0))) then
tmp = (a * log(t)) - t
else
tmp = (log(z) - t) + log((y * (t ** (-0.5d0))))
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.112) || !(a <= 3.6)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) - t) + Math.log((y * Math.pow(t, -0.5)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.112) or not (a <= 3.6): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) - t) + math.log((y * math.pow(t, -0.5))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.112) || !(a <= 3.6)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(z) - t) + log(Float64(y * (t ^ -0.5)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.112) || ~((a <= 3.6))) tmp = (a * log(t)) - t; else tmp = (log(z) - t) + log((y * (t ^ -0.5))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.112], N[Not[LessEqual[a, 3.6]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.112 \lor \neg \left(a \leq 3.6\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log \left(y \cdot {t}^{-0.5}\right)\\
\end{array}
\end{array}
if a < -0.112000000000000002 or 3.60000000000000009 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 72.3%
Taylor expanded in a around inf 98.1%
*-commutative98.1%
Simplified98.1%
if -0.112000000000000002 < a < 3.60000000000000009Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 66.9%
Taylor expanded in a around 0 66.5%
*-commutative66.5%
Simplified66.5%
*-un-lft-identity66.5%
add-log-exp66.5%
sum-log55.7%
exp-to-pow55.7%
Applied egg-rr55.7%
*-lft-identity55.7%
Simplified55.7%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 140.0) (- (+ (* (log t) (- a 0.5)) (log (* z y))) t) (- (+ (log z) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 140.0) {
tmp = ((log(t) * (a - 0.5)) + log((z * y))) - t;
} else {
tmp = (log(z) + (a * log(t))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (log(z) <= 140.0d0) then
tmp = ((log(t) * (a - 0.5d0)) + log((z * y))) - t
else
tmp = (log(z) + (a * log(t))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (Math.log(z) <= 140.0) {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((z * y))) - t;
} else {
tmp = (Math.log(z) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 140.0: tmp = ((math.log(t) * (a - 0.5)) + math.log((z * y))) - t else: tmp = (math.log(z) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 140.0) tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(z * y))) - t); else tmp = Float64(Float64(log(z) + Float64(a * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 140.0) tmp = ((log(t) * (a - 0.5)) + log((z * y))) - t; else tmp = (log(z) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 140.0], 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[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 140:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(z \cdot y\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if (log.f64 z) < 140Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
add-cube-cbrt98.1%
pow398.1%
Applied egg-rr89.9%
Taylor expanded in x around 0 57.4%
if 140 < (log.f64 z) Initial program 99.7%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 69.0%
Taylor expanded in y around inf 69.0%
+-commutative69.0%
mul-1-neg69.0%
sub-neg69.0%
metadata-eval69.0%
log-rec69.0%
remove-double-neg69.0%
fma-undefine69.0%
Simplified69.0%
Taylor expanded in a around inf 84.3%
*-commutative84.3%
Simplified84.3%
Final simplification69.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 112.0) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (+ (log z) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 112.0) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) + (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 <= 112.0d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) + (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 <= 112.0) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 112.0: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 112.0) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) + Float64(a * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 112.0) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(z) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 112.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[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 112:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 112Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 68.4%
Taylor expanded in t around 0 67.8%
if 112 < t Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 71.4%
Taylor expanded in y around inf 71.4%
+-commutative71.4%
mul-1-neg71.4%
sub-neg71.4%
metadata-eval71.4%
log-rec71.4%
remove-double-neg71.4%
fma-undefine71.4%
Simplified71.4%
Taylor expanded in a around inf 98.1%
*-commutative98.1%
Simplified98.1%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log z) (log (+ x y))) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log(z) + log((x + 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((x + 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((x + y))) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log(z) + math.log((x + y))) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(z) + log(Float64(x + y))) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log(z) + log((x + y))) - t) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[z], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log z + \log \left(x + y\right)\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (- (+ (* (log t) (- a 0.5)) (+ (log z) (log y))) t))
double code(double x, double y, double z, double t, double a) {
return ((log(t) * (a - 0.5)) + (log(z) + log(y))) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log(t) * (a - 0.5d0)) + (log(z) + log(y))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log(t) * (a - 0.5)) + (Math.log(z) + Math.log(y))) - t;
}
def code(x, y, z, t, a): return ((math.log(t) * (a - 0.5)) + (math.log(z) + math.log(y))) - t
function code(x, y, z, t, a) return Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(z) + log(y))) - t) end
function tmp = code(x, y, z, t, a) tmp = ((log(t) * (a - 0.5)) + (log(z) + log(y))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log t \cdot \left(a - 0.5\right) + \left(\log z + \log y\right)\right) - t
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
add-cube-cbrt98.0%
pow398.0%
Applied egg-rr70.0%
Taylor expanded in x around 0 49.1%
*-commutative49.1%
log-prod69.9%
Applied egg-rr69.9%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(y) + (log(z) + (log(t) * (a - 0.5d0)))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\right) - t
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 69.9%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (log y)) (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) + log(y)) + ((log(t) * (a - 0.5d0)) - t)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + Math.log(y)) + ((Math.log(t) * (a - 0.5)) - t);
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) + ((math.log(t) * (a - 0.5)) - t)
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 69.9%
Final simplification69.9%
(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-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 69.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (+ (log z) (* a (log t))) t)))
(if (<= a -3.95e-94)
t_1
(if (<= a -2.8e-159)
(- (log (* (pow t -0.5) (* z y))) t)
(if (<= a 7e-203)
(+ (- (log z) t) (log (+ x y)))
(if (<= a 1.05e-26) (- (log (* z (* y (pow t -0.5)))) t) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (log(z) + (a * log(t))) - t;
double tmp;
if (a <= -3.95e-94) {
tmp = t_1;
} else if (a <= -2.8e-159) {
tmp = log((pow(t, -0.5) * (z * y))) - t;
} else if (a <= 7e-203) {
tmp = (log(z) - t) + log((x + y));
} else if (a <= 1.05e-26) {
tmp = log((z * (y * pow(t, -0.5)))) - 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 = (log(z) + (a * log(t))) - t
if (a <= (-3.95d-94)) then
tmp = t_1
else if (a <= (-2.8d-159)) then
tmp = log(((t ** (-0.5d0)) * (z * y))) - t
else if (a <= 7d-203) then
tmp = (log(z) - t) + log((x + y))
else if (a <= 1.05d-26) then
tmp = log((z * (y * (t ** (-0.5d0))))) - 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 = (Math.log(z) + (a * Math.log(t))) - t;
double tmp;
if (a <= -3.95e-94) {
tmp = t_1;
} else if (a <= -2.8e-159) {
tmp = Math.log((Math.pow(t, -0.5) * (z * y))) - t;
} else if (a <= 7e-203) {
tmp = (Math.log(z) - t) + Math.log((x + y));
} else if (a <= 1.05e-26) {
tmp = Math.log((z * (y * Math.pow(t, -0.5)))) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (math.log(z) + (a * math.log(t))) - t tmp = 0 if a <= -3.95e-94: tmp = t_1 elif a <= -2.8e-159: tmp = math.log((math.pow(t, -0.5) * (z * y))) - t elif a <= 7e-203: tmp = (math.log(z) - t) + math.log((x + y)) elif a <= 1.05e-26: tmp = math.log((z * (y * math.pow(t, -0.5)))) - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(log(z) + Float64(a * log(t))) - t) tmp = 0.0 if (a <= -3.95e-94) tmp = t_1; elseif (a <= -2.8e-159) tmp = Float64(log(Float64((t ^ -0.5) * Float64(z * y))) - t); elseif (a <= 7e-203) tmp = Float64(Float64(log(z) - t) + log(Float64(x + y))); elseif (a <= 1.05e-26) tmp = Float64(log(Float64(z * Float64(y * (t ^ -0.5)))) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (log(z) + (a * log(t))) - t; tmp = 0.0; if (a <= -3.95e-94) tmp = t_1; elseif (a <= -2.8e-159) tmp = log(((t ^ -0.5) * (z * y))) - t; elseif (a <= 7e-203) tmp = (log(z) - t) + log((x + y)); elseif (a <= 1.05e-26) tmp = log((z * (y * (t ^ -0.5)))) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -3.95e-94], t$95$1, If[LessEqual[a, -2.8e-159], N[(N[Log[N[(N[Power[t, -0.5], $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 7e-203], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e-26], N[(N[Log[N[(z * N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\log z + a \cdot \log t\right) - t\\
\mathbf{if}\;a \leq -3.95 \cdot 10^{-94}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{-159}:\\
\;\;\;\;\log \left({t}^{-0.5} \cdot \left(z \cdot y\right)\right) - t\\
\mathbf{elif}\;a \leq 7 \cdot 10^{-203}:\\
\;\;\;\;\left(\log z - t\right) + \log \left(x + y\right)\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-26}:\\
\;\;\;\;\log \left(z \cdot \left(y \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.95e-94 or 1.05000000000000004e-26 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.1%
Taylor expanded in y around inf 71.1%
+-commutative71.1%
mul-1-neg71.1%
sub-neg71.1%
metadata-eval71.1%
log-rec71.1%
remove-double-neg71.1%
fma-undefine71.1%
Simplified71.1%
Taylor expanded in a around inf 93.3%
*-commutative93.3%
Simplified93.3%
if -3.95e-94 < a < -2.8000000000000002e-159Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt98.0%
pow398.2%
Applied egg-rr87.2%
Taylor expanded in x around 0 62.1%
Taylor expanded in a around 0 62.1%
+-commutative62.1%
*-commutative62.1%
Simplified62.1%
+-commutative62.1%
add-log-exp62.1%
sum-log53.4%
*-commutative53.4%
exp-to-pow53.4%
Applied egg-rr53.4%
if -2.8000000000000002e-159 < a < 7.0000000000000003e-203Initial program 99.7%
associate-+l-99.7%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t around inf 68.8%
if 7.0000000000000003e-203 < a < 1.05000000000000004e-26Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.3%
+-commutative99.3%
fma-define99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
add-cube-cbrt98.1%
pow398.1%
Applied egg-rr75.1%
Taylor expanded in x around 0 47.9%
Taylor expanded in a around 0 47.9%
+-commutative47.9%
*-commutative47.9%
Simplified47.9%
*-un-lft-identity47.9%
+-commutative47.9%
add-log-exp47.9%
sum-log42.2%
*-commutative42.2%
exp-to-pow42.2%
Applied egg-rr42.2%
*-lft-identity42.2%
associate-*l*45.3%
Simplified45.3%
Final simplification81.0%
(FPCore (x y z t a)
:precision binary64
(if (<= t 1.4e-135)
(+ (* (+ a -0.5) (log t)) (log (* z (+ x y))))
(if (or (<= t 3.8e-114) (not (<= t 1.75e-22)))
(- (+ (log z) (* a (log t))) t)
(+ (* (log t) (- a 0.5)) (log (* z y))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.4e-135) {
tmp = ((a + -0.5) * log(t)) + log((z * (x + y)));
} else if ((t <= 3.8e-114) || !(t <= 1.75e-22)) {
tmp = (log(z) + (a * log(t))) - t;
} else {
tmp = (log(t) * (a - 0.5)) + log((z * y));
}
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.4d-135) then
tmp = ((a + (-0.5d0)) * log(t)) + log((z * (x + y)))
else if ((t <= 3.8d-114) .or. (.not. (t <= 1.75d-22))) then
tmp = (log(z) + (a * log(t))) - t
else
tmp = (log(t) * (a - 0.5d0)) + log((z * y))
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.4e-135) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log((z * (x + y)));
} else if ((t <= 3.8e-114) || !(t <= 1.75e-22)) {
tmp = (Math.log(z) + (a * Math.log(t))) - t;
} else {
tmp = (Math.log(t) * (a - 0.5)) + Math.log((z * y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.4e-135: tmp = ((a + -0.5) * math.log(t)) + math.log((z * (x + y))) elif (t <= 3.8e-114) or not (t <= 1.75e-22): tmp = (math.log(z) + (a * math.log(t))) - t else: tmp = (math.log(t) * (a - 0.5)) + math.log((z * y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.4e-135) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(z * Float64(x + y)))); elseif ((t <= 3.8e-114) || !(t <= 1.75e-22)) tmp = Float64(Float64(log(z) + Float64(a * log(t))) - t); else tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(z * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.4e-135) tmp = ((a + -0.5) * log(t)) + log((z * (x + y))); elseif ((t <= 3.8e-114) || ~((t <= 1.75e-22))) tmp = (log(z) + (a * log(t))) - t; else tmp = (log(t) * (a - 0.5)) + log((z * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.4e-135], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.8e-114], N[Not[LessEqual[t, 1.75e-22]], $MachinePrecision]], N[(N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{-135}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(z \cdot \left(x + y\right)\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{-114} \lor \neg \left(t \leq 1.75 \cdot 10^{-22}\right):\\
\;\;\;\;\left(\log z + a \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(z \cdot y\right)\\
\end{array}
\end{array}
if t < 1.40000000000000012e-135Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.4%
+-commutative99.4%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt97.9%
pow398.0%
Applied egg-rr73.9%
Taylor expanded in t around 0 75.0%
+-commutative75.0%
sub-neg75.0%
metadata-eval75.0%
+-commutative75.0%
distribute-rgt-out75.0%
+-commutative75.0%
distribute-rgt-in75.0%
+-commutative75.0%
Simplified75.0%
if 1.40000000000000012e-135 < t < 3.7999999999999998e-114 or 1.75000000000000003e-22 < t Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.7%
+-commutative99.7%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 72.1%
Taylor expanded in y around inf 72.0%
+-commutative72.0%
mul-1-neg72.0%
sub-neg72.0%
metadata-eval72.0%
log-rec72.0%
remove-double-neg72.0%
fma-undefine72.0%
Simplified72.0%
Taylor expanded in a around inf 95.6%
*-commutative95.6%
Simplified95.6%
if 3.7999999999999998e-114 < t < 1.75000000000000003e-22Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.3%
+-commutative99.3%
fma-define99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
add-cube-cbrt97.9%
pow398.1%
Applied egg-rr86.3%
Taylor expanded in x around 0 60.4%
Taylor expanded in t around 0 60.4%
Final simplification84.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= t 8.4e-135) (and (not (<= t 1.35e-112)) (<= t 1.5e-22))) (+ (* (log t) (- a 0.5)) (log (* z y))) (- (+ (log z) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 8.4e-135) || (!(t <= 1.35e-112) && (t <= 1.5e-22))) {
tmp = (log(t) * (a - 0.5)) + log((z * y));
} else {
tmp = (log(z) + (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 <= 8.4d-135) .or. (.not. (t <= 1.35d-112)) .and. (t <= 1.5d-22)) then
tmp = (log(t) * (a - 0.5d0)) + log((z * y))
else
tmp = (log(z) + (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 <= 8.4e-135) || (!(t <= 1.35e-112) && (t <= 1.5e-22))) {
tmp = (Math.log(t) * (a - 0.5)) + Math.log((z * y));
} else {
tmp = (Math.log(z) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= 8.4e-135) or (not (t <= 1.35e-112) and (t <= 1.5e-22)): tmp = (math.log(t) * (a - 0.5)) + math.log((z * y)) else: tmp = (math.log(z) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= 8.4e-135) || (!(t <= 1.35e-112) && (t <= 1.5e-22))) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(z * y))); else tmp = Float64(Float64(log(z) + Float64(a * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= 8.4e-135) || (~((t <= 1.35e-112)) && (t <= 1.5e-22))) tmp = (log(t) * (a - 0.5)) + log((z * y)); else tmp = (log(z) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, 8.4e-135], And[N[Not[LessEqual[t, 1.35e-112]], $MachinePrecision], LessEqual[t, 1.5e-22]]], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.4 \cdot 10^{-135} \lor \neg \left(t \leq 1.35 \cdot 10^{-112}\right) \land t \leq 1.5 \cdot 10^{-22}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 8.4000000000000001e-135 or 1.35e-112 < t < 1.5e-22Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
add-cube-cbrt97.9%
pow398.0%
Applied egg-rr78.6%
Taylor expanded in x around 0 51.3%
Taylor expanded in t around 0 51.3%
if 8.4000000000000001e-135 < t < 1.35e-112 or 1.5e-22 < t Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.7%
+-commutative99.7%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 72.1%
Taylor expanded in y around inf 72.0%
+-commutative72.0%
mul-1-neg72.0%
sub-neg72.0%
metadata-eval72.0%
log-rec72.0%
remove-double-neg72.0%
fma-undefine72.0%
Simplified72.0%
Taylor expanded in a around inf 95.6%
*-commutative95.6%
Simplified95.6%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.25e-129) (not (<= a 2.3e-18))) (- (+ (log z) (* a (log t))) t) (- (log (* z (* y (pow t -0.5)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.25e-129) || !(a <= 2.3e-18)) {
tmp = (log(z) + (a * log(t))) - t;
} else {
tmp = log((z * (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 <= (-2.25d-129)) .or. (.not. (a <= 2.3d-18))) then
tmp = (log(z) + (a * log(t))) - t
else
tmp = log((z * (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 <= -2.25e-129) || !(a <= 2.3e-18)) {
tmp = (Math.log(z) + (a * Math.log(t))) - t;
} else {
tmp = Math.log((z * (y * Math.pow(t, -0.5)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.25e-129) or not (a <= 2.3e-18): tmp = (math.log(z) + (a * math.log(t))) - t else: tmp = math.log((z * (y * math.pow(t, -0.5)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.25e-129) || !(a <= 2.3e-18)) tmp = Float64(Float64(log(z) + Float64(a * log(t))) - t); else tmp = Float64(log(Float64(z * Float64(y * (t ^ -0.5)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.25e-129) || ~((a <= 2.3e-18))) tmp = (log(z) + (a * log(t))) - t; else tmp = log((z * (y * (t ^ -0.5)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.25e-129], N[Not[LessEqual[a, 2.3e-18]], $MachinePrecision]], N[(N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(z * N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.25 \cdot 10^{-129} \lor \neg \left(a \leq 2.3 \cdot 10^{-18}\right):\\
\;\;\;\;\left(\log z + a \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(z \cdot \left(y \cdot {t}^{-0.5}\right)\right) - t\\
\end{array}
\end{array}
if a < -2.25000000000000015e-129 or 2.3000000000000001e-18 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 69.8%
Taylor expanded in y around inf 69.8%
+-commutative69.8%
mul-1-neg69.8%
sub-neg69.8%
metadata-eval69.8%
log-rec69.8%
remove-double-neg69.8%
fma-undefine69.8%
Simplified69.8%
Taylor expanded in a around inf 92.8%
*-commutative92.8%
Simplified92.8%
if -2.25000000000000015e-129 < a < 2.3000000000000001e-18Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt97.8%
pow397.8%
Applied egg-rr65.7%
Taylor expanded in x around 0 47.4%
Taylor expanded in a around 0 47.4%
+-commutative47.4%
*-commutative47.4%
Simplified47.4%
*-un-lft-identity47.4%
+-commutative47.4%
add-log-exp47.4%
sum-log41.8%
*-commutative41.8%
exp-to-pow41.8%
Applied egg-rr41.8%
*-lft-identity41.8%
associate-*l*44.8%
Simplified44.8%
Final simplification76.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.49) (not (<= a 1.65))) (- (* a (log t)) t) (+ (- (log z) t) (log (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.49) || !(a <= 1.65)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(z) - t) + log((x + y));
}
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.49d0)) .or. (.not. (a <= 1.65d0))) then
tmp = (a * log(t)) - t
else
tmp = (log(z) - t) + log((x + y))
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.49) || !(a <= 1.65)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) - t) + Math.log((x + y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.49) or not (a <= 1.65): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) - t) + math.log((x + y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.49) || !(a <= 1.65)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(z) - t) + log(Float64(x + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.49) || ~((a <= 1.65))) tmp = (a * log(t)) - t; else tmp = (log(z) - t) + log((x + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.49], N[Not[LessEqual[a, 1.65]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.49 \lor \neg \left(a \leq 1.65\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log \left(x + y\right)\\
\end{array}
\end{array}
if a < -0.48999999999999999 or 1.6499999999999999 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 72.3%
Taylor expanded in a around inf 98.1%
*-commutative98.1%
Simplified98.1%
if -0.48999999999999999 < a < 1.6499999999999999Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 59.0%
Final simplification80.8%
(FPCore (x y z t a) :precision binary64 (- (+ (log z) (* a (log t))) t))
double code(double x, double y, double z, double t, double a) {
return (log(z) + (a * log(t))) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) + (a * log(t))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + (a * Math.log(t))) - t;
}
def code(x, y, z, t, a): return (math.log(z) + (a * math.log(t))) - t
function code(x, y, z, t, a) return Float64(Float64(log(z) + Float64(a * log(t))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + (a * log(t))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + a \cdot \log t\right) - t
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 69.9%
Taylor expanded in y around inf 69.9%
+-commutative69.9%
mul-1-neg69.9%
sub-neg69.9%
metadata-eval69.9%
log-rec69.9%
remove-double-neg69.9%
fma-undefine69.9%
Simplified69.9%
Taylor expanded in a around inf 79.5%
*-commutative79.5%
Simplified79.5%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 9e+17) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 9e+17) {
tmp = a * log(t);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 9d+17) then
tmp = a * log(t)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 9e+17) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 9e+17: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 9e+17) tmp = Float64(a * log(t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 9e+17) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 9e+17], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9 \cdot 10^{+17}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 9e17Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in a around inf 56.8%
*-commutative56.8%
Simplified56.8%
if 9e17 < t Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t around inf 75.8%
mul-1-neg75.8%
Simplified75.8%
Final simplification65.8%
(FPCore (x y z t a) :precision binary64 (- (* a (log t)) t))
double code(double x, double y, double z, double t, double a) {
return (a * 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 * log(t)) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * Math.log(t)) - t;
}
def code(x, y, z, t, a): return (a * math.log(t)) - t
function code(x, y, z, t, a) return Float64(Float64(a * log(t)) - t) end
function tmp = code(x, y, z, t, a) tmp = (a * log(t)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \log t - t
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 69.9%
Taylor expanded in a around inf 77.4%
*-commutative77.4%
Simplified77.4%
Final simplification77.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%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 37.5%
mul-1-neg37.5%
Simplified37.5%
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t)))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log((x + y)) + ((log(z) - t) + ((a - 0.5d0) * log(t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) + ((Math.log(z) - t) + ((a - 0.5) * Math.log(t)));
}
def code(x, y, z, t, a): return math.log((x + y)) + ((math.log(z) - t) + ((a - 0.5) * math.log(t)))
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(Float64(log(z) - t) + Float64(Float64(a - 0.5) * log(t)))) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t))); end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right)
\end{array}
herbie shell --seed 2024089
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))