
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (fma (+ a -0.5) (log t) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + fma((a + -0.5), log(t), (log(z) - t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + fma(Float64(a + -0.5), log(t), Float64(log(z) - t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \mathsf{fma}\left(a + -0.5, \log t, \log z - t\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.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(Float64(log(Float64(x + y)) + Float64(log(z) - t)) + Float64(Float64(a + -0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = (log((x + y)) + (log(z) - t)) + ((a + -0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.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(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 (if (<= t 3.5e-5) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (+ (log y) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.5e-5) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (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 <= 3.5d-5) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (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 <= 3.5e-5) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.5e-5: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(y) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.5e-5) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(y) + Float64(a * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.5e-5) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(y) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.5e-5], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.5 \cdot 10^{-5}:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 3.4999999999999997e-5Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 64.8%
Taylor expanded in t around 0 64.5%
if 3.4999999999999997e-5 < t Initial program 99.9%
associate--l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 71.5%
Taylor expanded in a around inf 71.0%
*-commutative71.0%
Simplified71.0%
Final simplification68.1%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) + (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(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.4%
Final simplification68.4%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(y) + (log(z) + (log(t) * (a - 0.5d0)))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\right) - t
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.4%
Final simplification68.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (* a (log t)))))
(if (<= a -6.2e+87)
t_1
(if (<= a -1.7e+56)
(- (log y) t)
(if (or (<= a -1.56) (not (<= a 3.1e+35)))
t_1
(- (+ (log z) (log y)) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y)) + (a * log(t));
double tmp;
if (a <= -6.2e+87) {
tmp = t_1;
} else if (a <= -1.7e+56) {
tmp = log(y) - t;
} else if ((a <= -1.56) || !(a <= 3.1e+35)) {
tmp = t_1;
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log((x + y)) + (a * log(t))
if (a <= (-6.2d+87)) then
tmp = t_1
else if (a <= (-1.7d+56)) then
tmp = log(y) - t
else if ((a <= (-1.56d0)) .or. (.not. (a <= 3.1d+35))) then
tmp = t_1
else
tmp = (log(z) + log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y)) + (a * Math.log(t));
double tmp;
if (a <= -6.2e+87) {
tmp = t_1;
} else if (a <= -1.7e+56) {
tmp = Math.log(y) - t;
} else if ((a <= -1.56) || !(a <= 3.1e+35)) {
tmp = t_1;
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + (a * math.log(t)) tmp = 0 if a <= -6.2e+87: tmp = t_1 elif a <= -1.7e+56: tmp = math.log(y) - t elif (a <= -1.56) or not (a <= 3.1e+35): tmp = t_1 else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(x + y)) + Float64(a * log(t))) tmp = 0.0 if (a <= -6.2e+87) tmp = t_1; elseif (a <= -1.7e+56) tmp = Float64(log(y) - t); elseif ((a <= -1.56) || !(a <= 3.1e+35)) tmp = t_1; else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + (a * log(t)); tmp = 0.0; if (a <= -6.2e+87) tmp = t_1; elseif (a <= -1.7e+56) tmp = log(y) - t; elseif ((a <= -1.56) || ~((a <= 3.1e+35))) tmp = t_1; else tmp = (log(z) + log(y)) - 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[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.2e+87], t$95$1, If[LessEqual[a, -1.7e+56], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[a, -1.56], N[Not[LessEqual[a, 3.1e+35]], $MachinePrecision]], t$95$1, N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + a \cdot \log t\\
\mathbf{if}\;a \leq -6.2 \cdot 10^{+87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -1.7 \cdot 10^{+56}:\\
\;\;\;\;\log y - t\\
\mathbf{elif}\;a \leq -1.56 \lor \neg \left(a \leq 3.1 \cdot 10^{+35}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -6.1999999999999999e87 or -1.7e56 < a < -1.5600000000000001 or 3.09999999999999987e35 < a Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 79.8%
*-commutative79.8%
Simplified79.8%
if -6.1999999999999999e87 < a < -1.7e56Initial program 100.0%
associate--l+100.0%
associate-+l+100.0%
+-commutative100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf 86.6%
mul-1-neg86.6%
Simplified86.6%
Taylor expanded in x around 0 71.6%
if -1.5600000000000001 < a < 3.09999999999999987e35Initial program 99.5%
associate--l+99.5%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 59.9%
*-commutative59.9%
sub-neg59.9%
metadata-eval59.9%
rem-cube-cbrt59.9%
+-commutative59.9%
*-commutative59.9%
+-commutative59.9%
Applied egg-rr59.9%
Taylor expanded in a around inf 40.0%
Final simplification59.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 960000000000.0) (+ (log (* z (+ x y))) (- (* (+ a -0.5) (log t)) t)) (- (+ (log y) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 960000000000.0) {
tmp = log((z * (x + y))) + (((a + -0.5) * log(t)) - t);
} else {
tmp = (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 <= 960000000000.0d0) then
tmp = log((z * (x + y))) + (((a + (-0.5d0)) * log(t)) - t)
else
tmp = (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 <= 960000000000.0) {
tmp = Math.log((z * (x + y))) + (((a + -0.5) * Math.log(t)) - t);
} else {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 960000000000.0: tmp = math.log((z * (x + y))) + (((a + -0.5) * math.log(t)) - t) else: tmp = (math.log(y) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 960000000000.0) tmp = Float64(log(Float64(z * Float64(x + y))) + Float64(Float64(Float64(a + -0.5) * log(t)) - t)); else tmp = Float64(Float64(log(y) + Float64(a * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 960000000000.0) tmp = log((z * (x + y))) + (((a + -0.5) * log(t)) - t); else tmp = (log(y) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 960000000000.0], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 960000000000:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + \left(\left(a + -0.5\right) \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 9.6e11Initial program 99.2%
associate--l+99.2%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
fma-udef99.4%
+-commutative99.4%
associate-+l+99.2%
associate-+r-99.2%
associate-+l-99.2%
sum-log74.0%
*-commutative74.0%
Applied egg-rr74.0%
if 9.6e11 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 72.5%
Taylor expanded in a around inf 72.5%
*-commutative72.5%
Simplified72.5%
Final simplification73.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 5.8e-28) (+ (* (+ a -0.5) (log t)) (log (* z (+ x y)))) (- (+ (log y) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 5.8e-28) {
tmp = ((a + -0.5) * log(t)) + log((z * (x + y)));
} else {
tmp = (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 <= 5.8d-28) then
tmp = ((a + (-0.5d0)) * log(t)) + log((z * (x + y)))
else
tmp = (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 <= 5.8e-28) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log((z * (x + y)));
} else {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 5.8e-28: tmp = ((a + -0.5) * math.log(t)) + math.log((z * (x + y))) else: tmp = (math.log(y) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 5.8e-28) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(z * Float64(x + y)))); else tmp = Float64(Float64(log(y) + Float64(a * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 5.8e-28) tmp = ((a + -0.5) * log(t)) + log((z * (x + y))); else tmp = (log(y) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 5.8e-28], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.8 \cdot 10^{-28}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(z \cdot \left(x + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 5.80000000000000026e-28Initial program 99.2%
associate--l+99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in t around 0 99.2%
log-prod74.8%
+-commutative74.8%
Simplified75.6%
if 5.80000000000000026e-28 < t Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 68.8%
Taylor expanded in a around inf 67.6%
*-commutative67.6%
Simplified67.6%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.7e-27) (+ (* (+ a -0.5) (log t)) (log (* y z))) (- (+ (log y) (* a (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.7e-27) {
tmp = ((a + -0.5) * log(t)) + log((y * z));
} else {
tmp = (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.7d-27) then
tmp = ((a + (-0.5d0)) * log(t)) + log((y * z))
else
tmp = (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.7e-27) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log((y * z));
} else {
tmp = (Math.log(y) + (a * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.7e-27: tmp = ((a + -0.5) * math.log(t)) + math.log((y * z)) else: tmp = (math.log(y) + (a * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.7e-27) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(y * z))); else tmp = Float64(Float64(log(y) + Float64(a * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.7e-27) tmp = ((a + -0.5) * log(t)) + log((y * z)); else tmp = (log(y) + (a * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.7e-27], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.7 \cdot 10^{-27}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + a \cdot \log t\right) - t\\
\end{array}
\end{array}
if t < 1.69999999999999985e-27Initial program 99.2%
associate--l+99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
add-cube-cbrt98.3%
pow398.3%
Applied egg-rr98.3%
Taylor expanded in t around 0 98.3%
log-prod74.8%
+-commutative74.8%
Simplified74.8%
Taylor expanded in y around inf 67.9%
+-commutative67.9%
+-commutative67.9%
mul-1-neg67.9%
log-rec67.9%
remove-double-neg67.9%
associate-+r+67.8%
log-prod46.5%
associate-*r*46.5%
pow-base-146.5%
*-lft-identity46.5%
sub-neg46.5%
metadata-eval46.5%
+-commutative46.5%
*-commutative46.5%
Simplified46.5%
if 1.69999999999999985e-27 < t Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 68.8%
Taylor expanded in a around inf 67.6%
*-commutative67.6%
Simplified67.6%
Final simplification59.0%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (* a (log t))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (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 = (log(y) + (a * log(t))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) + (a * Math.log(t))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (a * math.log(t))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(a * log(t))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (a * log(t))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + a \cdot \log t\right) - t
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.4%
Taylor expanded in a around inf 57.7%
*-commutative57.7%
Simplified57.7%
Final simplification57.7%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (log y)))
double code(double x, double y, double z, double t, double a) {
return (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(z) - t) + 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(y);
}
def code(x, y, z, t, a): return (math.log(z) - t) + math.log(y)
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + log(y)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + log(y); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \log y
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.4%
*-commutative68.4%
sub-neg68.4%
metadata-eval68.4%
rem-cube-cbrt68.0%
+-commutative68.0%
*-commutative68.0%
+-commutative68.0%
Applied egg-rr68.0%
Taylor expanded in a around inf 30.1%
associate--l+30.1%
+-commutative30.1%
Applied egg-rr30.1%
Final simplification30.1%
(FPCore (x y z t a) :precision binary64 (- (+ (log z) (log y)) t))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) - 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)) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + Math.log(y)) - t;
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) - t
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) - t
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.4%
*-commutative68.4%
sub-neg68.4%
metadata-eval68.4%
rem-cube-cbrt68.0%
+-commutative68.0%
*-commutative68.0%
+-commutative68.0%
Applied egg-rr68.0%
Taylor expanded in a around inf 30.1%
Final simplification30.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 480.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 480.0) {
tmp = log((x + y));
} 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 <= 480.0d0) then
tmp = log((x + y))
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 <= 480.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 480.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 480.0) tmp = log(Float64(x + y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 480.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 480.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 480:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 480Initial program 99.2%
associate--l+99.2%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in t around inf 8.9%
mul-1-neg8.9%
Simplified8.9%
Taylor expanded in t around 0 8.9%
+-commutative8.9%
Simplified8.9%
if 480 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 71.6%
mul-1-neg71.6%
Simplified71.6%
Taylor expanded in t around inf 71.5%
mul-1-neg71.5%
Simplified71.5%
Final simplification42.1%
(FPCore (x y z t a) :precision binary64 (- (log y) t))
double code(double x, double y, double z, double t, double a) {
return log(y) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log(y) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log(y) - t;
}
def code(x, y, z, t, a): return math.log(y) - t
function code(x, y, z, t, a) return Float64(log(y) - t) end
function tmp = code(x, y, z, t, a) tmp = log(y) - t; end
code[x_, y_, z_, t_, a_] := N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log y - t
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in t around inf 42.2%
mul-1-neg42.2%
Simplified42.2%
Taylor expanded in x around 0 29.2%
Final simplification29.2%
(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.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in t around inf 42.2%
mul-1-neg42.2%
Simplified42.2%
Taylor expanded in t around inf 39.3%
mul-1-neg39.3%
Simplified39.3%
Final simplification39.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 2023301
(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))))