
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (fma (+ a -0.5) (log t) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + fma((a + -0.5), log(t), (log(z) - t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + fma(Float64(a + -0.5), log(t), Float64(log(z) - t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \mathsf{fma}\left(a + -0.5, \log t, \log z - t\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -400000000.0)
(- t_1 t)
(if (<= (- a 0.5) -0.49999999998)
(+ (log y) (- (log z) (- t (* -0.5 (log t)))))
(+ (- (log z) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -400000000.0) {
tmp = t_1 - t;
} else if ((a - 0.5) <= -0.49999999998) {
tmp = log(y) + (log(z) - (t - (-0.5 * log(t))));
} else {
tmp = (log(z) - t) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if ((a - 0.5d0) <= (-400000000.0d0)) then
tmp = t_1 - t
else if ((a - 0.5d0) <= (-0.49999999998d0)) then
tmp = log(y) + (log(z) - (t - ((-0.5d0) * log(t))))
else
tmp = (log(z) - t) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if ((a - 0.5) <= -400000000.0) {
tmp = t_1 - t;
} else if ((a - 0.5) <= -0.49999999998) {
tmp = Math.log(y) + (Math.log(z) - (t - (-0.5 * Math.log(t))));
} else {
tmp = (Math.log(z) - t) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -400000000.0: tmp = t_1 - t elif (a - 0.5) <= -0.49999999998: tmp = math.log(y) + (math.log(z) - (t - (-0.5 * math.log(t)))) else: tmp = (math.log(z) - t) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -400000000.0) tmp = Float64(t_1 - t); elseif (Float64(a - 0.5) <= -0.49999999998) tmp = Float64(log(y) + Float64(log(z) - Float64(t - Float64(-0.5 * log(t))))); else tmp = Float64(Float64(log(z) - t) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -400000000.0) tmp = t_1 - t; elseif ((a - 0.5) <= -0.49999999998) tmp = log(y) + (log(z) - (t - (-0.5 * log(t)))); else tmp = (log(z) - t) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -400000000.0], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.49999999998], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(t - N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -400000000:\\
\;\;\;\;t_1 - t\\
\mathbf{elif}\;a - 0.5 \leq -0.49999999998:\\
\;\;\;\;\log y + \left(\log z - \left(t - -0.5 \cdot \log t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + t_1\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -4e8Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 73.3%
associate--l+73.3%
remove-double-neg73.3%
log-rec73.3%
mul-1-neg73.3%
associate--l+73.3%
fma-def73.3%
sub-neg73.3%
metadata-eval73.3%
+-commutative73.3%
mul-1-neg73.3%
log-rec73.3%
remove-double-neg73.3%
Simplified73.3%
Taylor expanded in a around inf 99.0%
*-commutative99.0%
Simplified99.0%
if -4e8 < (-.f64 a 1/2) < -0.49999999998Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 70.0%
Taylor expanded in a around 0 69.2%
associate-+r+69.2%
+-commutative69.2%
log-prod48.4%
Simplified48.4%
associate--l+48.4%
log-prod69.2%
associate-+l+69.3%
Applied egg-rr69.3%
if -0.49999999998 < (-.f64 a 1/2) 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 74.0%
Taylor expanded in a around inf 98.7%
*-commutative68.3%
Simplified98.7%
Final simplification84.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -400000000.0)
(- t_1 t)
(if (<= (- a 0.5) -0.49999999998)
(- (+ (log z) (log (* y (pow t -0.5)))) t)
(+ (- (log z) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -400000000.0) {
tmp = t_1 - t;
} else if ((a - 0.5) <= -0.49999999998) {
tmp = (log(z) + log((y * pow(t, -0.5)))) - t;
} else {
tmp = (log(z) - t) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if ((a - 0.5d0) <= (-400000000.0d0)) then
tmp = t_1 - t
else if ((a - 0.5d0) <= (-0.49999999998d0)) then
tmp = (log(z) + log((y * (t ** (-0.5d0))))) - t
else
tmp = (log(z) - t) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if ((a - 0.5) <= -400000000.0) {
tmp = t_1 - t;
} else if ((a - 0.5) <= -0.49999999998) {
tmp = (Math.log(z) + Math.log((y * Math.pow(t, -0.5)))) - t;
} else {
tmp = (Math.log(z) - t) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -400000000.0: tmp = t_1 - t elif (a - 0.5) <= -0.49999999998: tmp = (math.log(z) + math.log((y * math.pow(t, -0.5)))) - t else: tmp = (math.log(z) - t) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -400000000.0) tmp = Float64(t_1 - t); elseif (Float64(a - 0.5) <= -0.49999999998) tmp = Float64(Float64(log(z) + log(Float64(y * (t ^ -0.5)))) - t); else tmp = Float64(Float64(log(z) - t) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -400000000.0) tmp = t_1 - t; elseif ((a - 0.5) <= -0.49999999998) tmp = (log(z) + log((y * (t ^ -0.5)))) - t; else tmp = (log(z) - t) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -400000000.0], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.49999999998], N[(N[(N[Log[z], $MachinePrecision] + N[Log[N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -400000000:\\
\;\;\;\;t_1 - t\\
\mathbf{elif}\;a - 0.5 \leq -0.49999999998:\\
\;\;\;\;\left(\log z + \log \left(y \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + t_1\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -4e8Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 73.3%
associate--l+73.3%
remove-double-neg73.3%
log-rec73.3%
mul-1-neg73.3%
associate--l+73.3%
fma-def73.3%
sub-neg73.3%
metadata-eval73.3%
+-commutative73.3%
mul-1-neg73.3%
log-rec73.3%
remove-double-neg73.3%
Simplified73.3%
Taylor expanded in a around inf 99.0%
*-commutative99.0%
Simplified99.0%
if -4e8 < (-.f64 a 1/2) < -0.49999999998Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 70.0%
Taylor expanded in a around 0 69.2%
Taylor expanded in y around inf 69.2%
mul-1-neg69.2%
log-rec69.2%
remove-double-neg69.2%
log-pow69.2%
log-prod63.5%
Simplified63.5%
if -0.49999999998 < (-.f64 a 1/2) 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 74.0%
Taylor expanded in a around inf 98.7%
*-commutative68.3%
Simplified98.7%
Final simplification81.1%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 50.0) (+ (log (* (+ x 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) <= 50.0) {
tmp = log(((x + 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) <= 50.0d0) then
tmp = log(((x + 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) <= 50.0) {
tmp = Math.log(((x + 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) <= 50.0: tmp = math.log(((x + 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) <= 50.0) tmp = Float64(log(Float64(Float64(x + 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) <= 50.0) tmp = log(((x + 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], 50.0], 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[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 50:\\
\;\;\;\;\log \left(\left(x + y\right) \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) < 50Initial program 99.4%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
metadata-eval99.4%
sub-neg99.4%
associate-+r-99.4%
associate-+l-99.4%
+-commutative99.4%
sum-log91.3%
sub-neg91.3%
metadata-eval91.3%
Applied egg-rr91.3%
if 50 < (log.f64 z) Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 74.9%
Taylor expanded in a around inf 83.7%
*-commutative37.1%
Simplified83.7%
Final simplification87.4%
(FPCore (x y z t a) :precision binary64 (+ (+ (log (+ x y)) (- (log z) t)) (* (+ a -0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return (log((x + y)) + (log(z) - t)) + ((a + -0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log((x + y)) + (log(z) - t)) + ((a + (-0.5d0)) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log((x + y)) + (Math.log(z) - t)) + ((a + -0.5) * Math.log(t));
}
def code(x, y, z, t, a): return (math.log((x + y)) + (math.log(z) - t)) + ((a + -0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(log(Float64(x + y)) + Float64(log(z) - t)) + Float64(Float64(a + -0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = (log((x + y)) + (log(z) - t)) + ((a + -0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 230.0) (+ (log z) (+ (* (log t) (- a 0.5)) (log y))) (+ (- (log z) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 230.0) {
tmp = log(z) + ((log(t) * (a - 0.5)) + log(y));
} 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 (t <= 230.0d0) then
tmp = log(z) + ((log(t) * (a - 0.5d0)) + log(y))
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 (t <= 230.0) {
tmp = Math.log(z) + ((Math.log(t) * (a - 0.5)) + Math.log(y));
} else {
tmp = (Math.log(z) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 230.0: tmp = math.log(z) + ((math.log(t) * (a - 0.5)) + math.log(y)) else: tmp = (math.log(z) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 230.0) tmp = Float64(log(z) + Float64(Float64(log(t) * Float64(a - 0.5)) + log(y))); 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 (t <= 230.0) tmp = log(z) + ((log(t) * (a - 0.5)) + log(y)); else tmp = (log(z) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 230.0], N[(N[Log[z], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $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}\;t \leq 230:\\
\;\;\;\;\log z + \left(\log t \cdot \left(a - 0.5\right) + \log y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if t < 230Initial 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 69.7%
Taylor expanded in t around 0 69.3%
if 230 < 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.7%
Taylor expanded in a around inf 99.6%
*-commutative27.9%
Simplified99.6%
Final simplification85.5%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (* (log t) (- a 0.5)) (log y))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + ((log(t) * (a - 0.5)) + log(y));
}
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(t) * (a - 0.5d0)) + log(y))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + ((Math.log(t) * (a - 0.5)) + Math.log(y));
}
def code(x, y, z, t, a): return (math.log(z) - t) + ((math.log(t) * (a - 0.5)) + math.log(y))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(Float64(log(t) * Float64(a - 0.5)) + log(y))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + ((log(t) * (a - 0.5)) + log(y)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log t \cdot \left(a - 0.5\right) + \log y\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 71.8%
Final simplification71.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))) (t_2 (+ (log (+ x y)) t_1)))
(if (<= t 4.6e-220)
t_2
(if (<= t 3.5e-194)
(+ (* -0.5 (log t)) (log (* y z)))
(if (<= t 210.0) t_2 (- t_1 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double t_2 = log((x + y)) + t_1;
double tmp;
if (t <= 4.6e-220) {
tmp = t_2;
} else if (t <= 3.5e-194) {
tmp = (-0.5 * log(t)) + log((y * z));
} else if (t <= 210.0) {
tmp = t_2;
} else {
tmp = t_1 - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * log(t)
t_2 = log((x + y)) + t_1
if (t <= 4.6d-220) then
tmp = t_2
else if (t <= 3.5d-194) then
tmp = ((-0.5d0) * log(t)) + log((y * z))
else if (t <= 210.0d0) then
tmp = t_2
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double t_2 = Math.log((x + y)) + t_1;
double tmp;
if (t <= 4.6e-220) {
tmp = t_2;
} else if (t <= 3.5e-194) {
tmp = (-0.5 * Math.log(t)) + Math.log((y * z));
} else if (t <= 210.0) {
tmp = t_2;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) t_2 = math.log((x + y)) + t_1 tmp = 0 if t <= 4.6e-220: tmp = t_2 elif t <= 3.5e-194: tmp = (-0.5 * math.log(t)) + math.log((y * z)) elif t <= 210.0: tmp = t_2 else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) t_2 = Float64(log(Float64(x + y)) + t_1) tmp = 0.0 if (t <= 4.6e-220) tmp = t_2; elseif (t <= 3.5e-194) tmp = Float64(Float64(-0.5 * log(t)) + log(Float64(y * z))); elseif (t <= 210.0) tmp = t_2; else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); t_2 = log((x + y)) + t_1; tmp = 0.0; if (t <= 4.6e-220) tmp = t_2; elseif (t <= 3.5e-194) tmp = (-0.5 * log(t)) + log((y * z)); elseif (t <= 210.0) tmp = t_2; else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t, 4.6e-220], t$95$2, If[LessEqual[t, 3.5e-194], N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 210.0], t$95$2, N[(t$95$1 - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \log \left(x + y\right) + t_1\\
\mathbf{if}\;t \leq 4.6 \cdot 10^{-220}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-194}:\\
\;\;\;\;-0.5 \cdot \log t + \log \left(y \cdot z\right)\\
\mathbf{elif}\;t \leq 210:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if t < 4.59999999999999961e-220 or 3.5000000000000003e-194 < t < 210Initial program 99.3%
associate--l+99.3%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in a around inf 58.3%
*-commutative58.3%
Simplified58.3%
if 4.59999999999999961e-220 < t < 3.5000000000000003e-194Initial program 99.1%
associate--l+99.1%
+-commutative99.1%
associate-+l+99.1%
+-commutative99.1%
fma-def99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 79.1%
Taylor expanded in a around 0 56.8%
associate-+r+56.7%
+-commutative56.7%
log-prod52.1%
Simplified52.1%
Taylor expanded in t around 0 52.1%
if 210 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 73.7%
associate--l+73.7%
remove-double-neg73.7%
log-rec73.7%
mul-1-neg73.7%
associate--l+73.7%
fma-def73.7%
sub-neg73.7%
metadata-eval73.7%
+-commutative73.7%
mul-1-neg73.7%
log-rec73.7%
remove-double-neg73.7%
Simplified73.7%
Taylor expanded in a around inf 99.5%
*-commutative99.5%
Simplified99.5%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0065) (+ (* (+ a -0.5) (log t)) (log (* (+ x y) z))) (+ (- (log z) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0065) {
tmp = ((a + -0.5) * log(t)) + log(((x + y) * z));
} 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 (t <= 0.0065d0) then
tmp = ((a + (-0.5d0)) * log(t)) + log(((x + y) * z))
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 (t <= 0.0065) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log(((x + y) * z));
} else {
tmp = (Math.log(z) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0065: tmp = ((a + -0.5) * math.log(t)) + math.log(((x + y) * z)) else: tmp = (math.log(z) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0065) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(Float64(x + y) * z))); 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 (t <= 0.0065) tmp = ((a + -0.5) * log(t)) + log(((x + y) * z)); else tmp = (log(z) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0065], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $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}\;t \leq 0.0065:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(\left(x + y\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if t < 0.0064999999999999997Initial program 99.3%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around 0 97.9%
+-commutative97.9%
log-prod68.5%
+-commutative68.5%
Simplified68.5%
if 0.0064999999999999997 < 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.7%
Taylor expanded in a around inf 99.6%
*-commutative27.9%
Simplified99.6%
Final simplification85.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -105000.0)
(- t_1 t)
(if (<= a 2e-68)
(- (log (* z (* y (pow t -0.5)))) t)
(+ (- (log z) t) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -105000.0) {
tmp = t_1 - t;
} else if (a <= 2e-68) {
tmp = log((z * (y * pow(t, -0.5)))) - t;
} else {
tmp = (log(z) - t) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (a <= (-105000.0d0)) then
tmp = t_1 - t
else if (a <= 2d-68) then
tmp = log((z * (y * (t ** (-0.5d0))))) - t
else
tmp = (log(z) - t) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (a <= -105000.0) {
tmp = t_1 - t;
} else if (a <= 2e-68) {
tmp = Math.log((z * (y * Math.pow(t, -0.5)))) - t;
} else {
tmp = (Math.log(z) - t) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -105000.0: tmp = t_1 - t elif a <= 2e-68: tmp = math.log((z * (y * math.pow(t, -0.5)))) - t else: tmp = (math.log(z) - t) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -105000.0) tmp = Float64(t_1 - t); elseif (a <= 2e-68) tmp = Float64(log(Float64(z * Float64(y * (t ^ -0.5)))) - t); else tmp = Float64(Float64(log(z) - t) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (a <= -105000.0) tmp = t_1 - t; elseif (a <= 2e-68) tmp = log((z * (y * (t ^ -0.5)))) - t; else tmp = (log(z) - t) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -105000.0], N[(t$95$1 - t), $MachinePrecision], If[LessEqual[a, 2e-68], N[(N[Log[N[(z * N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -105000:\\
\;\;\;\;t_1 - t\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-68}:\\
\;\;\;\;\log \left(z \cdot \left(y \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + t_1\\
\end{array}
\end{array}
if a < -105000Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 73.3%
associate--l+73.3%
remove-double-neg73.3%
log-rec73.3%
mul-1-neg73.3%
associate--l+73.3%
fma-def73.3%
sub-neg73.3%
metadata-eval73.3%
+-commutative73.3%
mul-1-neg73.3%
log-rec73.3%
remove-double-neg73.3%
Simplified73.3%
Taylor expanded in a around inf 99.0%
*-commutative99.0%
Simplified99.0%
if -105000 < a < 2.00000000000000013e-68Initial program 99.5%
associate--l+99.5%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 70.6%
associate--l+70.6%
remove-double-neg70.6%
log-rec70.6%
mul-1-neg70.6%
associate--l+70.6%
fma-def70.6%
sub-neg70.6%
metadata-eval70.6%
+-commutative70.6%
mul-1-neg70.6%
log-rec70.6%
remove-double-neg70.6%
Simplified70.6%
Taylor expanded in a around 0 69.8%
associate-+r+69.8%
log-prod48.6%
log-pow48.6%
log-prod42.2%
associate-*r*50.7%
Simplified50.7%
if 2.00000000000000013e-68 < 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 72.7%
Taylor expanded in a around inf 96.7%
*-commutative62.8%
Simplified96.7%
Final simplification75.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))) (t_2 (+ (log z) t_1)))
(if (<= t 3.15e-264)
t_2
(if (<= t 1.3e-193)
(+ (* -0.5 (log t)) (log (* y z)))
(if (<= t 0.0052) t_2 (- t_1 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double t_2 = log(z) + t_1;
double tmp;
if (t <= 3.15e-264) {
tmp = t_2;
} else if (t <= 1.3e-193) {
tmp = (-0.5 * log(t)) + log((y * z));
} else if (t <= 0.0052) {
tmp = t_2;
} else {
tmp = t_1 - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * log(t)
t_2 = log(z) + t_1
if (t <= 3.15d-264) then
tmp = t_2
else if (t <= 1.3d-193) then
tmp = ((-0.5d0) * log(t)) + log((y * z))
else if (t <= 0.0052d0) then
tmp = t_2
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double t_2 = Math.log(z) + t_1;
double tmp;
if (t <= 3.15e-264) {
tmp = t_2;
} else if (t <= 1.3e-193) {
tmp = (-0.5 * Math.log(t)) + Math.log((y * z));
} else if (t <= 0.0052) {
tmp = t_2;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) t_2 = math.log(z) + t_1 tmp = 0 if t <= 3.15e-264: tmp = t_2 elif t <= 1.3e-193: tmp = (-0.5 * math.log(t)) + math.log((y * z)) elif t <= 0.0052: tmp = t_2 else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) t_2 = Float64(log(z) + t_1) tmp = 0.0 if (t <= 3.15e-264) tmp = t_2; elseif (t <= 1.3e-193) tmp = Float64(Float64(-0.5 * log(t)) + log(Float64(y * z))); elseif (t <= 0.0052) tmp = t_2; else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); t_2 = log(z) + t_1; tmp = 0.0; if (t <= 3.15e-264) tmp = t_2; elseif (t <= 1.3e-193) tmp = (-0.5 * log(t)) + log((y * z)); elseif (t <= 0.0052) tmp = t_2; else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[z], $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t, 3.15e-264], t$95$2, If[LessEqual[t, 1.3e-193], N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 0.0052], t$95$2, N[(t$95$1 - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \log z + t_1\\
\mathbf{if}\;t \leq 3.15 \cdot 10^{-264}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-193}:\\
\;\;\;\;-0.5 \cdot \log t + \log \left(y \cdot z\right)\\
\mathbf{elif}\;t \leq 0.0052:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if t < 3.1499999999999999e-264 or 1.30000000000000004e-193 < t < 0.0051999999999999998Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 69.1%
Taylor expanded in t around 0 68.5%
Taylor expanded in a around inf 60.1%
*-commutative60.1%
Simplified60.1%
if 3.1499999999999999e-264 < t < 1.30000000000000004e-193Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.2%
+-commutative99.2%
fma-def99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 73.9%
Taylor expanded in a around 0 50.3%
associate-+r+50.2%
+-commutative50.2%
log-prod44.2%
Simplified44.2%
Taylor expanded in t around 0 44.2%
if 0.0051999999999999998 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 73.1%
associate--l+73.1%
remove-double-neg73.1%
log-rec73.1%
mul-1-neg73.1%
associate--l+73.1%
fma-def73.1%
sub-neg73.1%
metadata-eval73.1%
+-commutative73.1%
mul-1-neg73.1%
log-rec73.1%
remove-double-neg73.1%
Simplified73.1%
Taylor expanded in a around inf 98.8%
*-commutative98.8%
Simplified98.8%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.2e-114) (not (<= a -1.05e-175))) (+ (- (log z) t) (* a (log t))) (+ (* -0.5 (log t)) (log (* y z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.2e-114) || !(a <= -1.05e-175)) {
tmp = (log(z) - t) + (a * log(t));
} else {
tmp = (-0.5 * log(t)) + log((y * z));
}
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 <= (-3.2d-114)) .or. (.not. (a <= (-1.05d-175)))) then
tmp = (log(z) - t) + (a * log(t))
else
tmp = ((-0.5d0) * log(t)) + log((y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.2e-114) || !(a <= -1.05e-175)) {
tmp = (Math.log(z) - t) + (a * Math.log(t));
} else {
tmp = (-0.5 * Math.log(t)) + Math.log((y * z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.2e-114) or not (a <= -1.05e-175): tmp = (math.log(z) - t) + (a * math.log(t)) else: tmp = (-0.5 * math.log(t)) + math.log((y * z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.2e-114) || !(a <= -1.05e-175)) tmp = Float64(Float64(log(z) - t) + Float64(a * log(t))); else tmp = Float64(Float64(-0.5 * log(t)) + log(Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.2e-114) || ~((a <= -1.05e-175))) tmp = (log(z) - t) + (a * log(t)); else tmp = (-0.5 * log(t)) + log((y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.2e-114], N[Not[LessEqual[a, -1.05e-175]], $MachinePrecision]], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{-114} \lor \neg \left(a \leq -1.05 \cdot 10^{-175}\right):\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot \log t + \log \left(y \cdot z\right)\\
\end{array}
\end{array}
if a < -3.2000000000000002e-114 or -1.05e-175 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 81.4%
*-commutative41.8%
Simplified81.4%
if -3.2000000000000002e-114 < a < -1.05e-175Initial program 99.0%
associate--l+99.0%
+-commutative99.0%
associate-+l+99.1%
+-commutative99.1%
fma-def99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 82.5%
Taylor expanded in a around 0 82.6%
associate-+r+82.5%
+-commutative82.5%
log-prod65.6%
Simplified65.6%
Taylor expanded in t around 0 54.3%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t 1.05e+35) (and (not (<= t 8.2e+60)) (<= t 8.5e+114))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 1.05e+35) || (!(t <= 8.2e+60) && (t <= 8.5e+114))) {
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 <= 1.05d+35) .or. (.not. (t <= 8.2d+60)) .and. (t <= 8.5d+114)) 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 <= 1.05e+35) || (!(t <= 8.2e+60) && (t <= 8.5e+114))) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= 1.05e+35) or (not (t <= 8.2e+60) and (t <= 8.5e+114)): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= 1.05e+35) || (!(t <= 8.2e+60) && (t <= 8.5e+114))) 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 <= 1.05e+35) || (~((t <= 8.2e+60)) && (t <= 8.5e+114))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, 1.05e+35], And[N[Not[LessEqual[t, 8.2e+60]], $MachinePrecision], LessEqual[t, 8.5e+114]]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.05 \cdot 10^{+35} \lor \neg \left(t \leq 8.2 \cdot 10^{+60}\right) \land t \leq 8.5 \cdot 10^{+114}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.0499999999999999e35 or 8.2e60 < t < 8.5000000000000001e114Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 72.8%
Taylor expanded in t around 0 66.9%
Taylor expanded in a around inf 53.1%
if 1.0499999999999999e35 < t < 8.2e60 or 8.5000000000000001e114 < 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 70.3%
Taylor expanded in t around inf 88.7%
neg-mul-188.7%
Simplified88.7%
Final simplification67.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.6e+61) (not (<= a 1.5e+16))) (* a (log t)) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.6e+61) || !(a <= 1.5e+16)) {
tmp = a * log(t);
} else {
tmp = log(y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3.6d+61)) .or. (.not. (a <= 1.5d+16))) then
tmp = a * log(t)
else
tmp = log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.6e+61) || !(a <= 1.5e+16)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.6e+61) or not (a <= 1.5e+16): tmp = a * math.log(t) else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.6e+61) || !(a <= 1.5e+16)) tmp = Float64(a * log(t)); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.6e+61) || ~((a <= 1.5e+16))) tmp = a * log(t); else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.6e+61], N[Not[LessEqual[a, 1.5e+16]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.6 \cdot 10^{+61} \lor \neg \left(a \leq 1.5 \cdot 10^{+16}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -3.6000000000000001e61 or 1.5e16 < 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 73.1%
Taylor expanded in t around 0 60.7%
Taylor expanded in a around inf 79.8%
if -3.6000000000000001e61 < a < 1.5e16Initial program 99.5%
associate--l+99.5%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in t around inf 60.3%
neg-mul-160.3%
Simplified60.3%
Taylor expanded in x around 0 47.2%
Final simplification61.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 980.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 980.0) {
tmp = log((x + y));
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 980.0d0) then
tmp = log((x + y))
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 980.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 980.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 980.0) tmp = log(Float64(x + y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 980.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 980.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 980:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 980Initial program 99.3%
associate--l+99.3%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in t around inf 9.6%
neg-mul-19.6%
Simplified9.6%
Taylor expanded in t around 0 9.7%
if 980 < 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.3%
Taylor expanded in t around inf 73.8%
neg-mul-173.8%
Simplified73.8%
Final simplification43.5%
(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%
associate-+l+99.6%
+-commutative99.6%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.8%
associate--l+71.8%
remove-double-neg71.8%
log-rec71.8%
mul-1-neg71.8%
associate--l+71.8%
fma-def71.8%
sub-neg71.8%
metadata-eval71.8%
+-commutative71.8%
mul-1-neg71.8%
log-rec71.8%
remove-double-neg71.8%
Simplified71.8%
Taylor expanded in a around inf 75.4%
*-commutative75.4%
Simplified75.4%
Final simplification75.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%
+-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 71.8%
Taylor expanded in t around inf 40.2%
neg-mul-140.2%
Simplified40.2%
Final simplification40.2%
(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 2023257
(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))))