
(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 19 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}
(FPCore (x y z t a)
:precision binary64
(if (<= (- a 0.5) -2e+19)
(- (* (log t) a) t)
(if (<= (- a 0.5) -0.4)
(- (+ (log y) (+ (log z) (* (log t) -0.5))) t)
(fma (+ a -0.5) (log t) (- t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -2e+19) {
tmp = (log(t) * a) - t;
} else if ((a - 0.5) <= -0.4) {
tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t;
} else {
tmp = fma((a + -0.5), log(t), -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a - 0.5) <= -2e+19) tmp = Float64(Float64(log(t) * a) - t); elseif (Float64(a - 0.5) <= -0.4) tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * -0.5))) - t); else tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+19], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+19}:\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{elif}\;a - 0.5 \leq -0.4:\\
\;\;\;\;\left(\log y + \left(\log z + \log t \cdot -0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t 410.0) (+ (log z) (+ (log (+ x y)) (* (log t) (- a 0.5)))) (fma (+ a -0.5) (log t) (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 410.0) {
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5)));
} else {
tmp = fma((a + -0.5), log(t), -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 410.0) tmp = Float64(log(z) + Float64(log(Float64(x + y)) + Float64(log(t) * Float64(a - 0.5)))); else tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 410.0], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 410:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (+ (log (+ x y)) (- (log z) t)) (* (log t) (+ a -0.5))))
double code(double x, double y, double z, double t, double a) {
return (log((x + y)) + (log(z) - t)) + (log(t) * (a + -0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log((x + y)) + (log(z) - t)) + (log(t) * (a + (-0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log((x + y)) + (Math.log(z) - t)) + (Math.log(t) * (a + -0.5));
}
def code(x, y, z, t, a): return (math.log((x + y)) + (math.log(z) - t)) + (math.log(t) * (a + -0.5))
function code(x, y, z, t, a) return Float64(Float64(log(Float64(x + y)) + Float64(log(z) - t)) + Float64(log(t) * Float64(a + -0.5))) end
function tmp = code(x, y, z, t, a) tmp = (log((x + y)) + (log(z) - t)) + (log(t) * (a + -0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \log t \cdot \left(a + -0.5\right)
\end{array}
(FPCore (x y z t a)
:precision binary64
(if (<= a -1200000000.0)
(- (* (log t) a) t)
(if (<= a 0.0018)
(- (+ (log y) (log (* z (pow t -0.5)))) t)
(fma (+ a -0.5) (log t) (- t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1200000000.0) {
tmp = (log(t) * a) - t;
} else if (a <= 0.0018) {
tmp = (log(y) + log((z * pow(t, -0.5)))) - t;
} else {
tmp = fma((a + -0.5), log(t), -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -1200000000.0) tmp = Float64(Float64(log(t) * a) - t); elseif (a <= 0.0018) tmp = Float64(Float64(log(y) + log(Float64(z * (t ^ -0.5)))) - t); else tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1200000000.0], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 0.0018], N[(N[(N[Log[y], $MachinePrecision] + N[Log[N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1200000000:\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{elif}\;a \leq 0.0018:\\
\;\;\;\;\left(\log y + \log \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\end{array}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))))
(if (<= t 4.2e-215)
(+ (log (* (+ x y) z)) t_1)
(if (<= t 2.7e-182)
(+ (log z) (+ (log y) (* (log t) -0.5)))
(if (<= t 2900.0)
(- (+ (log (* y z)) t_1) t)
(fma (+ a -0.5) (log t) (- 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 <= 4.2e-215) {
tmp = log(((x + y) * z)) + t_1;
} else if (t <= 2.7e-182) {
tmp = log(z) + (log(y) + (log(t) * -0.5));
} else if (t <= 2900.0) {
tmp = (log((y * z)) + t_1) - t;
} else {
tmp = fma((a + -0.5), log(t), -t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) tmp = 0.0 if (t <= 4.2e-215) tmp = Float64(log(Float64(Float64(x + y) * z)) + t_1); elseif (t <= 2.7e-182) tmp = Float64(log(z) + Float64(log(y) + Float64(log(t) * -0.5))); elseif (t <= 2900.0) tmp = Float64(Float64(log(Float64(y * z)) + t_1) - t); else tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); end return 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, 4.2e-215], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 2.7e-182], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2900.0], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 4.2 \cdot 10^{-215}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + t_1\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-182}:\\
\;\;\;\;\log z + \left(\log y + \log t \cdot -0.5\right)\\
\mathbf{elif}\;t \leq 2900:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + t_1\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\end{array}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))))
(if (<= t 1.4e-214)
(+ (log (* (+ x y) z)) t_1)
(if (<= t 6e-182)
(- (+ (log z) (log y)) (* (log t) 0.5))
(if (<= t 2500.0)
(- (+ (log (* y z)) t_1) t)
(fma (+ a -0.5) (log t) (- 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 <= 1.4e-214) {
tmp = log(((x + y) * z)) + t_1;
} else if (t <= 6e-182) {
tmp = (log(z) + log(y)) - (log(t) * 0.5);
} else if (t <= 2500.0) {
tmp = (log((y * z)) + t_1) - t;
} else {
tmp = fma((a + -0.5), log(t), -t);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) tmp = 0.0 if (t <= 1.4e-214) tmp = Float64(log(Float64(Float64(x + y) * z)) + t_1); elseif (t <= 6e-182) tmp = Float64(Float64(log(z) + log(y)) - Float64(log(t) * 0.5)); elseif (t <= 2500.0) tmp = Float64(Float64(log(Float64(y * z)) + t_1) - t); else tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); end return 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, 1.4e-214], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 6e-182], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2500.0], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 1.4 \cdot 10^{-214}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + t_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-182}:\\
\;\;\;\;\left(\log z + \log y\right) - \log t \cdot 0.5\\
\mathbf{elif}\;t \leq 2500:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + t_1\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\end{array}
\end{array}
(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}
(FPCore (x y z t a) :precision binary64 (if (<= t 2900.0) (- (+ (log (* (+ x y) z)) (* (log t) (- a 0.5))) t) (fma (+ a -0.5) (log t) (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2900.0) {
tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5))) - t;
} else {
tmp = fma((a + -0.5), log(t), -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2900.0) tmp = Float64(Float64(log(Float64(Float64(x + y) * z)) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2900.0], N[(N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2900:\\
\;\;\;\;\left(\log \left(\left(x + y\right) \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t 3.0) (+ (log (* (+ x y) z)) (* (log t) (- a 0.5))) (fma (+ a -0.5) (log t) (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.0) {
tmp = log(((x + y) * z)) + (log(t) * (a - 0.5));
} else {
tmp = fma((a + -0.5), log(t), -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.0) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(log(t) * Float64(a - 0.5))); else tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.0], 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 + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t 2700.0) (- (+ (* (log t) (- a 0.5)) (log (* y z))) t) (fma (+ a -0.5) (log t) (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2700.0) {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
} else {
tmp = fma((a + -0.5), log(t), -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2700.0) tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); else tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2700.0], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2700:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1e-30) (not (<= a 1.08e-16))) (fma (+ a -0.5) (log t) (- t)) (- (log (* y (* z (pow t -0.5)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1e-30) || !(a <= 1.08e-16)) {
tmp = fma((a + -0.5), log(t), -t);
} else {
tmp = log((y * (z * pow(t, -0.5)))) - t;
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1e-30) || !(a <= 1.08e-16)) tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); else tmp = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1e-30], N[Not[LessEqual[a, 1.08e-16]], $MachinePrecision]], N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision], N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{-30} \lor \neg \left(a \leq 1.08 \cdot 10^{-16}\right):\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\end{array}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* (log t) a) t)))
(if (<= a -1200000000.0)
t_1
(if (<= a 5.8e-52)
(- (+ (log z) (log y)) t)
(if (<= a 1.05e-22) (log (/ y (/ (sqrt t) z))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (log(t) * a) - t;
double tmp;
if (a <= -1200000000.0) {
tmp = t_1;
} else if (a <= 5.8e-52) {
tmp = (log(z) + log(y)) - t;
} else if (a <= 1.05e-22) {
tmp = log((y / (sqrt(t) / z)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (log(t) * a) - t
if (a <= (-1200000000.0d0)) then
tmp = t_1
else if (a <= 5.8d-52) then
tmp = (log(z) + log(y)) - t
else if (a <= 1.05d-22) then
tmp = log((y / (sqrt(t) / z)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (Math.log(t) * a) - t;
double tmp;
if (a <= -1200000000.0) {
tmp = t_1;
} else if (a <= 5.8e-52) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else if (a <= 1.05e-22) {
tmp = Math.log((y / (Math.sqrt(t) / z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (math.log(t) * a) - t tmp = 0 if a <= -1200000000.0: tmp = t_1 elif a <= 5.8e-52: tmp = (math.log(z) + math.log(y)) - t elif a <= 1.05e-22: tmp = math.log((y / (math.sqrt(t) / z))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(log(t) * a) - t) tmp = 0.0 if (a <= -1200000000.0) tmp = t_1; elseif (a <= 5.8e-52) tmp = Float64(Float64(log(z) + log(y)) - t); elseif (a <= 1.05e-22) tmp = log(Float64(y / Float64(sqrt(t) / z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (log(t) * a) - t; tmp = 0.0; if (a <= -1200000000.0) tmp = t_1; elseif (a <= 5.8e-52) tmp = (log(z) + log(y)) - t; elseif (a <= 1.05e-22) tmp = log((y / (sqrt(t) / z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -1200000000.0], t$95$1, If[LessEqual[a, 5.8e-52], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 1.05e-22], N[Log[N[(y / N[(N[Sqrt[t], $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a - t\\
\mathbf{if}\;a \leq -1200000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 5.8 \cdot 10^{-52}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{-22}:\\
\;\;\;\;\log \left(\frac{y}{\frac{\sqrt{t}}{z}}\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t 9.2e-5) (+ (* (log t) (- a 0.5)) (log (* y z))) (fma (+ a -0.5) (log t) (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 9.2e-5) {
tmp = (log(t) * (a - 0.5)) + log((y * z));
} else {
tmp = fma((a + -0.5), log(t), -t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (t <= 9.2e-5) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))); else tmp = fma(Float64(a + -0.5), log(t), Float64(-t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 9.2e-5], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9.2 \cdot 10^{-5}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a + -0.5, \log t, -t\right)\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (fma (+ a -0.5) (log t) (- t)))
double code(double x, double y, double z, double t, double a) {
return fma((a + -0.5), log(t), -t);
}
function code(x, y, z, t, a) return fma(Float64(a + -0.5), log(t), Float64(-t)) end
code[x_, y_, z_, t_, a_] := N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + (-t)), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, \log t, -t\right)
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.5e+33) (not (<= a 7.2e+37))) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.5e+33) || !(a <= 7.2e+37)) {
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 ((a <= (-6.5d+33)) .or. (.not. (a <= 7.2d+37))) 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 ((a <= -6.5e+33) || !(a <= 7.2e+37)) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.5e+33) or not (a <= 7.2e+37): tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.5e+33) || !(a <= 7.2e+37)) 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 ((a <= -6.5e+33) || ~((a <= 7.2e+37))) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.5e+33], N[Not[LessEqual[a, 7.2e+37]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+33} \lor \neg \left(a \leq 7.2 \cdot 10^{+37}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (<= t 350.0) (log (* y z)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 350.0) {
tmp = log((y * z));
} 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 <= 350.0d0) then
tmp = log((y * z))
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 <= 350.0) {
tmp = Math.log((y * z));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 350.0: tmp = math.log((y * z)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 350.0) tmp = log(Float64(y * z)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 350.0) tmp = log((y * z)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 350.0], N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 350:\\
\;\;\;\;\log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
(FPCore (x y z t a) :precision binary64 (- (* (log t) a) t))
double code(double x, double y, double z, double t, double a) {
return (log(t) * a) - 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) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(t) * a) - t;
}
def code(x, y, z, t, a): return (math.log(t) * a) - t
function code(x, y, z, t, a) return Float64(Float64(log(t) * a) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(t) * a) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log t \cdot a - t
\end{array}
(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}
(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 2023350
(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))))