
(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 12 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 (fma (+ a -0.5) (log t) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
return fma((a + -0.5), log(t), (log((x + y)) + (log(z) - t)));
}
function code(x, y, z, t, a) return fma(Float64(a + -0.5), log(t), Float64(log(Float64(x + y)) + Float64(log(z) - t))) end
code[x_, y_, z_, t_, a_] := N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, \log t, \log \left(x + y\right) + \left(\log z - t\right)\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.3e-9) (+ (log z) (- (log (+ x y)) (* (log t) (- 0.5 a)))) (+ (+ (log z) (log y)) (- (* a (log t)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.3e-9) {
tmp = log(z) + (log((x + y)) - (log(t) * (0.5 - a)));
} else {
tmp = (log(z) + log(y)) + ((a * log(t)) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.3d-9) then
tmp = log(z) + (log((x + y)) - (log(t) * (0.5d0 - a)))
else
tmp = (log(z) + log(y)) + ((a * log(t)) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.3e-9) {
tmp = Math.log(z) + (Math.log((x + y)) - (Math.log(t) * (0.5 - a)));
} else {
tmp = (Math.log(z) + Math.log(y)) + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.3e-9: tmp = math.log(z) + (math.log((x + y)) - (math.log(t) * (0.5 - a))) else: tmp = (math.log(z) + math.log(y)) + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.3e-9) tmp = Float64(log(z) + Float64(log(Float64(x + y)) - Float64(log(t) * Float64(0.5 - a)))); else tmp = Float64(Float64(log(z) + log(y)) + Float64(Float64(a * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.3e-9) tmp = log(z) + (log((x + y)) - (log(t) * (0.5 - a))); else tmp = (log(z) + log(y)) + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.3e-9], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.3 \cdot 10^{-9}:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) - \log t \cdot \left(0.5 - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 1.3000000000000001e-9Initial program 99.2%
Taylor expanded in t around 0 99.0%
if 1.3000000000000001e-9 < 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 x around 0 74.7%
Taylor expanded in a around inf 74.6%
associate-*r*74.6%
mul-1-neg74.6%
Simplified74.6%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.3e-9) (+ (+ (log z) (log y)) (* (log t) (- a 0.5))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.3e-9) {
tmp = (log(z) + log(y)) + (log(t) * (a - 0.5));
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.3d-9) then
tmp = (log(z) + log(y)) + (log(t) * (a - 0.5d0))
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.3e-9) {
tmp = (Math.log(z) + Math.log(y)) + (Math.log(t) * (a - 0.5));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.3e-9: tmp = (math.log(z) + math.log(y)) + (math.log(t) * (a - 0.5)) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.3e-9) tmp = Float64(Float64(log(z) + log(y)) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.3e-9) tmp = (log(z) + log(y)) + (log(t) * (a - 0.5)); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.3e-9], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.3 \cdot 10^{-9}:\\
\;\;\;\;\left(\log z + \log y\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 1.3000000000000001e-9Initial 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 x around 0 60.6%
Taylor expanded in t around 0 60.5%
if 1.3000000000000001e-9 < t Initial program 99.9%
Taylor expanded in x around 0 74.7%
Taylor expanded in a around inf 99.1%
*-commutative99.1%
Simplified99.1%
Final simplification80.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log z) (log y))))
(if (<= t 1.3e-9)
(+ t_1 (* (log t) (- a 0.5)))
(+ t_1 (- (* a (log t)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) + log(y);
double tmp;
if (t <= 1.3e-9) {
tmp = t_1 + (log(t) * (a - 0.5));
} else {
tmp = t_1 + ((a * log(t)) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(z) + log(y)
if (t <= 1.3d-9) then
tmp = t_1 + (log(t) * (a - 0.5d0))
else
tmp = t_1 + ((a * log(t)) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(z) + Math.log(y);
double tmp;
if (t <= 1.3e-9) {
tmp = t_1 + (Math.log(t) * (a - 0.5));
} else {
tmp = t_1 + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) + math.log(y) tmp = 0 if t <= 1.3e-9: tmp = t_1 + (math.log(t) * (a - 0.5)) else: tmp = t_1 + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) + log(y)) tmp = 0.0 if (t <= 1.3e-9) tmp = Float64(t_1 + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(t_1 + Float64(Float64(a * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) + log(y); tmp = 0.0; if (t <= 1.3e-9) tmp = t_1 + (log(t) * (a - 0.5)); else tmp = t_1 + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.3e-9], N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z + \log y\\
\mathbf{if}\;t \leq 1.3 \cdot 10^{-9}:\\
\;\;\;\;t\_1 + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 1.3000000000000001e-9Initial 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 x around 0 60.6%
Taylor expanded in t around 0 60.5%
if 1.3000000000000001e-9 < 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 x around 0 74.7%
Taylor expanded in a around inf 74.6%
associate-*r*74.6%
mul-1-neg74.6%
Simplified74.6%
Final simplification67.8%
(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.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (log y)) (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) + ((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(z) + log(y)) + ((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(z) + Math.log(y)) + ((Math.log(t) * (a - 0.5)) - t);
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) + ((math.log(t) * (a - 0.5)) - t)
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
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 x around 0 67.9%
Final simplification67.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= t 8.8e-275)
(log (/ (* y z) (pow t (- 0.5 a))))
(if (<= t 2.3e-251)
t_1
(if (<= t 9e-168)
(+ (log (* (+ x y) z)) (* -0.5 (log t)))
(- t_1 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (t <= 8.8e-275) {
tmp = log(((y * z) / pow(t, (0.5 - a))));
} else if (t <= 2.3e-251) {
tmp = t_1;
} else if (t <= 9e-168) {
tmp = log(((x + y) * z)) + (-0.5 * log(t));
} 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 = a * log(t)
if (t <= 8.8d-275) then
tmp = log(((y * z) / (t ** (0.5d0 - a))))
else if (t <= 2.3d-251) then
tmp = t_1
else if (t <= 9d-168) then
tmp = log(((x + y) * z)) + ((-0.5d0) * log(t))
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (t <= 8.8e-275) {
tmp = Math.log(((y * z) / Math.pow(t, (0.5 - a))));
} else if (t <= 2.3e-251) {
tmp = t_1;
} else if (t <= 9e-168) {
tmp = Math.log(((x + y) * z)) + (-0.5 * Math.log(t));
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if t <= 8.8e-275: tmp = math.log(((y * z) / math.pow(t, (0.5 - a)))) elif t <= 2.3e-251: tmp = t_1 elif t <= 9e-168: tmp = math.log(((x + y) * z)) + (-0.5 * math.log(t)) else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (t <= 8.8e-275) tmp = log(Float64(Float64(y * z) / (t ^ Float64(0.5 - a)))); elseif (t <= 2.3e-251) tmp = t_1; elseif (t <= 9e-168) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(-0.5 * log(t))); else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (t <= 8.8e-275) tmp = log(((y * z) / (t ^ (0.5 - a)))); elseif (t <= 2.3e-251) tmp = t_1; elseif (t <= 9e-168) tmp = log(((x + y) * z)) + (-0.5 * log(t)); else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 8.8e-275], N[Log[N[(N[(y * z), $MachinePrecision] / N[Power[t, N[(0.5 - a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 2.3e-251], t$95$1, If[LessEqual[t, 9e-168], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;t \leq 8.8 \cdot 10^{-275}:\\
\;\;\;\;\log \left(\frac{y \cdot z}{{t}^{\left(0.5 - a\right)}}\right)\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-251}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-168}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + -0.5 \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < 8.79999999999999955e-275Initial program 98.0%
associate-+l-98.0%
associate--l+98.0%
sub-neg98.0%
+-commutative98.0%
*-commutative98.0%
distribute-rgt-neg-in98.0%
fma-undefine98.0%
sub-neg98.0%
+-commutative98.0%
distribute-neg-in98.0%
metadata-eval98.0%
metadata-eval98.0%
unsub-neg98.0%
Simplified98.0%
add-log-exp63.6%
sum-log54.9%
exp-diff54.9%
add-exp-log55.0%
Applied egg-rr55.0%
Taylor expanded in t around 0 55.0%
exp-to-pow56.4%
Simplified56.4%
Taylor expanded in x around 0 39.2%
*-commutative39.2%
exp-to-pow39.7%
Simplified39.7%
if 8.79999999999999955e-275 < t < 2.30000000000000017e-251Initial program 99.5%
associate-+l-99.5%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in a around inf 68.9%
*-commutative68.9%
Simplified68.9%
if 2.30000000000000017e-251 < t < 9.0000000000000002e-168Initial program 99.3%
Taylor expanded in t around 0 99.1%
associate-+r+99.3%
sub-neg99.3%
metadata-eval99.3%
+-commutative99.3%
log-prod75.1%
+-commutative75.1%
fma-define75.1%
*-commutative75.1%
+-commutative75.1%
Simplified75.1%
Taylor expanded in a around 0 54.6%
+-commutative54.6%
*-commutative54.6%
+-commutative54.6%
Simplified54.6%
if 9.0000000000000002e-168 < t Initial program 99.8%
Taylor expanded in x around 0 70.4%
Taylor expanded in a around inf 86.3%
*-commutative86.3%
Simplified86.3%
Final simplification78.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 1e-44) (+ (log (* (+ x y) z)) (* (log t) (- a 0.5))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1e-44) {
tmp = log(((x + y) * z)) + (log(t) * (a - 0.5));
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1d-44) then
tmp = log(((x + y) * z)) + (log(t) * (a - 0.5d0))
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1e-44) {
tmp = Math.log(((x + y) * z)) + (Math.log(t) * (a - 0.5));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1e-44: tmp = math.log(((x + y) * z)) + (math.log(t) * (a - 0.5)) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1e-44) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1e-44) tmp = log(((x + y) * z)) + (log(t) * (a - 0.5)); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1e-44], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-44}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 9.99999999999999953e-45Initial 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 t around 0 99.2%
log-prod76.4%
+-commutative76.4%
Simplified76.4%
if 9.99999999999999953e-45 < t Initial program 99.9%
Taylor expanded in x around 0 72.7%
Taylor expanded in a around inf 96.4%
*-commutative96.4%
Simplified96.4%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 1e-44) (+ (log (* y z)) (* (log t) (- a 0.5))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1e-44) {
tmp = log((y * z)) + (log(t) * (a - 0.5));
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1d-44) then
tmp = log((y * z)) + (log(t) * (a - 0.5d0))
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1e-44) {
tmp = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1e-44: tmp = math.log((y * z)) + (math.log(t) * (a - 0.5)) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1e-44) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1e-44) tmp = log((y * z)) + (log(t) * (a - 0.5)); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1e-44], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 10^{-44}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 9.99999999999999953e-45Initial 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 x around 0 61.8%
Taylor expanded in t around 0 61.8%
log-prod44.4%
*-commutative44.4%
Simplified44.4%
if 9.99999999999999953e-45 < t Initial program 99.9%
Taylor expanded in x around 0 72.7%
Taylor expanded in a around inf 96.4%
*-commutative96.4%
Simplified96.4%
Final simplification73.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 7.2e+26) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 7.2e+26) {
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 <= 7.2d+26) 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 <= 7.2e+26) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 7.2e+26: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 7.2e+26) 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 <= 7.2e+26) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 7.2e+26], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.2 \cdot 10^{+26}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 7.20000000000000048e26Initial program 99.3%
associate-+l-99.3%
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 50.1%
*-commutative50.1%
Simplified50.1%
if 7.20000000000000048e26 < 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 82.7%
neg-mul-182.7%
Simplified82.7%
Final simplification65.3%
(FPCore (x y z t a) :precision binary64 (- (* a (log t)) t))
double code(double x, double y, double z, double t, double a) {
return (a * log(t)) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (a * log(t)) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * Math.log(t)) - t;
}
def code(x, y, z, t, a): return (a * math.log(t)) - t
function code(x, y, z, t, a) return Float64(Float64(a * log(t)) - t) end
function tmp = code(x, y, z, t, a) tmp = (a * log(t)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \log t - t
\end{array}
Initial program 99.6%
Taylor expanded in x around 0 67.9%
Taylor expanded in a around inf 74.1%
*-commutative74.1%
Simplified74.1%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.6%
associate-+l-99.6%
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.7%
neg-mul-140.7%
Simplified40.7%
Final simplification40.7%
(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 2024039
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))