
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (- (log z) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9.5e-42) (not (<= a 3.2e-17))) (- (* (log t) a) t) (- (+ (log y) (log (* z (pow t -0.5)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.5e-42) || !(a <= 3.2e-17)) {
tmp = (log(t) * a) - t;
} else {
tmp = (log(y) + log((z * pow(t, -0.5)))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-9.5d-42)) .or. (.not. (a <= 3.2d-17))) then
tmp = (log(t) * a) - t
else
tmp = (log(y) + log((z * (t ** (-0.5d0))))) - 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 <= -9.5e-42) || !(a <= 3.2e-17)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = (Math.log(y) + Math.log((z * Math.pow(t, -0.5)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9.5e-42) or not (a <= 3.2e-17): tmp = (math.log(t) * a) - t else: tmp = (math.log(y) + math.log((z * math.pow(t, -0.5)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -9.5e-42) || !(a <= 3.2e-17)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(Float64(log(y) + log(Float64(z * (t ^ -0.5)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -9.5e-42) || ~((a <= 3.2e-17))) tmp = (log(t) * a) - t; else tmp = (log(y) + log((z * (t ^ -0.5)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9.5e-42], N[Not[LessEqual[a, 3.2e-17]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[Log[N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.5 \cdot 10^{-42} \lor \neg \left(a \leq 3.2 \cdot 10^{-17}\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\end{array}
\end{array}
if a < -9.49999999999999948e-42 or 3.2000000000000002e-17 < a Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 74.4%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
if -9.49999999999999948e-42 < a < 3.2000000000000002e-17Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 60.9%
Taylor expanded in a around 0 60.9%
*-commutative60.9%
Simplified60.9%
add-log-exp60.9%
sum-log54.6%
pow-to-exp54.6%
Applied egg-rr54.6%
Final simplification79.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0018) (+ (log z) (+ (log y) (* (log t) (- a 0.5)))) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0018) {
tmp = log(z) + (log(y) + (log(t) * (a - 0.5)));
} else {
tmp = (log(t) * a) - 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 <= 0.0018d0) then
tmp = log(z) + (log(y) + (log(t) * (a - 0.5d0)))
else
tmp = (log(t) * a) - 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 <= 0.0018) {
tmp = Math.log(z) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0018: tmp = math.log(z) + (math.log(y) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0018) tmp = Float64(log(z) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.0018) tmp = log(z) + (log(y) + (log(t) * (a - 0.5))); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0018], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0018:\\
\;\;\;\;\log z + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 0.0018Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 66.0%
Taylor expanded in t around 0 65.6%
if 0.0018 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 71.3%
Taylor expanded in a around inf 98.6%
*-commutative98.6%
Simplified98.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 (- (+ (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%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.6%
(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-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (log (* y (* z (pow t -0.5)))) t)) (t_2 (- (* (log t) a) t)))
(if (<= a -5.5e-169)
t_2
(if (<= a 1.6e-242)
t_1
(if (<= a 4.1e-117)
(+ (log (+ x y)) (- (log z) t))
(if (<= a 2.35e-17) t_1 t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((y * (z * pow(t, -0.5)))) - t;
double t_2 = (log(t) * a) - t;
double tmp;
if (a <= -5.5e-169) {
tmp = t_2;
} else if (a <= 1.6e-242) {
tmp = t_1;
} else if (a <= 4.1e-117) {
tmp = log((x + y)) + (log(z) - t);
} else if (a <= 2.35e-17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log((y * (z * (t ** (-0.5d0))))) - t
t_2 = (log(t) * a) - t
if (a <= (-5.5d-169)) then
tmp = t_2
else if (a <= 1.6d-242) then
tmp = t_1
else if (a <= 4.1d-117) then
tmp = log((x + y)) + (log(z) - t)
else if (a <= 2.35d-17) then
tmp = t_1
else
tmp = t_2
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((y * (z * Math.pow(t, -0.5)))) - t;
double t_2 = (Math.log(t) * a) - t;
double tmp;
if (a <= -5.5e-169) {
tmp = t_2;
} else if (a <= 1.6e-242) {
tmp = t_1;
} else if (a <= 4.1e-117) {
tmp = Math.log((x + y)) + (Math.log(z) - t);
} else if (a <= 2.35e-17) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((y * (z * math.pow(t, -0.5)))) - t t_2 = (math.log(t) * a) - t tmp = 0 if a <= -5.5e-169: tmp = t_2 elif a <= 1.6e-242: tmp = t_1 elif a <= 4.1e-117: tmp = math.log((x + y)) + (math.log(z) - t) elif a <= 2.35e-17: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t) t_2 = Float64(Float64(log(t) * a) - t) tmp = 0.0 if (a <= -5.5e-169) tmp = t_2; elseif (a <= 1.6e-242) tmp = t_1; elseif (a <= 4.1e-117) tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); elseif (a <= 2.35e-17) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((y * (z * (t ^ -0.5)))) - t; t_2 = (log(t) * a) - t; tmp = 0.0; if (a <= -5.5e-169) tmp = t_2; elseif (a <= 1.6e-242) tmp = t_1; elseif (a <= 4.1e-117) tmp = log((x + y)) + (log(z) - t); elseif (a <= 2.35e-17) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -5.5e-169], t$95$2, If[LessEqual[a, 1.6e-242], t$95$1, If[LessEqual[a, 4.1e-117], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.35e-17], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\
t_2 := \log t \cdot a - t\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{-169}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{-242}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{-117}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -5.4999999999999994e-169 or 2.35e-17 < a Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 70.8%
Taylor expanded in a around inf 93.5%
*-commutative93.5%
Simplified93.5%
if -5.4999999999999994e-169 < a < 1.59999999999999999e-242 or 4.10000000000000031e-117 < a < 2.35e-17Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.3%
+-commutative99.3%
fma-define99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 67.6%
Taylor expanded in a around 0 67.6%
*-commutative67.6%
Simplified67.6%
*-un-lft-identity67.6%
associate-+r+67.6%
sum-log60.0%
add-log-exp50.9%
exp-sum50.9%
add-exp-log51.0%
*-commutative51.0%
pow-to-exp51.1%
Applied egg-rr51.1%
*-lft-identity51.1%
*-commutative51.1%
associate-*l*49.6%
Simplified49.6%
if 1.59999999999999999e-242 < a < 4.10000000000000031e-117Initial program 99.6%
associate-+l-99.6%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 54.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.05e-167) (not (<= a 1.05e-8))) (- (* (log t) a) t) (+ (log (* (+ x y) z)) (- (* (log t) (+ a -0.5)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.05e-167) || !(a <= 1.05e-8)) {
tmp = (log(t) * a) - t;
} else {
tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3.05d-167)) .or. (.not. (a <= 1.05d-8))) then
tmp = (log(t) * a) - t
else
tmp = log(((x + y) * z)) + ((log(t) * (a + (-0.5d0))) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.05e-167) || !(a <= 1.05e-8)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log(((x + y) * z)) + ((Math.log(t) * (a + -0.5)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.05e-167) or not (a <= 1.05e-8): tmp = (math.log(t) * a) - t else: tmp = math.log(((x + y) * z)) + ((math.log(t) * (a + -0.5)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.05e-167) || !(a <= 1.05e-8)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(log(t) * Float64(a + -0.5)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.05e-167) || ~((a <= 1.05e-8))) tmp = (log(t) * a) - t; else tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.05e-167], N[Not[LessEqual[a, 1.05e-8]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.05 \cdot 10^{-167} \lor \neg \left(a \leq 1.05 \cdot 10^{-8}\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\
\end{array}
\end{array}
if a < -3.0499999999999999e-167 or 1.04999999999999997e-8 < a Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.6%
Taylor expanded in a around inf 94.0%
*-commutative94.0%
Simplified94.0%
if -3.0499999999999999e-167 < a < 1.04999999999999997e-8Initial program 99.3%
associate-+l-99.3%
sum-log81.7%
sub-neg81.7%
metadata-eval81.7%
*-commutative81.7%
Applied egg-rr81.7%
Final simplification89.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.5e-167) (not (<= a 2.8e-8))) (- (* (log t) a) 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 <= -3.5e-167) || !(a <= 2.8e-8)) {
tmp = (log(t) * a) - 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 <= (-3.5d-167)) .or. (.not. (a <= 2.8d-8))) then
tmp = (log(t) * a) - 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 <= -3.5e-167) || !(a <= 2.8e-8)) {
tmp = (Math.log(t) * a) - 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 <= -3.5e-167) or not (a <= 2.8e-8): tmp = (math.log(t) * a) - 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 ((a <= -3.5e-167) || !(a <= 2.8e-8)) tmp = Float64(Float64(log(t) * a) - 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 <= -3.5e-167) || ~((a <= 2.8e-8))) tmp = (log(t) * a) - t; else tmp = ((log(t) * (a + -0.5)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.5e-167], N[Not[LessEqual[a, 2.8e-8]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $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 \leq -3.5 \cdot 10^{-167} \lor \neg \left(a \leq 2.8 \cdot 10^{-8}\right):\\
\;\;\;\;\log t \cdot a - 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 a < -3.4999999999999999e-167 or 2.7999999999999999e-8 < a Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.6%
Taylor expanded in a around inf 94.0%
*-commutative94.0%
Simplified94.0%
if -3.4999999999999999e-167 < a < 2.7999999999999999e-8Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 62.7%
*-un-lft-identity62.7%
add-log-exp56.8%
sum-log41.4%
exp-sum41.4%
add-exp-log41.4%
sub-neg41.4%
metadata-eval41.4%
pow-to-exp41.5%
Applied egg-rr41.5%
*-lft-identity41.5%
associate-*r*43.9%
Simplified43.9%
*-commutative43.9%
log-prod54.0%
pow-to-exp54.0%
add-log-exp54.0%
*-commutative54.0%
Applied egg-rr54.0%
Final simplification80.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.4e-167) (not (<= a 4.6e-8))) (- (* (log t) a) t) (- (log (* (pow t -0.5) (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.4e-167) || !(a <= 4.6e-8)) {
tmp = (log(t) * a) - t;
} else {
tmp = log((pow(t, -0.5) * (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 <= (-4.4d-167)) .or. (.not. (a <= 4.6d-8))) then
tmp = (log(t) * a) - t
else
tmp = log(((t ** (-0.5d0)) * (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 <= -4.4e-167) || !(a <= 4.6e-8)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log((Math.pow(t, -0.5) * (y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.4e-167) or not (a <= 4.6e-8): tmp = (math.log(t) * a) - t else: tmp = math.log((math.pow(t, -0.5) * (y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.4e-167) || !(a <= 4.6e-8)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(Float64((t ^ -0.5) * Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.4e-167) || ~((a <= 4.6e-8))) tmp = (log(t) * a) - t; else tmp = log(((t ^ -0.5) * (y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.4e-167], N[Not[LessEqual[a, 4.6e-8]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[Power[t, -0.5], $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.4 \cdot 10^{-167} \lor \neg \left(a \leq 4.6 \cdot 10^{-8}\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left({t}^{-0.5} \cdot \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -4.3999999999999999e-167 or 4.6000000000000002e-8 < a Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 71.6%
Taylor expanded in a around inf 94.0%
*-commutative94.0%
Simplified94.0%
if -4.3999999999999999e-167 < a < 4.6000000000000002e-8Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 62.7%
Taylor expanded in a around 0 62.7%
*-commutative62.7%
Simplified62.7%
associate-+r+62.6%
sum-log54.0%
add-log-exp43.8%
exp-sum43.8%
add-exp-log43.8%
*-commutative43.8%
pow-to-exp43.9%
Applied egg-rr43.9%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.1) (not (<= a 5.3e-8))) (- (* (log t) a) t) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.1) || !(a <= 5.3e-8)) {
tmp = (log(t) * a) - t;
} else {
tmp = log((x + y)) + (log(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 <= (-1.1d0)) .or. (.not. (a <= 5.3d-8))) then
tmp = (log(t) * a) - t
else
tmp = log((x + y)) + (log(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 <= -1.1) || !(a <= 5.3e-8)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log((x + y)) + (Math.log(z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.1) or not (a <= 5.3e-8): tmp = (math.log(t) * a) - t else: tmp = math.log((x + y)) + (math.log(z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.1) || !(a <= 5.3e-8)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.1) || ~((a <= 5.3e-8))) tmp = (log(t) * a) - t; else tmp = log((x + y)) + (log(z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.1], N[Not[LessEqual[a, 5.3e-8]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \lor \neg \left(a \leq 5.3 \cdot 10^{-8}\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\end{array}
\end{array}
if a < -1.1000000000000001 or 5.2999999999999998e-8 < a Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 75.3%
Taylor expanded in a around inf 99.0%
*-commutative99.0%
Simplified99.0%
if -1.1000000000000001 < a < 5.2999999999999998e-8Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 56.1%
Final simplification79.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.82) (not (<= a 3.2e-17))) (- (* (log t) a) t) (+ (- (log y) t) (/ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.82) || !(a <= 3.2e-17)) {
tmp = (log(t) * a) - t;
} else {
tmp = (log(y) - t) + (x / y);
}
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.82d0)) .or. (.not. (a <= 3.2d-17))) then
tmp = (log(t) * a) - t
else
tmp = (log(y) - t) + (x / y)
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.82) || !(a <= 3.2e-17)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = (Math.log(y) - t) + (x / y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.82) or not (a <= 3.2e-17): tmp = (math.log(t) * a) - t else: tmp = (math.log(y) - t) + (x / y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.82) || !(a <= 3.2e-17)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(Float64(log(y) - t) + Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.82) || ~((a <= 3.2e-17))) tmp = (log(t) * a) - t; else tmp = (log(y) - t) + (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.82], N[Not[LessEqual[a, 3.2e-17]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.82 \lor \neg \left(a \leq 3.2 \cdot 10^{-17}\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y - t\right) + \frac{x}{y}\\
\end{array}
\end{array}
if a < -0.819999999999999951 or 3.2000000000000002e-17 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 74.2%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
if -0.819999999999999951 < a < 3.2000000000000002e-17Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 99.5%
mul-1-neg99.5%
unsub-neg99.5%
associate-/l*99.5%
log-rec99.5%
Simplified99.5%
Taylor expanded in t around inf 54.1%
Taylor expanded in x around 0 31.3%
associate-+r+31.3%
mul-1-neg31.3%
unsub-neg31.3%
Simplified31.3%
Final simplification68.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.88) (not (<= a 3.2e-17))) (- (* (log t) a) t) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.88) || !(a <= 3.2e-17)) {
tmp = (log(t) * a) - t;
} else {
tmp = log((x + 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 <= (-0.88d0)) .or. (.not. (a <= 3.2d-17))) then
tmp = (log(t) * a) - t
else
tmp = log((x + 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 <= -0.88) || !(a <= 3.2e-17)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.88) or not (a <= 3.2e-17): tmp = (math.log(t) * a) - t else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.88) || !(a <= 3.2e-17)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(Float64(x + y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.88) || ~((a <= 3.2e-17))) tmp = (log(t) * a) - t; else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.88], N[Not[LessEqual[a, 3.2e-17]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.88 \lor \neg \left(a \leq 3.2 \cdot 10^{-17}\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -0.880000000000000004 or 3.2000000000000002e-17 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 74.2%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
if -0.880000000000000004 < a < 3.2000000000000002e-17Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 99.5%
mul-1-neg99.5%
unsub-neg99.5%
associate-/l*99.5%
log-rec99.5%
Simplified99.5%
Taylor expanded in t around inf 54.1%
Final simplification78.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.048) (not (<= a 3.2e-17))) (- (* (log t) a) t) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.048) || !(a <= 3.2e-17)) {
tmp = (log(t) * a) - t;
} else {
tmp = 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 <= (-0.048d0)) .or. (.not. (a <= 3.2d-17))) then
tmp = (log(t) * a) - t
else
tmp = 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 <= -0.048) || !(a <= 3.2e-17)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.048) or not (a <= 3.2e-17): tmp = (math.log(t) * a) - t else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.048) || !(a <= 3.2e-17)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.048) || ~((a <= 3.2e-17))) tmp = (log(t) * a) - t; else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.048], N[Not[LessEqual[a, 3.2e-17]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.048 \lor \neg \left(a \leq 3.2 \cdot 10^{-17}\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -0.048000000000000001 or 3.2000000000000002e-17 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 74.2%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
if -0.048000000000000001 < a < 3.2000000000000002e-17Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 99.5%
mul-1-neg99.5%
unsub-neg99.5%
associate-/l*99.5%
log-rec99.5%
Simplified99.5%
Taylor expanded in t around inf 54.1%
Taylor expanded in x around 0 37.9%
mul-1-neg37.9%
unsub-neg37.9%
Simplified37.9%
Final simplification71.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -33000000000.0) (not (<= a 1.12e+36))) (* (log t) a) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -33000000000.0) || !(a <= 1.12e+36)) {
tmp = log(t) * a;
} else {
tmp = 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 <= (-33000000000.0d0)) .or. (.not. (a <= 1.12d+36))) then
tmp = log(t) * a
else
tmp = 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 <= -33000000000.0) || !(a <= 1.12e+36)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -33000000000.0) or not (a <= 1.12e+36): tmp = math.log(t) * a else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -33000000000.0) || !(a <= 1.12e+36)) tmp = Float64(log(t) * a); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -33000000000.0) || ~((a <= 1.12e+36))) tmp = log(t) * a; else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -33000000000.0], N[Not[LessEqual[a, 1.12e+36]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -33000000000 \lor \neg \left(a \leq 1.12 \cdot 10^{+36}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -3.3e10 or 1.11999999999999999e36 < a Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in a around inf 79.9%
*-commutative79.9%
Simplified79.9%
if -3.3e10 < a < 1.11999999999999999e36Initial program 99.5%
associate-+l-99.5%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 99.5%
mul-1-neg99.5%
unsub-neg99.5%
associate-/l*99.5%
log-rec99.5%
Simplified99.5%
Taylor expanded in t around inf 54.3%
Taylor expanded in x around 0 37.8%
mul-1-neg37.8%
unsub-neg37.8%
Simplified37.8%
Final simplification58.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.15e+16) (not (<= a 4.9e+39))) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.15e+16) || !(a <= 4.9e+39)) {
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 <= (-1.15d+16)) .or. (.not. (a <= 4.9d+39))) 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 <= -1.15e+16) || !(a <= 4.9e+39)) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.15e+16) or not (a <= 4.9e+39): tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.15e+16) || !(a <= 4.9e+39)) 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 <= -1.15e+16) || ~((a <= 4.9e+39))) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.15e+16], N[Not[LessEqual[a, 4.9e+39]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.15 \cdot 10^{+16} \lor \neg \left(a \leq 4.9 \cdot 10^{+39}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -1.15e16 or 4.89999999999999987e39 < a Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in a around inf 79.9%
*-commutative79.9%
Simplified79.9%
if -1.15e16 < a < 4.89999999999999987e39Initial program 99.5%
associate-+l-99.5%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 47.5%
neg-mul-147.5%
Simplified47.5%
Final simplification63.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 520.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 520.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 <= 520.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 <= 520.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 520.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 520.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 <= 520.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 520.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 520:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 520Initial program 99.3%
associate-+l-99.3%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-undefine99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in t around inf 74.7%
mul-1-neg74.7%
unsub-neg74.7%
associate-/l*74.7%
log-rec74.7%
Simplified74.7%
Taylor expanded in t around inf 9.8%
Taylor expanded in t around 0 9.8%
+-commutative9.8%
Simplified9.8%
if 520 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 67.0%
neg-mul-167.0%
Simplified67.0%
Final simplification37.5%
(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%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 33.8%
neg-mul-133.8%
Simplified33.8%
(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 2024108
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))