
(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}
(FPCore (x y z t a) :precision binary64 (fma (+ a -0.5) (log t) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
return fma((a + -0.5), log(t), (log((x + y)) + (log(z) - t)));
}
function code(x, y, z, t, a) return fma(Float64(a + -0.5), log(t), Float64(log(Float64(x + y)) + Float64(log(z) - t))) end
code[x_, y_, z_, t_, a_] := N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, \log t, \log \left(x + y\right) + \left(\log z - t\right)\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 98.0) (+ (log z) (+ (log (+ x y)) (* (log t) (- a 0.5)))) (+ (- (log z) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 98.0) {
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) - t) + (a * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 98.0d0) then
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) - t) + (a * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 98.0) {
tmp = Math.log(z) + (Math.log((x + y)) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 98.0: tmp = math.log(z) + (math.log((x + y)) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 98.0) tmp = Float64(log(z) + Float64(log(Float64(x + y)) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 98.0) tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5))); else tmp = (log(z) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 98.0], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 98:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if t < 98Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
associate-+r+99.3%
+-commutative99.3%
fma-define99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around 0 98.2%
associate-+r+98.3%
+-commutative98.3%
log-prod69.5%
sub-neg69.5%
metadata-eval69.5%
*-commutative69.5%
+-commutative69.5%
fma-define69.5%
+-commutative69.5%
Simplified69.5%
Taylor expanded in z around 0 98.2%
if 98 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification98.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 240.0) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (+ (- (log z) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 240.0) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) - t) + (a * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 240.0d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) - t) + (a * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 240.0) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 240.0: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 240.0) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 240.0) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(z) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 240.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[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 240:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if t < 240Initial program 99.4%
Taylor expanded in x around 0 56.0%
Taylor expanded in t around 0 55.5%
if 240 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 98.4%
*-commutative98.4%
Simplified98.4%
Final simplification78.1%
(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 z) (log y)) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log(z) + log(y)) - t) + (log(t) * (a - 0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log(z) + log(y)) - t) + (log(t) * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log(z) + Math.log(y)) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log(z) + math.log(y)) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(z) + log(y)) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log(z) + log(y)) - t) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log z + \log y\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.6%
Taylor expanded in x around 0 63.5%
Final simplification63.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))) (t_2 (+ (log (* y z)) (* -0.5 (log t)))))
(if (<= t 6.4e-231)
t_2
(if (<= t 1.12e-169) (+ (log z) t_1) (if (<= t 4.5e-89) t_2 (- t_1 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double t_2 = log((y * z)) + (-0.5 * log(t));
double tmp;
if (t <= 6.4e-231) {
tmp = t_2;
} else if (t <= 1.12e-169) {
tmp = log(z) + t_1;
} else if (t <= 4.5e-89) {
tmp = t_2;
} else {
tmp = t_1 - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * log(t)
t_2 = log((y * z)) + ((-0.5d0) * log(t))
if (t <= 6.4d-231) then
tmp = t_2
else if (t <= 1.12d-169) then
tmp = log(z) + t_1
else if (t <= 4.5d-89) then
tmp = t_2
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double t_2 = Math.log((y * z)) + (-0.5 * Math.log(t));
double tmp;
if (t <= 6.4e-231) {
tmp = t_2;
} else if (t <= 1.12e-169) {
tmp = Math.log(z) + t_1;
} else if (t <= 4.5e-89) {
tmp = t_2;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) t_2 = math.log((y * z)) + (-0.5 * math.log(t)) tmp = 0 if t <= 6.4e-231: tmp = t_2 elif t <= 1.12e-169: tmp = math.log(z) + t_1 elif t <= 4.5e-89: tmp = t_2 else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) t_2 = Float64(log(Float64(y * z)) + Float64(-0.5 * log(t))) tmp = 0.0 if (t <= 6.4e-231) tmp = t_2; elseif (t <= 1.12e-169) tmp = Float64(log(z) + t_1); elseif (t <= 4.5e-89) tmp = t_2; else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); t_2 = log((y * z)) + (-0.5 * log(t)); tmp = 0.0; if (t <= 6.4e-231) tmp = t_2; elseif (t <= 1.12e-169) tmp = log(z) + t_1; elseif (t <= 4.5e-89) tmp = t_2; else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 6.4e-231], t$95$2, If[LessEqual[t, 1.12e-169], N[(N[Log[z], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 4.5e-89], t$95$2, N[(t$95$1 - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \log \left(y \cdot z\right) + -0.5 \cdot \log t\\
\mathbf{if}\;t \leq 6.4 \cdot 10^{-231}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-169}:\\
\;\;\;\;\log z + t\_1\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{-89}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < 6.40000000000000016e-231 or 1.11999999999999998e-169 < t < 4.4999999999999999e-89Initial program 99.2%
+-commutative99.2%
associate--l+99.2%
associate-+r+99.2%
+-commutative99.2%
fma-define99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in t around 0 99.2%
associate-+r+99.2%
+-commutative99.2%
log-prod76.7%
sub-neg76.7%
metadata-eval76.7%
*-commutative76.7%
+-commutative76.7%
fma-define76.7%
+-commutative76.7%
Simplified76.7%
Taylor expanded in a around 0 58.2%
Taylor expanded in x around 0 24.4%
+-commutative24.4%
*-commutative24.4%
*-commutative24.4%
Simplified24.4%
if 6.40000000000000016e-231 < t < 1.11999999999999998e-169Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 50.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in t around 0 50.1%
if 4.4999999999999999e-89 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in a around 0 99.7%
Taylor expanded in a around inf 89.8%
Final simplification70.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))) (t_2 (+ (log (* y z)) (* -0.5 (log t)))))
(if (<= t 5.3e-230)
t_2
(if (<= t 1.85e-169)
(+ (log z) t_1)
(if (<= t 3.5e-89) t_2 (+ (- (log z) t) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double t_2 = log((y * z)) + (-0.5 * log(t));
double tmp;
if (t <= 5.3e-230) {
tmp = t_2;
} else if (t <= 1.85e-169) {
tmp = log(z) + t_1;
} else if (t <= 3.5e-89) {
tmp = t_2;
} else {
tmp = (log(z) - t) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a * log(t)
t_2 = log((y * z)) + ((-0.5d0) * log(t))
if (t <= 5.3d-230) then
tmp = t_2
else if (t <= 1.85d-169) then
tmp = log(z) + t_1
else if (t <= 3.5d-89) then
tmp = t_2
else
tmp = (log(z) - t) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double t_2 = Math.log((y * z)) + (-0.5 * Math.log(t));
double tmp;
if (t <= 5.3e-230) {
tmp = t_2;
} else if (t <= 1.85e-169) {
tmp = Math.log(z) + t_1;
} else if (t <= 3.5e-89) {
tmp = t_2;
} else {
tmp = (Math.log(z) - t) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) t_2 = math.log((y * z)) + (-0.5 * math.log(t)) tmp = 0 if t <= 5.3e-230: tmp = t_2 elif t <= 1.85e-169: tmp = math.log(z) + t_1 elif t <= 3.5e-89: tmp = t_2 else: tmp = (math.log(z) - t) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) t_2 = Float64(log(Float64(y * z)) + Float64(-0.5 * log(t))) tmp = 0.0 if (t <= 5.3e-230) tmp = t_2; elseif (t <= 1.85e-169) tmp = Float64(log(z) + t_1); elseif (t <= 3.5e-89) tmp = t_2; else tmp = Float64(Float64(log(z) - t) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); t_2 = log((y * z)) + (-0.5 * log(t)); tmp = 0.0; if (t <= 5.3e-230) tmp = t_2; elseif (t <= 1.85e-169) tmp = log(z) + t_1; elseif (t <= 3.5e-89) tmp = t_2; else tmp = (log(z) - t) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 5.3e-230], t$95$2, If[LessEqual[t, 1.85e-169], N[(N[Log[z], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 3.5e-89], t$95$2, N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \log \left(y \cdot z\right) + -0.5 \cdot \log t\\
\mathbf{if}\;t \leq 5.3 \cdot 10^{-230}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{-169}:\\
\;\;\;\;\log z + t\_1\\
\mathbf{elif}\;t \leq 3.5 \cdot 10^{-89}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + t\_1\\
\end{array}
\end{array}
if t < 5.2999999999999998e-230 or 1.8499999999999999e-169 < t < 3.4999999999999997e-89Initial program 99.2%
+-commutative99.2%
associate--l+99.2%
associate-+r+99.2%
+-commutative99.2%
fma-define99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in t around 0 99.2%
associate-+r+99.2%
+-commutative99.2%
log-prod76.7%
sub-neg76.7%
metadata-eval76.7%
*-commutative76.7%
+-commutative76.7%
fma-define76.7%
+-commutative76.7%
Simplified76.7%
Taylor expanded in a around 0 58.2%
Taylor expanded in x around 0 24.4%
+-commutative24.4%
*-commutative24.4%
*-commutative24.4%
Simplified24.4%
if 5.2999999999999998e-230 < t < 1.8499999999999999e-169Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 50.1%
*-commutative50.1%
Simplified50.1%
Taylor expanded in t around 0 50.1%
if 3.4999999999999997e-89 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in a around inf 90.6%
*-commutative90.6%
Simplified90.6%
Final simplification71.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 11000000000.0) (- (+ (* (+ a -0.5) (log t)) (log (* (+ x y) z))) t) (+ (- (log z) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 11000000000.0) {
tmp = (((a + -0.5) * log(t)) + log(((x + y) * z))) - t;
} else {
tmp = (log(z) - t) + (a * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 11000000000.0d0) then
tmp = (((a + (-0.5d0)) * log(t)) + log(((x + y) * z))) - t
else
tmp = (log(z) - t) + (a * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 11000000000.0) {
tmp = (((a + -0.5) * Math.log(t)) + Math.log(((x + y) * z))) - t;
} else {
tmp = (Math.log(z) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 11000000000.0: tmp = (((a + -0.5) * math.log(t)) + math.log(((x + y) * z))) - t else: tmp = (math.log(z) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 11000000000.0) tmp = Float64(Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(Float64(x + y) * z))) - t); else tmp = Float64(Float64(log(z) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 11000000000.0) tmp = (((a + -0.5) * log(t)) + log(((x + y) * z))) - t; else tmp = (log(z) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 11000000000.0], N[(N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 11000000000:\\
\;\;\;\;\left(\left(a + -0.5\right) \cdot \log t + \log \left(\left(x + y\right) \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if t < 1.1e10Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
associate-+r+99.3%
+-commutative99.3%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
+-commutative99.4%
fma-undefine99.3%
metadata-eval99.3%
sub-neg99.3%
associate-+r+99.4%
associate-+r-99.4%
associate-+r-99.4%
sub-neg99.4%
metadata-eval99.4%
sum-log71.3%
Applied egg-rr71.3%
if 1.1e10 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 99.3%
*-commutative99.3%
Simplified99.3%
Final simplification85.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= t 2.1e-169)
(+ (log z) t_1)
(if (<= t 5e-89) (log (* (* y z) (pow t -0.5))) (- t_1 t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (t <= 2.1e-169) {
tmp = log(z) + t_1;
} else if (t <= 5e-89) {
tmp = log(((y * z) * pow(t, -0.5)));
} else {
tmp = t_1 - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (t <= 2.1d-169) then
tmp = log(z) + t_1
else if (t <= 5d-89) then
tmp = log(((y * z) * (t ** (-0.5d0))))
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (t <= 2.1e-169) {
tmp = Math.log(z) + t_1;
} else if (t <= 5e-89) {
tmp = Math.log(((y * z) * Math.pow(t, -0.5)));
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if t <= 2.1e-169: tmp = math.log(z) + t_1 elif t <= 5e-89: tmp = math.log(((y * z) * math.pow(t, -0.5))) else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (t <= 2.1e-169) tmp = Float64(log(z) + t_1); elseif (t <= 5e-89) tmp = log(Float64(Float64(y * z) * (t ^ -0.5))); else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (t <= 2.1e-169) tmp = log(z) + t_1; elseif (t <= 5e-89) tmp = log(((y * z) * (t ^ -0.5))); else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 2.1e-169], N[(N[Log[z], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 5e-89], N[Log[N[(N[(y * z), $MachinePrecision] * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;t \leq 2.1 \cdot 10^{-169}:\\
\;\;\;\;\log z + t\_1\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-89}:\\
\;\;\;\;\log \left(\left(y \cdot z\right) \cdot {t}^{-0.5}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < 2.1000000000000001e-169Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
associate-+r+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in a around inf 42.8%
*-commutative42.8%
Simplified42.8%
Taylor expanded in t around 0 42.8%
if 2.1000000000000001e-169 < t < 4.99999999999999967e-89Initial program 99.2%
+-commutative99.2%
associate--l+99.2%
associate-+r+99.1%
+-commutative99.1%
fma-define99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in t around 0 99.1%
associate-+r+99.2%
+-commutative99.2%
log-prod79.9%
sub-neg79.9%
metadata-eval79.9%
*-commutative79.9%
+-commutative79.9%
fma-define79.8%
+-commutative79.8%
Simplified79.8%
Taylor expanded in a around 0 57.5%
add-log-exp57.5%
sum-log52.2%
+-commutative52.2%
*-commutative52.2%
pow-to-exp52.4%
Applied egg-rr52.4%
Taylor expanded in y around inf 23.4%
*-commutative23.4%
Simplified23.4%
if 4.99999999999999967e-89 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in a around 0 99.7%
Taylor expanded in a around inf 89.8%
Final simplification71.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 24000000000.0) (- (+ (* (+ a -0.5) (log t)) (log (* y z))) t) (+ (- (log z) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 24000000000.0) {
tmp = (((a + -0.5) * log(t)) + log((y * z))) - t;
} else {
tmp = (log(z) - t) + (a * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 24000000000.0d0) then
tmp = (((a + (-0.5d0)) * log(t)) + log((y * z))) - t
else
tmp = (log(z) - t) + (a * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 24000000000.0) {
tmp = (((a + -0.5) * Math.log(t)) + Math.log((y * z))) - t;
} else {
tmp = (Math.log(z) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 24000000000.0: tmp = (((a + -0.5) * math.log(t)) + math.log((y * z))) - t else: tmp = (math.log(z) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 24000000000.0) tmp = Float64(Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(y * z))) - t); else tmp = Float64(Float64(log(z) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 24000000000.0) tmp = (((a + -0.5) * log(t)) + log((y * z))) - t; else tmp = (log(z) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 24000000000.0], N[(N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 24000000000:\\
\;\;\;\;\left(\left(a + -0.5\right) \cdot \log t + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if t < 2.4e10Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
associate-+r+99.3%
+-commutative99.3%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in a around 0 99.4%
Taylor expanded in x around 0 56.2%
distribute-rgt-in56.2%
associate-+r+56.3%
log-prod39.9%
Simplified39.9%
if 2.4e10 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 99.3%
*-commutative99.3%
Simplified99.3%
Final simplification70.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 2.15e-5) (+ (* (log t) (- a 0.5)) (log (* y z))) (+ (- (log z) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.15e-5) {
tmp = (log(t) * (a - 0.5)) + log((y * z));
} else {
tmp = (log(z) - t) + (a * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 2.15d-5) then
tmp = (log(t) * (a - 0.5d0)) + log((y * z))
else
tmp = (log(z) - t) + (a * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.15e-5) {
tmp = (Math.log(t) * (a - 0.5)) + Math.log((y * z));
} else {
tmp = (Math.log(z) - t) + (a * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.15e-5: tmp = (math.log(t) * (a - 0.5)) + math.log((y * z)) else: tmp = (math.log(z) - t) + (a * math.log(t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.15e-5) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))); else tmp = Float64(Float64(log(z) - t) + Float64(a * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2.15e-5) tmp = (log(t) * (a - 0.5)) + log((y * z)); else tmp = (log(z) - t) + (a * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.15e-5], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.15 \cdot 10^{-5}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + a \cdot \log t\\
\end{array}
\end{array}
if t < 2.1500000000000001e-5Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
associate-+r+99.3%
+-commutative99.3%
fma-define99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around 0 98.6%
associate-+r+98.7%
+-commutative98.7%
log-prod70.3%
sub-neg70.3%
metadata-eval70.3%
*-commutative70.3%
+-commutative70.3%
fma-define70.3%
+-commutative70.3%
Simplified70.3%
Taylor expanded in x around 0 38.9%
if 2.1500000000000001e-5 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around inf 97.9%
*-commutative97.9%
Simplified97.9%
Final simplification70.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (log t)))) (if (<= t 600.0) (+ (log z) t_1) (- t_1 t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (t <= 600.0) {
tmp = log(z) + t_1;
} else {
tmp = t_1 - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (t <= 600.0d0) then
tmp = log(z) + t_1
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (t <= 600.0) {
tmp = Math.log(z) + t_1;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if t <= 600.0: tmp = math.log(z) + t_1 else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (t <= 600.0) tmp = Float64(log(z) + t_1); else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (t <= 600.0) tmp = log(z) + t_1; else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 600.0], N[(N[Log[z], $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;t \leq 600:\\
\;\;\;\;\log z + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < 600Initial program 99.4%
+-commutative99.4%
associate--l+99.4%
associate-+r+99.3%
+-commutative99.3%
fma-define99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in a around inf 46.4%
*-commutative46.4%
Simplified46.4%
Taylor expanded in t around 0 46.4%
if 600 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in a around inf 98.4%
Final simplification73.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.85e+64) (not (<= a 4.2e+154))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.85e+64) || !(a <= 4.2e+154)) {
tmp = a * log(t);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3.85d+64)) .or. (.not. (a <= 4.2d+154))) then
tmp = a * log(t)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.85e+64) || !(a <= 4.2e+154)) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.85e+64) or not (a <= 4.2e+154): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.85e+64) || !(a <= 4.2e+154)) tmp = Float64(a * log(t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.85e+64) || ~((a <= 4.2e+154))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.85e+64], N[Not[LessEqual[a, 4.2e+154]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.85 \cdot 10^{+64} \lor \neg \left(a \leq 4.2 \cdot 10^{+154}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -3.85e64 or 4.19999999999999989e154 < a Initial program 99.6%
Taylor expanded in x around 0 73.5%
Taylor expanded in a around inf 86.1%
*-commutative86.1%
Simplified86.1%
if -3.85e64 < a < 4.19999999999999989e154Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in t around inf 50.0%
neg-mul-150.0%
Simplified50.0%
Final simplification61.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9.4e+76) (not (<= a 4.2e+154))) (* a (log t)) (- (log z) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.4e+76) || !(a <= 4.2e+154)) {
tmp = a * log(t);
} else {
tmp = 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 <= (-9.4d+76)) .or. (.not. (a <= 4.2d+154))) then
tmp = a * log(t)
else
tmp = 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 <= -9.4e+76) || !(a <= 4.2e+154)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log(z) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9.4e+76) or not (a <= 4.2e+154): tmp = a * math.log(t) else: tmp = math.log(z) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -9.4e+76) || !(a <= 4.2e+154)) tmp = Float64(a * log(t)); else tmp = Float64(log(z) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -9.4e+76) || ~((a <= 4.2e+154))) tmp = a * log(t); else tmp = log(z) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9.4e+76], N[Not[LessEqual[a, 4.2e+154]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.4 \cdot 10^{+76} \lor \neg \left(a \leq 4.2 \cdot 10^{+154}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log z - t\\
\end{array}
\end{array}
if a < -9.4000000000000006e76 or 4.19999999999999989e154 < a Initial program 99.6%
Taylor expanded in x around 0 73.4%
Taylor expanded in a around inf 87.9%
*-commutative87.9%
Simplified87.9%
if -9.4000000000000006e76 < a < 4.19999999999999989e154Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 62.9%
*-commutative62.9%
Simplified62.9%
Taylor expanded in a around 0 54.6%
Final simplification64.5%
(FPCore (x y z t a) :precision binary64 (- (* a (log t)) t))
double code(double x, double y, double z, double t, double a) {
return (a * log(t)) - 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 = (a * log(t)) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * Math.log(t)) - t;
}
def code(x, y, z, t, a): return (a * math.log(t)) - t
function code(x, y, z, t, a) return Float64(Float64(a * log(t)) - t) end
function tmp = code(x, y, z, t, a) tmp = (a * log(t)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \log t - t
\end{array}
Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around 0 99.6%
Taylor expanded in a around inf 70.9%
Final simplification70.9%
(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%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in t around inf 39.4%
neg-mul-139.4%
Simplified39.4%
Final simplification39.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 2024046
(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))))