
(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 (+ 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 (if (<= (log z) 295.0) (+ (log (* y z)) (- (* (+ a -0.5) (log t)) t)) (+ (- (log z) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 295.0) {
tmp = log((y * z)) + (((a + -0.5) * log(t)) - t);
} else {
tmp = (log(z) - t) + (a * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (log(z) <= 295.0d0) then
tmp = log((y * z)) + (((a + (-0.5d0)) * log(t)) - t)
else
tmp = (log(z) - t) + (a * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (Math.log(z) <= 295.0) {
tmp = Math.log((y * z)) + (((a + -0.5) * Math.log(t)) - t);
} else {
tmp = (Math.log(z) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 295.0: tmp = math.log((y * z)) + (((a + -0.5) * math.log(t)) - t) else: tmp = (math.log(z) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 295.0) tmp = Float64(log(Float64(y * z)) + Float64(Float64(Float64(a + -0.5) * log(t)) - t)); else tmp = Float64(Float64(log(z) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 295.0) tmp = log((y * z)) + (((a + -0.5) * log(t)) - t); else tmp = (log(z) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 295.0], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 295:\\
\;\;\;\;\log \left(y \cdot z\right) + \left(\left(a + -0.5\right) \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if (log.f64 z) < 295Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 71.4%
Taylor expanded in z around 0 71.4%
associate-+r+71.4%
log-prod58.9%
associate--l+58.9%
sub-neg58.9%
metadata-eval58.9%
+-commutative58.9%
distribute-rgt-out58.9%
+-commutative58.9%
distribute-rgt-in58.9%
Simplified58.9%
if 295 < (log.f64 z) Initial program 99.8%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 62.9%
Taylor expanded in a around inf 74.7%
*-commutative74.7%
Simplified74.7%
Final simplification63.3%
(FPCore (x y z t a) :precision binary64 (+ (+ (log (+ x y)) (- (log z) t)) (* (+ a -0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return (log((x + y)) + (log(z) - t)) + ((a + -0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log((x + y)) + (log(z) - t)) + ((a + (-0.5d0)) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log((x + y)) + (Math.log(z) - t)) + ((a + -0.5) * Math.log(t));
}
def code(x, y, z, t, a): return (math.log((x + y)) + (math.log(z) - t)) + ((a + -0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(log(Float64(x + y)) + Float64(log(z) - t)) + Float64(Float64(a + -0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = (log((x + y)) + (log(z) - t)) + ((a + -0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
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 -7.2e-15) (not (<= a 0.2))) (- (+ (log y) (* a (log t))) t) (- (+ (log y) (log (* z (pow t -0.5)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.2e-15) || !(a <= 0.2)) {
tmp = (log(y) + (a * log(t))) - t;
} else {
tmp = (log(y) + log((z * 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 <= (-7.2d-15)) .or. (.not. (a <= 0.2d0))) then
tmp = (log(y) + (a * log(t))) - t
else
tmp = (log(y) + log((z * (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 <= -7.2e-15) || !(a <= 0.2)) {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
} else {
tmp = (Math.log(y) + Math.log((z * Math.pow(t, -0.5)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.2e-15) or not (a <= 0.2): tmp = (math.log(y) + (a * math.log(t))) - t else: tmp = (math.log(y) + math.log((z * math.pow(t, -0.5)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.2e-15) || !(a <= 0.2)) tmp = Float64(Float64(log(y) + Float64(a * log(t))) - t); else tmp = Float64(Float64(log(y) + log(Float64(z * (t ^ -0.5)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7.2e-15) || ~((a <= 0.2))) tmp = (log(y) + (a * log(t))) - t; else tmp = (log(y) + log((z * (t ^ -0.5)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.2e-15], N[Not[LessEqual[a, 0.2]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[Log[N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{-15} \lor \neg \left(a \leq 0.2\right):\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\end{array}
\end{array}
if a < -7.2000000000000002e-15 or 0.20000000000000001 < 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 96.7%
*-commutative96.7%
Simplified96.7%
Taylor expanded in x around 0 75.7%
if -7.2000000000000002e-15 < a < 0.20000000000000001Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 61.1%
Taylor expanded in a around 0 60.6%
Taylor expanded in z around inf 60.6%
*-commutative60.6%
mul-1-neg60.6%
log-rec60.6%
remove-double-neg60.6%
rem-log-exp51.7%
exp-sum51.7%
rem-exp-log51.7%
exp-to-pow51.7%
Simplified51.7%
Final simplification63.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 120.0) (+ (log z) (+ (log y) (* (log t) (- a 0.5)))) (+ (log (+ x y)) (- (* a (log t)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 120.0) {
tmp = log(z) + (log(y) + (log(t) * (a - 0.5)));
} else {
tmp = log((x + y)) + ((a * log(t)) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 120.0d0) then
tmp = log(z) + (log(y) + (log(t) * (a - 0.5d0)))
else
tmp = log((x + y)) + ((a * log(t)) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 120.0) {
tmp = Math.log(z) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
} else {
tmp = Math.log((x + y)) + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 120.0: tmp = math.log(z) + (math.log(y) + (math.log(t) * (a - 0.5))) else: tmp = math.log((x + y)) + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 120.0) tmp = Float64(log(z) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(log(Float64(x + y)) + Float64(Float64(a * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 120.0) tmp = log(z) + (log(y) + (log(t) * (a - 0.5))); else tmp = log((x + y)) + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 120.0], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 120:\\
\;\;\;\;\log z + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 120Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 64.8%
Taylor expanded in t around 0 64.0%
if 120 < 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 97.4%
*-commutative97.4%
Simplified97.4%
Final simplification79.3%
(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 69.0%
Final simplification69.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (log (* y (* z (pow t -0.5)))) t)) (t_2 (* a (log t))))
(if (<= a -6.5e-17)
(- (+ (log y) t_2) t)
(if (<= a -1.1e-174)
t_1
(if (<= a 8e-280)
(- (log (+ x y)) t)
(if (<= a 8.2e-34) t_1 (+ (- (log z) t) t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((y * (z * pow(t, -0.5)))) - t;
double t_2 = a * log(t);
double tmp;
if (a <= -6.5e-17) {
tmp = (log(y) + t_2) - t;
} else if (a <= -1.1e-174) {
tmp = t_1;
} else if (a <= 8e-280) {
tmp = log((x + y)) - t;
} else if (a <= 8.2e-34) {
tmp = t_1;
} else {
tmp = (log(z) - t) + t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log((y * (z * (t ** (-0.5d0))))) - t
t_2 = a * log(t)
if (a <= (-6.5d-17)) then
tmp = (log(y) + t_2) - t
else if (a <= (-1.1d-174)) then
tmp = t_1
else if (a <= 8d-280) then
tmp = log((x + y)) - t
else if (a <= 8.2d-34) then
tmp = t_1
else
tmp = (log(z) - t) + t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((y * (z * Math.pow(t, -0.5)))) - t;
double t_2 = a * Math.log(t);
double tmp;
if (a <= -6.5e-17) {
tmp = (Math.log(y) + t_2) - t;
} else if (a <= -1.1e-174) {
tmp = t_1;
} else if (a <= 8e-280) {
tmp = Math.log((x + y)) - t;
} else if (a <= 8.2e-34) {
tmp = t_1;
} else {
tmp = (Math.log(z) - t) + t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((y * (z * math.pow(t, -0.5)))) - t t_2 = a * math.log(t) tmp = 0 if a <= -6.5e-17: tmp = (math.log(y) + t_2) - t elif a <= -1.1e-174: tmp = t_1 elif a <= 8e-280: tmp = math.log((x + y)) - t elif a <= 8.2e-34: tmp = t_1 else: tmp = (math.log(z) - t) + t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t) t_2 = Float64(a * log(t)) tmp = 0.0 if (a <= -6.5e-17) tmp = Float64(Float64(log(y) + t_2) - t); elseif (a <= -1.1e-174) tmp = t_1; elseif (a <= 8e-280) tmp = Float64(log(Float64(x + y)) - t); elseif (a <= 8.2e-34) tmp = t_1; else tmp = Float64(Float64(log(z) - t) + t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((y * (z * (t ^ -0.5)))) - t; t_2 = a * log(t); tmp = 0.0; if (a <= -6.5e-17) tmp = (log(y) + t_2) - t; elseif (a <= -1.1e-174) tmp = t_1; elseif (a <= 8e-280) tmp = log((x + y)) - t; elseif (a <= 8.2e-34) tmp = t_1; else tmp = (log(z) - t) + t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.5e-17], N[(N[(N[Log[y], $MachinePrecision] + t$95$2), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, -1.1e-174], t$95$1, If[LessEqual[a, 8e-280], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 8.2e-34], t$95$1, N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\
t_2 := a \cdot \log t\\
\mathbf{if}\;a \leq -6.5 \cdot 10^{-17}:\\
\;\;\;\;\left(\log y + t_2\right) - t\\
\mathbf{elif}\;a \leq -1.1 \cdot 10^{-174}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 8 \cdot 10^{-280}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{-34}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + t_2\\
\end{array}
\end{array}
if a < -6.4999999999999996e-17Initial 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 95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in x around 0 72.3%
if -6.4999999999999996e-17 < a < -1.10000000000000011e-174 or 7.9999999999999997e-280 < a < 8.2000000000000007e-34Initial program 99.4%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 60.6%
Taylor expanded in a around 0 60.6%
Taylor expanded in y around inf 60.6%
associate-+r+60.7%
mul-1-neg60.7%
log-rec60.7%
remove-double-neg60.7%
log-prod42.7%
*-commutative42.7%
log-prod60.7%
*-commutative60.7%
associate-+r+60.6%
rem-log-exp42.1%
exp-sum39.6%
rem-exp-log39.8%
exp-sum39.8%
rem-exp-log39.9%
exp-to-pow40.0%
Simplified40.0%
if -1.10000000000000011e-174 < a < 7.9999999999999997e-280Initial program 99.8%
associate--l+99.7%
associate-+l+99.8%
+-commutative99.8%
associate-+r-99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 64.6%
*-commutative64.6%
Simplified64.6%
Taylor expanded in a around 0 64.6%
+-commutative64.6%
Simplified64.6%
if 8.2000000000000007e-34 < a Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 81.8%
Taylor expanded in a around inf 94.1%
*-commutative94.1%
Simplified94.1%
Final simplification64.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.9e+15) (+ (log (* (+ x y) z)) (- (* (+ a -0.5) (log t)) t)) (- (+ (log y) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.9e+15) {
tmp = log(((x + y) * z)) + (((a + -0.5) * log(t)) - 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 <= 1.9d+15) then
tmp = log(((x + y) * z)) + (((a + (-0.5d0)) * log(t)) - 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 <= 1.9e+15) {
tmp = Math.log(((x + y) * z)) + (((a + -0.5) * Math.log(t)) - t);
} else {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.9e+15: tmp = math.log(((x + y) * z)) + (((a + -0.5) * math.log(t)) - 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 <= 1.9e+15) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(Float64(a + -0.5) * log(t)) - 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 <= 1.9e+15) tmp = log(((x + y) * z)) + (((a + -0.5) * log(t)) - t); else tmp = (log(y) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.9e+15], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $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.9 \cdot 10^{+15}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\left(a + -0.5\right) \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 1.9e15Initial program 99.4%
cancel-sign-sub99.4%
cancel-sign-sub-inv99.4%
associate--l+99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
associate-+r-99.4%
metadata-eval99.4%
sub-neg99.4%
associate-+l-99.4%
+-commutative99.4%
sum-log70.5%
sub-neg70.5%
metadata-eval70.5%
Applied egg-rr70.5%
if 1.9e15 < 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.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in x around 0 73.2%
Final simplification71.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8.5e-17) (not (<= a 3.2e-79))) (- (+ (log y) (* a (log t))) t) (+ (log (* y z)) (- (* -0.5 (log t)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e-17) || !(a <= 3.2e-79)) {
tmp = (log(y) + (a * log(t))) - t;
} else {
tmp = log((y * z)) + ((-0.5 * log(t)) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-8.5d-17)) .or. (.not. (a <= 3.2d-79))) then
tmp = (log(y) + (a * log(t))) - t
else
tmp = log((y * z)) + (((-0.5d0) * log(t)) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e-17) || !(a <= 3.2e-79)) {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
} else {
tmp = Math.log((y * z)) + ((-0.5 * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -8.5e-17) or not (a <= 3.2e-79): tmp = (math.log(y) + (a * math.log(t))) - t else: tmp = math.log((y * z)) + ((-0.5 * math.log(t)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8.5e-17) || !(a <= 3.2e-79)) tmp = Float64(Float64(log(y) + Float64(a * log(t))) - t); else tmp = Float64(log(Float64(y * z)) + Float64(Float64(-0.5 * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -8.5e-17) || ~((a <= 3.2e-79))) tmp = (log(y) + (a * log(t))) - t; else tmp = log((y * z)) + ((-0.5 * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8.5e-17], N[Not[LessEqual[a, 3.2e-79]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{-17} \lor \neg \left(a \leq 3.2 \cdot 10^{-79}\right):\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot z\right) + \left(-0.5 \cdot \log t - t\right)\\
\end{array}
\end{array}
if a < -8.5e-17 or 3.19999999999999988e-79 < 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 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in x around 0 73.7%
if -8.5e-17 < a < 3.19999999999999988e-79Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 59.9%
Taylor expanded in a around 0 59.9%
Taylor expanded in t around inf 59.9%
associate-+r+59.9%
log-prod43.1%
*-commutative43.1%
neg-mul-143.1%
+-commutative43.1%
unsub-neg43.1%
log-rec43.1%
Simplified43.1%
Taylor expanded in t around 0 43.1%
neg-mul-143.1%
+-commutative43.1%
sub-neg43.1%
*-commutative43.1%
Simplified43.1%
Final simplification59.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log z) (* a (log t)))))
(if (<= t 9.5e-99)
t_1
(if (<= t 2e-83)
(+ (log (* y z)) (* -0.5 (log t)))
(if (<= t 6200000000.0) t_1 (- (log (+ x y)) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) + (a * log(t));
double tmp;
if (t <= 9.5e-99) {
tmp = t_1;
} else if (t <= 2e-83) {
tmp = log((y * z)) + (-0.5 * log(t));
} else if (t <= 6200000000.0) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = log(z) + (a * log(t))
if (t <= 9.5d-99) then
tmp = t_1
else if (t <= 2d-83) then
tmp = log((y * z)) + ((-0.5d0) * log(t))
else if (t <= 6200000000.0d0) then
tmp = t_1
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 t_1 = Math.log(z) + (a * Math.log(t));
double tmp;
if (t <= 9.5e-99) {
tmp = t_1;
} else if (t <= 2e-83) {
tmp = Math.log((y * z)) + (-0.5 * Math.log(t));
} else if (t <= 6200000000.0) {
tmp = t_1;
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) + (a * math.log(t)) tmp = 0 if t <= 9.5e-99: tmp = t_1 elif t <= 2e-83: tmp = math.log((y * z)) + (-0.5 * math.log(t)) elif t <= 6200000000.0: tmp = t_1 else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) + Float64(a * log(t))) tmp = 0.0 if (t <= 9.5e-99) tmp = t_1; elseif (t <= 2e-83) tmp = Float64(log(Float64(y * z)) + Float64(-0.5 * log(t))); elseif (t <= 6200000000.0) tmp = t_1; else tmp = Float64(log(Float64(x + y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) + (a * log(t)); tmp = 0.0; if (t <= 9.5e-99) tmp = t_1; elseif (t <= 2e-83) tmp = log((y * z)) + (-0.5 * log(t)); elseif (t <= 6200000000.0) tmp = t_1; else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 9.5e-99], t$95$1, If[LessEqual[t, 2e-83], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6200000000.0], t$95$1, N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z + a \cdot \log t\\
\mathbf{if}\;t \leq 9.5 \cdot 10^{-99}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-83}:\\
\;\;\;\;\log \left(y \cdot z\right) + -0.5 \cdot \log t\\
\mathbf{elif}\;t \leq 6200000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if t < 9.5000000000000008e-99 or 2.0000000000000001e-83 < t < 6.2e9Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 65.7%
Taylor expanded in a around inf 54.9%
*-commutative54.9%
Simplified54.9%
Taylor expanded in t around 0 54.6%
*-commutative54.6%
Simplified54.6%
if 9.5000000000000008e-99 < t < 2.0000000000000001e-83Initial 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 57.4%
Taylor expanded in a around 0 44.8%
Taylor expanded in t around inf 44.8%
associate-+r+44.8%
log-prod44.9%
*-commutative44.9%
neg-mul-144.9%
+-commutative44.9%
unsub-neg44.9%
log-rec44.9%
Simplified44.9%
Taylor expanded in t around 0 44.9%
+-commutative44.9%
*-commutative44.9%
Simplified44.9%
if 6.2e9 < 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.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in a around 0 76.6%
+-commutative76.6%
Simplified76.6%
Final simplification64.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.00027) (+ (* (+ a -0.5) (log t)) (log (* y z))) (+ (log (+ x y)) (- (* a (log t)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00027) {
tmp = ((a + -0.5) * log(t)) + log((y * z));
} else {
tmp = log((x + y)) + ((a * log(t)) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 0.00027d0) then
tmp = ((a + (-0.5d0)) * log(t)) + log((y * z))
else
tmp = log((x + y)) + ((a * log(t)) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00027) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log((y * z));
} else {
tmp = Math.log((x + y)) + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.00027: tmp = ((a + -0.5) * math.log(t)) + math.log((y * z)) else: tmp = math.log((x + y)) + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.00027) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(y * z))); else tmp = Float64(log(Float64(x + y)) + Float64(Float64(a * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.00027) tmp = ((a + -0.5) * log(t)) + log((y * z)); else tmp = log((x + y)) + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.00027], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.00027:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 2.70000000000000003e-4Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 64.5%
Taylor expanded in t around 0 64.1%
associate-+r+64.1%
log-prod44.7%
+-commutative44.7%
sub-neg44.7%
metadata-eval44.7%
Simplified44.7%
if 2.70000000000000003e-4 < 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 96.7%
*-commutative96.7%
Simplified96.7%
Final simplification68.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 2500000000.0) (+ (log z) (* a (log t))) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2500000000.0) {
tmp = log(z) + (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 (t <= 2500000000.0d0) then
tmp = log(z) + (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 (t <= 2500000000.0) {
tmp = Math.log(z) + (a * Math.log(t));
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2500000000.0: tmp = math.log(z) + (a * math.log(t)) else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2500000000.0) tmp = Float64(log(z) + 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 (t <= 2500000000.0) tmp = log(z) + (a * log(t)); else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2500000000.0], N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2500000000:\\
\;\;\;\;\log z + a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if t < 2.5e9Initial program 99.4%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.4%
+-commutative99.4%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 65.3%
Taylor expanded in a around inf 52.9%
*-commutative52.9%
Simplified52.9%
Taylor expanded in t around 0 52.6%
*-commutative52.6%
Simplified52.6%
if 2.5e9 < 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.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in a around 0 76.6%
+-commutative76.6%
Simplified76.6%
Final simplification63.2%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (* a (log t))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (a * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) - t) + (a * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (a * Math.log(t));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (a * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(a * log(t))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (a * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + a \cdot \log t
\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 69.0%
Taylor expanded in a around inf 73.1%
*-commutative73.1%
Simplified73.1%
Final simplification73.1%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (* a (log t))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (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(y) + (a * log(t))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) + (a * Math.log(t))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (a * math.log(t))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(a * log(t))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (a * log(t))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + a \cdot \log t\right) - 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 a around inf 73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in x around 0 55.7%
Final simplification55.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 3400000000.0) (* a (log t)) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3400000000.0) {
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 (t <= 3400000000.0d0) 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 (t <= 3400000000.0) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3400000000.0: 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 (t <= 3400000000.0) 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 (t <= 3400000000.0) tmp = a * log(t); else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3400000000.0], 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}\;t \leq 3400000000:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if t < 3.4e9Initial program 99.4%
associate--l+99.3%
associate-+l+99.4%
+-commutative99.4%
associate-+r-99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in a around inf 54.3%
*-commutative54.3%
Simplified54.3%
Taylor expanded in a around inf 47.2%
if 3.4e9 < 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.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in a around 0 76.6%
+-commutative76.6%
Simplified76.6%
Final simplification60.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 2300000000.0) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2300000000.0) {
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 <= 2300000000.0d0) 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 <= 2300000000.0) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2300000000.0: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2300000000.0) 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 <= 2300000000.0) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2300000000.0], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2300000000:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 2.3e9Initial program 99.4%
associate--l+99.3%
associate-+l+99.4%
+-commutative99.4%
associate-+r-99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in a around inf 54.3%
*-commutative54.3%
Simplified54.3%
Taylor expanded in a around inf 47.2%
if 2.3e9 < 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 76.5%
neg-mul-176.5%
Simplified76.5%
Final simplification60.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 6300000000.0) (* a (log t)) (- (log z) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 6300000000.0) {
tmp = a * log(t);
} else {
tmp = log(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 (t <= 6300000000.0d0) then
tmp = a * log(t)
else
tmp = log(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 (t <= 6300000000.0) {
tmp = a * Math.log(t);
} else {
tmp = Math.log(z) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 6300000000.0: tmp = a * math.log(t) else: tmp = math.log(z) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 6300000000.0) tmp = Float64(a * log(t)); else tmp = Float64(log(z) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 6300000000.0) tmp = a * log(t); else tmp = log(z) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 6300000000.0], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6300000000:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log z - t\\
\end{array}
\end{array}
if t < 6.3e9Initial program 99.4%
associate--l+99.3%
associate-+l+99.4%
+-commutative99.4%
associate-+r-99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in a around inf 54.3%
*-commutative54.3%
Simplified54.3%
Taylor expanded in a around inf 47.2%
if 6.3e9 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 73.8%
Taylor expanded in a around inf 98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in a around 0 76.6%
Final simplification60.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 560.0) (log z) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 560.0) {
tmp = log(z);
} 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 <= 560.0d0) then
tmp = log(z)
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 <= 560.0) {
tmp = Math.log(z);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 560.0: tmp = math.log(z) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 560.0) tmp = log(z); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 560.0) tmp = log(z); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 560.0], N[Log[z], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 560:\\
\;\;\;\;\log z\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 560Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 65.0%
Taylor expanded in a around inf 52.9%
*-commutative52.9%
Simplified52.9%
Taylor expanded in a around 0 9.2%
Taylor expanded in t around 0 9.3%
if 560 < 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.1%
neg-mul-175.1%
Simplified75.1%
Final simplification39.1%
(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 35.5%
neg-mul-135.5%
Simplified35.5%
Final simplification35.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 2023277
(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))))