
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log z) (log (+ x y))) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log(z) + log((x + y))) - 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(z) + log((x + y))) - 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(z) + Math.log((x + y))) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log(z) + math.log((x + y))) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(z) + log(Float64(x + y))) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log(z) + log((x + y))) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[z], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log z + \log \left(x + y\right)\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -20000000.0) (not (<= (- a 0.5) -0.4))) (- (* a (log t)) t) (- (+ (log z) (+ (log (+ x y)) (* (log t) -0.5))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(z) + (log((x + y)) + (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) <= (-20000000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
tmp = (a * log(t)) - t
else
tmp = (log(z) + (log((x + y)) + (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) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) + (Math.log((x + y)) + (Math.log(t) * -0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -20000000.0) or not ((a - 0.5) <= -0.4): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) + (math.log((x + y)) + (math.log(t) * -0.5))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -20000000.0) || !(Float64(a - 0.5) <= -0.4)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(z) + Float64(log(Float64(x + y)) + 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) <= -20000000.0) || ~(((a - 0.5) <= -0.4))) tmp = (a * log(t)) - t; else tmp = (log(z) + (log((x + y)) + (log(t) * -0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -20000000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $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 -20000000 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \left(\log \left(x + y\right) + \log t \cdot -0.5\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2e7 or -0.40000000000000002 < (-.f64 a 1/2) Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.5%
Taylor expanded in a around inf 99.2%
*-commutative99.2%
Simplified99.2%
if -2e7 < (-.f64 a 1/2) < -0.40000000000000002Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in a around 0 98.2%
Final simplification98.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -20000000.0) (not (<= (- a 0.5) -0.4))) (- (* a (log t)) t) (- (+ (log (+ x 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) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log((x + 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) <= (-20000000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
tmp = (a * log(t)) - t
else
tmp = (log((x + 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) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log((x + 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) <= -20000000.0) or not ((a - 0.5) <= -0.4): tmp = (a * math.log(t)) - t else: tmp = (math.log((x + 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) <= -20000000.0) || !(Float64(a - 0.5) <= -0.4)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(Float64(x + 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) <= -20000000.0) || ~(((a - 0.5) <= -0.4))) tmp = (a * log(t)) - t; else tmp = (log((x + 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], -20000000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(x + y), $MachinePrecision]], $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 -20000000 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(x + y\right) + \left(\log z + \log t \cdot -0.5\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2e7 or -0.40000000000000002 < (-.f64 a 1/2) Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.5%
Taylor expanded in a around inf 99.2%
*-commutative99.2%
Simplified99.2%
if -2e7 < (-.f64 a 1/2) < -0.40000000000000002Initial program 99.6%
associate--l+99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in a around 0 98.3%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -20000000.0) (not (<= (- a 0.5) -0.4))) (- (* a (log t)) t) (- (+ (log z) (+ (log y) (* (log t) -0.5))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(z) + (log(y) + (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) <= (-20000000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
tmp = (a * log(t)) - t
else
tmp = (log(z) + (log(y) + (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) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) + (Math.log(y) + (Math.log(t) * -0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -20000000.0) or not ((a - 0.5) <= -0.4): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) + (math.log(y) + (math.log(t) * -0.5))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -20000000.0) || !(Float64(a - 0.5) <= -0.4)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(z) + Float64(log(y) + 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) <= -20000000.0) || ~(((a - 0.5) <= -0.4))) tmp = (a * log(t)) - t; else tmp = (log(z) + (log(y) + (log(t) * -0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -20000000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $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 -20000000 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \left(\log y + \log t \cdot -0.5\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2e7 or -0.40000000000000002 < (-.f64 a 1/2) Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.5%
Taylor expanded in a around inf 99.2%
*-commutative99.2%
Simplified99.2%
if -2e7 < (-.f64 a 1/2) < -0.40000000000000002Initial program 99.6%
associate--l+99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 67.4%
Taylor expanded in a around 0 66.6%
Final simplification83.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -20000000.0) (not (<= (- a 0.5) -0.4))) (- (* a (log t)) t) (- (+ (+ (log z) (log y)) (* (log t) -0.5)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * log(t)) - t;
} else {
tmp = ((log(z) + log(y)) + (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) <= (-20000000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
tmp = (a * log(t)) - t
else
tmp = ((log(z) + log(y)) + (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) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = ((Math.log(z) + Math.log(y)) + (Math.log(t) * -0.5)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -20000000.0) or not ((a - 0.5) <= -0.4): tmp = (a * math.log(t)) - t else: tmp = ((math.log(z) + math.log(y)) + (math.log(t) * -0.5)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -20000000.0) || !(Float64(a - 0.5) <= -0.4)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(Float64(log(z) + log(y)) + 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) <= -20000000.0) || ~(((a - 0.5) <= -0.4))) tmp = (a * log(t)) - t; else tmp = ((log(z) + log(y)) + (log(t) * -0.5)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -20000000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -20000000 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\log z + \log y\right) + \log t \cdot -0.5\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2e7 or -0.40000000000000002 < (-.f64 a 1/2) Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.5%
Taylor expanded in a around inf 99.2%
*-commutative99.2%
Simplified99.2%
if -2e7 < (-.f64 a 1/2) < -0.40000000000000002Initial program 99.6%
associate--l+99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 67.4%
Taylor expanded in a around 0 66.8%
Final simplification83.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -20000000.0) (not (<= (- a 0.5) -0.4))) (- (* a (log t)) t) (- (+ (log z) (log (* y (pow t -0.5)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(z) + log((y * pow(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) <= (-20000000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
tmp = (a * log(t)) - t
else
tmp = (log(z) + log((y * (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) <= -20000000.0) || !((a - 0.5) <= -0.4)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) + Math.log((y * Math.pow(t, -0.5)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -20000000.0) or not ((a - 0.5) <= -0.4): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) + math.log((y * math.pow(t, -0.5)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -20000000.0) || !(Float64(a - 0.5) <= -0.4)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(z) + log(Float64(y * (t ^ -0.5)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -20000000.0) || ~(((a - 0.5) <= -0.4))) tmp = (a * log(t)) - t; else tmp = (log(z) + log((y * (t ^ -0.5)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -20000000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -20000000 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log \left(y \cdot {t}^{-0.5}\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -2e7 or -0.40000000000000002 < (-.f64 a 1/2) Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.5%
Taylor expanded in a around inf 99.2%
*-commutative99.2%
Simplified99.2%
if -2e7 < (-.f64 a 1/2) < -0.40000000000000002Initial program 99.6%
associate--l+99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 67.4%
Taylor expanded in a around 0 66.6%
Taylor expanded in y around inf 66.6%
mul-1-neg66.6%
log-rec66.6%
remove-double-neg66.6%
log-pow66.6%
log-prod58.6%
Simplified58.6%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (- (+ (* (- a 0.5) (log t)) (+ (log z) (log y))) t))
double code(double x, double y, double z, double t, double a) {
return (((a - 0.5) * log(t)) + (log(z) + log(y))) - 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 - 0.5d0) * log(t)) + (log(z) + log(y))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (((a - 0.5) * Math.log(t)) + (Math.log(z) + Math.log(y))) - t;
}
def code(x, y, z, t, a): return (((a - 0.5) * math.log(t)) + (math.log(z) + math.log(y))) - t
function code(x, y, z, t, a) return Float64(Float64(Float64(Float64(a - 0.5) * log(t)) + Float64(log(z) + log(y))) - t) end
function tmp = code(x, y, z, t, a) tmp = (((a - 0.5) * log(t)) + (log(z) + log(y))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(a - 0.5\right) \cdot \log t + \left(\log z + \log y\right)\right) - t
\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%
Taylor expanded in x around 0 72.0%
Final simplification72.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.95e-10) (not (<= a 0.235))) (- (* a (log t)) t) (- (+ (log (* y z)) (* 0.5 (log (/ 1.0 t)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.95e-10) || !(a <= 0.235)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log((y * z)) + (0.5 * log((1.0 / t)))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.95d-10)) .or. (.not. (a <= 0.235d0))) then
tmp = (a * log(t)) - t
else
tmp = (log((y * z)) + (0.5d0 * log((1.0d0 / t)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.95e-10) || !(a <= 0.235)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log((y * z)) + (0.5 * Math.log((1.0 / t)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.95e-10) or not (a <= 0.235): tmp = (a * math.log(t)) - t else: tmp = (math.log((y * z)) + (0.5 * math.log((1.0 / t)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.95e-10) || !(a <= 0.235)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(Float64(y * z)) + Float64(0.5 * log(Float64(1.0 / t)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.95e-10) || ~((a <= 0.235))) tmp = (a * log(t)) - t; else tmp = (log((y * z)) + (0.5 * log((1.0 / t)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.95e-10], N[Not[LessEqual[a, 0.235]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(0.5 * N[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{-10} \lor \neg \left(a \leq 0.235\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + 0.5 \cdot \log \left(\frac{1}{t}\right)\right) - t\\
\end{array}
\end{array}
if a < -1.95e-10 or 0.23499999999999999 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.4%
Taylor expanded in a around inf 98.6%
*-commutative98.6%
Simplified98.6%
if -1.95e-10 < a < 0.23499999999999999Initial program 99.6%
associate--l+99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 67.3%
Taylor expanded in a around 0 66.4%
associate-+r+66.6%
log-prod48.0%
Simplified48.0%
Taylor expanded in t around inf 48.0%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3e-11) (not (<= a 0.0075))) (- (* a (log t)) t) (- (+ (* (log t) -0.5) (log (* (+ x y) z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e-11) || !(a <= 0.0075)) {
tmp = (a * log(t)) - t;
} else {
tmp = ((log(t) * -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 <= (-3d-11)) .or. (.not. (a <= 0.0075d0))) then
tmp = (a * log(t)) - t
else
tmp = ((log(t) * (-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 <= -3e-11) || !(a <= 0.0075)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = ((Math.log(t) * -0.5) + Math.log(((x + y) * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3e-11) or not (a <= 0.0075): tmp = (a * math.log(t)) - t else: tmp = ((math.log(t) * -0.5) + math.log(((x + y) * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3e-11) || !(a <= 0.0075)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(Float64(log(t) * -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 <= -3e-11) || ~((a <= 0.0075))) tmp = (a * log(t)) - t; else tmp = ((log(t) * -0.5) + log(((x + y) * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3e-11], N[Not[LessEqual[a, 0.0075]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision] + N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{-11} \lor \neg \left(a \leq 0.0075\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot -0.5 + \log \left(\left(x + y\right) \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -3e-11 or 0.0074999999999999997 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.4%
Taylor expanded in a around inf 98.6%
*-commutative98.6%
Simplified98.6%
if -3e-11 < a < 0.0074999999999999997Initial program 99.6%
associate--l+99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in a around 0 98.8%
associate-+r+98.9%
+-commutative98.9%
associate-+r+98.7%
+-commutative98.7%
associate-+r+98.9%
log-prod76.2%
+-commutative76.2%
Simplified76.2%
Final simplification87.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 28500000000.0) (- (+ (* (log t) (+ a -0.5)) (log (* (+ x y) z))) t) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 28500000000.0) {
tmp = ((log(t) * (a + -0.5)) + log(((x + y) * z))) - t;
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 28500000000.0d0) then
tmp = ((log(t) * (a + (-0.5d0))) + log(((x + y) * z))) - t
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 28500000000.0) {
tmp = ((Math.log(t) * (a + -0.5)) + Math.log(((x + y) * z))) - t;
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 28500000000.0: tmp = ((math.log(t) * (a + -0.5)) + math.log(((x + y) * z))) - t else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 28500000000.0) tmp = Float64(Float64(Float64(log(t) * Float64(a + -0.5)) + log(Float64(Float64(x + y) * z))) - t); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 28500000000.0) tmp = ((log(t) * (a + -0.5)) + log(((x + y) * z))) - t; else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 28500000000.0], 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], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 28500000000:\\
\;\;\;\;\left(\log t \cdot \left(a + -0.5\right) + \log \left(\left(x + y\right) \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 2.85e10Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
+-commutative99.3%
fma-udef99.3%
metadata-eval99.3%
sub-neg99.3%
associate-+r+99.4%
associate--l+99.4%
associate-+r-99.4%
sub-neg99.4%
metadata-eval99.4%
+-commutative99.4%
sum-log78.8%
Applied egg-rr78.8%
if 2.85e10 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 76.8%
Taylor expanded in a around inf 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.5e-12) (not (<= a 0.024))) (- (* a (log t)) t) (- (+ (* (log t) -0.5) (log (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.5e-12) || !(a <= 0.024)) {
tmp = (a * log(t)) - t;
} else {
tmp = ((log(t) * -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 <= (-4.5d-12)) .or. (.not. (a <= 0.024d0))) then
tmp = (a * log(t)) - t
else
tmp = ((log(t) * (-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 <= -4.5e-12) || !(a <= 0.024)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = ((Math.log(t) * -0.5) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.5e-12) or not (a <= 0.024): tmp = (a * math.log(t)) - t else: tmp = ((math.log(t) * -0.5) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.5e-12) || !(a <= 0.024)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(Float64(log(t) * -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 <= -4.5e-12) || ~((a <= 0.024))) tmp = (a * log(t)) - t; else tmp = ((log(t) * -0.5) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.5e-12], N[Not[LessEqual[a, 0.024]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.5 \cdot 10^{-12} \lor \neg \left(a \leq 0.024\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot -0.5 + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -4.49999999999999981e-12 or 0.024 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.4%
Taylor expanded in a around inf 98.6%
*-commutative98.6%
Simplified98.6%
if -4.49999999999999981e-12 < a < 0.024Initial program 99.6%
associate--l+99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 67.3%
Taylor expanded in a around 0 66.4%
associate-+r+66.6%
log-prod48.0%
Simplified48.0%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 46000000000.0) (- (+ (* (- a 0.5) (log t)) (log (* y z))) t) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 46000000000.0) {
tmp = (((a - 0.5) * log(t)) + log((y * z))) - t;
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 46000000000.0d0) then
tmp = (((a - 0.5d0) * log(t)) + log((y * z))) - t
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 46000000000.0) {
tmp = (((a - 0.5) * Math.log(t)) + Math.log((y * z))) - t;
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 46000000000.0: tmp = (((a - 0.5) * math.log(t)) + math.log((y * z))) - t else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 46000000000.0) tmp = Float64(Float64(Float64(Float64(a - 0.5) * log(t)) + log(Float64(y * z))) - t); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 46000000000.0) tmp = (((a - 0.5) * log(t)) + log((y * z))) - t; else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 46000000000.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[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 46000000000:\\
\;\;\;\;\left(\left(a - 0.5\right) \cdot \log t + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 4.6e10Initial program 99.4%
associate--l+99.4%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 67.7%
sum-log56.5%
Applied egg-rr56.5%
if 4.6e10 < t Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
remove-double-neg99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 76.8%
Taylor expanded in a around inf 99.9%
*-commutative99.9%
Simplified99.9%
Final simplification77.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3e-11) (not (<= a 0.007))) (- (* a (log t)) t) (- (log (* (pow t -0.5) (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e-11) || !(a <= 0.007)) {
tmp = (a * log(t)) - t;
} else {
tmp = log((pow(t, -0.5) * (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 <= (-3d-11)) .or. (.not. (a <= 0.007d0))) then
tmp = (a * log(t)) - t
else
tmp = log(((t ** (-0.5d0)) * (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 <= -3e-11) || !(a <= 0.007)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = Math.log((Math.pow(t, -0.5) * (y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3e-11) or not (a <= 0.007): tmp = (a * math.log(t)) - t else: tmp = math.log((math.pow(t, -0.5) * (y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3e-11) || !(a <= 0.007)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(log(Float64((t ^ -0.5) * Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3e-11) || ~((a <= 0.007))) tmp = (a * log(t)) - t; else tmp = log(((t ^ -0.5) * (y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3e-11], N[Not[LessEqual[a, 0.007]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[Power[t, -0.5], $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{-11} \lor \neg \left(a \leq 0.007\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\log \left({t}^{-0.5} \cdot \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -3e-11 or 0.00700000000000000015 < a Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
remove-double-neg99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.4%
Taylor expanded in a around inf 98.6%
*-commutative98.6%
Simplified98.6%
if -3e-11 < a < 0.00700000000000000015Initial program 99.6%
associate--l+99.6%
associate-+l+99.5%
+-commutative99.5%
fma-def99.5%
remove-double-neg99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 67.3%
Taylor expanded in a around 0 66.4%
associate-+r+66.6%
log-prod48.0%
Simplified48.0%
Taylor expanded in z around 0 66.4%
log-pow66.4%
associate-+r+66.6%
log-prod48.0%
log-prod43.5%
*-commutative43.5%
Simplified43.5%
Final simplification71.9%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (log t)))) (if (<= t 2.6e-17) (+ t_1 (log (+ x y))) (- 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.6e-17) {
tmp = t_1 + log((x + y));
} 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.6d-17) then
tmp = t_1 + log((x + y))
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.6e-17) {
tmp = t_1 + Math.log((x + y));
} 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.6e-17: tmp = t_1 + math.log((x + y)) 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.6e-17) tmp = Float64(t_1 + log(Float64(x + y))); 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.6e-17) tmp = t_1 + log((x + y)); 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.6e-17], N[(t$95$1 + N[Log[N[(x + y), $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.6 \cdot 10^{-17}:\\
\;\;\;\;t_1 + \log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if t < 2.60000000000000003e-17Initial program 99.5%
associate--l+99.5%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in a around inf 57.0%
*-commutative57.0%
Simplified57.0%
if 2.60000000000000003e-17 < t Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 76.5%
Taylor expanded in a around inf 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification78.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 2.6e-17) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.6e-17) {
tmp = log((x + y));
} 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 <= 2.6d-17) then
tmp = log((x + y))
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 <= 2.6e-17) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.6e-17: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.6e-17) tmp = log(Float64(x + y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2.6e-17) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.6e-17], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.6 \cdot 10^{-17}:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 2.60000000000000003e-17Initial program 99.5%
associate--l+99.5%
associate-+l+99.4%
+-commutative99.4%
fma-def99.4%
remove-double-neg99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in t around inf 9.4%
neg-mul-19.4%
Simplified9.4%
Taylor expanded in t around 0 9.4%
if 2.60000000000000003e-17 < t Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
remove-double-neg99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 76.5%
Taylor expanded in t around inf 72.8%
neg-mul-172.8%
Simplified72.8%
Final simplification42.1%
(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%
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 x around 0 72.0%
Taylor expanded in a around inf 75.4%
*-commutative75.4%
Simplified75.4%
Final simplification75.4%
(FPCore (x y z t a) :precision binary64 (- (log y) t))
double code(double x, double y, double z, double t, double a) {
return log(y) - 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) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log(y) - t;
}
def code(x, y, z, t, a): return math.log(y) - t
function code(x, y, z, t, a) return Float64(log(y) - t) end
function tmp = code(x, y, z, t, a) tmp = log(y) - t; end
code[x_, y_, z_, t_, a_] := N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log y - t
\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%
Taylor expanded in t around inf 42.0%
neg-mul-142.0%
Simplified42.0%
Taylor expanded in x around 0 31.7%
Final simplification31.7%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
remove-double-neg99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 72.0%
Taylor expanded in t around inf 38.7%
neg-mul-138.7%
Simplified38.7%
Final simplification38.7%
(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 2023192
(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))))