
(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 14 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 z) (log (+ x y))) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log(z) + log((x + y))) - 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(z) + log((x + y))) - 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(z) + Math.log((x + y))) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log(z) + math.log((x + y))) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(z) + log(Float64(x + y))) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log(z) + log((x + y))) - t) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[z], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log z + \log \left(x + y\right)\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.00029) (+ (log z) (+ (log (+ x y)) (* (log t) (- a 0.5)))) (+ (+ (log z) (log y)) (- (* a (log t)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00029) {
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) + log(y)) + ((a * log(t)) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 0.00029d0) then
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) + log(y)) + ((a * log(t)) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00029) {
tmp = Math.log(z) + (Math.log((x + y)) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) + Math.log(y)) + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.00029: tmp = math.log(z) + (math.log((x + y)) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) + math.log(y)) + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.00029) tmp = Float64(log(z) + Float64(log(Float64(x + y)) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) + log(y)) + Float64(Float64(a * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.00029) tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5))); else tmp = (log(z) + log(y)) + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.00029], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.00029:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 2.9e-4Initial program 99.4%
associate-+l-99.4%
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 0 99.1%
associate--l+99.1%
+-commutative99.1%
Simplified99.1%
if 2.9e-4 < t Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 75.2%
Taylor expanded in a around inf 74.6%
mul-1-neg74.6%
distribute-rgt-neg-in74.6%
Simplified74.6%
Final simplification86.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 3.2e+38) (+ (log z) (+ (log y) (* (log t) (- a 0.5)))) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.2e+38) {
tmp = log(z) + (log(y) + (log(t) * (a - 0.5)));
} 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 <= 3.2d+38) then
tmp = log(z) + (log(y) + (log(t) * (a - 0.5d0)))
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 <= 3.2e+38) {
tmp = Math.log(z) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.2e+38: tmp = math.log(z) + (math.log(y) + (math.log(t) * (a - 0.5))) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.2e+38) tmp = Float64(log(z) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.2e+38) tmp = log(z) + (log(y) + (log(t) * (a - 0.5))); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.2e+38], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.2 \cdot 10^{+38}:\\
\;\;\;\;\log z + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 3.19999999999999985e38Initial program 99.4%
associate-+l-99.4%
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 0 97.2%
associate--l+97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in y around inf 67.6%
mul-1-neg67.6%
log-rec67.6%
remove-double-neg67.6%
*-commutative67.6%
Simplified67.6%
if 3.19999999999999985e38 < 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 77.5%
neg-mul-177.5%
Simplified77.5%
Final simplification72.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 7e+38) (+ (+ (log z) (log y)) (* (log t) (- a 0.5))) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 7e+38) {
tmp = (log(z) + log(y)) + (log(t) * (a - 0.5));
} 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 <= 7d+38) then
tmp = (log(z) + log(y)) + (log(t) * (a - 0.5d0))
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 <= 7e+38) {
tmp = (Math.log(z) + Math.log(y)) + (Math.log(t) * (a - 0.5));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 7e+38: tmp = (math.log(z) + math.log(y)) + (math.log(t) * (a - 0.5)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 7e+38) tmp = Float64(Float64(log(z) + log(y)) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 7e+38) tmp = (log(z) + log(y)) + (log(t) * (a - 0.5)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 7e+38], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7 \cdot 10^{+38}:\\
\;\;\;\;\left(\log z + \log y\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 7.00000000000000003e38Initial program 99.4%
associate-+l-99.4%
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 x around 0 69.8%
Taylor expanded in t around 0 67.6%
+-commutative67.6%
*-commutative67.6%
Simplified67.6%
if 7.00000000000000003e38 < 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 77.5%
neg-mul-177.5%
Simplified77.5%
Final simplification72.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log z) (log y))))
(if (<= t 0.00029)
(+ t_1 (* (log t) (- a 0.5)))
(+ t_1 (- (* a (log t)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) + log(y);
double tmp;
if (t <= 0.00029) {
tmp = t_1 + (log(t) * (a - 0.5));
} else {
tmp = t_1 + ((a * log(t)) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(z) + log(y)
if (t <= 0.00029d0) then
tmp = t_1 + (log(t) * (a - 0.5d0))
else
tmp = t_1 + ((a * log(t)) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(z) + Math.log(y);
double tmp;
if (t <= 0.00029) {
tmp = t_1 + (Math.log(t) * (a - 0.5));
} else {
tmp = t_1 + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) + math.log(y) tmp = 0 if t <= 0.00029: tmp = t_1 + (math.log(t) * (a - 0.5)) else: tmp = t_1 + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) + log(y)) tmp = 0.0 if (t <= 0.00029) tmp = Float64(t_1 + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(t_1 + Float64(Float64(a * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) + log(y); tmp = 0.0; if (t <= 0.00029) tmp = t_1 + (log(t) * (a - 0.5)); else tmp = t_1 + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 0.00029], N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z + \log y\\
\mathbf{if}\;t \leq 0.00029:\\
\;\;\;\;t\_1 + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 2.9e-4Initial program 99.4%
associate-+l-99.4%
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 x around 0 67.6%
Taylor expanded in t around 0 67.3%
+-commutative67.3%
*-commutative67.3%
Simplified67.3%
if 2.9e-4 < t Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 75.2%
Taylor expanded in a around inf 74.6%
mul-1-neg74.6%
distribute-rgt-neg-in74.6%
Simplified74.6%
Final simplification71.1%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (log y)) (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) + log(y)) + ((log(t) * (a - 0.5d0)) - t)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + Math.log(y)) + ((Math.log(t) * (a - 0.5)) - t);
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) + ((math.log(t) * (a - 0.5)) - t)
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.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 x around 0 71.6%
Final simplification71.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -5.5e+98)
(* a (log t))
(if (<= a 9.5e-125)
(+ (log (* (+ x y) z)) (- (* (log t) (+ a -0.5)) t))
(if (<= a 0.00052)
(- (+ (log z) (log y)) t)
(- (+ (log (* y z)) (* (* t (/ (log t) t)) (- a 0.5))) t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -5.5e+98) {
tmp = a * log(t);
} else if (a <= 9.5e-125) {
tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t);
} else if (a <= 0.00052) {
tmp = (log(z) + log(y)) - t;
} else {
tmp = (log((y * z)) + ((t * (log(t) / 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 <= (-5.5d+98)) then
tmp = a * log(t)
else if (a <= 9.5d-125) then
tmp = log(((x + y) * z)) + ((log(t) * (a + (-0.5d0))) - t)
else if (a <= 0.00052d0) then
tmp = (log(z) + log(y)) - t
else
tmp = (log((y * z)) + ((t * (log(t) / 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 <= -5.5e+98) {
tmp = a * Math.log(t);
} else if (a <= 9.5e-125) {
tmp = Math.log(((x + y) * z)) + ((Math.log(t) * (a + -0.5)) - t);
} else if (a <= 0.00052) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else {
tmp = (Math.log((y * z)) + ((t * (Math.log(t) / t)) * (a - 0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -5.5e+98: tmp = a * math.log(t) elif a <= 9.5e-125: tmp = math.log(((x + y) * z)) + ((math.log(t) * (a + -0.5)) - t) elif a <= 0.00052: tmp = (math.log(z) + math.log(y)) - t else: tmp = (math.log((y * z)) + ((t * (math.log(t) / t)) * (a - 0.5))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -5.5e+98) tmp = Float64(a * log(t)); elseif (a <= 9.5e-125) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(log(t) * Float64(a + -0.5)) - t)); elseif (a <= 0.00052) tmp = Float64(Float64(log(z) + log(y)) - t); else tmp = Float64(Float64(log(Float64(y * z)) + Float64(Float64(t * Float64(log(t) / t)) * Float64(a - 0.5))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -5.5e+98) tmp = a * log(t); elseif (a <= 9.5e-125) tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t); elseif (a <= 0.00052) tmp = (log(z) + log(y)) - t; else tmp = (log((y * z)) + ((t * (log(t) / t)) * (a - 0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -5.5e+98], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-125], 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], If[LessEqual[a, 0.00052], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(t * N[(N[Log[t], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+98}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-125}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\
\mathbf{elif}\;a \leq 0.00052:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \left(t \cdot \frac{\log t}{t}\right) \cdot \left(a - 0.5\right)\right) - t\\
\end{array}
\end{array}
if a < -5.49999999999999946e98Initial 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 a around inf 87.6%
*-commutative87.6%
Simplified87.6%
if -5.49999999999999946e98 < a < 9.50000000000000031e-125Initial program 99.6%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
+-commutative99.5%
fma-undefine99.5%
metadata-eval99.5%
sub-neg99.5%
associate-+r+99.5%
associate--l+99.6%
+-commutative99.6%
associate-+l-99.6%
sum-log80.3%
sub-neg80.3%
metadata-eval80.3%
*-commutative80.3%
Applied egg-rr80.3%
if 9.50000000000000031e-125 < a < 5.19999999999999954e-4Initial program 99.8%
associate-+l-99.8%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 74.9%
Taylor expanded in t around inf 58.5%
if 5.19999999999999954e-4 < a Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 76.0%
Taylor expanded in t around inf 56.5%
associate-*r/56.5%
mul-1-neg56.5%
log-rec56.5%
distribute-lft-neg-in56.5%
remove-double-neg56.5%
*-commutative56.5%
Simplified56.5%
+-commutative56.5%
distribute-rgt-in56.5%
associate-/l*56.5%
associate-*l*76.0%
*-un-lft-identity76.0%
Applied egg-rr76.0%
associate--r+76.0%
sub-neg76.0%
sum-log64.1%
*-commutative64.1%
*-commutative64.1%
Applied egg-rr64.1%
Final simplification75.6%
(FPCore (x y z t a)
:precision binary64
(if (<= a -1.5e+94)
(* a (log t))
(if (or (<= a 9.5e-125) (not (<= a 0.00021)))
(+ (log (* y z)) (- (* (log t) (+ a -0.5)) t))
(- (+ (log z) (log y)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -1.5e+94) {
tmp = a * log(t);
} else if ((a <= 9.5e-125) || !(a <= 0.00021)) {
tmp = log((y * z)) + ((log(t) * (a + -0.5)) - 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+94)) then
tmp = a * log(t)
else if ((a <= 9.5d-125) .or. (.not. (a <= 0.00021d0))) then
tmp = log((y * z)) + ((log(t) * (a + (-0.5d0))) - 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+94) {
tmp = a * Math.log(t);
} else if ((a <= 9.5e-125) || !(a <= 0.00021)) {
tmp = Math.log((y * z)) + ((Math.log(t) * (a + -0.5)) - 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+94: tmp = a * math.log(t) elif (a <= 9.5e-125) or not (a <= 0.00021): tmp = math.log((y * z)) + ((math.log(t) * (a + -0.5)) - 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+94) tmp = Float64(a * log(t)); elseif ((a <= 9.5e-125) || !(a <= 0.00021)) tmp = Float64(log(Float64(y * z)) + Float64(Float64(log(t) * Float64(a + -0.5)) - 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+94) tmp = a * log(t); elseif ((a <= 9.5e-125) || ~((a <= 0.00021))) tmp = log((y * z)) + ((log(t) * (a + -0.5)) - t); else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -1.5e+94], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 9.5e-125], N[Not[LessEqual[a, 0.00021]], $MachinePrecision]], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - 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^{+94}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-125} \lor \neg \left(a \leq 0.00021\right):\\
\;\;\;\;\log \left(y \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -1.5e94Initial 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 a around inf 87.6%
*-commutative87.6%
Simplified87.6%
if -1.5e94 < a < 9.50000000000000031e-125 or 2.1000000000000001e-4 < a 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%
add-cube-cbrt98.1%
pow398.0%
Applied egg-rr79.9%
Taylor expanded in x around 0 57.0%
associate--l+57.0%
*-commutative57.0%
sub-neg57.0%
metadata-eval57.0%
Simplified57.0%
if 9.50000000000000031e-125 < a < 2.1000000000000001e-4Initial program 99.8%
associate-+l-99.8%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 74.9%
Taylor expanded in t around inf 58.5%
Final simplification62.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* (log t) (+ a -0.5)) t)))
(if (<= a -1.15e+101)
(* a (log t))
(if (<= a 9.5e-125)
(+ (log (* (+ x y) z)) t_1)
(if (<= a 0.00021) (- (+ (log z) (log y)) t) (+ (log (* y z)) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (log(t) * (a + -0.5)) - t;
double tmp;
if (a <= -1.15e+101) {
tmp = a * log(t);
} else if (a <= 9.5e-125) {
tmp = log(((x + y) * z)) + t_1;
} else if (a <= 0.00021) {
tmp = (log(z) + log(y)) - t;
} else {
tmp = log((y * z)) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (log(t) * (a + (-0.5d0))) - t
if (a <= (-1.15d+101)) then
tmp = a * log(t)
else if (a <= 9.5d-125) then
tmp = log(((x + y) * z)) + t_1
else if (a <= 0.00021d0) then
tmp = (log(z) + log(y)) - t
else
tmp = log((y * z)) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (Math.log(t) * (a + -0.5)) - t;
double tmp;
if (a <= -1.15e+101) {
tmp = a * Math.log(t);
} else if (a <= 9.5e-125) {
tmp = Math.log(((x + y) * z)) + t_1;
} else if (a <= 0.00021) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else {
tmp = Math.log((y * z)) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (math.log(t) * (a + -0.5)) - t tmp = 0 if a <= -1.15e+101: tmp = a * math.log(t) elif a <= 9.5e-125: tmp = math.log(((x + y) * z)) + t_1 elif a <= 0.00021: tmp = (math.log(z) + math.log(y)) - t else: tmp = math.log((y * z)) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(log(t) * Float64(a + -0.5)) - t) tmp = 0.0 if (a <= -1.15e+101) tmp = Float64(a * log(t)); elseif (a <= 9.5e-125) tmp = Float64(log(Float64(Float64(x + y) * z)) + t_1); elseif (a <= 0.00021) tmp = Float64(Float64(log(z) + log(y)) - t); else tmp = Float64(log(Float64(y * z)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (log(t) * (a + -0.5)) - t; tmp = 0.0; if (a <= -1.15e+101) tmp = a * log(t); elseif (a <= 9.5e-125) tmp = log(((x + y) * z)) + t_1; elseif (a <= 0.00021) tmp = (log(z) + log(y)) - t; else tmp = log((y * z)) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -1.15e+101], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-125], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[a, 0.00021], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a + -0.5\right) - t\\
\mathbf{if}\;a \leq -1.15 \cdot 10^{+101}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-125}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + t\_1\\
\mathbf{elif}\;a \leq 0.00021:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot z\right) + t\_1\\
\end{array}
\end{array}
if a < -1.1500000000000001e101Initial 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 a around inf 87.6%
*-commutative87.6%
Simplified87.6%
if -1.1500000000000001e101 < a < 9.50000000000000031e-125Initial program 99.6%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
+-commutative99.5%
fma-undefine99.5%
metadata-eval99.5%
sub-neg99.5%
associate-+r+99.5%
associate--l+99.6%
+-commutative99.6%
associate-+l-99.6%
sum-log80.3%
sub-neg80.3%
metadata-eval80.3%
*-commutative80.3%
Applied egg-rr80.3%
if 9.50000000000000031e-125 < a < 2.1000000000000001e-4Initial program 99.8%
associate-+l-99.8%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 74.9%
Taylor expanded in t around inf 58.5%
if 2.1000000000000001e-4 < a Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
add-cube-cbrt97.8%
pow398.0%
Applied egg-rr81.7%
Taylor expanded in x around 0 64.1%
associate--l+64.1%
*-commutative64.1%
sub-neg64.1%
metadata-eval64.1%
Simplified64.1%
Final simplification75.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -7.4e+17)
t_1
(if (<= a 8e-126)
(+ (log (* y z)) (- (* (log t) -0.5) t))
(if (<= a 7e+64)
(- (+ (log z) (log y)) t)
(if (or (<= a 2.2e+130) (not (<= a 6e+165))) t_1 (- t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -7.4e+17) {
tmp = t_1;
} else if (a <= 8e-126) {
tmp = log((y * z)) + ((log(t) * -0.5) - t);
} else if (a <= 7e+64) {
tmp = (log(z) + log(y)) - t;
} else if ((a <= 2.2e+130) || !(a <= 6e+165)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (a <= (-7.4d+17)) then
tmp = t_1
else if (a <= 8d-126) then
tmp = log((y * z)) + ((log(t) * (-0.5d0)) - t)
else if (a <= 7d+64) then
tmp = (log(z) + log(y)) - t
else if ((a <= 2.2d+130) .or. (.not. (a <= 6d+165))) then
tmp = t_1
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (a <= -7.4e+17) {
tmp = t_1;
} else if (a <= 8e-126) {
tmp = Math.log((y * z)) + ((Math.log(t) * -0.5) - t);
} else if (a <= 7e+64) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else if ((a <= 2.2e+130) || !(a <= 6e+165)) {
tmp = t_1;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -7.4e+17: tmp = t_1 elif a <= 8e-126: tmp = math.log((y * z)) + ((math.log(t) * -0.5) - t) elif a <= 7e+64: tmp = (math.log(z) + math.log(y)) - t elif (a <= 2.2e+130) or not (a <= 6e+165): tmp = t_1 else: tmp = -t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -7.4e+17) tmp = t_1; elseif (a <= 8e-126) tmp = Float64(log(Float64(y * z)) + Float64(Float64(log(t) * -0.5) - t)); elseif (a <= 7e+64) tmp = Float64(Float64(log(z) + log(y)) - t); elseif ((a <= 2.2e+130) || !(a <= 6e+165)) tmp = t_1; else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (a <= -7.4e+17) tmp = t_1; elseif (a <= 8e-126) tmp = log((y * z)) + ((log(t) * -0.5) - t); elseif (a <= 7e+64) tmp = (log(z) + log(y)) - t; elseif ((a <= 2.2e+130) || ~((a <= 6e+165))) tmp = t_1; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -7.4e+17], t$95$1, If[LessEqual[a, 8e-126], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7e+64], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[a, 2.2e+130], N[Not[LessEqual[a, 6e+165]], $MachinePrecision]], t$95$1, (-t)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -7.4 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8 \cdot 10^{-126}:\\
\;\;\;\;\log \left(y \cdot z\right) + \left(\log t \cdot -0.5 - t\right)\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+64}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{+130} \lor \neg \left(a \leq 6 \cdot 10^{+165}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -7.4e17 or 6.9999999999999997e64 < a < 2.19999999999999993e130 or 5.99999999999999981e165 < 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 83.3%
*-commutative83.3%
Simplified83.3%
if -7.4e17 < a < 7.9999999999999996e-126Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt98.2%
pow398.1%
Applied egg-rr77.2%
Taylor expanded in x around 0 52.4%
associate--l+52.5%
*-commutative52.5%
sub-neg52.5%
metadata-eval52.5%
Simplified52.5%
Taylor expanded in a around 0 50.6%
*-commutative50.6%
Simplified50.6%
if 7.9999999999999996e-126 < a < 6.9999999999999997e64Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 77.7%
Taylor expanded in t around inf 57.1%
if 2.19999999999999993e130 < a < 5.99999999999999981e165Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-undefine100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 75.7%
neg-mul-175.7%
Simplified75.7%
Final simplification65.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= a -6.5e+17)
t_1
(if (<= a 7e+64)
(- (+ (log z) (log y)) t)
(if (or (<= a 1.8e+130) (not (<= a 6e+165))) t_1 (- t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (a <= -6.5e+17) {
tmp = t_1;
} else if (a <= 7e+64) {
tmp = (log(z) + log(y)) - t;
} else if ((a <= 1.8e+130) || !(a <= 6e+165)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (a <= (-6.5d+17)) then
tmp = t_1
else if (a <= 7d+64) then
tmp = (log(z) + log(y)) - t
else if ((a <= 1.8d+130) .or. (.not. (a <= 6d+165))) then
tmp = t_1
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (a <= -6.5e+17) {
tmp = t_1;
} else if (a <= 7e+64) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else if ((a <= 1.8e+130) || !(a <= 6e+165)) {
tmp = t_1;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if a <= -6.5e+17: tmp = t_1 elif a <= 7e+64: tmp = (math.log(z) + math.log(y)) - t elif (a <= 1.8e+130) or not (a <= 6e+165): tmp = t_1 else: tmp = -t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (a <= -6.5e+17) tmp = t_1; elseif (a <= 7e+64) tmp = Float64(Float64(log(z) + log(y)) - t); elseif ((a <= 1.8e+130) || !(a <= 6e+165)) tmp = t_1; else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (a <= -6.5e+17) tmp = t_1; elseif (a <= 7e+64) tmp = (log(z) + log(y)) - t; elseif ((a <= 1.8e+130) || ~((a <= 6e+165))) tmp = t_1; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.5e+17], t$95$1, If[LessEqual[a, 7e+64], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[a, 1.8e+130], N[Not[LessEqual[a, 6e+165]], $MachinePrecision]], t$95$1, (-t)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a \leq -6.5 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7 \cdot 10^{+64}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+130} \lor \neg \left(a \leq 6 \cdot 10^{+165}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -6.5e17 or 6.9999999999999997e64 < a < 1.8000000000000001e130 or 5.99999999999999981e165 < 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 83.3%
*-commutative83.3%
Simplified83.3%
if -6.5e17 < a < 6.9999999999999997e64Initial program 99.6%
associate-+l-99.6%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in x around 0 69.5%
Taylor expanded in t around inf 45.7%
if 1.8000000000000001e130 < a < 5.99999999999999981e165Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-undefine100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 75.7%
neg-mul-175.7%
Simplified75.7%
Final simplification62.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 3.05e+38) (+ (log (* y z)) (* (log t) (- a 0.5))) (if (or (<= t 3.8e+120) (not (<= t 1.25e+144))) (- t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.05e+38) {
tmp = log((y * z)) + (log(t) * (a - 0.5));
} else if ((t <= 3.8e+120) || !(t <= 1.25e+144)) {
tmp = -t;
} else {
tmp = a * log(t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 3.05d+38) then
tmp = log((y * z)) + (log(t) * (a - 0.5d0))
else if ((t <= 3.8d+120) .or. (.not. (t <= 1.25d+144))) then
tmp = -t
else
tmp = a * log(t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.05e+38) {
tmp = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
} else if ((t <= 3.8e+120) || !(t <= 1.25e+144)) {
tmp = -t;
} else {
tmp = a * Math.log(t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.05e+38: tmp = math.log((y * z)) + (math.log(t) * (a - 0.5)) elif (t <= 3.8e+120) or not (t <= 1.25e+144): tmp = -t else: tmp = a * math.log(t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.05e+38) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))); elseif ((t <= 3.8e+120) || !(t <= 1.25e+144)) tmp = Float64(-t); else tmp = Float64(a * log(t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.05e+38) tmp = log((y * z)) + (log(t) * (a - 0.5)); elseif ((t <= 3.8e+120) || ~((t <= 1.25e+144))) tmp = -t; else tmp = a * log(t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.05e+38], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, 3.8e+120], N[Not[LessEqual[t, 1.25e+144]], $MachinePrecision]], (-t), N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.05 \cdot 10^{+38}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+120} \lor \neg \left(t \leq 1.25 \cdot 10^{+144}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t\\
\end{array}
\end{array}
if t < 3.05e38Initial program 99.4%
associate-+l-99.4%
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 x around 0 69.8%
Taylor expanded in t around 0 67.6%
+-commutative67.6%
*-commutative67.6%
Simplified67.6%
sum-log55.4%
Applied egg-rr55.4%
if 3.05e38 < t < 3.7999999999999998e120 or 1.25e144 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 82.8%
neg-mul-182.8%
Simplified82.8%
if 3.7999999999999998e120 < t < 1.25e144Initial 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.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in a around inf 66.7%
*-commutative66.7%
Simplified66.7%
Final simplification67.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.5e+17) (not (<= a 7.8e+64))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.5e+17) || !(a <= 7.8e+64)) {
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 <= (-6.5d+17)) .or. (.not. (a <= 7.8d+64))) 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 <= -6.5e+17) || !(a <= 7.8e+64)) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.5e+17) or not (a <= 7.8e+64): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.5e+17) || !(a <= 7.8e+64)) 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 <= -6.5e+17) || ~((a <= 7.8e+64))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.5e+17], N[Not[LessEqual[a, 7.8e+64]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+17} \lor \neg \left(a \leq 7.8 \cdot 10^{+64}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -6.5e17 or 7.7999999999999996e64 < 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.3%
*-commutative79.3%
Simplified79.3%
if -6.5e17 < a < 7.7999999999999996e64Initial program 99.6%
associate-+l-99.6%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 52.1%
neg-mul-152.1%
Simplified52.1%
Final simplification64.2%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
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 37.9%
neg-mul-137.9%
Simplified37.9%
Final simplification37.9%
(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 2024066
(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))))