
(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 14 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)) (+ (* (- a 0.5) (log t)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (((a - 0.5) * log(t)) + (log(z) - 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)) + (((a - 0.5d0) * log(t)) + (log(z) - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) + (((a - 0.5) * Math.log(t)) + (Math.log(z) - t));
}
def code(x, y, z, t, a): return math.log((x + y)) + (((a - 0.5) * math.log(t)) + (math.log(z) - t))
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(Float64(Float64(a - 0.5) * log(t)) + Float64(log(z) - t))) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) + (((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]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\left(a - 0.5\right) \cdot \log t + \left(\log z - t\right)\right)
\end{array}
Initial program 99.6%
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= t 290.0) (+ (* (log t) (- a 0.5)) (+ (log z) (log y))) (- (+ (* (log t) a) (log z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 290.0) {
tmp = (log(t) * (a - 0.5)) + (log(z) + log(y));
} else {
tmp = ((log(t) * a) + log(z)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 290.0d0) then
tmp = (log(t) * (a - 0.5d0)) + (log(z) + log(y))
else
tmp = ((log(t) * a) + log(z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 290.0) {
tmp = (Math.log(t) * (a - 0.5)) + (Math.log(z) + Math.log(y));
} else {
tmp = ((Math.log(t) * a) + Math.log(z)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 290.0: tmp = (math.log(t) * (a - 0.5)) + (math.log(z) + math.log(y)) else: tmp = ((math.log(t) * a) + math.log(z)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 290.0) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(z) + log(y))); else tmp = Float64(Float64(Float64(log(t) * a) + log(z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 290.0) tmp = (log(t) * (a - 0.5)) + (log(z) + log(y)); else tmp = ((log(t) * a) + log(z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 290.0], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 290:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \left(\log z + \log y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot a + \log z\right) - t\\
\end{array}
\end{array}
if t < 290Initial program 99.3%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in y around inf 0
Simplified0
if 290 < t Initial program 99.9%
Simplified0
Applied egg-rr0
Taylor expanded in a around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (- (+ (+ (* (- a 0.5) (log t)) (log y)) (log z)) t))
double code(double x, double y, double z, double t, double a) {
return ((((a - 0.5) * log(t)) + log(y)) + log(z)) - 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 - 0.5d0) * log(t)) + log(y)) + log(z)) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return ((((a - 0.5) * Math.log(t)) + Math.log(y)) + Math.log(z)) - t;
}
def code(x, y, z, t, a): return ((((a - 0.5) * math.log(t)) + math.log(y)) + math.log(z)) - t
function code(x, y, z, t, a) return Float64(Float64(Float64(Float64(Float64(a - 0.5) * log(t)) + log(y)) + log(z)) - t) end
function tmp = code(x, y, z, t, a) tmp = ((((a - 0.5) * log(t)) + log(y)) + log(z)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(a - 0.5\right) \cdot \log t + \log y\right) + \log z\right) - t
\end{array}
Initial program 99.6%
Simplified0
Applied egg-rr0
Taylor expanded in x around 0 0
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= t 4600.0) (- (log (* z (+ x y))) (- t (* (- a 0.5) (log t)))) (- (+ (* (log t) a) (log z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4600.0) {
tmp = log((z * (x + y))) - (t - ((a - 0.5) * log(t)));
} else {
tmp = ((log(t) * a) + log(z)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 4600.0d0) then
tmp = log((z * (x + y))) - (t - ((a - 0.5d0) * log(t)))
else
tmp = ((log(t) * a) + log(z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4600.0) {
tmp = Math.log((z * (x + y))) - (t - ((a - 0.5) * Math.log(t)));
} else {
tmp = ((Math.log(t) * a) + Math.log(z)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4600.0: tmp = math.log((z * (x + y))) - (t - ((a - 0.5) * math.log(t))) else: tmp = ((math.log(t) * a) + math.log(z)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4600.0) tmp = Float64(log(Float64(z * Float64(x + y))) - Float64(t - Float64(Float64(a - 0.5) * log(t)))); else tmp = Float64(Float64(Float64(log(t) * a) + log(z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4600.0) tmp = log((z * (x + y))) - (t - ((a - 0.5) * log(t))); else tmp = ((log(t) * a) + log(z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4600.0], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - N[(t - N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4600:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) - \left(t - \left(a - 0.5\right) \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot a + \log z\right) - t\\
\end{array}
\end{array}
if t < 4600Initial program 99.3%
Simplified0
Applied egg-rr0
if 4600 < t Initial program 99.9%
Simplified0
Applied egg-rr0
Taylor expanded in a around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= t 1.42e-11) (+ (* (log t) (- a 0.5)) (log (* z (+ x y)))) (- (+ (* (log t) a) (log z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.42e-11) {
tmp = (log(t) * (a - 0.5)) + log((z * (x + y)));
} else {
tmp = ((log(t) * a) + log(z)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.42d-11) then
tmp = (log(t) * (a - 0.5d0)) + log((z * (x + y)))
else
tmp = ((log(t) * a) + log(z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.42e-11) {
tmp = (Math.log(t) * (a - 0.5)) + Math.log((z * (x + y)));
} else {
tmp = ((Math.log(t) * a) + Math.log(z)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.42e-11: tmp = (math.log(t) * (a - 0.5)) + math.log((z * (x + y))) else: tmp = ((math.log(t) * a) + math.log(z)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.42e-11) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(z * Float64(x + y)))); else tmp = Float64(Float64(Float64(log(t) * a) + log(z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.42e-11) tmp = (log(t) * (a - 0.5)) + log((z * (x + y))); else tmp = ((log(t) * a) + log(z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.42e-11], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.42 \cdot 10^{-11}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(z \cdot \left(x + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot a + \log z\right) - t\\
\end{array}
\end{array}
if t < 1.42e-11Initial program 99.3%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
if 1.42e-11 < t Initial program 99.9%
Simplified0
Applied egg-rr0
Taylor expanded in a around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= t 4800.0) (+ (log (* z y)) (- (* (log t) (- a 0.5)) t)) (- (+ (* (log t) a) (log z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4800.0) {
tmp = log((z * y)) + ((log(t) * (a - 0.5)) - t);
} else {
tmp = ((log(t) * a) + log(z)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 4800.0d0) then
tmp = log((z * y)) + ((log(t) * (a - 0.5d0)) - t)
else
tmp = ((log(t) * a) + log(z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4800.0) {
tmp = Math.log((z * y)) + ((Math.log(t) * (a - 0.5)) - t);
} else {
tmp = ((Math.log(t) * a) + Math.log(z)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4800.0: tmp = math.log((z * y)) + ((math.log(t) * (a - 0.5)) - t) else: tmp = ((math.log(t) * a) + math.log(z)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4800.0) tmp = Float64(log(Float64(z * y)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)); else tmp = Float64(Float64(Float64(log(t) * a) + log(z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4800.0) tmp = log((z * y)) + ((log(t) * (a - 0.5)) - t); else tmp = ((log(t) * a) + log(z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4800.0], N[(N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4800:\\
\;\;\;\;\log \left(z \cdot y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot a + \log z\right) - t\\
\end{array}
\end{array}
if t < 4800Initial program 99.3%
Simplified0
Applied egg-rr0
Taylor expanded in x around 0 0
Simplified0
if 4800 < t Initial program 99.9%
Simplified0
Applied egg-rr0
Taylor expanded in a around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= t 3.2e-12) (+ (* (log t) (- a 0.5)) (log (* z y))) (- (+ (* (log t) a) (log z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.2e-12) {
tmp = (log(t) * (a - 0.5)) + log((z * y));
} else {
tmp = ((log(t) * a) + log(z)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 3.2d-12) then
tmp = (log(t) * (a - 0.5d0)) + log((z * y))
else
tmp = ((log(t) * a) + log(z)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.2e-12) {
tmp = (Math.log(t) * (a - 0.5)) + Math.log((z * y));
} else {
tmp = ((Math.log(t) * a) + Math.log(z)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.2e-12: tmp = (math.log(t) * (a - 0.5)) + math.log((z * y)) else: tmp = ((math.log(t) * a) + math.log(z)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.2e-12) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(z * y))); else tmp = Float64(Float64(Float64(log(t) * a) + log(z)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.2e-12) tmp = (log(t) * (a - 0.5)) + log((z * y)); else tmp = ((log(t) * a) + log(z)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.2e-12], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.2 \cdot 10^{-12}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(z \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot a + \log z\right) - t\\
\end{array}
\end{array}
if t < 3.2000000000000001e-12Initial program 99.3%
Simplified0
Applied egg-rr0
Taylor expanded in t around 0 0
Simplified0
Taylor expanded in x around 0 0
Simplified0
if 3.2000000000000001e-12 < t Initial program 99.9%
Simplified0
Applied egg-rr0
Taylor expanded in a around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (log t) a))) (if (<= a -4.8e+18) t_1 (if (<= a 1.6e+50) (- (* -0.5 (log t)) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if (a <= -4.8e+18) {
tmp = t_1;
} else if (a <= 1.6e+50) {
tmp = (-0.5 * log(t)) - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) * a
if (a <= (-4.8d+18)) then
tmp = t_1
else if (a <= 1.6d+50) then
tmp = ((-0.5d0) * log(t)) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double tmp;
if (a <= -4.8e+18) {
tmp = t_1;
} else if (a <= 1.6e+50) {
tmp = (-0.5 * Math.log(t)) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if a <= -4.8e+18: tmp = t_1 elif a <= 1.6e+50: tmp = (-0.5 * math.log(t)) - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (a <= -4.8e+18) tmp = t_1; elseif (a <= 1.6e+50) tmp = Float64(Float64(-0.5 * log(t)) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; tmp = 0.0; if (a <= -4.8e+18) tmp = t_1; elseif (a <= 1.6e+50) tmp = (-0.5 * log(t)) - t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -4.8e+18], t$95$1, If[LessEqual[a, 1.6e+50], N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a \leq -4.8 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+50}:\\
\;\;\;\;-0.5 \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.8e18 or 1.59999999999999991e50 < a Initial program 99.6%
Simplified0
Taylor expanded in a around inf 0
Simplified0
if -4.8e18 < a < 1.59999999999999991e50Initial program 99.5%
Taylor expanded in t around inf 0
Simplified0
Taylor expanded in a around 0 0
Simplified0
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (log t) a))) (if (<= a -1.85e+21) t_1 (if (<= a 1.85e+50) (- t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if (a <= -1.85e+21) {
tmp = t_1;
} else if (a <= 1.85e+50) {
tmp = -t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) * a
if (a <= (-1.85d+21)) then
tmp = t_1
else if (a <= 1.85d+50) then
tmp = -t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double tmp;
if (a <= -1.85e+21) {
tmp = t_1;
} else if (a <= 1.85e+50) {
tmp = -t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if a <= -1.85e+21: tmp = t_1 elif a <= 1.85e+50: tmp = -t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (a <= -1.85e+21) tmp = t_1; elseif (a <= 1.85e+50) tmp = Float64(-t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; tmp = 0.0; if (a <= -1.85e+21) tmp = t_1; elseif (a <= 1.85e+50) tmp = -t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1.85e+21], t$95$1, If[LessEqual[a, 1.85e+50], (-t), t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a \leq -1.85 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{+50}:\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.85e21 or 1.85e50 < a Initial program 99.6%
Simplified0
Taylor expanded in a around inf 0
Simplified0
if -1.85e21 < a < 1.85e50Initial program 99.5%
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
(FPCore (x y z t a) :precision binary64 (if (<= t 2.6e-14) (* (log t) (+ -0.5 a)) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.6e-14) {
tmp = log(t) * (-0.5 + a);
} else {
tmp = (log(t) * a) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 2.6d-14) then
tmp = log(t) * ((-0.5d0) + a)
else
tmp = (log(t) * a) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.6e-14) {
tmp = Math.log(t) * (-0.5 + a);
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.6e-14: tmp = math.log(t) * (-0.5 + a) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.6e-14) tmp = Float64(log(t) * Float64(-0.5 + a)); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2.6e-14) tmp = log(t) * (-0.5 + a); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.6e-14], N[(N[Log[t], $MachinePrecision] * N[(-0.5 + a), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.6 \cdot 10^{-14}:\\
\;\;\;\;\log t \cdot \left(-0.5 + a\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 2.59999999999999997e-14Initial program 99.3%
Taylor expanded in t around inf 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 2.59999999999999997e-14 < t Initial program 99.9%
Simplified0
Applied egg-rr0
Taylor expanded in a around inf 0
Simplified0
(FPCore (x y z t a) :precision binary64 (if (<= t 3.6e+59) (* (log t) (+ -0.5 a)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.6e+59) {
tmp = log(t) * (-0.5 + a);
} 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 <= 3.6d+59) then
tmp = log(t) * ((-0.5d0) + a)
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 <= 3.6e+59) {
tmp = Math.log(t) * (-0.5 + a);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.6e+59: tmp = math.log(t) * (-0.5 + a) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.6e+59) tmp = Float64(log(t) * Float64(-0.5 + a)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.6e+59) tmp = log(t) * (-0.5 + a); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.6e+59], N[(N[Log[t], $MachinePrecision] * N[(-0.5 + a), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.6 \cdot 10^{+59}:\\
\;\;\;\;\log t \cdot \left(-0.5 + a\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 3.5999999999999999e59Initial program 99.4%
Taylor expanded in t around inf 0
Simplified0
Taylor expanded in t around 0 0
Simplified0
if 3.5999999999999999e59 < t Initial program 99.9%
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
(FPCore (x y z t a) :precision binary64 (+ (- 0.0 t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return (0.0 - 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 = (0.0d0 - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (0.0 - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return (0.0 - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(0.0 - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = (0.0 - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(0.0 - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(0 - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
Taylor expanded in t around inf 0
Simplified0
(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%
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
(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 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%
Simplified0
Taylor expanded in t around inf 0
Simplified0
Applied egg-rr0
Applied egg-rr0
Applied egg-rr0
(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 2024110
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))