
(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) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\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%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (or (<= t_1 -900.0) (not (<= t_1 611.0)))
(- (* (log t) (- a 0.5)) t)
(+ (log (* (+ x y) z)) (- (* (log t) (+ a -0.5)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y)) + log(z);
double tmp;
if ((t_1 <= -900.0) || !(t_1 <= 611.0)) {
tmp = (log(t) * (a - 0.5)) - t;
} else {
tmp = log(((x + y) * z)) + ((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) :: t_1
real(8) :: tmp
t_1 = log((x + y)) + log(z)
if ((t_1 <= (-900.0d0)) .or. (.not. (t_1 <= 611.0d0))) then
tmp = (log(t) * (a - 0.5d0)) - t
else
tmp = log(((x + y) * z)) + ((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 t_1 = Math.log((x + y)) + Math.log(z);
double tmp;
if ((t_1 <= -900.0) || !(t_1 <= 611.0)) {
tmp = (Math.log(t) * (a - 0.5)) - t;
} else {
tmp = Math.log(((x + y) * z)) + ((Math.log(t) * (a + -0.5)) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + math.log(z) tmp = 0 if (t_1 <= -900.0) or not (t_1 <= 611.0): tmp = (math.log(t) * (a - 0.5)) - t else: tmp = math.log(((x + y) * z)) + ((math.log(t) * (a + -0.5)) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(x + y)) + log(z)) tmp = 0.0 if ((t_1 <= -900.0) || !(t_1 <= 611.0)) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) - t); else tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(log(t) * Float64(a + -0.5)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + log(z); tmp = 0.0; if ((t_1 <= -900.0) || ~((t_1 <= 611.0))) tmp = (log(t) * (a - 0.5)) - t; else tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -900.0], N[Not[LessEqual[t$95$1, 611.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t\_1 \leq -900 \lor \neg \left(t\_1 \leq 611\right):\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -900 or 611 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.8%
Taylor expanded in t around -inf 99.7%
mul-1-neg99.7%
distribute-rgt-neg-in99.7%
mul-1-neg99.7%
unsub-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 84.8%
neg-mul-184.8%
Simplified84.8%
if -900 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 611Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
+-commutative99.4%
fma-undefine99.4%
metadata-eval99.4%
sub-neg99.4%
associate-+r+99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l-99.4%
sum-log98.6%
sub-neg98.6%
metadata-eval98.6%
*-commutative98.6%
Applied egg-rr98.6%
Final simplification94.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (- (* (log t) (- a 0.5)) t)) (t_2 (+ (log (+ x y)) (log z)))) (if (or (<= t_2 -900.0) (not (<= t_2 611.0))) t_1 (+ t_1 (log (* y z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (log(t) * (a - 0.5)) - t;
double t_2 = log((x + y)) + log(z);
double tmp;
if ((t_2 <= -900.0) || !(t_2 <= 611.0)) {
tmp = t_1;
} else {
tmp = t_1 + log((y * z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (log(t) * (a - 0.5d0)) - t
t_2 = log((x + y)) + log(z)
if ((t_2 <= (-900.0d0)) .or. (.not. (t_2 <= 611.0d0))) then
tmp = t_1
else
tmp = t_1 + log((y * z))
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)) - t;
double t_2 = Math.log((x + y)) + Math.log(z);
double tmp;
if ((t_2 <= -900.0) || !(t_2 <= 611.0)) {
tmp = t_1;
} else {
tmp = t_1 + Math.log((y * z));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (math.log(t) * (a - 0.5)) - t t_2 = math.log((x + y)) + math.log(z) tmp = 0 if (t_2 <= -900.0) or not (t_2 <= 611.0): tmp = t_1 else: tmp = t_1 + math.log((y * z)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(log(t) * Float64(a - 0.5)) - t) t_2 = Float64(log(Float64(x + y)) + log(z)) tmp = 0.0 if ((t_2 <= -900.0) || !(t_2 <= 611.0)) tmp = t_1; else tmp = Float64(t_1 + log(Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (log(t) * (a - 0.5)) - t; t_2 = log((x + y)) + log(z); tmp = 0.0; if ((t_2 <= -900.0) || ~((t_2 <= 611.0))) tmp = t_1; else tmp = t_1 + log((y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -900.0], N[Not[LessEqual[t$95$2, 611.0]], $MachinePrecision]], t$95$1, N[(t$95$1 + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right) - t\\
t_2 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t\_2 \leq -900 \lor \neg \left(t\_2 \leq 611\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \log \left(y \cdot z\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -900 or 611 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.8%
Taylor expanded in t around -inf 99.7%
mul-1-neg99.7%
distribute-rgt-neg-in99.7%
mul-1-neg99.7%
unsub-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 84.8%
neg-mul-184.8%
Simplified84.8%
if -900 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 611Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
associate-+r-99.4%
fma-undefine99.4%
associate--r+99.4%
sum-log98.6%
Applied egg-rr98.6%
Taylor expanded in x around 0 64.0%
Final simplification69.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (log t) (- a 0.5)))) (if (<= t 0.285) (+ (log (+ x y)) (+ (log z) t_1)) (- 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 <= 0.285) {
tmp = log((x + y)) + (log(z) + t_1);
} 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 <= 0.285d0) then
tmp = log((x + y)) + (log(z) + t_1)
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 <= 0.285) {
tmp = Math.log((x + y)) + (Math.log(z) + t_1);
} 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 <= 0.285: tmp = math.log((x + y)) + (math.log(z) + t_1) 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 <= 0.285) tmp = Float64(log(Float64(x + y)) + Float64(log(z) + t_1)); 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 <= 0.285) tmp = log((x + y)) + (log(z) + t_1); 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, 0.285], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + t$95$1), $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 0.285:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < 0.284999999999999976Initial program 99.2%
associate-+l-99.2%
associate--l+99.1%
sub-neg99.1%
+-commutative99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
fma-undefine99.1%
sub-neg99.1%
+-commutative99.1%
distribute-neg-in99.1%
metadata-eval99.1%
metadata-eval99.1%
unsub-neg99.1%
Simplified99.1%
Taylor expanded in t around 0 97.9%
if 0.284999999999999976 < t Initial program 99.8%
Taylor expanded in t around -inf 99.9%
mul-1-neg99.9%
distribute-rgt-neg-in99.9%
mul-1-neg99.9%
unsub-neg99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 98.1%
neg-mul-198.1%
Simplified98.1%
Final simplification98.0%
(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 (+ (- (log z) t) (+ (* (log t) (- a 0.5)) (log y))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + ((log(t) * (a - 0.5)) + log(y));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) - t) + ((log(t) * (a - 0.5d0)) + log(y))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + ((Math.log(t) * (a - 0.5)) + Math.log(y));
}
def code(x, y, z, t, a): return (math.log(z) - t) + ((math.log(t) * (a - 0.5)) + math.log(y))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(Float64(log(t) * Float64(a - 0.5)) + log(y))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + ((log(t) * (a - 0.5)) + log(y)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log t \cdot \left(a - 0.5\right) + \log y\right)
\end{array}
Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 67.8%
Final simplification67.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.2e-42) (not (<= a 2.1e-8))) (- (* (log t) (- a 0.5)) t) (- (log (* y z)) (+ t (* (log t) 0.5)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.2e-42) || !(a <= 2.1e-8)) {
tmp = (log(t) * (a - 0.5)) - t;
} else {
tmp = log((y * z)) - (t + (log(t) * 0.5));
}
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 <= (-4.2d-42)) .or. (.not. (a <= 2.1d-8))) then
tmp = (log(t) * (a - 0.5d0)) - t
else
tmp = log((y * z)) - (t + (log(t) * 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.2e-42) || !(a <= 2.1e-8)) {
tmp = (Math.log(t) * (a - 0.5)) - t;
} else {
tmp = Math.log((y * z)) - (t + (Math.log(t) * 0.5));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.2e-42) or not (a <= 2.1e-8): tmp = (math.log(t) * (a - 0.5)) - t else: tmp = math.log((y * z)) - (t + (math.log(t) * 0.5)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.2e-42) || !(a <= 2.1e-8)) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) - t); else tmp = Float64(log(Float64(y * z)) - Float64(t + Float64(log(t) * 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.2e-42) || ~((a <= 2.1e-8))) tmp = (log(t) * (a - 0.5)) - t; else tmp = log((y * z)) - (t + (log(t) * 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.2e-42], N[Not[LessEqual[a, 2.1e-8]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - N[(t + N[(N[Log[t], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-42} \lor \neg \left(a \leq 2.1 \cdot 10^{-8}\right):\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot z\right) - \left(t + \log t \cdot 0.5\right)\\
\end{array}
\end{array}
if a < -4.20000000000000013e-42 or 2.09999999999999994e-8 < a Initial program 99.7%
Taylor expanded in t around -inf 99.7%
mul-1-neg99.7%
distribute-rgt-neg-in99.7%
mul-1-neg99.7%
unsub-neg99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in t around inf 96.7%
neg-mul-196.7%
Simplified96.7%
if -4.20000000000000013e-42 < a < 2.09999999999999994e-8Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
associate-+r-99.4%
fma-undefine99.4%
associate--r+99.4%
sum-log79.3%
Applied egg-rr79.3%
Taylor expanded in x around 0 51.1%
*-commutative51.1%
*-commutative51.1%
Simplified51.1%
Taylor expanded in a around 0 50.7%
Final simplification70.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t 5.1e-154) (not (<= t 6.5e-62))) (- (* (log t) (- a 0.5)) t) (log (* (+ x y) (* z (sqrt (/ 1.0 t)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 5.1e-154) || !(t <= 6.5e-62)) {
tmp = (log(t) * (a - 0.5)) - t;
} else {
tmp = log(((x + y) * (z * sqrt((1.0 / 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 <= 5.1d-154) .or. (.not. (t <= 6.5d-62))) then
tmp = (log(t) * (a - 0.5d0)) - t
else
tmp = log(((x + y) * (z * sqrt((1.0d0 / 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 <= 5.1e-154) || !(t <= 6.5e-62)) {
tmp = (Math.log(t) * (a - 0.5)) - t;
} else {
tmp = Math.log(((x + y) * (z * Math.sqrt((1.0 / t)))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= 5.1e-154) or not (t <= 6.5e-62): tmp = (math.log(t) * (a - 0.5)) - t else: tmp = math.log(((x + y) * (z * math.sqrt((1.0 / t))))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= 5.1e-154) || !(t <= 6.5e-62)) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) - t); else tmp = log(Float64(Float64(x + y) * Float64(z * sqrt(Float64(1.0 / t))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= 5.1e-154) || ~((t <= 6.5e-62))) tmp = (log(t) * (a - 0.5)) - t; else tmp = log(((x + y) * (z * sqrt((1.0 / t))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, 5.1e-154], N[Not[LessEqual[t, 6.5e-62]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[Log[N[(N[(x + y), $MachinePrecision] * N[(z * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.1 \cdot 10^{-154} \lor \neg \left(t \leq 6.5 \cdot 10^{-62}\right):\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot \left(z \cdot \sqrt{\frac{1}{t}}\right)\right)\\
\end{array}
\end{array}
if t < 5.0999999999999998e-154 or 6.50000000000000026e-62 < t Initial program 99.6%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
distribute-rgt-neg-in99.6%
mul-1-neg99.6%
unsub-neg99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 80.3%
neg-mul-180.3%
Simplified80.3%
if 5.0999999999999998e-154 < t < 6.50000000000000026e-62Initial program 99.0%
associate--l+99.0%
+-commutative99.0%
associate-+l+98.8%
+-commutative98.8%
fma-define98.9%
sub-neg98.9%
metadata-eval98.9%
Simplified98.9%
add-log-exp66.1%
+-commutative66.1%
exp-sum60.7%
fma-undefine60.6%
metadata-eval60.6%
sub-neg60.6%
exp-sum60.8%
add-exp-log61.0%
sub-neg61.0%
metadata-eval61.0%
*-commutative61.0%
exp-to-pow61.1%
exp-diff61.1%
add-exp-log61.6%
Applied egg-rr61.6%
associate-*l*64.1%
associate-*r/64.1%
*-commutative64.1%
+-commutative64.1%
Simplified64.1%
Taylor expanded in t around 0 61.2%
*-commutative61.2%
exp-to-pow61.6%
sub-neg61.6%
metadata-eval61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in a around 0 63.1%
associate-*r*65.8%
Simplified65.8%
Final simplification78.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= t 5.1e-154) (not (<= t 1.8e-87))) (- (* (log t) (- a 0.5)) t) (log (* (* y z) (pow t (+ a -0.5))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 5.1e-154) || !(t <= 1.8e-87)) {
tmp = (log(t) * (a - 0.5)) - t;
} else {
tmp = log(((y * z) * pow(t, (a + -0.5))));
}
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 <= 5.1d-154) .or. (.not. (t <= 1.8d-87))) then
tmp = (log(t) * (a - 0.5d0)) - t
else
tmp = log(((y * z) * (t ** (a + (-0.5d0)))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 5.1e-154) || !(t <= 1.8e-87)) {
tmp = (Math.log(t) * (a - 0.5)) - t;
} else {
tmp = Math.log(((y * z) * Math.pow(t, (a + -0.5))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= 5.1e-154) or not (t <= 1.8e-87): tmp = (math.log(t) * (a - 0.5)) - t else: tmp = math.log(((y * z) * math.pow(t, (a + -0.5)))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= 5.1e-154) || !(t <= 1.8e-87)) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) - t); else tmp = log(Float64(Float64(y * z) * (t ^ Float64(a + -0.5)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= 5.1e-154) || ~((t <= 1.8e-87))) tmp = (log(t) * (a - 0.5)) - t; else tmp = log(((y * z) * (t ^ (a + -0.5)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, 5.1e-154], N[Not[LessEqual[t, 1.8e-87]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[Log[N[(N[(y * z), $MachinePrecision] * N[Power[t, N[(a + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.1 \cdot 10^{-154} \lor \neg \left(t \leq 1.8 \cdot 10^{-87}\right):\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\left(y \cdot z\right) \cdot {t}^{\left(a + -0.5\right)}\right)\\
\end{array}
\end{array}
if t < 5.0999999999999998e-154 or 1.79999999999999996e-87 < t Initial program 99.5%
Taylor expanded in t around -inf 99.5%
mul-1-neg99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
unsub-neg99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in t around inf 78.8%
neg-mul-178.8%
Simplified78.8%
if 5.0999999999999998e-154 < t < 1.79999999999999996e-87Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+98.9%
+-commutative98.9%
fma-define99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
add-log-exp73.4%
+-commutative73.4%
exp-sum66.2%
fma-undefine66.1%
metadata-eval66.1%
sub-neg66.1%
exp-sum66.3%
add-exp-log66.4%
sub-neg66.4%
metadata-eval66.4%
*-commutative66.4%
exp-to-pow66.6%
exp-diff66.6%
add-exp-log66.9%
Applied egg-rr66.9%
associate-*l*73.9%
associate-*r/73.9%
*-commutative73.9%
+-commutative73.9%
Simplified73.9%
Taylor expanded in t around 0 66.6%
*-commutative66.6%
exp-to-pow66.9%
sub-neg66.9%
metadata-eval66.9%
+-commutative66.9%
Simplified66.9%
Taylor expanded in x around 0 36.3%
associate-*r*36.2%
*-commutative36.2%
exp-to-pow36.3%
sub-neg36.3%
metadata-eval36.3%
Simplified36.3%
Final simplification74.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t 4.3e-154) (not (<= t 1.4e-61))) (- (* (log t) (- a 0.5)) t) (log (* z (* y (pow t (+ a -0.5)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 4.3e-154) || !(t <= 1.4e-61)) {
tmp = (log(t) * (a - 0.5)) - t;
} else {
tmp = log((z * (y * pow(t, (a + -0.5)))));
}
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 <= 4.3d-154) .or. (.not. (t <= 1.4d-61))) then
tmp = (log(t) * (a - 0.5d0)) - t
else
tmp = log((z * (y * (t ** (a + (-0.5d0))))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 4.3e-154) || !(t <= 1.4e-61)) {
tmp = (Math.log(t) * (a - 0.5)) - t;
} else {
tmp = Math.log((z * (y * Math.pow(t, (a + -0.5)))));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= 4.3e-154) or not (t <= 1.4e-61): tmp = (math.log(t) * (a - 0.5)) - t else: tmp = math.log((z * (y * math.pow(t, (a + -0.5))))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= 4.3e-154) || !(t <= 1.4e-61)) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) - t); else tmp = log(Float64(z * Float64(y * (t ^ Float64(a + -0.5))))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= 4.3e-154) || ~((t <= 1.4e-61))) tmp = (log(t) * (a - 0.5)) - t; else tmp = log((z * (y * (t ^ (a + -0.5))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, 4.3e-154], N[Not[LessEqual[t, 1.4e-61]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[Log[N[(z * N[(y * N[Power[t, N[(a + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.3 \cdot 10^{-154} \lor \neg \left(t \leq 1.4 \cdot 10^{-61}\right):\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(z \cdot \left(y \cdot {t}^{\left(a + -0.5\right)}\right)\right)\\
\end{array}
\end{array}
if t < 4.29999999999999992e-154 or 1.4000000000000001e-61 < t Initial program 99.6%
Taylor expanded in t around -inf 99.6%
mul-1-neg99.6%
distribute-rgt-neg-in99.6%
mul-1-neg99.6%
unsub-neg99.6%
+-commutative99.6%
Simplified99.6%
Taylor expanded in t around inf 80.3%
neg-mul-180.3%
Simplified80.3%
if 4.29999999999999992e-154 < t < 1.4000000000000001e-61Initial program 99.0%
associate--l+99.0%
+-commutative99.0%
associate-+l+98.8%
+-commutative98.8%
fma-define98.9%
sub-neg98.9%
metadata-eval98.9%
Simplified98.9%
add-log-exp66.1%
+-commutative66.1%
exp-sum60.7%
fma-undefine60.6%
metadata-eval60.6%
sub-neg60.6%
exp-sum60.8%
add-exp-log61.0%
sub-neg61.0%
metadata-eval61.0%
*-commutative61.0%
exp-to-pow61.1%
exp-diff61.1%
add-exp-log61.6%
Applied egg-rr61.6%
associate-*l*64.1%
associate-*r/64.1%
*-commutative64.1%
+-commutative64.1%
Simplified64.1%
Taylor expanded in t around 0 61.2%
*-commutative61.2%
exp-to-pow61.6%
sub-neg61.6%
metadata-eval61.6%
+-commutative61.6%
Simplified61.6%
Taylor expanded in x around 0 33.9%
exp-to-pow34.2%
sub-neg34.2%
metadata-eval34.2%
Simplified34.2%
Final simplification74.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 8500000000000.0) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 8500000000000.0) {
tmp = log(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 <= 8500000000000.0d0) then
tmp = log(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 <= 8500000000000.0) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 8500000000000.0: tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 8500000000000.0) tmp = Float64(log(t) * a); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 8500000000000.0) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 8500000000000.0], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8500000000000:\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 8.5e12Initial program 99.2%
associate-+l-99.2%
associate--l+99.1%
sub-neg99.1%
+-commutative99.1%
*-commutative99.1%
distribute-rgt-neg-in99.1%
fma-undefine99.1%
sub-neg99.1%
+-commutative99.1%
distribute-neg-in99.1%
metadata-eval99.1%
metadata-eval99.1%
unsub-neg99.1%
Simplified99.1%
Taylor expanded in a around inf 43.7%
*-commutative43.7%
Simplified43.7%
if 8.5e12 < 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 80.5%
neg-mul-180.5%
Simplified80.5%
(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%
Taylor expanded in t around -inf 99.5%
mul-1-neg99.5%
distribute-rgt-neg-in99.5%
mul-1-neg99.5%
unsub-neg99.5%
+-commutative99.5%
Simplified99.5%
Taylor expanded in t around inf 73.8%
neg-mul-173.8%
Simplified73.8%
Final simplification73.8%
(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 40.6%
neg-mul-140.6%
Simplified40.6%
(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 2024186
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (+ (log (+ x y)) (+ (- (log z) t) (* (- a 1/2) (log t)))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))