
(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 17 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.5%
+-commutative99.5%
fma-def99.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 (<= (- a 0.5) -2e+48)
(* a (log t))
(if (<= (- a 0.5) 50000000.0)
(- (+ (log z) (+ (log (+ x y)) (* -0.5 (log t)))) t)
(- (+ (* (log t) (- a 0.5)) (log (* y z))) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -2e+48) {
tmp = a * log(t);
} else if ((a - 0.5) <= 50000000.0) {
tmp = (log(z) + (log((x + y)) + (-0.5 * log(t)))) - t;
} else {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a - 0.5d0) <= (-2d+48)) then
tmp = a * log(t)
else if ((a - 0.5d0) <= 50000000.0d0) then
tmp = (log(z) + (log((x + y)) + ((-0.5d0) * log(t)))) - t
else
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -2e+48) {
tmp = a * Math.log(t);
} else if ((a - 0.5) <= 50000000.0) {
tmp = (Math.log(z) + (Math.log((x + y)) + (-0.5 * Math.log(t)))) - t;
} else {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a - 0.5) <= -2e+48: tmp = a * math.log(t) elif (a - 0.5) <= 50000000.0: tmp = (math.log(z) + (math.log((x + y)) + (-0.5 * math.log(t)))) - t else: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a - 0.5) <= -2e+48) tmp = Float64(a * log(t)); elseif (Float64(a - 0.5) <= 50000000.0) tmp = Float64(Float64(log(z) + Float64(log(Float64(x + y)) + Float64(-0.5 * log(t)))) - t); else tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a - 0.5) <= -2e+48) tmp = a * log(t); elseif ((a - 0.5) <= 50000000.0) tmp = (log(z) + (log((x + y)) + (-0.5 * log(t)))) - t; else tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+48], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], 50000000.0], N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+48}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{elif}\;a - 0.5 \leq 50000000:\\
\;\;\;\;\left(\log z + \left(\log \left(x + y\right) + -0.5 \cdot \log t\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2.00000000000000009e48Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in a around inf 86.1%
*-commutative86.1%
Simplified86.1%
if -2.00000000000000009e48 < (-.f64 a 1/2) < 5e7Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in a around 0 97.8%
if 5e7 < (-.f64 a 1/2) Initial program 99.6%
+-commutative99.6%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
associate--l+99.7%
Simplified99.7%
Taylor expanded in x around 0 75.2%
Taylor expanded in z around inf 75.2%
mul-1-neg75.2%
log-rec75.2%
remove-double-neg75.2%
log-prod61.9%
Simplified61.9%
Final simplification88.4%
(FPCore (x y z t a)
:precision binary64
(if (<= (- a 0.5) -2e+48)
(* a (log t))
(if (<= (- a 0.5) 50000000.0)
(- (+ (log y) (log (* z (sqrt (/ 1.0 t))))) t)
(- (+ (* (log t) (- a 0.5)) (log (* y z))) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -2e+48) {
tmp = a * log(t);
} else if ((a - 0.5) <= 50000000.0) {
tmp = (log(y) + log((z * sqrt((1.0 / t))))) - t;
} else {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a - 0.5d0) <= (-2d+48)) then
tmp = a * log(t)
else if ((a - 0.5d0) <= 50000000.0d0) then
tmp = (log(y) + log((z * sqrt((1.0d0 / t))))) - t
else
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -2e+48) {
tmp = a * Math.log(t);
} else if ((a - 0.5) <= 50000000.0) {
tmp = (Math.log(y) + Math.log((z * Math.sqrt((1.0 / t))))) - t;
} else {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a - 0.5) <= -2e+48: tmp = a * math.log(t) elif (a - 0.5) <= 50000000.0: tmp = (math.log(y) + math.log((z * math.sqrt((1.0 / t))))) - t else: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a - 0.5) <= -2e+48) tmp = Float64(a * log(t)); elseif (Float64(a - 0.5) <= 50000000.0) tmp = Float64(Float64(log(y) + log(Float64(z * sqrt(Float64(1.0 / t))))) - t); else tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a - 0.5) <= -2e+48) tmp = a * log(t); elseif ((a - 0.5) <= 50000000.0) tmp = (log(y) + log((z * sqrt((1.0 / t))))) - t; else tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+48], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], 50000000.0], N[(N[(N[Log[y], $MachinePrecision] + N[Log[N[(z * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+48}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{elif}\;a - 0.5 \leq 50000000:\\
\;\;\;\;\left(\log y + \log \left(z \cdot \sqrt{\frac{1}{t}}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2.00000000000000009e48Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in a around inf 86.1%
*-commutative86.1%
Simplified86.1%
if -2.00000000000000009e48 < (-.f64 a 1/2) < 5e7Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in x around 0 66.9%
fma-udef66.8%
metadata-eval66.8%
sub-neg66.8%
associate--l+66.8%
sub-neg66.8%
metadata-eval66.8%
add-log-exp62.4%
sum-log42.4%
sum-log39.3%
*-commutative39.3%
exp-to-pow39.4%
Applied egg-rr39.4%
Taylor expanded in a around 0 42.5%
associate-*l*44.6%
Simplified44.6%
Taylor expanded in y around 0 58.0%
if 5e7 < (-.f64 a 1/2) Initial program 99.6%
+-commutative99.6%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
associate--l+99.7%
Simplified99.7%
Taylor expanded in x around 0 75.2%
Taylor expanded in z around inf 75.2%
mul-1-neg75.2%
log-rec75.2%
remove-double-neg75.2%
log-prod61.9%
Simplified61.9%
Final simplification64.8%
(FPCore (x y z t a)
:precision binary64
(if (<= (- a 0.5) -2e+48)
(* a (log t))
(if (<= (- a 0.5) 50000000.0)
(- (+ (log z) (+ (log y) (* -0.5 (log t)))) t)
(- (+ (* (log t) (- a 0.5)) (log (* y z))) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -2e+48) {
tmp = a * log(t);
} else if ((a - 0.5) <= 50000000.0) {
tmp = (log(z) + (log(y) + (-0.5 * log(t)))) - t;
} else {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a - 0.5d0) <= (-2d+48)) then
tmp = a * log(t)
else if ((a - 0.5d0) <= 50000000.0d0) then
tmp = (log(z) + (log(y) + ((-0.5d0) * log(t)))) - t
else
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -2e+48) {
tmp = a * Math.log(t);
} else if ((a - 0.5) <= 50000000.0) {
tmp = (Math.log(z) + (Math.log(y) + (-0.5 * Math.log(t)))) - t;
} else {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a - 0.5) <= -2e+48: tmp = a * math.log(t) elif (a - 0.5) <= 50000000.0: tmp = (math.log(z) + (math.log(y) + (-0.5 * math.log(t)))) - t else: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a - 0.5) <= -2e+48) tmp = Float64(a * log(t)); elseif (Float64(a - 0.5) <= 50000000.0) tmp = Float64(Float64(log(z) + Float64(log(y) + Float64(-0.5 * log(t)))) - t); else tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a - 0.5) <= -2e+48) tmp = a * log(t); elseif ((a - 0.5) <= 50000000.0) tmp = (log(z) + (log(y) + (-0.5 * log(t)))) - t; else tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+48], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], 50000000.0], N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+48}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{elif}\;a - 0.5 \leq 50000000:\\
\;\;\;\;\left(\log z + \left(\log y + -0.5 \cdot \log t\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2.00000000000000009e48Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in a around inf 86.1%
*-commutative86.1%
Simplified86.1%
if -2.00000000000000009e48 < (-.f64 a 1/2) < 5e7Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in x around 0 66.9%
Taylor expanded in a around 0 65.2%
if 5e7 < (-.f64 a 1/2) Initial program 99.6%
+-commutative99.6%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
associate--l+99.7%
Simplified99.7%
Taylor expanded in x around 0 75.2%
Taylor expanded in z around inf 75.2%
mul-1-neg75.2%
log-rec75.2%
remove-double-neg75.2%
log-prod61.9%
Simplified61.9%
Final simplification69.1%
(FPCore (x y z t a)
:precision binary64
(if (<= (- a 0.5) -2e+48)
(* a (log t))
(if (<= (- a 0.5) 50000000.0)
(- (+ (+ (log z) (log y)) (* -0.5 (log t))) t)
(- (+ (* (log t) (- a 0.5)) (log (* y z))) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -2e+48) {
tmp = a * log(t);
} else if ((a - 0.5) <= 50000000.0) {
tmp = ((log(z) + log(y)) + (-0.5 * log(t))) - t;
} else {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a - 0.5d0) <= (-2d+48)) then
tmp = a * log(t)
else if ((a - 0.5d0) <= 50000000.0d0) then
tmp = ((log(z) + log(y)) + ((-0.5d0) * log(t))) - t
else
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -2e+48) {
tmp = a * Math.log(t);
} else if ((a - 0.5) <= 50000000.0) {
tmp = ((Math.log(z) + Math.log(y)) + (-0.5 * Math.log(t))) - t;
} else {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a - 0.5) <= -2e+48: tmp = a * math.log(t) elif (a - 0.5) <= 50000000.0: tmp = ((math.log(z) + math.log(y)) + (-0.5 * math.log(t))) - t else: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a - 0.5) <= -2e+48) tmp = Float64(a * log(t)); elseif (Float64(a - 0.5) <= 50000000.0) tmp = Float64(Float64(Float64(log(z) + log(y)) + Float64(-0.5 * log(t))) - t); else tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a - 0.5) <= -2e+48) tmp = a * log(t); elseif ((a - 0.5) <= 50000000.0) tmp = ((log(z) + log(y)) + (-0.5 * log(t))) - t; else tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+48], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(a - 0.5), $MachinePrecision], 50000000.0], N[(N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+48}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{elif}\;a - 0.5 \leq 50000000:\\
\;\;\;\;\left(\left(\log z + \log y\right) + -0.5 \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2.00000000000000009e48Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in a around inf 86.1%
*-commutative86.1%
Simplified86.1%
if -2.00000000000000009e48 < (-.f64 a 1/2) < 5e7Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in x around 0 66.8%
Taylor expanded in a around 0 65.3%
if 5e7 < (-.f64 a 1/2) Initial program 99.6%
+-commutative99.6%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
associate--l+99.7%
Simplified99.7%
Taylor expanded in x around 0 75.2%
Taylor expanded in z around inf 75.2%
mul-1-neg75.2%
log-rec75.2%
remove-double-neg75.2%
log-prod61.9%
Simplified61.9%
Final simplification69.1%
(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.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (- (+ (* (log t) (- a 0.5)) (+ (log z) (log y))) t))
double code(double x, double y, double z, double t, double a) {
return ((log(t) * (a - 0.5)) + (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(t) * (a - 0.5d0)) + (log(z) + log(y))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log(t) * (a - 0.5)) + (Math.log(z) + Math.log(y))) - t;
}
def code(x, y, z, t, a): return ((math.log(t) * (a - 0.5)) + (math.log(z) + math.log(y))) - t
function code(x, y, z, t, a) return Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(z) + log(y))) - t) end
function tmp = code(x, y, z, t, a) tmp = ((log(t) * (a - 0.5)) + (log(z) + log(y))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log t \cdot \left(a - 0.5\right) + \left(\log z + \log y\right)\right) - t
\end{array}
Initial program 99.5%
+-commutative99.5%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
Simplified99.6%
Taylor expanded in x around 0 68.5%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (<= (- a 0.5) -5e+119) (* a (log t)) (+ (log (* (+ x y) z)) (- (* (+ a -0.5) (log t)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -5e+119) {
tmp = a * log(t);
} else {
tmp = log(((x + y) * z)) + (((a + -0.5) * 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 ((a - 0.5d0) <= (-5d+119)) then
tmp = a * log(t)
else
tmp = log(((x + y) * z)) + (((a + (-0.5d0)) * 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 ((a - 0.5) <= -5e+119) {
tmp = a * Math.log(t);
} else {
tmp = Math.log(((x + y) * z)) + (((a + -0.5) * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a - 0.5) <= -5e+119: tmp = a * math.log(t) else: tmp = math.log(((x + y) * z)) + (((a + -0.5) * math.log(t)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a - 0.5) <= -5e+119) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(Float64(a + -0.5) * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a - 0.5) <= -5e+119) tmp = a * log(t); else tmp = log(((x + y) * z)) + (((a + -0.5) * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+119], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+119}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\left(a + -0.5\right) \cdot \log t - t\right)\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -4.9999999999999999e119Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in a around inf 90.8%
*-commutative90.8%
Simplified90.8%
if -4.9999999999999999e119 < (-.f64 a 1/2) Initial program 99.5%
+-commutative99.5%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
Simplified99.6%
fma-udef99.5%
metadata-eval99.5%
sub-neg99.5%
+-commutative99.5%
associate-+r-99.5%
associate-+l-99.5%
sum-log73.5%
sub-neg73.5%
metadata-eval73.5%
Applied egg-rr73.5%
Final simplification76.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))) (t_2 (- (log (* y (* z (pow t -0.5)))) t)))
(if (<= a -5e+25)
t_1
(if (<= a 2.5e-290)
t_2
(if (<= a 5.6e-153)
(- (+ (log z) (log y)) t)
(if (<= a 8.2e+46) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double t_2 = log((y * (z * pow(t, -0.5)))) - t;
double tmp;
if (a <= -5e+25) {
tmp = t_1;
} else if (a <= 2.5e-290) {
tmp = t_2;
} else if (a <= 5.6e-153) {
tmp = (log(z) + log(y)) - t;
} else if (a <= 8.2e+46) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = a * log(t)
t_2 = log((y * (z * (t ** (-0.5d0))))) - t
if (a <= (-5d+25)) then
tmp = t_1
else if (a <= 2.5d-290) then
tmp = t_2
else if (a <= 5.6d-153) then
tmp = (log(z) + log(y)) - t
else if (a <= 8.2d+46) then
tmp = t_2
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 = a * Math.log(t);
double t_2 = Math.log((y * (z * Math.pow(t, -0.5)))) - t;
double tmp;
if (a <= -5e+25) {
tmp = t_1;
} else if (a <= 2.5e-290) {
tmp = t_2;
} else if (a <= 5.6e-153) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else if (a <= 8.2e+46) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) t_2 = math.log((y * (z * math.pow(t, -0.5)))) - t tmp = 0 if a <= -5e+25: tmp = t_1 elif a <= 2.5e-290: tmp = t_2 elif a <= 5.6e-153: tmp = (math.log(z) + math.log(y)) - t elif a <= 8.2e+46: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) t_2 = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t) tmp = 0.0 if (a <= -5e+25) tmp = t_1; elseif (a <= 2.5e-290) tmp = t_2; elseif (a <= 5.6e-153) tmp = Float64(Float64(log(z) + log(y)) - t); elseif (a <= 8.2e+46) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); t_2 = log((y * (z * (t ^ -0.5)))) - t; tmp = 0.0; if (a <= -5e+25) tmp = t_1; elseif (a <= 2.5e-290) tmp = t_2; elseif (a <= 5.6e-153) tmp = (log(z) + log(y)) - t; elseif (a <= 8.2e+46) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -5e+25], t$95$1, If[LessEqual[a, 2.5e-290], t$95$2, If[LessEqual[a, 5.6e-153], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 8.2e+46], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{if}\;a \leq -5 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-290}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{-153}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{elif}\;a \leq 8.2 \cdot 10^{+46}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -5.00000000000000024e25 or 8.19999999999999999e46 < a Initial program 99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
Simplified99.6%
Taylor expanded in a around inf 85.1%
*-commutative85.1%
Simplified85.1%
if -5.00000000000000024e25 < a < 2.5e-290 or 5.6000000000000001e-153 < a < 8.19999999999999999e46Initial program 99.4%
+-commutative99.4%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in x around 0 62.8%
fma-udef62.8%
metadata-eval62.8%
sub-neg62.8%
associate--l+62.8%
sub-neg62.8%
metadata-eval62.8%
add-log-exp56.6%
sum-log40.2%
sum-log37.4%
*-commutative37.4%
exp-to-pow37.4%
Applied egg-rr37.4%
Taylor expanded in a around 0 41.2%
associate-*l*42.4%
Simplified42.4%
Taylor expanded in z around 0 42.4%
*-commutative42.4%
unpow1/242.4%
exp-to-pow42.3%
log-rec42.3%
distribute-lft-neg-out42.3%
distribute-rgt-neg-in42.3%
metadata-eval42.3%
exp-to-pow42.4%
Simplified42.4%
if 2.5e-290 < a < 5.6000000000000001e-153Initial program 99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
Simplified99.8%
Taylor expanded in x around 0 75.8%
sub-neg75.8%
metadata-eval75.8%
add-cube-cbrt75.8%
pow375.8%
Applied egg-rr75.8%
Taylor expanded in a around inf 55.5%
Final simplification60.5%
(FPCore (x y z t a) :precision binary64 (if (<= (- a 0.5) -5e+119) (* a (log t)) (- (+ (* (log t) (- a 0.5)) (log (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -5e+119) {
tmp = a * log(t);
} else {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a - 0.5d0) <= (-5d+119)) then
tmp = a * log(t)
else
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a - 0.5) <= -5e+119) {
tmp = a * Math.log(t);
} else {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a - 0.5) <= -5e+119: tmp = a * math.log(t) else: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(a - 0.5) <= -5e+119) tmp = Float64(a * log(t)); else tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a - 0.5) <= -5e+119) tmp = a * log(t); else tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+119], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+119}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -4.9999999999999999e119Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in a around inf 90.8%
*-commutative90.8%
Simplified90.8%
if -4.9999999999999999e119 < (-.f64 a 1/2) Initial program 99.5%
+-commutative99.5%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
Simplified99.6%
Taylor expanded in x around 0 67.5%
Taylor expanded in z around inf 67.5%
mul-1-neg67.5%
log-rec67.5%
remove-double-neg67.5%
log-prod48.5%
Simplified48.5%
Final simplification55.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 72000.0) (+ (* (+ a -0.5) (log t)) (log (* (+ x y) z))) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 72000.0) {
tmp = ((a + -0.5) * log(t)) + log(((x + y) * z));
} 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) :: tmp
if (t <= 72000.0d0) then
tmp = ((a + (-0.5d0)) * log(t)) + log(((x + y) * z))
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 tmp;
if (t <= 72000.0) {
tmp = ((a + -0.5) * Math.log(t)) + Math.log(((x + y) * z));
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 72000.0: tmp = ((a + -0.5) * math.log(t)) + math.log(((x + y) * z)) else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 72000.0) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(Float64(x + y) * z))); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 72000.0) tmp = ((a + -0.5) * log(t)) + log(((x + y) * z)); else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 72000.0], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 72000:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \log \left(\left(x + y\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if t < 72000Initial program 99.2%
associate--l+99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in t around 0 97.4%
+-commutative97.4%
log-prod74.6%
+-commutative74.6%
Simplified74.6%
if 72000 < t Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 76.1%
sub-neg76.1%
metadata-eval76.1%
add-cube-cbrt75.9%
pow375.9%
Applied egg-rr75.9%
Taylor expanded in a around inf 57.8%
Final simplification66.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 7500.0) (+ (* (log t) (- a 0.5)) (log (* y z))) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 7500.0) {
tmp = (log(t) * (a - 0.5)) + log((y * z));
} 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) :: tmp
if (t <= 7500.0d0) then
tmp = (log(t) * (a - 0.5d0)) + log((y * z))
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 tmp;
if (t <= 7500.0) {
tmp = (Math.log(t) * (a - 0.5)) + Math.log((y * z));
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 7500.0: tmp = (math.log(t) * (a - 0.5)) + math.log((y * z)) else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 7500.0) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 7500.0) tmp = (log(t) * (a - 0.5)) + log((y * z)); else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 7500.0], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7500:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if t < 7500Initial program 99.2%
+-commutative99.2%
fma-def99.2%
sub-neg99.2%
metadata-eval99.2%
associate--l+99.2%
Simplified99.2%
fma-udef99.2%
+-commutative99.2%
add-sqr-sqrt63.2%
pow263.2%
+-commutative63.2%
fma-udef63.2%
associate-+r-63.2%
sum-log44.0%
Applied egg-rr44.0%
Taylor expanded in x around 0 25.6%
Taylor expanded in t around 0 43.7%
if 7500 < t Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in x around 0 76.1%
sub-neg76.1%
metadata-eval76.1%
add-cube-cbrt75.9%
pow375.9%
Applied egg-rr75.9%
Taylor expanded in a around inf 57.8%
Final simplification50.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.5e+45) (not (<= a 2.45e+47))) (* a (log t)) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.5e+45) || !(a <= 2.45e+47)) {
tmp = a * log(t);
} 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) :: tmp
if ((a <= (-1.5d+45)) .or. (.not. (a <= 2.45d+47))) then
tmp = a * log(t)
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 tmp;
if ((a <= -1.5e+45) || !(a <= 2.45e+47)) {
tmp = a * Math.log(t);
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.5e+45) or not (a <= 2.45e+47): tmp = a * math.log(t) else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.5e+45) || !(a <= 2.45e+47)) tmp = Float64(a * log(t)); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.5e+45) || ~((a <= 2.45e+47))) tmp = a * log(t); else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.5e+45], N[Not[LessEqual[a, 2.45e+47]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{+45} \lor \neg \left(a \leq 2.45 \cdot 10^{+47}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -1.50000000000000005e45 or 2.4500000000000001e47 < a Initial program 99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
Simplified99.6%
Taylor expanded in a around inf 85.8%
*-commutative85.8%
Simplified85.8%
if -1.50000000000000005e45 < a < 2.4500000000000001e47Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in x around 0 65.8%
sub-neg65.8%
metadata-eval65.8%
add-cube-cbrt65.6%
pow365.6%
Applied egg-rr65.6%
Taylor expanded in a around inf 45.7%
Final simplification60.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.2e+26) (not (<= a 1.56e+47))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.2e+26) || !(a <= 1.56e+47)) {
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 ((a <= (-3.2d+26)) .or. (.not. (a <= 1.56d+47))) 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 ((a <= -3.2e+26) || !(a <= 1.56e+47)) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.2e+26) or not (a <= 1.56e+47): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.2e+26) || !(a <= 1.56e+47)) 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 ((a <= -3.2e+26) || ~((a <= 1.56e+47))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.2e+26], N[Not[LessEqual[a, 1.56e+47]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.2 \cdot 10^{+26} \lor \neg \left(a \leq 1.56 \cdot 10^{+47}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -3.20000000000000029e26 or 1.55999999999999998e47 < a Initial program 99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
Simplified99.6%
Taylor expanded in a around inf 85.1%
*-commutative85.1%
Simplified85.1%
if -3.20000000000000029e26 < a < 1.55999999999999998e47Initial program 99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
Simplified99.5%
Taylor expanded in t around inf 52.4%
neg-mul-152.4%
Simplified52.4%
Final simplification65.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 380.0) (log (* y z)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 380.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 <= 380.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 <= 380.0) {
tmp = Math.log((y * z));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 380.0: tmp = math.log((y * z)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 380.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 <= 380.0) tmp = log((y * z)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 380.0], N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 380:\\
\;\;\;\;\log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 380Initial program 99.2%
+-commutative99.2%
fma-def99.2%
sub-neg99.2%
metadata-eval99.2%
associate--l+99.2%
Simplified99.2%
Taylor expanded in x around 0 60.7%
sub-neg60.7%
metadata-eval60.7%
add-cube-cbrt60.2%
pow360.2%
Applied egg-rr60.2%
Taylor expanded in a around inf 8.4%
log-prod5.6%
Simplified5.6%
Taylor expanded in t around 0 5.5%
if 380 < t Initial program 99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
Simplified99.9%
Taylor expanded in t around inf 73.7%
neg-mul-173.7%
Simplified73.7%
Final simplification39.3%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.5%
+-commutative99.5%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
Simplified99.6%
Taylor expanded in t around inf 38.1%
neg-mul-138.1%
Simplified38.1%
Final simplification38.1%
(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 2023195
(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))))