
(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.5%
associate--l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r-99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))) (t_2 (+ t_1 (log z))))
(if (or (<= t_2 -750.0) (not (<= t_2 690.0)))
(+ t_1 (- (* a (log t)) t))
(- (+ (* (+ a -0.5) (log t)) (log (* y z))) t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double t_2 = t_1 + log(z);
double tmp;
if ((t_2 <= -750.0) || !(t_2 <= 690.0)) {
tmp = t_1 + ((a * log(t)) - t);
} else {
tmp = (((a + -0.5) * log(t)) + log((y * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log((x + y))
t_2 = t_1 + log(z)
if ((t_2 <= (-750.0d0)) .or. (.not. (t_2 <= 690.0d0))) then
tmp = t_1 + ((a * log(t)) - t)
else
tmp = (((a + (-0.5d0)) * log(t)) + log((y * z))) - 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((x + y));
double t_2 = t_1 + Math.log(z);
double tmp;
if ((t_2 <= -750.0) || !(t_2 <= 690.0)) {
tmp = t_1 + ((a * Math.log(t)) - t);
} else {
tmp = (((a + -0.5) * Math.log(t)) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) t_2 = t_1 + math.log(z) tmp = 0 if (t_2 <= -750.0) or not (t_2 <= 690.0): tmp = t_1 + ((a * math.log(t)) - t) else: tmp = (((a + -0.5) * math.log(t)) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) t_2 = Float64(t_1 + log(z)) tmp = 0.0 if ((t_2 <= -750.0) || !(t_2 <= 690.0)) tmp = Float64(t_1 + Float64(Float64(a * log(t)) - t)); else tmp = Float64(Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)); t_2 = t_1 + log(z); tmp = 0.0; if ((t_2 <= -750.0) || ~((t_2 <= 690.0))) tmp = t_1 + ((a * log(t)) - t); else tmp = (((a + -0.5) * log(t)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -750.0], N[Not[LessEqual[t$95$2, 690.0]], $MachinePrecision]], N[(t$95$1 + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
t_2 := t_1 + \log z\\
\mathbf{if}\;t_2 \leq -750 \lor \neg \left(t_2 \leq 690\right):\\
\;\;\;\;t_1 + \left(a \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(a + -0.5\right) \cdot \log t + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -750 or 690 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) 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 74.4%
*-commutative74.4%
Simplified74.4%
if -750 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 690Initial program 99.5%
cancel-sign-sub99.5%
cancel-sign-sub-inv99.5%
associate--l+99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt98.7%
pow398.7%
Applied egg-rr98.7%
Taylor expanded in x around 0 71.5%
associate-+r+71.5%
log-prod69.5%
pow-base-169.5%
sub-neg69.5%
metadata-eval69.5%
*-commutative69.5%
*-lft-identity69.5%
associate--l+69.5%
*-commutative69.5%
log-prod71.5%
remove-double-neg71.5%
log-rec71.5%
mul-1-neg71.5%
associate--l+71.5%
Simplified69.5%
Final simplification70.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -1e+33) (not (<= (- a 0.5) -0.49999999995))) (- (* a (log t)) t) (+ (- (log z) t) (+ (log (+ x y)) (* -0.5 (log t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -1e+33) || !((a - 0.5) <= -0.49999999995)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(z) - t) + (log((x + y)) + (-0.5 * 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 (((a - 0.5d0) <= (-1d+33)) .or. (.not. ((a - 0.5d0) <= (-0.49999999995d0)))) then
tmp = (a * log(t)) - t
else
tmp = (log(z) - t) + (log((x + y)) + ((-0.5d0) * 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 (((a - 0.5) <= -1e+33) || !((a - 0.5) <= -0.49999999995)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) - t) + (Math.log((x + y)) + (-0.5 * Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -1e+33) or not ((a - 0.5) <= -0.49999999995): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) - t) + (math.log((x + y)) + (-0.5 * math.log(t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -1e+33) || !(Float64(a - 0.5) <= -0.49999999995)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(z) - t) + Float64(log(Float64(x + y)) + Float64(-0.5 * log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -1e+33) || ~(((a - 0.5) <= -0.49999999995))) tmp = (a * log(t)) - t; else tmp = (log(z) - t) + (log((x + y)) + (-0.5 * log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -1e+33], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.49999999995]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -1 \cdot 10^{+33} \lor \neg \left(a - 0.5 \leq -0.49999999995\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \left(\log \left(x + y\right) + -0.5 \cdot \log t\right)\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -9.9999999999999995e32 or -0.49999999995 < (-.f64 a 1/2) 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 x around 0 81.7%
Taylor expanded in a around inf 99.4%
*-commutative99.4%
Simplified99.4%
if -9.9999999999999995e32 < (-.f64 a 1/2) < -0.49999999995Initial program 99.4%
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 a around 0 99.1%
+-commutative99.1%
+-commutative99.1%
Simplified99.1%
Final simplification99.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(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.5%
cancel-sign-sub99.5%
cancel-sign-sub-inv99.5%
associate--l+99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5)); 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[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* a (log t)) t)))
(if (<= a -2.3e+32)
t_1
(if (<= a 6.8e-40)
(- (+ (log y) (log (* z (pow t -0.5)))) t)
(+ (log (+ x y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * log(t)) - t;
double tmp;
if (a <= -2.3e+32) {
tmp = t_1;
} else if (a <= 6.8e-40) {
tmp = (log(y) + log((z * pow(t, -0.5)))) - t;
} else {
tmp = log((x + y)) + 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)) - t
if (a <= (-2.3d+32)) then
tmp = t_1
else if (a <= 6.8d-40) then
tmp = (log(y) + log((z * (t ** (-0.5d0))))) - t
else
tmp = log((x + y)) + 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)) - t;
double tmp;
if (a <= -2.3e+32) {
tmp = t_1;
} else if (a <= 6.8e-40) {
tmp = (Math.log(y) + Math.log((z * Math.pow(t, -0.5)))) - t;
} else {
tmp = Math.log((x + y)) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * math.log(t)) - t tmp = 0 if a <= -2.3e+32: tmp = t_1 elif a <= 6.8e-40: tmp = (math.log(y) + math.log((z * math.pow(t, -0.5)))) - t else: tmp = math.log((x + y)) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * log(t)) - t) tmp = 0.0 if (a <= -2.3e+32) tmp = t_1; elseif (a <= 6.8e-40) tmp = Float64(Float64(log(y) + log(Float64(z * (t ^ -0.5)))) - t); else tmp = Float64(log(Float64(x + y)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * log(t)) - t; tmp = 0.0; if (a <= -2.3e+32) tmp = t_1; elseif (a <= 6.8e-40) tmp = (log(y) + log((z * (t ^ -0.5)))) - t; else tmp = log((x + y)) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -2.3e+32], t$95$1, If[LessEqual[a, 6.8e-40], N[(N[(N[Log[y], $MachinePrecision] + N[Log[N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t - t\\
\mathbf{if}\;a \leq -2.3 \cdot 10^{+32}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 6.8 \cdot 10^{-40}:\\
\;\;\;\;\left(\log y + \log \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + t_1\\
\end{array}
\end{array}
if a < -2.3e32Initial 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 x around 0 79.4%
Taylor expanded in a around inf 99.7%
*-commutative99.7%
Simplified99.7%
if -2.3e32 < a < 6.79999999999999968e-40Initial program 99.3%
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 0 99.1%
associate-+r+99.1%
log-prod76.2%
+-commutative76.2%
Simplified76.2%
+-commutative76.2%
*-commutative76.2%
sum-log99.1%
Applied egg-rr99.1%
Taylor expanded in x around 0 61.9%
log-pow61.9%
log-prod55.9%
Simplified55.9%
if 6.79999999999999968e-40 < a Initial program 99.7%
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 98.1%
*-commutative98.1%
Simplified98.1%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 660.0) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 660.0) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 660.0d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 660.0) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 660.0: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 660.0) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 660.0) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 660.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 660:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 660Initial program 99.2%
associate--l+99.2%
associate-+l+99.3%
+-commutative99.3%
associate-+r-99.2%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 66.8%
Taylor expanded in t around 0 66.4%
if 660 < 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 x around 0 78.1%
Taylor expanded in a around inf 99.0%
*-commutative99.0%
Simplified99.0%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(y) + (log(z) + (log(t) * (a - 0.5d0)))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\right) - t
\end{array}
Initial program 99.5%
associate--l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r-99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 71.7%
Final simplification71.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.2e-104) (not (<= a 6.2e-40))) (+ (log (+ x y)) (- (* a (log t)) t)) (- (log (* (pow t -0.5) (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e-104) || !(a <= 6.2e-40)) {
tmp = log((x + y)) + ((a * log(t)) - t);
} else {
tmp = log((pow(t, -0.5) * (y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.2d-104)) .or. (.not. (a <= 6.2d-40))) then
tmp = log((x + y)) + ((a * log(t)) - t)
else
tmp = log(((t ** (-0.5d0)) * (y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e-104) || !(a <= 6.2e-40)) {
tmp = Math.log((x + y)) + ((a * Math.log(t)) - t);
} else {
tmp = Math.log((Math.pow(t, -0.5) * (y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.2e-104) or not (a <= 6.2e-40): tmp = math.log((x + y)) + ((a * math.log(t)) - t) else: tmp = math.log((math.pow(t, -0.5) * (y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.2e-104) || !(a <= 6.2e-40)) tmp = Float64(log(Float64(x + y)) + Float64(Float64(a * log(t)) - t)); else tmp = Float64(log(Float64((t ^ -0.5) * Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.2e-104) || ~((a <= 6.2e-40))) tmp = log((x + y)) + ((a * log(t)) - t); else tmp = log(((t ^ -0.5) * (y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.2e-104], N[Not[LessEqual[a, 6.2e-40]], $MachinePrecision]], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(N[Power[t, -0.5], $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{-104} \lor \neg \left(a \leq 6.2 \cdot 10^{-40}\right):\\
\;\;\;\;\log \left(x + y\right) + \left(a \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left({t}^{-0.5} \cdot \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -2.20000000000000012e-104 or 6.20000000000000021e-40 < 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 92.4%
*-commutative92.4%
Simplified92.4%
if -2.20000000000000012e-104 < a < 6.20000000000000021e-40Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+r-99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in a around 0 99.2%
associate-+r+99.3%
log-prod81.0%
+-commutative81.0%
Simplified81.0%
+-commutative81.0%
add-log-exp81.0%
sum-log75.7%
*-commutative75.7%
pow-to-exp75.9%
+-commutative75.9%
*-commutative75.9%
Applied egg-rr75.9%
Taylor expanded in x around 0 49.3%
*-commutative49.3%
Simplified49.3%
Final simplification74.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.5e-17) (not (<= a 6.8e-40))) (+ (log (+ x y)) (- (* a (log t)) t)) (- (+ (* -0.5 (log t)) (log (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.5e-17) || !(a <= 6.8e-40)) {
tmp = log((x + y)) + ((a * log(t)) - t);
} else {
tmp = ((-0.5 * log(t)) + log((y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-7.5d-17)) .or. (.not. (a <= 6.8d-40))) then
tmp = log((x + y)) + ((a * log(t)) - t)
else
tmp = (((-0.5d0) * log(t)) + log((y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.5e-17) || !(a <= 6.8e-40)) {
tmp = Math.log((x + y)) + ((a * Math.log(t)) - t);
} else {
tmp = ((-0.5 * Math.log(t)) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.5e-17) or not (a <= 6.8e-40): tmp = math.log((x + y)) + ((a * math.log(t)) - t) else: tmp = ((-0.5 * math.log(t)) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.5e-17) || !(a <= 6.8e-40)) tmp = Float64(log(Float64(x + y)) + Float64(Float64(a * log(t)) - t)); else tmp = Float64(Float64(Float64(-0.5 * log(t)) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7.5e-17) || ~((a <= 6.8e-40))) tmp = log((x + y)) + ((a * log(t)) - t); else tmp = ((-0.5 * log(t)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.5e-17], N[Not[LessEqual[a, 6.8e-40]], $MachinePrecision]], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{-17} \lor \neg \left(a \leq 6.8 \cdot 10^{-40}\right):\\
\;\;\;\;\log \left(x + y\right) + \left(a \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \log t + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -7.49999999999999984e-17 or 6.79999999999999968e-40 < 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 97.3%
*-commutative97.3%
Simplified97.3%
if -7.49999999999999984e-17 < a < 6.79999999999999968e-40Initial program 99.3%
associate--l+99.3%
associate-+l+99.4%
+-commutative99.4%
associate-+r-99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in a around 0 99.3%
associate-+r+99.3%
log-prod78.0%
+-commutative78.0%
Simplified78.0%
Taylor expanded in y around inf 60.9%
mul-1-neg60.9%
log-rec60.9%
remove-double-neg60.9%
log-prod50.1%
*-commutative50.1%
Simplified50.1%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.8e-17) (not (<= a 5.5e-40))) (- (* a (log t)) t) (- (log (* (pow t -0.5) (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.8e-17) || !(a <= 5.5e-40)) {
tmp = (a * log(t)) - t;
} else {
tmp = log((pow(t, -0.5) * (y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-7.8d-17)) .or. (.not. (a <= 5.5d-40))) then
tmp = (a * log(t)) - t
else
tmp = log(((t ** (-0.5d0)) * (y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.8e-17) || !(a <= 5.5e-40)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = Math.log((Math.pow(t, -0.5) * (y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.8e-17) or not (a <= 5.5e-40): tmp = (a * math.log(t)) - t else: tmp = math.log((math.pow(t, -0.5) * (y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.8e-17) || !(a <= 5.5e-40)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(log(Float64((t ^ -0.5) * Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7.8e-17) || ~((a <= 5.5e-40))) tmp = (a * log(t)) - t; else tmp = log(((t ^ -0.5) * (y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.8e-17], N[Not[LessEqual[a, 5.5e-40]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[Power[t, -0.5], $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{-17} \lor \neg \left(a \leq 5.5 \cdot 10^{-40}\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\log \left({t}^{-0.5} \cdot \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -7.79999999999999979e-17 or 5.50000000000000002e-40 < 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 x around 0 82.1%
Taylor expanded in a around inf 97.0%
*-commutative97.0%
Simplified97.0%
if -7.79999999999999979e-17 < a < 5.50000000000000002e-40Initial program 99.3%
associate--l+99.3%
associate-+l+99.4%
+-commutative99.4%
associate-+r-99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in a around 0 99.3%
associate-+r+99.3%
log-prod78.0%
+-commutative78.0%
Simplified78.0%
+-commutative78.0%
add-log-exp78.0%
sum-log72.7%
*-commutative72.7%
pow-to-exp72.9%
+-commutative72.9%
*-commutative72.9%
Applied egg-rr72.9%
Taylor expanded in x around 0 46.3%
*-commutative46.3%
Simplified46.3%
Final simplification72.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.3e+32) (not (<= a 5.5e-11))) (- (* a (log t)) t) (- (+ (log (+ x y)) (log z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.3e+32) || !(a <= 5.5e-11)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log((x + y)) + 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 ((a <= (-2.3d+32)) .or. (.not. (a <= 5.5d-11))) then
tmp = (a * log(t)) - t
else
tmp = (log((x + y)) + 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 ((a <= -2.3e+32) || !(a <= 5.5e-11)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log((x + y)) + Math.log(z)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.3e+32) or not (a <= 5.5e-11): tmp = (a * math.log(t)) - t else: tmp = (math.log((x + y)) + math.log(z)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.3e+32) || !(a <= 5.5e-11)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(Float64(x + y)) + log(z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.3e+32) || ~((a <= 5.5e-11))) tmp = (a * log(t)) - t; else tmp = (log((x + y)) + log(z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.3e+32], N[Not[LessEqual[a, 5.5e-11]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+32} \lor \neg \left(a \leq 5.5 \cdot 10^{-11}\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(x + y\right) + \log z\right) - t\\
\end{array}
\end{array}
if a < -2.3e32 or 5.49999999999999975e-11 < 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 x around 0 81.7%
Taylor expanded in a around inf 99.4%
*-commutative99.4%
Simplified99.4%
if -2.3e32 < a < 5.49999999999999975e-11Initial program 99.4%
cancel-sign-sub99.4%
cancel-sign-sub-inv99.4%
associate--l+99.3%
remove-double-neg99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
add-cube-cbrt99.0%
pow399.0%
Applied egg-rr99.0%
Taylor expanded in a around inf 51.0%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.3e+32) (not (<= a 5.5e-11))) (- (* a (log t)) t) (+ (log z) (- (log y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.3e+32) || !(a <= 5.5e-11)) {
tmp = (a * log(t)) - t;
} else {
tmp = log(z) + (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 <= (-2.3d+32)) .or. (.not. (a <= 5.5d-11))) then
tmp = (a * log(t)) - t
else
tmp = log(z) + (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 <= -2.3e+32) || !(a <= 5.5e-11)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = Math.log(z) + (Math.log(y) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.3e+32) or not (a <= 5.5e-11): tmp = (a * math.log(t)) - t else: tmp = math.log(z) + (math.log(y) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.3e+32) || !(a <= 5.5e-11)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(log(z) + Float64(log(y) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.3e+32) || ~((a <= 5.5e-11))) tmp = (a * log(t)) - t; else tmp = log(z) + (log(y) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.3e+32], N[Not[LessEqual[a, 5.5e-11]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+32} \lor \neg \left(a \leq 5.5 \cdot 10^{-11}\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\log z + \left(\log y - t\right)\\
\end{array}
\end{array}
if a < -2.3e32 or 5.49999999999999975e-11 < 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 x around 0 81.7%
Taylor expanded in a around inf 99.4%
*-commutative99.4%
Simplified99.4%
if -2.3e32 < a < 5.49999999999999975e-11Initial program 99.4%
cancel-sign-sub99.4%
cancel-sign-sub-inv99.4%
associate--l+99.3%
remove-double-neg99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
add-cube-cbrt99.0%
pow399.0%
Applied egg-rr99.0%
Taylor expanded in a around inf 51.0%
log-prod38.7%
+-commutative38.7%
Simplified38.7%
Taylor expanded in y around inf 37.1%
mul-1-neg37.1%
log-rec37.1%
Simplified37.1%
remove-double-neg37.1%
associate--l+37.1%
Applied egg-rr37.1%
Final simplification66.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.3e+32) (not (<= a 5.5e-11))) (- (* a (log t)) t) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.3e+32) || !(a <= 5.5e-11)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(z) + 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 <= (-2.3d+32)) .or. (.not. (a <= 5.5d-11))) then
tmp = (a * log(t)) - t
else
tmp = (log(z) + 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 <= -2.3e+32) || !(a <= 5.5e-11)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.3e+32) or not (a <= 5.5e-11): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.3e+32) || !(a <= 5.5e-11)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.3e+32) || ~((a <= 5.5e-11))) tmp = (a * log(t)) - t; else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.3e+32], N[Not[LessEqual[a, 5.5e-11]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.3 \cdot 10^{+32} \lor \neg \left(a \leq 5.5 \cdot 10^{-11}\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -2.3e32 or 5.49999999999999975e-11 < 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 x around 0 81.7%
Taylor expanded in a around inf 99.4%
*-commutative99.4%
Simplified99.4%
if -2.3e32 < a < 5.49999999999999975e-11Initial program 99.4%
cancel-sign-sub99.4%
cancel-sign-sub-inv99.4%
associate--l+99.3%
remove-double-neg99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
add-cube-cbrt99.0%
pow399.0%
Applied egg-rr99.0%
Taylor expanded in a around inf 51.0%
log-prod38.7%
+-commutative38.7%
Simplified38.7%
Taylor expanded in y around inf 37.1%
mul-1-neg37.1%
log-rec37.1%
Simplified37.1%
Taylor expanded in z around 0 37.1%
Final simplification66.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 660.0) (log (* (+ x y) z)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 660.0) {
tmp = log(((x + y) * 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 <= 660.0d0) then
tmp = log(((x + y) * 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 <= 660.0) {
tmp = Math.log(((x + y) * z));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 660.0: tmp = math.log(((x + y) * z)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 660.0) tmp = log(Float64(Float64(x + y) * z)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 660.0) tmp = log(((x + y) * z)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 660.0], N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 660:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 660Initial program 99.2%
cancel-sign-sub99.2%
cancel-sign-sub-inv99.2%
associate--l+99.2%
remove-double-neg99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
add-cube-cbrt98.1%
pow398.2%
Applied egg-rr98.2%
Taylor expanded in a around inf 12.0%
log-prod9.4%
+-commutative9.4%
Simplified9.4%
Taylor expanded in t around 0 9.3%
if 660 < 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 70.9%
neg-mul-170.9%
Simplified70.9%
Final simplification35.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 1020.0) (- (log (* y z)) t) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1020.0) {
tmp = log((y * z)) - 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 <= 1020.0d0) then
tmp = log((y * z)) - 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 <= 1020.0) {
tmp = Math.log((y * z)) - t;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1020.0: tmp = math.log((y * z)) - t else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1020.0) tmp = Float64(log(Float64(y * z)) - t); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1020.0) tmp = log((y * z)) - t; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1020.0], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1020:\\
\;\;\;\;\log \left(y \cdot z\right) - t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1020Initial program 99.2%
cancel-sign-sub99.2%
cancel-sign-sub-inv99.2%
associate--l+99.2%
remove-double-neg99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
add-cube-cbrt98.1%
pow398.2%
Applied egg-rr98.2%
Taylor expanded in a around inf 12.0%
log-prod9.4%
+-commutative9.4%
Simplified9.4%
Taylor expanded in y around inf 8.6%
mul-1-neg8.6%
log-rec8.6%
remove-double-neg8.6%
log-prod7.2%
Simplified7.2%
if 1020 < 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 70.9%
neg-mul-170.9%
Simplified70.9%
Final simplification34.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 660.0) (log (* y z)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 660.0) {
tmp = log((y * 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 <= 660.0d0) then
tmp = log((y * 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 <= 660.0) {
tmp = Math.log((y * z));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 660.0: tmp = math.log((y * z)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 660.0) tmp = log(Float64(y * z)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 660.0) tmp = log((y * z)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 660.0], N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 660:\\
\;\;\;\;\log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 660Initial program 99.2%
cancel-sign-sub99.2%
cancel-sign-sub-inv99.2%
associate--l+99.2%
remove-double-neg99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
add-cube-cbrt98.1%
pow398.2%
Applied egg-rr98.2%
Taylor expanded in a around inf 12.0%
log-prod9.4%
+-commutative9.4%
Simplified9.4%
Taylor expanded in t around 0 9.3%
Taylor expanded in x around 0 7.2%
*-commutative7.2%
Simplified7.2%
if 660 < 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 70.9%
neg-mul-170.9%
Simplified70.9%
Final simplification34.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.5%
associate--l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r-99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 71.7%
Taylor expanded in a around inf 69.3%
*-commutative69.3%
Simplified69.3%
Final simplification69.3%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.5%
associate--l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r-99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 32.2%
neg-mul-132.2%
Simplified32.2%
Final simplification32.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 2023290
(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))))