
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (- (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) t))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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
assert x < y && y < z && z < t && t < a;
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;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return (math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))) - t
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) - t) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. 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}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\right) - t
\end{array}
Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 69.5%
associate-+r+69.5%
sub-neg69.5%
metadata-eval69.5%
Simplified69.5%
Taylor expanded in y around 0 69.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t 140.0) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (* (log t) a) t)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 140.0) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(t) * a) - t;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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 <= 140.0d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(t) * a) - t
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 140.0) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if t <= 140.0: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(t) * a) - t return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (t <= 140.0) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= 140.0)
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
else
tmp = (log(t) * a) - t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, 140.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 140:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 140Initial program 99.2%
associate--l+99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 64.0%
associate-+r+64.0%
sub-neg64.0%
metadata-eval64.0%
Simplified64.0%
Taylor expanded in y around 0 64.0%
Taylor expanded in t around 0 63.6%
if 140 < t Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 75.7%
associate-+r+75.7%
sub-neg75.7%
metadata-eval75.7%
Simplified75.7%
Taylor expanded in a around inf 98.4%
*-commutative98.4%
Simplified98.4%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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
assert x < y && y < z && z < t && t < a;
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)));
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. 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}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Initial 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%
Taylor expanded in x around 0 69.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= a -4.8e-108) (not (<= a 175.0))) (- (* (log t) a) t) (+ (* (log t) (- a 0.5)) (- (log (* z (+ y x))) t))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e-108) || !(a <= 175.0)) {
tmp = (log(t) * a) - t;
} else {
tmp = (log(t) * (a - 0.5)) + (log((z * (y + x))) - t);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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.8d-108)) .or. (.not. (a <= 175.0d0))) then
tmp = (log(t) * a) - t
else
tmp = (log(t) * (a - 0.5d0)) + (log((z * (y + x))) - t)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e-108) || !(a <= 175.0)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = (Math.log(t) * (a - 0.5)) + (Math.log((z * (y + x))) - t);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (a <= -4.8e-108) or not (a <= 175.0): tmp = (math.log(t) * a) - t else: tmp = (math.log(t) * (a - 0.5)) + (math.log((z * (y + x))) - t) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.8e-108) || !(a <= 175.0)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(Float64(z * Float64(y + x))) - t)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((a <= -4.8e-108) || ~((a <= 175.0)))
tmp = (log(t) * a) - t;
else
tmp = (log(t) * (a - 0.5)) + (log((z * (y + x))) - t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.8e-108], N[Not[LessEqual[a, 175.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(z * N[(y + x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 175\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \left(\log \left(z \cdot \left(y + x\right)\right) - t\right)\\
\end{array}
\end{array}
if a < -4.80000000000000034e-108 or 175 < a Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.9%
associate-+r+71.9%
sub-neg71.9%
metadata-eval71.9%
Simplified71.9%
Taylor expanded in a around inf 93.6%
*-commutative93.6%
Simplified93.6%
if -4.80000000000000034e-108 < a < 175Initial program 99.4%
sum-log78.2%
Applied egg-rr78.2%
Final simplification87.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* (log t) a) t)))
(if (<= a -2.1)
t_1
(if (<= a 9e-52)
(- (+ (log y) (log z)) t)
(if (<= a 2.3e-15) (+ (log (* y z)) (* (log t) -0.5)) t_1)))))assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = (log(t) * a) - t;
double tmp;
if (a <= -2.1) {
tmp = t_1;
} else if (a <= 9e-52) {
tmp = (log(y) + log(z)) - t;
} else if (a <= 2.3e-15) {
tmp = log((y * z)) + (log(t) * -0.5);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (log(t) * a) - t
if (a <= (-2.1d0)) then
tmp = t_1
else if (a <= 9d-52) then
tmp = (log(y) + log(z)) - t
else if (a <= 2.3d-15) then
tmp = log((y * z)) + (log(t) * (-0.5d0))
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (Math.log(t) * a) - t;
double tmp;
if (a <= -2.1) {
tmp = t_1;
} else if (a <= 9e-52) {
tmp = (Math.log(y) + Math.log(z)) - t;
} else if (a <= 2.3e-15) {
tmp = Math.log((y * z)) + (Math.log(t) * -0.5);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = (math.log(t) * a) - t tmp = 0 if a <= -2.1: tmp = t_1 elif a <= 9e-52: tmp = (math.log(y) + math.log(z)) - t elif a <= 2.3e-15: tmp = math.log((y * z)) + (math.log(t) * -0.5) else: tmp = t_1 return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(Float64(log(t) * a) - t) tmp = 0.0 if (a <= -2.1) tmp = t_1; elseif (a <= 9e-52) tmp = Float64(Float64(log(y) + log(z)) - t); elseif (a <= 2.3e-15) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * -0.5)); else tmp = t_1; end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = (log(t) * a) - t;
tmp = 0.0;
if (a <= -2.1)
tmp = t_1;
elseif (a <= 9e-52)
tmp = (log(y) + log(z)) - t;
elseif (a <= 2.3e-15)
tmp = log((y * z)) + (log(t) * -0.5);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -2.1], t$95$1, If[LessEqual[a, 9e-52], N[(N[(N[Log[y], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 2.3e-15], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \log t \cdot a - t\\
\mathbf{if}\;a \leq -2.1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9 \cdot 10^{-52}:\\
\;\;\;\;\left(\log y + \log z\right) - t\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-15}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot -0.5\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -2.10000000000000009 or 2.2999999999999999e-15 < a Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.5%
associate-+r+71.5%
sub-neg71.5%
metadata-eval71.5%
Simplified71.5%
Taylor expanded in a around inf 97.8%
*-commutative97.8%
Simplified97.8%
if -2.10000000000000009 < a < 9.0000000000000001e-52Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in t around inf 99.3%
mul-1-neg99.3%
associate-/l*99.4%
distribute-lft-neg-in99.4%
log-rec99.4%
remove-double-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 69.2%
Taylor expanded in t around inf 45.9%
if 9.0000000000000001e-52 < a < 2.2999999999999999e-15Initial program 99.3%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 45.5%
associate-+r+45.6%
sub-neg45.6%
metadata-eval45.6%
Simplified45.6%
associate--l+45.6%
sum-log44.0%
Applied egg-rr44.0%
+-commutative44.0%
*-commutative44.0%
Simplified44.0%
Taylor expanded in a around 0 44.0%
*-commutative44.0%
Simplified44.0%
Taylor expanded in t around 0 34.8%
+-commutative34.8%
*-commutative34.8%
Simplified34.8%
Final simplification73.4%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= a -4.8e-108) (not (<= a 55000.0))) (- (* (log t) a) t) (+ (- (* (log t) (+ a -0.5)) t) (log (* y z)))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e-108) || !(a <= 55000.0)) {
tmp = (log(t) * a) - t;
} else {
tmp = ((log(t) * (a + -0.5)) - t) + log((y * z));
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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.8d-108)) .or. (.not. (a <= 55000.0d0))) then
tmp = (log(t) * a) - t
else
tmp = ((log(t) * (a + (-0.5d0))) - t) + log((y * z))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e-108) || !(a <= 55000.0)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = ((Math.log(t) * (a + -0.5)) - t) + Math.log((y * z));
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (a <= -4.8e-108) or not (a <= 55000.0): tmp = (math.log(t) * a) - t else: tmp = ((math.log(t) * (a + -0.5)) - t) + math.log((y * z)) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.8e-108) || !(a <= 55000.0)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(Float64(Float64(log(t) * Float64(a + -0.5)) - t) + log(Float64(y * z))); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((a <= -4.8e-108) || ~((a <= 55000.0)))
tmp = (log(t) * a) - t;
else
tmp = ((log(t) * (a + -0.5)) - t) + log((y * z));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.8e-108], N[Not[LessEqual[a, 55000.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 55000\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot \left(a + -0.5\right) - t\right) + \log \left(y \cdot z\right)\\
\end{array}
\end{array}
if a < -4.80000000000000034e-108 or 55000 < a Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.9%
associate-+r+71.9%
sub-neg71.9%
metadata-eval71.9%
Simplified71.9%
Taylor expanded in a around inf 93.6%
*-commutative93.6%
Simplified93.6%
if -4.80000000000000034e-108 < a < 55000Initial program 99.4%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 66.0%
associate-+r+66.1%
sub-neg66.1%
metadata-eval66.1%
Simplified66.1%
associate--l+66.0%
sum-log55.0%
Applied egg-rr55.0%
+-commutative55.0%
*-commutative55.0%
Simplified55.0%
Final simplification77.8%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= a -4.8e-108) (not (<= a 0.142))) (- (* (log t) a) t) (- (+ (log (* y z)) (* (log t) -0.5)) t)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e-108) || !(a <= 0.142)) {
tmp = (log(t) * a) - t;
} else {
tmp = (log((y * z)) + (log(t) * -0.5)) - t;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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.8d-108)) .or. (.not. (a <= 0.142d0))) then
tmp = (log(t) * a) - t
else
tmp = (log((y * z)) + (log(t) * (-0.5d0))) - t
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e-108) || !(a <= 0.142)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = (Math.log((y * z)) + (Math.log(t) * -0.5)) - t;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (a <= -4.8e-108) or not (a <= 0.142): tmp = (math.log(t) * a) - t else: tmp = (math.log((y * z)) + (math.log(t) * -0.5)) - t return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.8e-108) || !(a <= 0.142)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(Float64(log(Float64(y * z)) + Float64(log(t) * -0.5)) - t); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((a <= -4.8e-108) || ~((a <= 0.142)))
tmp = (log(t) * a) - t;
else
tmp = (log((y * z)) + (log(t) * -0.5)) - t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.8e-108], N[Not[LessEqual[a, 0.142]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 0.142\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot -0.5\right) - t\\
\end{array}
\end{array}
if a < -4.80000000000000034e-108 or 0.141999999999999987 < a Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.9%
associate-+r+71.9%
sub-neg71.9%
metadata-eval71.9%
Simplified71.9%
Taylor expanded in a around inf 93.6%
*-commutative93.6%
Simplified93.6%
if -4.80000000000000034e-108 < a < 0.141999999999999987Initial program 99.4%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 66.0%
associate-+r+66.1%
sub-neg66.1%
metadata-eval66.1%
Simplified66.1%
associate--l+66.0%
sum-log55.0%
Applied egg-rr55.0%
+-commutative55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in a around 0 55.0%
Final simplification77.8%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= a -4.8e-108) (not (<= a 0.00068))) (- (* (log t) a) t) (+ (log (* y z)) (- (* (log t) -0.5) t))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e-108) || !(a <= 0.00068)) {
tmp = (log(t) * a) - t;
} else {
tmp = log((y * z)) + ((log(t) * -0.5) - t);
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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.8d-108)) .or. (.not. (a <= 0.00068d0))) then
tmp = (log(t) * a) - t
else
tmp = log((y * z)) + ((log(t) * (-0.5d0)) - t)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.8e-108) || !(a <= 0.00068)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log((y * z)) + ((Math.log(t) * -0.5) - t);
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (a <= -4.8e-108) or not (a <= 0.00068): tmp = (math.log(t) * a) - t else: tmp = math.log((y * z)) + ((math.log(t) * -0.5) - t) return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.8e-108) || !(a <= 0.00068)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(Float64(y * z)) + Float64(Float64(log(t) * -0.5) - t)); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((a <= -4.8e-108) || ~((a <= 0.00068)))
tmp = (log(t) * a) - t;
else
tmp = log((y * z)) + ((log(t) * -0.5) - t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.8e-108], N[Not[LessEqual[a, 0.00068]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.8 \cdot 10^{-108} \lor \neg \left(a \leq 0.00068\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot z\right) + \left(\log t \cdot -0.5 - t\right)\\
\end{array}
\end{array}
if a < -4.80000000000000034e-108 or 6.8e-4 < a Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.9%
associate-+r+71.9%
sub-neg71.9%
metadata-eval71.9%
Simplified71.9%
Taylor expanded in a around inf 93.6%
*-commutative93.6%
Simplified93.6%
if -4.80000000000000034e-108 < a < 6.8e-4Initial program 99.4%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 66.0%
associate-+r+66.1%
sub-neg66.1%
metadata-eval66.1%
Simplified66.1%
associate--l+66.0%
sum-log55.0%
Applied egg-rr55.0%
+-commutative55.0%
*-commutative55.0%
Simplified55.0%
Taylor expanded in a around 0 55.0%
*-commutative55.0%
Simplified55.0%
Final simplification77.8%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (or (<= a -0.98) (not (<= a 2.6))) (- (* (log t) a) t) (- (+ (log y) (log z)) t)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.98) || !(a <= 2.6)) {
tmp = (log(t) * a) - t;
} else {
tmp = (log(y) + log(z)) - t;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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.98d0)) .or. (.not. (a <= 2.6d0))) then
tmp = (log(t) * a) - t
else
tmp = (log(y) + log(z)) - t
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.98) || !(a <= 2.6)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = (Math.log(y) + Math.log(z)) - t;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if (a <= -0.98) or not (a <= 2.6): tmp = (math.log(t) * a) - t else: tmp = (math.log(y) + math.log(z)) - t return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.98) || !(a <= 2.6)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(Float64(log(y) + log(z)) - t); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if ((a <= -0.98) || ~((a <= 2.6)))
tmp = (log(t) * a) - t;
else
tmp = (log(y) + log(z)) - t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.98], N[Not[LessEqual[a, 2.6]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.98 \lor \neg \left(a \leq 2.6\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log z\right) - t\\
\end{array}
\end{array}
if a < -0.97999999999999998 or 2.60000000000000009 < a Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.5%
associate-+r+71.5%
sub-neg71.5%
metadata-eval71.5%
Simplified71.5%
Taylor expanded in a around inf 97.8%
*-commutative97.8%
Simplified97.8%
if -0.97999999999999998 < a < 2.60000000000000009Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in t around inf 99.4%
mul-1-neg99.4%
associate-/l*99.4%
distribute-lft-neg-in99.4%
log-rec99.4%
remove-double-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 67.2%
Taylor expanded in t around inf 43.7%
Final simplification72.8%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t 0.0136) (+ (* (log t) (- a 0.5)) (log (* y z))) (- (* (log t) a) t)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0136) {
tmp = (log(t) * (a - 0.5)) + log((y * z));
} else {
tmp = (log(t) * a) - t;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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.0136d0) then
tmp = (log(t) * (a - 0.5d0)) + log((y * z))
else
tmp = (log(t) * a) - t
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0136) {
tmp = (Math.log(t) * (a - 0.5)) + Math.log((y * z));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if t <= 0.0136: tmp = (math.log(t) * (a - 0.5)) + math.log((y * z)) else: tmp = (math.log(t) * a) - t return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0136) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= 0.0136)
tmp = (log(t) * (a - 0.5)) + log((y * z));
else
tmp = (log(t) * a) - t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0136], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0136:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 0.0135999999999999992Initial program 99.2%
associate--l+99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 64.2%
associate-+r+64.3%
sub-neg64.3%
metadata-eval64.3%
Simplified64.3%
associate--l+64.3%
sum-log45.9%
Applied egg-rr45.9%
+-commutative45.9%
*-commutative45.9%
Simplified45.9%
Taylor expanded in t around 0 45.5%
if 0.0135999999999999992 < t Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 75.0%
associate-+r+75.0%
sub-neg75.0%
metadata-eval75.0%
Simplified75.0%
Taylor expanded in a around inf 96.8%
*-commutative96.8%
Simplified96.8%
Final simplification70.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (log t) a))) (if (<= t 120.0) (+ t_1 (log (+ y x))) (- t_1 t))))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if (t <= 120.0) {
tmp = t_1 + log((y + x));
} else {
tmp = t_1 - t;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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
if (t <= 120.0d0) then
tmp = t_1 + log((y + x))
else
tmp = t_1 - t
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double tmp;
if (t <= 120.0) {
tmp = t_1 + Math.log((y + x));
} else {
tmp = t_1 - t;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if t <= 120.0: tmp = t_1 + math.log((y + x)) else: tmp = t_1 - t return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (t <= 120.0) tmp = Float64(t_1 + log(Float64(y + x))); else tmp = Float64(t_1 - t); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
t_1 = log(t) * a;
tmp = 0.0;
if (t <= 120.0)
tmp = t_1 + log((y + x));
else
tmp = t_1 - t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, 120.0], N[(t$95$1 + N[Log[N[(y + x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;t \leq 120:\\
\;\;\;\;t\_1 + \log \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < 120Initial program 99.2%
associate-+l-99.2%
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 a around inf 99.2%
Taylor expanded in a around inf 56.5%
if 120 < t Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 75.7%
associate-+r+75.7%
sub-neg75.7%
metadata-eval75.7%
Simplified75.7%
Taylor expanded in a around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification76.3%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (if (<= t 12500000000000.0) (* (log t) a) (- t)))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 12500000000000.0) {
tmp = log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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 <= 12500000000000.0d0) then
tmp = log(t) * a
else
tmp = -t
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 12500000000000.0) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): tmp = 0 if t <= 12500000000000.0: tmp = math.log(t) * a else: tmp = -t return tmp
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) tmp = 0.0 if (t <= 12500000000000.0) tmp = Float64(log(t) * a); else tmp = Float64(-t); end return tmp end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp_2 = code(x, y, z, t, a)
tmp = 0.0;
if (t <= 12500000000000.0)
tmp = log(t) * a;
else
tmp = -t;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := If[LessEqual[t, 12500000000000.0], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq 12500000000000:\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.25e13Initial 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 a around inf 51.4%
*-commutative51.4%
Simplified51.4%
if 1.25e13 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
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 73.5%
neg-mul-173.5%
Simplified73.5%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (- (* (log t) a) t))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return (log(t) * a) - t;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(t) * a) - t
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(t) * a) - t;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return (math.log(t) * a) - t
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(Float64(log(t) * a) - t) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = (log(t) * a) - t;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\log t \cdot a - t
\end{array}
Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 69.5%
associate-+r+69.5%
sub-neg69.5%
metadata-eval69.5%
Simplified69.5%
Taylor expanded in a around inf 73.6%
*-commutative73.6%
Simplified73.6%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (+ (- 1.0 t) -1.0))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return (1.0 - t) + -1.0;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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 = (1.0d0 - t) + (-1.0d0)
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return (1.0 - t) + -1.0;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return (1.0 - t) + -1.0
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(Float64(1.0 - t) + -1.0) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = (1.0 - t) + -1.0;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := N[(N[(1.0 - t), $MachinePrecision] + -1.0), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
\left(1 - t\right) + -1
\end{array}
Initial 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 35.2%
neg-mul-135.2%
Simplified35.2%
expm1-log1p-u1.4%
expm1-undefine1.4%
Applied egg-rr1.4%
sub-neg1.4%
log1p-undefine1.4%
rem-exp-log35.2%
unsub-neg35.2%
metadata-eval35.2%
Simplified35.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 (- t))
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return -t;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return -t
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return Float64(-t) end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = -t;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
-t
\end{array}
Initial 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 35.2%
neg-mul-135.2%
Simplified35.2%
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a) :precision binary64 0.0)
assert(x < y && y < z && z < t && t < a);
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function.
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 = 0.0d0
end function
assert x < y && y < z && z < t && t < a;
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
[x, y, z, t, a] = sort([x, y, z, t, a]) def code(x, y, z, t, a): return 0.0
x, y, z, t, a = sort([x, y, z, t, a]) function code(x, y, z, t, a) return 0.0 end
x, y, z, t, a = num2cell(sort([x, y, z, t, a])){:}
function tmp = code(x, y, z, t, a)
tmp = 0.0;
end
NOTE: x, y, z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
[x, y, z, t, a] = \mathsf{sort}([x, y, z, t, a])\\
\\
0
\end{array}
Initial 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 35.2%
neg-mul-135.2%
Simplified35.2%
expm1-log1p-u1.4%
expm1-undefine1.4%
Applied egg-rr1.4%
sub-neg1.4%
log1p-undefine1.4%
rem-exp-log35.2%
unsub-neg35.2%
metadata-eval35.2%
Simplified35.2%
Taylor expanded in t around 0 2.4%
metadata-eval2.4%
Applied egg-rr2.4%
(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 2024135
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (+ (log (+ x y)) (+ (- (log z) t) (* (- a 1/2) (log t)))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))