
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (- (log z) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.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%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -2e+33) (not (<= (- a 0.5) 1e+83))) (* (log t) a) (- (+ (log y) (+ (log z) (* (log t) -0.5))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -2e+33) || !((a - 0.5) <= 1e+83)) {
tmp = log(t) * a;
} else {
tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a - 0.5d0) <= (-2d+33)) .or. (.not. ((a - 0.5d0) <= 1d+83))) then
tmp = log(t) * a
else
tmp = (log(y) + (log(z) + (log(t) * (-0.5d0)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -2e+33) || !((a - 0.5) <= 1e+83)) {
tmp = Math.log(t) * a;
} else {
tmp = (Math.log(y) + (Math.log(z) + (Math.log(t) * -0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -2e+33) or not ((a - 0.5) <= 1e+83): tmp = math.log(t) * a else: tmp = (math.log(y) + (math.log(z) + (math.log(t) * -0.5))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -2e+33) || !(Float64(a - 0.5) <= 1e+83)) tmp = Float64(log(t) * a); else tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * -0.5))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -2e+33) || ~(((a - 0.5) <= 1e+83))) tmp = log(t) * a; else tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+33], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 1e+83]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+33} \lor \neg \left(a - 0.5 \leq 10^{+83}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \left(\log z + \log t \cdot -0.5\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -1.9999999999999999e33 or 1.00000000000000003e83 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 72.0%
Taylor expanded in a around inf 83.4%
*-commutative83.4%
Simplified83.4%
if -1.9999999999999999e33 < (-.f64 a #s(literal 1/2 binary64)) < 1.00000000000000003e83Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 61.8%
Taylor expanded in a around 0 60.4%
Final simplification69.5%
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(y) + (log(z) + (log(t) * (a - 0.5d0)))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\right) - t
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 65.8%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 65.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)))
(if (<= a -1.4e+28)
t_1
(if (<= a 2.2e-192)
(- (log (* z (* y (pow t -0.5)))) t)
(if (<= a 7.2e-64)
(- (+ (log (* y z)) (* (log t) -0.5)) t)
(if (<= a 7.2e+82) (+ (log (+ x y)) (- (log z) t)) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if (a <= -1.4e+28) {
tmp = t_1;
} else if (a <= 2.2e-192) {
tmp = log((z * (y * pow(t, -0.5)))) - t;
} else if (a <= 7.2e-64) {
tmp = (log((y * z)) + (log(t) * -0.5)) - t;
} else if (a <= 7.2e+82) {
tmp = log((x + y)) + (log(z) - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) * a
if (a <= (-1.4d+28)) then
tmp = t_1
else if (a <= 2.2d-192) then
tmp = log((z * (y * (t ** (-0.5d0))))) - t
else if (a <= 7.2d-64) then
tmp = (log((y * z)) + (log(t) * (-0.5d0))) - t
else if (a <= 7.2d+82) then
tmp = log((x + y)) + (log(z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double tmp;
if (a <= -1.4e+28) {
tmp = t_1;
} else if (a <= 2.2e-192) {
tmp = Math.log((z * (y * Math.pow(t, -0.5)))) - t;
} else if (a <= 7.2e-64) {
tmp = (Math.log((y * z)) + (Math.log(t) * -0.5)) - t;
} else if (a <= 7.2e+82) {
tmp = Math.log((x + y)) + (Math.log(z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if a <= -1.4e+28: tmp = t_1 elif a <= 2.2e-192: tmp = math.log((z * (y * math.pow(t, -0.5)))) - t elif a <= 7.2e-64: tmp = (math.log((y * z)) + (math.log(t) * -0.5)) - t elif a <= 7.2e+82: tmp = math.log((x + y)) + (math.log(z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (a <= -1.4e+28) tmp = t_1; elseif (a <= 2.2e-192) tmp = Float64(log(Float64(z * Float64(y * (t ^ -0.5)))) - t); elseif (a <= 7.2e-64) tmp = Float64(Float64(log(Float64(y * z)) + Float64(log(t) * -0.5)) - t); elseif (a <= 7.2e+82) tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; tmp = 0.0; if (a <= -1.4e+28) tmp = t_1; elseif (a <= 2.2e-192) tmp = log((z * (y * (t ^ -0.5)))) - t; elseif (a <= 7.2e-64) tmp = (log((y * z)) + (log(t) * -0.5)) - t; elseif (a <= 7.2e+82) tmp = log((x + y)) + (log(z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1.4e+28], t$95$1, If[LessEqual[a, 2.2e-192], N[(N[Log[N[(z * N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 7.2e-64], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 7.2e+82], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a \leq -1.4 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-192}:\\
\;\;\;\;\log \left(z \cdot \left(y \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{-64}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot -0.5\right) - t\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{+82}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.4000000000000001e28 or 7.20000000000000028e82 < 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%
Taylor expanded in x around 0 72.0%
Taylor expanded in a around inf 83.4%
*-commutative83.4%
Simplified83.4%
if -1.4000000000000001e28 < a < 2.20000000000000006e-192Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
add-sqr-sqrt32.2%
pow232.2%
Applied egg-rr27.1%
Taylor expanded in a around 0 73.4%
Taylor expanded in x around 0 47.0%
+-commutative47.0%
*-commutative47.0%
Simplified47.0%
*-un-lft-identity47.0%
+-commutative47.0%
add-log-exp47.0%
sum-log45.4%
pow-to-exp45.4%
Applied egg-rr45.4%
*-lft-identity45.4%
*-commutative45.4%
associate-*l*48.5%
Simplified48.5%
if 2.20000000000000006e-192 < a < 7.1999999999999996e-64Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
add-sqr-sqrt37.2%
pow237.2%
Applied egg-rr34.3%
Taylor expanded in a around 0 93.8%
Taylor expanded in x around 0 63.3%
+-commutative63.3%
*-commutative63.3%
Simplified63.3%
if 7.1999999999999996e-64 < a < 7.20000000000000028e82Initial program 99.7%
associate-+l-99.7%
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 t around inf 72.8%
Final simplification67.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)) (t_2 (+ (log (+ x y)) (- (log z) t))))
(if (<= a -4.4e+31)
t_1
(if (<= a -1.1e-276)
t_2
(if (<= a 8.6e-247)
(log (* y (* z (pow t (+ a -0.5)))))
(if (<= a 7.2e+82) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double t_2 = log((x + y)) + (log(z) - t);
double tmp;
if (a <= -4.4e+31) {
tmp = t_1;
} else if (a <= -1.1e-276) {
tmp = t_2;
} else if (a <= 8.6e-247) {
tmp = log((y * (z * pow(t, (a + -0.5)))));
} else if (a <= 7.2e+82) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log(t) * a
t_2 = log((x + y)) + (log(z) - t)
if (a <= (-4.4d+31)) then
tmp = t_1
else if (a <= (-1.1d-276)) then
tmp = t_2
else if (a <= 8.6d-247) then
tmp = log((y * (z * (t ** (a + (-0.5d0))))))
else if (a <= 7.2d+82) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double t_2 = Math.log((x + y)) + (Math.log(z) - t);
double tmp;
if (a <= -4.4e+31) {
tmp = t_1;
} else if (a <= -1.1e-276) {
tmp = t_2;
} else if (a <= 8.6e-247) {
tmp = Math.log((y * (z * Math.pow(t, (a + -0.5)))));
} else if (a <= 7.2e+82) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a t_2 = math.log((x + y)) + (math.log(z) - t) tmp = 0 if a <= -4.4e+31: tmp = t_1 elif a <= -1.1e-276: tmp = t_2 elif a <= 8.6e-247: tmp = math.log((y * (z * math.pow(t, (a + -0.5))))) elif a <= 7.2e+82: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) t_2 = Float64(log(Float64(x + y)) + Float64(log(z) - t)) tmp = 0.0 if (a <= -4.4e+31) tmp = t_1; elseif (a <= -1.1e-276) tmp = t_2; elseif (a <= 8.6e-247) tmp = log(Float64(y * Float64(z * (t ^ Float64(a + -0.5))))); elseif (a <= 7.2e+82) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; t_2 = log((x + y)) + (log(z) - t); tmp = 0.0; if (a <= -4.4e+31) tmp = t_1; elseif (a <= -1.1e-276) tmp = t_2; elseif (a <= 8.6e-247) tmp = log((y * (z * (t ^ (a + -0.5))))); elseif (a <= 7.2e+82) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.4e+31], t$95$1, If[LessEqual[a, -1.1e-276], t$95$2, If[LessEqual[a, 8.6e-247], N[Log[N[(y * N[(z * N[Power[t, N[(a + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[a, 7.2e+82], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
t_2 := \log \left(x + y\right) + \left(\log z - t\right)\\
\mathbf{if}\;a \leq -4.4 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.1 \cdot 10^{-276}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 8.6 \cdot 10^{-247}:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{+82}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.4000000000000002e31 or 7.20000000000000028e82 < 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%
Taylor expanded in x around 0 72.0%
Taylor expanded in a around inf 83.4%
*-commutative83.4%
Simplified83.4%
if -4.4000000000000002e31 < a < -1.0999999999999999e-276 or 8.6000000000000001e-247 < a < 7.20000000000000028e82Initial program 99.7%
associate-+l-99.7%
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 t around inf 67.0%
if -1.0999999999999999e-276 < a < 8.6000000000000001e-247Initial program 98.8%
associate--l+98.8%
+-commutative98.8%
associate-+l+99.0%
+-commutative99.0%
fma-define99.0%
sub-neg99.0%
metadata-eval99.0%
Simplified99.0%
Taylor expanded in x around 0 48.0%
add-log-exp37.1%
exp-sum31.6%
exp-diff31.6%
add-exp-log31.4%
exp-sum31.5%
add-exp-log32.6%
sub-neg32.6%
metadata-eval32.6%
exp-to-pow32.7%
Applied egg-rr32.7%
Taylor expanded in t around 0 37.0%
exp-to-pow37.1%
sub-neg37.1%
metadata-eval37.1%
Simplified37.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -1e+52) (not (<= (- a 0.5) 5e+111))) (* (log t) a) (- (+ (* (log t) (- a 0.5)) (log (* (+ x y) z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -1e+52) || !((a - 0.5) <= 5e+111)) {
tmp = log(t) * a;
} else {
tmp = ((log(t) * (a - 0.5)) + log(((x + y) * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a - 0.5d0) <= (-1d+52)) .or. (.not. ((a - 0.5d0) <= 5d+111))) then
tmp = log(t) * a
else
tmp = ((log(t) * (a - 0.5d0)) + log(((x + y) * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -1e+52) || !((a - 0.5) <= 5e+111)) {
tmp = Math.log(t) * a;
} else {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log(((x + y) * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -1e+52) or not ((a - 0.5) <= 5e+111): tmp = math.log(t) * a else: tmp = ((math.log(t) * (a - 0.5)) + math.log(((x + y) * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -1e+52) || !(Float64(a - 0.5) <= 5e+111)) tmp = Float64(log(t) * a); else tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(Float64(x + y) * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -1e+52) || ~(((a - 0.5) <= 5e+111))) tmp = log(t) * a; else tmp = ((log(t) * (a - 0.5)) + log(((x + y) * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -1e+52], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 5e+111]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -1 \cdot 10^{+52} \lor \neg \left(a - 0.5 \leq 5 \cdot 10^{+111}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(\left(x + y\right) \cdot z\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -9.9999999999999999e51 or 4.9999999999999997e111 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 69.8%
Taylor expanded in a around inf 86.4%
*-commutative86.4%
Simplified86.4%
if -9.9999999999999999e51 < (-.f64 a #s(literal 1/2 binary64)) < 4.9999999999999997e111Initial program 99.6%
associate-+l-99.6%
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%
associate-+r-99.6%
fma-undefine99.6%
associate--r+99.6%
+-commutative99.6%
sum-log77.8%
Applied egg-rr77.8%
Final simplification80.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -1e+52) (not (<= (- a 0.5) 5e+111))) (* (log t) a) (- (+ (* (log t) (- a 0.5)) (log (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -1e+52) || !((a - 0.5) <= 5e+111)) {
tmp = log(t) * a;
} else {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a - 0.5d0) <= (-1d+52)) .or. (.not. ((a - 0.5d0) <= 5d+111))) then
tmp = log(t) * a
else
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -1e+52) || !((a - 0.5) <= 5e+111)) {
tmp = Math.log(t) * a;
} else {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -1e+52) or not ((a - 0.5) <= 5e+111): tmp = math.log(t) * a else: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -1e+52) || !(Float64(a - 0.5) <= 5e+111)) tmp = Float64(log(t) * a); else tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -1e+52) || ~(((a - 0.5) <= 5e+111))) tmp = log(t) * a; else tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -1e+52], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 5e+111]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -1 \cdot 10^{+52} \lor \neg \left(a - 0.5 \leq 5 \cdot 10^{+111}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -9.9999999999999999e51 or 4.9999999999999997e111 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 69.8%
Taylor expanded in a around inf 86.4%
*-commutative86.4%
Simplified86.4%
if -9.9999999999999999e51 < (-.f64 a #s(literal 1/2 binary64)) < 4.9999999999999997e111Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
add-sqr-sqrt31.0%
pow231.0%
Applied egg-rr26.0%
Taylor expanded in x around 0 47.3%
Final simplification60.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)))
(if (<= a -5.7e+30)
t_1
(if (<= a 7.7e-100)
(- (log (* z (* y (pow t -0.5)))) t)
(if (<= a 7.2e+82) (+ (log (+ x y)) (- (log z) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if (a <= -5.7e+30) {
tmp = t_1;
} else if (a <= 7.7e-100) {
tmp = log((z * (y * pow(t, -0.5)))) - t;
} else if (a <= 7.2e+82) {
tmp = log((x + y)) + (log(z) - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) * a
if (a <= (-5.7d+30)) then
tmp = t_1
else if (a <= 7.7d-100) then
tmp = log((z * (y * (t ** (-0.5d0))))) - t
else if (a <= 7.2d+82) then
tmp = log((x + y)) + (log(z) - t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double tmp;
if (a <= -5.7e+30) {
tmp = t_1;
} else if (a <= 7.7e-100) {
tmp = Math.log((z * (y * Math.pow(t, -0.5)))) - t;
} else if (a <= 7.2e+82) {
tmp = Math.log((x + y)) + (Math.log(z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if a <= -5.7e+30: tmp = t_1 elif a <= 7.7e-100: tmp = math.log((z * (y * math.pow(t, -0.5)))) - t elif a <= 7.2e+82: tmp = math.log((x + y)) + (math.log(z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (a <= -5.7e+30) tmp = t_1; elseif (a <= 7.7e-100) tmp = Float64(log(Float64(z * Float64(y * (t ^ -0.5)))) - t); elseif (a <= 7.2e+82) tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; tmp = 0.0; if (a <= -5.7e+30) tmp = t_1; elseif (a <= 7.7e-100) tmp = log((z * (y * (t ^ -0.5)))) - t; elseif (a <= 7.2e+82) tmp = log((x + y)) + (log(z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -5.7e+30], t$95$1, If[LessEqual[a, 7.7e-100], N[(N[Log[N[(z * N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 7.2e+82], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a \leq -5.7 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.7 \cdot 10^{-100}:\\
\;\;\;\;\log \left(z \cdot \left(y \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{+82}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.7000000000000002e30 or 7.20000000000000028e82 < 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%
Taylor expanded in x around 0 72.0%
Taylor expanded in a around inf 83.4%
*-commutative83.4%
Simplified83.4%
if -5.7000000000000002e30 < a < 7.69999999999999975e-100Initial 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-sqr-sqrt33.8%
pow233.8%
Applied egg-rr29.0%
Taylor expanded in a around 0 77.4%
Taylor expanded in x around 0 51.7%
+-commutative51.7%
*-commutative51.7%
Simplified51.7%
*-un-lft-identity51.7%
+-commutative51.7%
add-log-exp51.7%
sum-log47.9%
pow-to-exp48.0%
Applied egg-rr48.0%
*-lft-identity48.0%
*-commutative48.0%
associate-*l*49.6%
Simplified49.6%
if 7.69999999999999975e-100 < a < 7.20000000000000028e82Initial 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 t around inf 71.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.7e+29) (not (<= a 7.6e+82))) (* (log t) a) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.7e+29) || !(a <= 7.6e+82)) {
tmp = log(t) * a;
} else {
tmp = log((x + y)) + (log(z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.7d+29)) .or. (.not. (a <= 7.6d+82))) then
tmp = log(t) * a
else
tmp = log((x + y)) + (log(z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.7e+29) || !(a <= 7.6e+82)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log((x + y)) + (Math.log(z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.7e+29) or not (a <= 7.6e+82): tmp = math.log(t) * a else: tmp = math.log((x + y)) + (math.log(z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.7e+29) || !(a <= 7.6e+82)) tmp = Float64(log(t) * a); else tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.7e+29) || ~((a <= 7.6e+82))) tmp = log(t) * a; else tmp = log((x + y)) + (log(z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.7e+29], N[Not[LessEqual[a, 7.6e+82]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+29} \lor \neg \left(a \leq 7.6 \cdot 10^{+82}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\end{array}
\end{array}
if a < -2.7e29 or 7.60000000000000067e82 < 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%
Taylor expanded in x around 0 72.0%
Taylor expanded in a around inf 83.4%
*-commutative83.4%
Simplified83.4%
if -2.7e29 < a < 7.60000000000000067e82Initial program 99.6%
associate-+l-99.6%
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 t around inf 63.7%
Final simplification71.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.3e+28) (not (<= a 8.8e+82))) (* (log t) a) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.3e+28) || !(a <= 8.8e+82)) {
tmp = log(t) * a;
} 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 <= (-6.3d+28)) .or. (.not. (a <= 8.8d+82))) then
tmp = log(t) * a
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 <= -6.3e+28) || !(a <= 8.8e+82)) {
tmp = Math.log(t) * a;
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.3e+28) or not (a <= 8.8e+82): tmp = math.log(t) * a else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.3e+28) || !(a <= 8.8e+82)) tmp = Float64(log(t) * a); 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 <= -6.3e+28) || ~((a <= 8.8e+82))) tmp = log(t) * a; else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.3e+28], N[Not[LessEqual[a, 8.8e+82]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.3 \cdot 10^{+28} \lor \neg \left(a \leq 8.8 \cdot 10^{+82}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -6.3000000000000001e28 or 8.8000000000000005e82 < 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%
Taylor expanded in x around 0 72.0%
Taylor expanded in a around inf 83.4%
*-commutative83.4%
Simplified83.4%
if -6.3000000000000001e28 < a < 8.8000000000000005e82Initial program 99.6%
associate-+l-99.6%
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 t around inf 99.7%
mul-1-neg99.7%
unsub-neg99.7%
associate-/l*99.7%
log-rec99.7%
Simplified99.7%
Taylor expanded in x around 0 61.7%
sub-neg61.7%
mul-1-neg61.7%
remove-double-neg61.7%
associate-/l*61.7%
Simplified61.7%
Taylor expanded in t around inf 44.3%
Final simplification59.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.28e+29) (not (<= a 8e+82))) (* (log t) a) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.28e+29) || !(a <= 8e+82)) {
tmp = log(t) * a;
} else {
tmp = log((x + y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.28d+29)) .or. (.not. (a <= 8d+82))) then
tmp = log(t) * a
else
tmp = log((x + y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.28e+29) || !(a <= 8e+82)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.28e+29) or not (a <= 8e+82): tmp = math.log(t) * a else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.28e+29) || !(a <= 8e+82)) tmp = Float64(log(t) * a); else tmp = Float64(log(Float64(x + y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.28e+29) || ~((a <= 8e+82))) tmp = log(t) * a; else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.28e+29], N[Not[LessEqual[a, 8e+82]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.28 \cdot 10^{+29} \lor \neg \left(a \leq 8 \cdot 10^{+82}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -1.28e29 or 7.9999999999999997e82 < 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%
Taylor expanded in x around 0 72.0%
Taylor expanded in a around inf 83.4%
*-commutative83.4%
Simplified83.4%
if -1.28e29 < a < 7.9999999999999997e82Initial program 99.6%
associate-+l-99.6%
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 t around inf 62.8%
neg-mul-162.8%
Simplified62.8%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 8e+27) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 8e+27) {
tmp = log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 8d+27) then
tmp = log(t) * a
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 8e+27) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 8e+27: tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 8e+27) tmp = Float64(log(t) * a); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 8e+27) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 8e+27], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8 \cdot 10^{+27}:\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 8.0000000000000001e27Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 59.4%
Taylor expanded in a around inf 51.9%
*-commutative51.9%
Simplified51.9%
if 8.0000000000000001e27 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 72.9%
Taylor expanded in t around inf 82.8%
neg-mul-182.8%
Simplified82.8%
(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%
+-commutative99.6%
associate-+l+99.7%
+-commutative99.7%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 65.8%
Taylor expanded in t around inf 41.5%
neg-mul-141.5%
Simplified41.5%
(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 2024086
(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))))