
(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 13 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)) (- (log z) t)) (* (log (/ 1.0 t)) (- 0.5 a))))
double code(double x, double y, double z, double t, double a) {
return (log((x + y)) + (log(z) - t)) + (log((1.0 / t)) * (0.5 - a));
}
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((1.0d0 / t)) * (0.5d0 - a))
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((1.0 / t)) * (0.5 - a));
}
def code(x, y, z, t, a): return (math.log((x + y)) + (math.log(z) - t)) + (math.log((1.0 / t)) * (0.5 - a))
function code(x, y, z, t, a) return Float64(Float64(log(Float64(x + y)) + Float64(log(z) - t)) + Float64(log(Float64(1.0 / t)) * Float64(0.5 - a))) end
function tmp = code(x, y, z, t, a) tmp = (log((x + y)) + (log(z) - t)) + (log((1.0 / t)) * (0.5 - a)); 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[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \log \left(\frac{1}{t}\right) \cdot \left(0.5 - a\right)
\end{array}
Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.031) (+ (log z) (+ (log (+ x y)) (* (- a 0.5) (log t)))) (- (* (log t) (+ a -0.5)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.031) {
tmp = log(z) + (log((x + y)) + ((a - 0.5) * log(t)));
} else {
tmp = (log(t) * (a + -0.5)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 0.031d0) then
tmp = log(z) + (log((x + y)) + ((a - 0.5d0) * log(t)))
else
tmp = (log(t) * (a + (-0.5d0))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.031) {
tmp = Math.log(z) + (Math.log((x + y)) + ((a - 0.5) * Math.log(t)));
} else {
tmp = (Math.log(t) * (a + -0.5)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.031: tmp = math.log(z) + (math.log((x + y)) + ((a - 0.5) * math.log(t))) else: tmp = (math.log(t) * (a + -0.5)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.031) tmp = Float64(log(z) + Float64(log(Float64(x + y)) + Float64(Float64(a - 0.5) * log(t)))); else tmp = Float64(Float64(log(t) * Float64(a + -0.5)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.031) tmp = log(z) + (log((x + y)) + ((a - 0.5) * log(t))); else tmp = (log(t) * (a + -0.5)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.031], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.031:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) + \left(a - 0.5\right) \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a + -0.5\right) - t\\
\end{array}
\end{array}
if t < 0.031Initial program 99.1%
associate--l+99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in t around 0 97.9%
if 0.031 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 69.5%
associate--l+69.5%
Simplified69.5%
Taylor expanded in t around inf 99.3%
neg-mul-199.3%
Simplified99.3%
Final simplification98.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.031) (+ (log y) (+ (log z) (* (- a 0.5) (log t)))) (- (* (log t) (+ a -0.5)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.031) {
tmp = log(y) + (log(z) + ((a - 0.5) * log(t)));
} else {
tmp = (log(t) * (a + -0.5)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 0.031d0) then
tmp = log(y) + (log(z) + ((a - 0.5d0) * log(t)))
else
tmp = (log(t) * (a + (-0.5d0))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.031) {
tmp = Math.log(y) + (Math.log(z) + ((a - 0.5) * Math.log(t)));
} else {
tmp = (Math.log(t) * (a + -0.5)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.031: tmp = math.log(y) + (math.log(z) + ((a - 0.5) * math.log(t))) else: tmp = (math.log(t) * (a + -0.5)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.031) tmp = Float64(log(y) + Float64(log(z) + Float64(Float64(a - 0.5) * log(t)))); else tmp = Float64(Float64(log(t) * Float64(a + -0.5)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.031) tmp = log(y) + (log(z) + ((a - 0.5) * log(t))); else tmp = (log(t) * (a + -0.5)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.031], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.031:\\
\;\;\;\;\log y + \left(\log z + \left(a - 0.5\right) \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a + -0.5\right) - t\\
\end{array}
\end{array}
if t < 0.031Initial program 99.1%
associate--l+99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in t around 0 97.9%
Taylor expanded in x around 0 57.8%
if 0.031 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 69.5%
associate--l+69.5%
Simplified69.5%
Taylor expanded in t around inf 99.3%
neg-mul-199.3%
Simplified99.3%
Final simplification78.6%
(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(log(Float64(x + y)) + Float64(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[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \log t \cdot \left(a + -0.5\right)
\end{array}
Initial program 99.5%
associate--l+99.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) (* (- 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}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (+ (* (log t) (+ a -0.5)) (+ (- (log z) t) (log y))))
double code(double x, double y, double z, double t, double a) {
return (log(t) * (a + -0.5)) + ((log(z) - t) + 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(t) * (a + (-0.5d0))) + ((log(z) - t) + log(y))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(t) * (a + -0.5)) + ((Math.log(z) - t) + Math.log(y));
}
def code(x, y, z, t, a): return (math.log(t) * (a + -0.5)) + ((math.log(z) - t) + math.log(y))
function code(x, y, z, t, a) return Float64(Float64(log(t) * Float64(a + -0.5)) + Float64(Float64(log(z) - t) + log(y))) end
function tmp = code(x, y, z, t, a) tmp = (log(t) * (a + -0.5)) + ((log(z) - t) + log(y)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t \cdot \left(a + -0.5\right) + \left(\left(\log z - t\right) + \log y\right)
\end{array}
Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 64.0%
associate--l+64.0%
Simplified64.0%
Final simplification64.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.12e-54) (not (<= a 4.8e-40))) (- (* (log t) (+ a -0.5)) t) (- (+ (* (log t) -0.5) (log (* (+ x y) z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.12e-54) || !(a <= 4.8e-40)) {
tmp = (log(t) * (a + -0.5)) - t;
} else {
tmp = ((log(t) * -0.5) + log(((x + 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 <= (-1.12d-54)) .or. (.not. (a <= 4.8d-40))) then
tmp = (log(t) * (a + (-0.5d0))) - t
else
tmp = ((log(t) * (-0.5d0)) + log(((x + 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 <= -1.12e-54) || !(a <= 4.8e-40)) {
tmp = (Math.log(t) * (a + -0.5)) - t;
} else {
tmp = ((Math.log(t) * -0.5) + Math.log(((x + y) * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.12e-54) or not (a <= 4.8e-40): tmp = (math.log(t) * (a + -0.5)) - t else: tmp = ((math.log(t) * -0.5) + math.log(((x + y) * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.12e-54) || !(a <= 4.8e-40)) tmp = Float64(Float64(log(t) * Float64(a + -0.5)) - t); else tmp = Float64(Float64(Float64(log(t) * -0.5) + log(Float64(Float64(x + y) * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.12e-54) || ~((a <= 4.8e-40))) tmp = (log(t) * (a + -0.5)) - t; else tmp = ((log(t) * -0.5) + log(((x + y) * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.12e-54], N[Not[LessEqual[a, 4.8e-40]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision] + N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{-54} \lor \neg \left(a \leq 4.8 \cdot 10^{-40}\right):\\
\;\;\;\;\log t \cdot \left(a + -0.5\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot -0.5 + \log \left(\left(x + y\right) \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -1.11999999999999994e-54 or 4.79999999999999982e-40 < a Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 69.1%
associate--l+69.1%
Simplified69.1%
Taylor expanded in t around inf 94.8%
neg-mul-194.8%
Simplified94.8%
if -1.11999999999999994e-54 < a < 4.79999999999999982e-40Initial program 99.2%
associate--l+99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in a around 0 99.3%
+-commutative99.3%
+-commutative99.3%
associate-+l+99.2%
log-prod77.2%
*-commutative77.2%
*-commutative77.2%
+-commutative77.2%
Simplified77.2%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.12e-54) (not (<= a 9e-44))) (- (* (log t) (+ a -0.5)) t) (- (+ (* (log t) -0.5) (log (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.12e-54) || !(a <= 9e-44)) {
tmp = (log(t) * (a + -0.5)) - t;
} else {
tmp = ((log(t) * -0.5) + 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 <= (-1.12d-54)) .or. (.not. (a <= 9d-44))) then
tmp = (log(t) * (a + (-0.5d0))) - t
else
tmp = ((log(t) * (-0.5d0)) + 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 <= -1.12e-54) || !(a <= 9e-44)) {
tmp = (Math.log(t) * (a + -0.5)) - t;
} else {
tmp = ((Math.log(t) * -0.5) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.12e-54) or not (a <= 9e-44): tmp = (math.log(t) * (a + -0.5)) - t else: tmp = ((math.log(t) * -0.5) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.12e-54) || !(a <= 9e-44)) tmp = Float64(Float64(log(t) * Float64(a + -0.5)) - t); else tmp = Float64(Float64(Float64(log(t) * -0.5) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.12e-54) || ~((a <= 9e-44))) tmp = (log(t) * (a + -0.5)) - t; else tmp = ((log(t) * -0.5) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.12e-54], N[Not[LessEqual[a, 9e-44]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.12 \cdot 10^{-54} \lor \neg \left(a \leq 9 \cdot 10^{-44}\right):\\
\;\;\;\;\log t \cdot \left(a + -0.5\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot -0.5 + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -1.11999999999999994e-54 or 8.9999999999999997e-44 < a Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 69.1%
associate--l+69.1%
Simplified69.1%
Taylor expanded in t around inf 94.8%
neg-mul-194.8%
Simplified94.8%
if -1.11999999999999994e-54 < a < 8.9999999999999997e-44Initial program 99.2%
associate--l+99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in a around 0 99.3%
+-commutative99.3%
+-commutative99.3%
associate-+l+99.2%
log-prod77.2%
*-commutative77.2%
*-commutative77.2%
+-commutative77.2%
Simplified77.2%
Taylor expanded in y around inf 57.1%
+-commutative57.1%
mul-1-neg57.1%
log-rec57.1%
remove-double-neg57.1%
log-prod38.3%
Simplified38.3%
Final simplification70.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (log t) (+ a -0.5)))) (if (<= t 5.7e-15) (+ t_1 (log (* y z))) (- t_1 t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * (a + -0.5);
double tmp;
if (t <= 5.7e-15) {
tmp = t_1 + log((y * z));
} 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) :: tmp
t_1 = log(t) * (a + (-0.5d0))
if (t <= 5.7d-15) then
tmp = t_1 + log((y * z))
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 = Math.log(t) * (a + -0.5);
double tmp;
if (t <= 5.7e-15) {
tmp = t_1 + Math.log((y * z));
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a + -0.5) tmp = 0 if t <= 5.7e-15: tmp = t_1 + math.log((y * z)) else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a + -0.5)) tmp = 0.0 if (t <= 5.7e-15) tmp = Float64(t_1 + log(Float64(y * z))); else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a + -0.5); tmp = 0.0; if (t <= 5.7e-15) tmp = t_1 + log((y * z)); else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 5.7e-15], N[(t$95$1 + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a + -0.5\right)\\
\mathbf{if}\;t \leq 5.7 \cdot 10^{-15}:\\
\;\;\;\;t\_1 + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < 5.7000000000000003e-15Initial program 99.1%
associate--l+99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in t around 0 99.1%
Taylor expanded in x around 0 58.4%
associate-+r+58.4%
log-prod38.6%
sub-neg38.6%
metadata-eval38.6%
Simplified38.6%
if 5.7000000000000003e-15 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 69.0%
associate--l+69.0%
Simplified69.0%
Taylor expanded in t around inf 96.7%
neg-mul-196.7%
Simplified96.7%
Final simplification69.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.65e+23) (* (log (/ 1.0 t)) (- a)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.65e+23) {
tmp = log((1.0 / t)) * -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 <= 1.65d+23) then
tmp = log((1.0d0 / t)) * -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 <= 1.65e+23) {
tmp = Math.log((1.0 / t)) * -a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.65e+23: tmp = math.log((1.0 / t)) * -a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.65e+23) tmp = Float64(log(Float64(1.0 / t)) * Float64(-a)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.65e+23) tmp = log((1.0 / t)) * -a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.65e+23], N[(N[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * (-a)), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.65 \cdot 10^{+23}:\\
\;\;\;\;\log \left(\frac{1}{t}\right) \cdot \left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.65000000000000015e23Initial program 99.2%
associate--l+99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in t around inf 99.2%
Taylor expanded in a around inf 48.2%
if 1.65000000000000015e23 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 78.0%
neg-mul-178.0%
Simplified78.0%
Final simplification62.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 9.6e+22) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 9.6e+22) {
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 <= 9.6d+22) 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 <= 9.6e+22) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 9.6e+22: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 9.6e+22) 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 <= 9.6e+22) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 9.6e+22], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.6 \cdot 10^{+22}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 9.6e22Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in a around inf 48.2%
*-commutative48.2%
Simplified48.2%
if 9.6e22 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 78.0%
neg-mul-178.0%
Simplified78.0%
Final simplification62.0%
(FPCore (x y z t a) :precision binary64 (- (* (log t) (+ a -0.5)) t))
double code(double x, double y, double z, double t, double a) {
return (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(t) * (a + (-0.5d0))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(t) * (a + -0.5)) - t;
}
def code(x, y, z, t, a): return (math.log(t) * (a + -0.5)) - t
function code(x, y, z, t, a) return Float64(Float64(log(t) * Float64(a + -0.5)) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(t) * (a + -0.5)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log t \cdot \left(a + -0.5\right) - t
\end{array}
Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 64.0%
associate--l+64.0%
Simplified64.0%
Taylor expanded in t around inf 75.5%
neg-mul-175.5%
Simplified75.5%
Final simplification75.5%
(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%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 38.3%
neg-mul-138.3%
Simplified38.3%
Final simplification38.3%
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t)))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log((x + y)) + ((log(z) - t) + ((a - 0.5d0) * log(t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) + ((Math.log(z) - t) + ((a - 0.5) * Math.log(t)));
}
def code(x, y, z, t, a): return math.log((x + y)) + ((math.log(z) - t) + ((a - 0.5) * math.log(t)))
function code(x, y, z, t, a) return Float64(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 2024053
(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))))