
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (fma (+ a -0.5) (log t) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + fma((a + -0.5), log(t), (log(z) - t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + fma(Float64(a + -0.5), log(t), Float64(log(z) - t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \mathsf{fma}\left(a + -0.5, \log t, \log z - t\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))))
(if (<= t 0.44)
(+ t_1 (+ (log z) (log y)))
(if (<= t 1e+180)
(- (+ t_1 (log (* y z))) t)
(- (+ (log z) (+ (log y) (* -0.5 (log t)))) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * (a - 0.5);
double tmp;
if (t <= 0.44) {
tmp = t_1 + (log(z) + log(y));
} else if (t <= 1e+180) {
tmp = (t_1 + log((y * z))) - t;
} else {
tmp = (log(z) + (log(y) + (-0.5 * log(t)))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) * (a - 0.5d0)
if (t <= 0.44d0) then
tmp = t_1 + (log(z) + log(y))
else if (t <= 1d+180) then
tmp = (t_1 + log((y * z))) - t
else
tmp = (log(z) + (log(y) + ((-0.5d0) * log(t)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * (a - 0.5);
double tmp;
if (t <= 0.44) {
tmp = t_1 + (Math.log(z) + Math.log(y));
} else if (t <= 1e+180) {
tmp = (t_1 + Math.log((y * z))) - t;
} else {
tmp = (Math.log(z) + (Math.log(y) + (-0.5 * Math.log(t)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) tmp = 0 if t <= 0.44: tmp = t_1 + (math.log(z) + math.log(y)) elif t <= 1e+180: tmp = (t_1 + math.log((y * z))) - t else: tmp = (math.log(z) + (math.log(y) + (-0.5 * math.log(t)))) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) tmp = 0.0 if (t <= 0.44) tmp = Float64(t_1 + Float64(log(z) + log(y))); elseif (t <= 1e+180) tmp = Float64(Float64(t_1 + log(Float64(y * z))) - t); else tmp = Float64(Float64(log(z) + Float64(log(y) + Float64(-0.5 * log(t)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); tmp = 0.0; if (t <= 0.44) tmp = t_1 + (log(z) + log(y)); elseif (t <= 1e+180) tmp = (t_1 + log((y * z))) - t; else tmp = (log(z) + (log(y) + (-0.5 * log(t)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 0.44], N[(t$95$1 + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+180], N[(N[(t$95$1 + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 0.44:\\
\;\;\;\;t_1 + \left(\log z + \log y\right)\\
\mathbf{elif}\;t \leq 10^{+180}:\\
\;\;\;\;\left(t_1 + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \left(\log y + -0.5 \cdot \log t\right)\right) - t\\
\end{array}
\end{array}
if t < 0.440000000000000002Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 61.4%
Taylor expanded in t around 0 61.4%
if 0.440000000000000002 < t < 1e180Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r-99.9%
associate-+l-99.9%
+-commutative99.9%
sum-log88.6%
sub-neg88.6%
metadata-eval88.6%
Applied egg-rr88.6%
Taylor expanded in x around 0 64.8%
if 1e180 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 70.3%
Taylor expanded in a around 0 65.1%
Final simplification63.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))))
(if (<= t 0.43)
(+ (log (+ x y)) (+ (log z) t_1))
(if (<= t 9.8e+179)
(- (+ t_1 (log (* y z))) t)
(- (+ (log z) (+ (log y) (* -0.5 (log t)))) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * (a - 0.5);
double tmp;
if (t <= 0.43) {
tmp = log((x + y)) + (log(z) + t_1);
} else if (t <= 9.8e+179) {
tmp = (t_1 + log((y * z))) - t;
} else {
tmp = (log(z) + (log(y) + (-0.5 * log(t)))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) * (a - 0.5d0)
if (t <= 0.43d0) then
tmp = log((x + y)) + (log(z) + t_1)
else if (t <= 9.8d+179) then
tmp = (t_1 + log((y * z))) - t
else
tmp = (log(z) + (log(y) + ((-0.5d0) * log(t)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * (a - 0.5);
double tmp;
if (t <= 0.43) {
tmp = Math.log((x + y)) + (Math.log(z) + t_1);
} else if (t <= 9.8e+179) {
tmp = (t_1 + Math.log((y * z))) - t;
} else {
tmp = (Math.log(z) + (Math.log(y) + (-0.5 * Math.log(t)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) tmp = 0 if t <= 0.43: tmp = math.log((x + y)) + (math.log(z) + t_1) elif t <= 9.8e+179: tmp = (t_1 + math.log((y * z))) - t else: tmp = (math.log(z) + (math.log(y) + (-0.5 * math.log(t)))) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) tmp = 0.0 if (t <= 0.43) tmp = Float64(log(Float64(x + y)) + Float64(log(z) + t_1)); elseif (t <= 9.8e+179) tmp = Float64(Float64(t_1 + log(Float64(y * z))) - t); else tmp = Float64(Float64(log(z) + Float64(log(y) + Float64(-0.5 * log(t)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); tmp = 0.0; if (t <= 0.43) tmp = log((x + y)) + (log(z) + t_1); elseif (t <= 9.8e+179) tmp = (t_1 + log((y * z))) - t; else tmp = (log(z) + (log(y) + (-0.5 * log(t)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 0.43], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.8e+179], N[(N[(t$95$1 + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 0.43:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z + t_1\right)\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{+179}:\\
\;\;\;\;\left(t_1 + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \left(\log y + -0.5 \cdot \log t\right)\right) - t\\
\end{array}
\end{array}
if t < 0.429999999999999993Initial program 99.3%
associate--l+99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
remove-double-neg99.3%
remove-double-neg99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around 0 98.7%
if 0.429999999999999993 < t < 9.7999999999999997e179Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r-99.9%
associate-+l-99.9%
+-commutative99.9%
sum-log88.6%
sub-neg88.6%
metadata-eval88.6%
Applied egg-rr88.6%
Taylor expanded in x around 0 64.8%
if 9.7999999999999997e179 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 70.3%
Taylor expanded in a around 0 65.1%
Final simplification82.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))))
(if (<= t 1.35)
(+ t_1 (+ (log z) (log y)))
(if (<= t 2e+180) (- (+ t_1 (log (* y z))) t) (- t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * (a - 0.5);
double tmp;
if (t <= 1.35) {
tmp = t_1 + (log(z) + log(y));
} else if (t <= 2e+180) {
tmp = (t_1 + log((y * z))) - 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) :: t_1
real(8) :: tmp
t_1 = log(t) * (a - 0.5d0)
if (t <= 1.35d0) then
tmp = t_1 + (log(z) + log(y))
else if (t <= 2d+180) then
tmp = (t_1 + log((y * z))) - 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 t_1 = Math.log(t) * (a - 0.5);
double tmp;
if (t <= 1.35) {
tmp = t_1 + (Math.log(z) + Math.log(y));
} else if (t <= 2e+180) {
tmp = (t_1 + Math.log((y * z))) - t;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) tmp = 0 if t <= 1.35: tmp = t_1 + (math.log(z) + math.log(y)) elif t <= 2e+180: tmp = (t_1 + math.log((y * z))) - t else: tmp = -t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) tmp = 0.0 if (t <= 1.35) tmp = Float64(t_1 + Float64(log(z) + log(y))); elseif (t <= 2e+180) tmp = Float64(Float64(t_1 + log(Float64(y * z))) - t); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); tmp = 0.0; if (t <= 1.35) tmp = t_1 + (log(z) + log(y)); elseif (t <= 2e+180) tmp = (t_1 + log((y * z))) - t; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 1.35], N[(t$95$1 + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+180], N[(N[(t$95$1 + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], (-t)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 1.35:\\
\;\;\;\;t_1 + \left(\log z + \log y\right)\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+180}:\\
\;\;\;\;\left(t_1 + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.3500000000000001Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 61.4%
Taylor expanded in t around 0 61.4%
if 1.3500000000000001 < t < 2e180Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
metadata-eval99.9%
sub-neg99.9%
associate-+r-99.9%
associate-+l-99.9%
+-commutative99.9%
sum-log88.6%
sub-neg88.6%
metadata-eval88.6%
Applied egg-rr88.6%
Taylor expanded in x around 0 64.8%
if 2e180 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 70.3%
Taylor expanded in t around inf 89.2%
mul-1-neg89.2%
Simplified89.2%
Final simplification68.2%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (* (log t) (- a 0.5)) (log y))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + ((log(t) * (a - 0.5)) + log(y));
}
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(t) * (a - 0.5d0)) + log(y))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + ((Math.log(t) * (a - 0.5)) + Math.log(y));
}
def code(x, y, z, t, a): return (math.log(z) - t) + ((math.log(t) * (a - 0.5)) + math.log(y))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(Float64(log(t) * Float64(a - 0.5)) + log(y))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + ((log(t) * (a - 0.5)) + log(y)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log t \cdot \left(a - 0.5\right) + \log y\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 67.2%
Final simplification67.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -5e+208)
t_1
(if (<= (- a 0.5) 400.0)
(+ (log (* (+ x y) z)) (- (* (+ a -0.5) (log t)) t))
(+ (log (+ x y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -5e+208) {
tmp = t_1;
} else if ((a - 0.5) <= 400.0) {
tmp = log(((x + y) * z)) + (((a + -0.5) * log(t)) - t);
} else {
tmp = log((x + y)) + 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 = a * log(t)
if ((a - 0.5d0) <= (-5d+208)) then
tmp = t_1
else if ((a - 0.5d0) <= 400.0d0) then
tmp = log(((x + y) * z)) + (((a + (-0.5d0)) * log(t)) - t)
else
tmp = log((x + y)) + 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 tmp;
if ((a - 0.5) <= -5e+208) {
tmp = t_1;
} else if ((a - 0.5) <= 400.0) {
tmp = Math.log(((x + y) * z)) + (((a + -0.5) * Math.log(t)) - t);
} else {
tmp = Math.log((x + y)) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -5e+208: tmp = t_1 elif (a - 0.5) <= 400.0: tmp = math.log(((x + y) * z)) + (((a + -0.5) * math.log(t)) - t) else: tmp = math.log((x + y)) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -5e+208) tmp = t_1; elseif (Float64(a - 0.5) <= 400.0) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(Float64(a + -0.5) * log(t)) - t)); else tmp = Float64(log(Float64(x + y)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -5e+208) tmp = t_1; elseif ((a - 0.5) <= 400.0) tmp = log(((x + y) * z)) + (((a + -0.5) * log(t)) - t); else tmp = log((x + y)) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+208], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], 400.0], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+208}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a - 0.5 \leq 400:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\left(a + -0.5\right) \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + t_1\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -5.0000000000000004e208Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 91.2%
Taylor expanded in a around inf 91.8%
if -5.0000000000000004e208 < (-.f64 a 1/2) < 400Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
metadata-eval99.6%
sub-neg99.6%
associate-+r-99.6%
associate-+l-99.6%
+-commutative99.6%
sum-log77.7%
sub-neg77.7%
metadata-eval77.7%
Applied egg-rr77.7%
if 400 < (-.f64 a 1/2) Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 87.1%
*-commutative87.1%
Simplified87.1%
Final simplification81.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -5e+208)
t_1
(if (<= (- a 0.5) 400.0)
(- (+ (* (log t) (- a 0.5)) (log (* y z))) t)
(+ (log (+ x y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -5e+208) {
tmp = t_1;
} else if ((a - 0.5) <= 400.0) {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
} else {
tmp = log((x + y)) + 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 = a * log(t)
if ((a - 0.5d0) <= (-5d+208)) then
tmp = t_1
else if ((a - 0.5d0) <= 400.0d0) then
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
else
tmp = log((x + y)) + 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 tmp;
if ((a - 0.5) <= -5e+208) {
tmp = t_1;
} else if ((a - 0.5) <= 400.0) {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
} else {
tmp = Math.log((x + y)) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -5e+208: tmp = t_1 elif (a - 0.5) <= 400.0: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t else: tmp = math.log((x + y)) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -5e+208) tmp = t_1; elseif (Float64(a - 0.5) <= 400.0) tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); else tmp = Float64(log(Float64(x + y)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -5e+208) tmp = t_1; elseif ((a - 0.5) <= 400.0) tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; else tmp = log((x + y)) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+208], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], 400.0], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+208}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a - 0.5 \leq 400:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + t_1\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -5.0000000000000004e208Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 91.2%
Taylor expanded in a around inf 91.8%
if -5.0000000000000004e208 < (-.f64 a 1/2) < 400Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
metadata-eval99.6%
sub-neg99.6%
associate-+r-99.6%
associate-+l-99.6%
+-commutative99.6%
sum-log77.7%
sub-neg77.7%
metadata-eval77.7%
Applied egg-rr77.7%
Taylor expanded in x around 0 49.3%
if 400 < (-.f64 a 1/2) Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 87.1%
*-commutative87.1%
Simplified87.1%
Final simplification62.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -5e+25)
t_1
(if (<= (- a 0.5) 400.0)
(- (+ (log (* y z)) (* -0.5 (log t))) t)
(+ (log (+ x y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -5e+25) {
tmp = t_1;
} else if ((a - 0.5) <= 400.0) {
tmp = (log((y * z)) + (-0.5 * log(t))) - t;
} else {
tmp = log((x + y)) + 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 = a * log(t)
if ((a - 0.5d0) <= (-5d+25)) then
tmp = t_1
else if ((a - 0.5d0) <= 400.0d0) then
tmp = (log((y * z)) + ((-0.5d0) * log(t))) - t
else
tmp = log((x + y)) + 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 tmp;
if ((a - 0.5) <= -5e+25) {
tmp = t_1;
} else if ((a - 0.5) <= 400.0) {
tmp = (Math.log((y * z)) + (-0.5 * Math.log(t))) - t;
} else {
tmp = Math.log((x + y)) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -5e+25: tmp = t_1 elif (a - 0.5) <= 400.0: tmp = (math.log((y * z)) + (-0.5 * math.log(t))) - t else: tmp = math.log((x + y)) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -5e+25) tmp = t_1; elseif (Float64(a - 0.5) <= 400.0) tmp = Float64(Float64(log(Float64(y * z)) + Float64(-0.5 * log(t))) - t); else tmp = Float64(log(Float64(x + y)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -5e+25) tmp = t_1; elseif ((a - 0.5) <= 400.0) tmp = (log((y * z)) + (-0.5 * log(t))) - t; else tmp = log((x + y)) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+25], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], 400.0], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a - 0.5 \leq 400:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + -0.5 \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + t_1\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -5.00000000000000024e25Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 80.9%
Taylor expanded in a around inf 81.3%
if -5.00000000000000024e25 < (-.f64 a 1/2) < 400Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 60.8%
Taylor expanded in a around 0 59.6%
associate-+r+59.6%
log-prod48.1%
*-commutative48.1%
Simplified48.1%
if 400 < (-.f64 a 1/2) Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 87.1%
*-commutative87.1%
Simplified87.1%
Final simplification66.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -5e+25)
t_1
(if (<= (- a 0.5) -0.5)
(- (log (* (* y z) (pow t -0.5))) t)
(+ (log (+ x y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -5e+25) {
tmp = t_1;
} else if ((a - 0.5) <= -0.5) {
tmp = log(((y * z) * pow(t, -0.5))) - t;
} else {
tmp = log((x + y)) + 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 = a * log(t)
if ((a - 0.5d0) <= (-5d+25)) then
tmp = t_1
else if ((a - 0.5d0) <= (-0.5d0)) then
tmp = log(((y * z) * (t ** (-0.5d0)))) - t
else
tmp = log((x + y)) + 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 tmp;
if ((a - 0.5) <= -5e+25) {
tmp = t_1;
} else if ((a - 0.5) <= -0.5) {
tmp = Math.log(((y * z) * Math.pow(t, -0.5))) - t;
} else {
tmp = Math.log((x + y)) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -5e+25: tmp = t_1 elif (a - 0.5) <= -0.5: tmp = math.log(((y * z) * math.pow(t, -0.5))) - t else: tmp = math.log((x + y)) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -5e+25) tmp = t_1; elseif (Float64(a - 0.5) <= -0.5) tmp = Float64(log(Float64(Float64(y * z) * (t ^ -0.5))) - t); else tmp = Float64(log(Float64(x + y)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -5e+25) tmp = t_1; elseif ((a - 0.5) <= -0.5) tmp = log(((y * z) * (t ^ -0.5))) - t; else tmp = log((x + y)) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+25], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], -0.5], N[(N[Log[N[(N[(y * z), $MachinePrecision] * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+25}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a - 0.5 \leq -0.5:\\
\;\;\;\;\log \left(\left(y \cdot z\right) \cdot {t}^{-0.5}\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + t_1\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -5.00000000000000024e25Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 80.9%
Taylor expanded in a around inf 81.3%
if -5.00000000000000024e25 < (-.f64 a 1/2) < -0.5Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt99.2%
pow399.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 59.6%
Taylor expanded in a around 0 59.2%
log-prod48.4%
associate--l+48.3%
pow-base-148.3%
*-lft-identity48.3%
associate-+r-48.4%
+-commutative48.4%
rem-log-exp43.8%
exp-sum43.8%
rem-exp-log44.1%
*-commutative44.1%
exp-to-pow44.2%
Simplified44.2%
if -0.5 < (-.f64 a 1/2) Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 83.7%
*-commutative83.7%
Simplified83.7%
Final simplification63.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -2e+49)
t_1
(if (<= (- a 0.5) 400.0)
(- (+ (log z) (log y)) t)
(+ (log (+ x y)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -2e+49) {
tmp = t_1;
} else if ((a - 0.5) <= 400.0) {
tmp = (log(z) + log(y)) - t;
} else {
tmp = log((x + y)) + 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 = a * log(t)
if ((a - 0.5d0) <= (-2d+49)) then
tmp = t_1
else if ((a - 0.5d0) <= 400.0d0) then
tmp = (log(z) + log(y)) - t
else
tmp = log((x + y)) + 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 tmp;
if ((a - 0.5) <= -2e+49) {
tmp = t_1;
} else if ((a - 0.5) <= 400.0) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else {
tmp = Math.log((x + y)) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -2e+49: tmp = t_1 elif (a - 0.5) <= 400.0: tmp = (math.log(z) + math.log(y)) - t else: tmp = math.log((x + y)) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -2e+49) tmp = t_1; elseif (Float64(a - 0.5) <= 400.0) tmp = Float64(Float64(log(z) + log(y)) - t); else tmp = Float64(log(Float64(x + y)) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -2e+49) tmp = t_1; elseif ((a - 0.5) <= 400.0) tmp = (log(z) + log(y)) - t; else tmp = log((x + y)) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+49], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], 400.0], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -2 \cdot 10^{+49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a - 0.5 \leq 400:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + t_1\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -1.99999999999999989e49Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 81.9%
Taylor expanded in a around inf 82.2%
if -1.99999999999999989e49 < (-.f64 a 1/2) < 400Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt99.2%
pow399.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 60.4%
Taylor expanded in a around inf 42.5%
if 400 < (-.f64 a 1/2) Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around inf 87.1%
*-commutative87.1%
Simplified87.1%
Final simplification63.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.8e+31) (not (<= a 1750000000.0))) (* a (log t)) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.8e+31) || !(a <= 1750000000.0)) {
tmp = a * log(t);
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3.8d+31)) .or. (.not. (a <= 1750000000.0d0))) then
tmp = a * log(t)
else
tmp = (log(z) + log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.8e+31) || !(a <= 1750000000.0)) {
tmp = a * Math.log(t);
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.8e+31) or not (a <= 1750000000.0): tmp = a * math.log(t) else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.8e+31) || !(a <= 1750000000.0)) tmp = Float64(a * log(t)); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.8e+31) || ~((a <= 1750000000.0))) tmp = a * log(t); else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.8e+31], N[Not[LessEqual[a, 1750000000.0]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+31} \lor \neg \left(a \leq 1750000000\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -3.8000000000000001e31 or 1.75e9 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 74.1%
Taylor expanded in a around inf 84.7%
if -3.8000000000000001e31 < a < 1.75e9Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt99.2%
pow399.2%
Applied egg-rr99.2%
Taylor expanded in x around 0 60.4%
Taylor expanded in a around inf 42.5%
Final simplification63.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.3e+44) (not (<= a 2100000000.0))) (* a (log t)) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.3e+44) || !(a <= 2100000000.0)) {
tmp = a * log(t);
} else {
tmp = log((x + y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.3d+44)) .or. (.not. (a <= 2100000000.0d0))) then
tmp = a * log(t)
else
tmp = log((x + y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.3e+44) || !(a <= 2100000000.0)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.3e+44) or not (a <= 2100000000.0): tmp = a * math.log(t) else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.3e+44) || !(a <= 2100000000.0)) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(x + y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.3e+44) || ~((a <= 2100000000.0))) tmp = a * log(t); else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.3e+44], N[Not[LessEqual[a, 2100000000.0]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{+44} \lor \neg \left(a \leq 2100000000\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -1.3e44 or 2.1e9 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 74.1%
Taylor expanded in a around inf 84.7%
if -1.3e44 < a < 2.1e9Initial program 99.5%
associate--l+99.5%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in t around inf 61.8%
neg-mul-161.8%
Simplified61.8%
Final simplification73.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.95e+22) (not (<= a 2200000000.0))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.95e+22) || !(a <= 2200000000.0)) {
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 <= (-2.95d+22)) .or. (.not. (a <= 2200000000.0d0))) 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 <= -2.95e+22) || !(a <= 2200000000.0)) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.95e+22) or not (a <= 2200000000.0): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.95e+22) || !(a <= 2200000000.0)) 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 <= -2.95e+22) || ~((a <= 2200000000.0))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.95e+22], N[Not[LessEqual[a, 2200000000.0]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.95 \cdot 10^{+22} \lor \neg \left(a \leq 2200000000\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -2.9500000000000001e22 or 2.2e9 < a Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 73.7%
Taylor expanded in a around inf 84.2%
if -2.9500000000000001e22 < a < 2.2e9Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 60.8%
Taylor expanded in t around inf 56.3%
mul-1-neg56.3%
Simplified56.3%
Final simplification70.1%
(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.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 67.2%
Taylor expanded in t around inf 36.3%
mul-1-neg36.3%
Simplified36.3%
Final simplification36.3%
(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 2023238
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))