
(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) t) (fma (+ a -0.5) (log t) (log (+ x y)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + fma((a + -0.5), log(t), log((x + y)));
}
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + fma(Float64(a + -0.5), log(t), log(Float64(x + y)))) end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \mathsf{fma}\left(a + -0.5, \log t, \log \left(x + y\right)\right)
\end{array}
Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 150.0) (+ (log (* z (+ x y))) (- (* (+ a -0.5) (log t)) t)) (- (+ (log y) (+ (log z) (* a (log t)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 150.0) {
tmp = log((z * (x + y))) + (((a + -0.5) * log(t)) - t);
} else {
tmp = (log(y) + (log(z) + (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 (log(z) <= 150.0d0) then
tmp = log((z * (x + y))) + (((a + (-0.5d0)) * log(t)) - t)
else
tmp = (log(y) + (log(z) + (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 (Math.log(z) <= 150.0) {
tmp = Math.log((z * (x + y))) + (((a + -0.5) * Math.log(t)) - t);
} else {
tmp = (Math.log(y) + (Math.log(z) + (a * Math.log(t)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 150.0: tmp = math.log((z * (x + y))) + (((a + -0.5) * math.log(t)) - t) else: tmp = (math.log(y) + (math.log(z) + (a * math.log(t)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 150.0) tmp = Float64(log(Float64(z * Float64(x + y))) + Float64(Float64(Float64(a + -0.5) * log(t)) - t)); else tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(a * log(t)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 150.0) tmp = log((z * (x + y))) + (((a + -0.5) * log(t)) - t); else tmp = (log(y) + (log(z) + (a * log(t)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 150.0], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 150:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + \left(\left(a + -0.5\right) \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \left(\log z + a \cdot \log t\right)\right) - t\\
\end{array}
\end{array}
if (log.f64 z) < 150Initial program 99.3%
+-commutative99.3%
fma-define99.3%
sub-neg99.3%
metadata-eval99.3%
associate--l+99.4%
Simplified99.4%
fma-undefine99.3%
metadata-eval99.3%
sub-neg99.3%
+-commutative99.3%
associate-+r-99.3%
associate-+l-99.3%
+-commutative99.3%
sum-log95.8%
sub-neg95.8%
metadata-eval95.8%
Applied egg-rr95.8%
if 150 < (log.f64 z) Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.6%
+-commutative99.6%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 73.0%
Taylor expanded in a around inf 62.0%
Final simplification83.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -50000.0) (not (<= (- a 0.5) -0.4))) (- (+ (log y) (+ (log z) (* a (log t)))) t) (- (+ (* -0.5 (log t)) (+ (log z) (log y))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -50000.0) || !((a - 0.5) <= -0.4)) {
tmp = (log(y) + (log(z) + (a * log(t)))) - t;
} else {
tmp = ((-0.5 * log(t)) + (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 - 0.5d0) <= (-50000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
tmp = (log(y) + (log(z) + (a * log(t)))) - t
else
tmp = (((-0.5d0) * log(t)) + (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 - 0.5) <= -50000.0) || !((a - 0.5) <= -0.4)) {
tmp = (Math.log(y) + (Math.log(z) + (a * Math.log(t)))) - t;
} else {
tmp = ((-0.5 * Math.log(t)) + (Math.log(z) + Math.log(y))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -50000.0) or not ((a - 0.5) <= -0.4): tmp = (math.log(y) + (math.log(z) + (a * math.log(t)))) - t else: tmp = ((-0.5 * math.log(t)) + (math.log(z) + math.log(y))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -50000.0) || !(Float64(a - 0.5) <= -0.4)) tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(a * log(t)))) - t); else tmp = Float64(Float64(Float64(-0.5 * log(t)) + Float64(log(z) + log(y))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -50000.0) || ~(((a - 0.5) <= -0.4))) tmp = (log(y) + (log(z) + (a * log(t)))) - t; else tmp = ((-0.5 * log(t)) + (log(z) + log(y))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -50000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -50000 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;\left(\log y + \left(\log z + a \cdot \log t\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(-0.5 \cdot \log t + \left(\log z + \log y\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -5e4 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 77.7%
Taylor expanded in a around inf 77.6%
if -5e4 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 65.4%
Taylor expanded in a around 0 65.0%
+-commutative65.0%
+-commutative65.0%
associate-+l+65.0%
Simplified65.0%
Final simplification71.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -50000.0) (not (<= (- a 0.5) -0.4))) (- (+ (log y) (+ (log z) (* a (log t)))) t) (- (+ (log y) (+ (log z) (* -0.5 (log t)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -50000.0) || !((a - 0.5) <= -0.4)) {
tmp = (log(y) + (log(z) + (a * log(t)))) - t;
} else {
tmp = (log(y) + (log(z) + (-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) :: tmp
if (((a - 0.5d0) <= (-50000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
tmp = (log(y) + (log(z) + (a * log(t)))) - t
else
tmp = (log(y) + (log(z) + ((-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 tmp;
if (((a - 0.5) <= -50000.0) || !((a - 0.5) <= -0.4)) {
tmp = (Math.log(y) + (Math.log(z) + (a * Math.log(t)))) - t;
} else {
tmp = (Math.log(y) + (Math.log(z) + (-0.5 * Math.log(t)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -50000.0) or not ((a - 0.5) <= -0.4): tmp = (math.log(y) + (math.log(z) + (a * math.log(t)))) - t else: tmp = (math.log(y) + (math.log(z) + (-0.5 * math.log(t)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -50000.0) || !(Float64(a - 0.5) <= -0.4)) tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(a * log(t)))) - t); else tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(-0.5 * log(t)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -50000.0) || ~(((a - 0.5) <= -0.4))) tmp = (log(y) + (log(z) + (a * log(t)))) - t; else tmp = (log(y) + (log(z) + (-0.5 * log(t)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -50000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -50000 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;\left(\log y + \left(\log z + a \cdot \log t\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \left(\log z + -0.5 \cdot \log t\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -5e4 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 77.7%
Taylor expanded in a around inf 77.6%
if -5e4 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 65.4%
Taylor expanded in a around 0 65.0%
+-commutative65.0%
Simplified65.0%
Final simplification71.2%
(FPCore (x y z t a) :precision binary64 (+ (+ (- (log z) t) (log (+ x y))) (* (+ a -0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log(z) - t) + log((x + y))) + ((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) - t) + log((x + y))) + ((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) - t) + Math.log((x + y))) + ((a + -0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log(z) - t) + math.log((x + y))) + ((a + -0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(z) - t) + log(Float64(x + y))) + Float64(Float64(a + -0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log(z) - t) + log((x + y))) + ((a + -0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log z - t\right) + \log \left(x + y\right)\right) + \left(a + -0.5\right) \cdot \log t
\end{array}
Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(y) + (log(z) + (log(t) * (a - 0.5d0)))) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\right) - t
\end{array}
Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 71.4%
(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(a + -0.5) * log(t)) + Float64(log(z) + Float64(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[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.5\right) \cdot \log t + \left(\log z + \left(\log y - t\right)\right)
\end{array}
Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 71.4%
remove-double-neg71.4%
log-rec71.4%
mul-1-neg71.4%
+-commutative71.4%
associate--l+71.4%
mul-1-neg71.4%
log-rec71.4%
remove-double-neg71.4%
Simplified71.4%
Final simplification71.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -50000.0) (not (<= (- a 0.5) 2.0))) (- (* a (log t)) t) (+ (log (* z (+ x y))) (- (* -0.5 (log t)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -50000.0) || !((a - 0.5) <= 2.0)) {
tmp = (a * log(t)) - t;
} else {
tmp = log((z * (x + 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) :: tmp
if (((a - 0.5d0) <= (-50000.0d0)) .or. (.not. ((a - 0.5d0) <= 2.0d0))) then
tmp = (a * log(t)) - t
else
tmp = log((z * (x + 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 tmp;
if (((a - 0.5) <= -50000.0) || !((a - 0.5) <= 2.0)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = Math.log((z * (x + y))) + ((-0.5 * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -50000.0) or not ((a - 0.5) <= 2.0): tmp = (a * math.log(t)) - t else: tmp = math.log((z * (x + y))) + ((-0.5 * math.log(t)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -50000.0) || !(Float64(a - 0.5) <= 2.0)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(log(Float64(z * Float64(x + y))) + Float64(Float64(-0.5 * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -50000.0) || ~(((a - 0.5) <= 2.0))) tmp = (a * log(t)) - t; else tmp = log((z * (x + y))) + ((-0.5 * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -50000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 2.0]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -50000 \lor \neg \left(a - 0.5 \leq 2\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + \left(-0.5 \cdot \log t - t\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -5e4 or 2 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
add-sqr-sqrt53.2%
pow253.2%
Applied egg-rr53.2%
+-commutative53.2%
unpow253.2%
add-sqr-sqrt99.6%
fma-define99.6%
associate-+r-99.6%
sum-log77.8%
+-commutative77.8%
Applied egg-rr77.8%
Taylor expanded in y around 0 54.5%
Taylor expanded in a around inf 99.0%
if -5e4 < (-.f64 a #s(literal 1/2 binary64)) < 2Initial program 99.4%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
add-sqr-sqrt1.5%
pow21.5%
Applied egg-rr1.5%
+-commutative1.5%
unpow21.5%
add-sqr-sqrt99.4%
fma-define99.4%
associate-+r-99.3%
sum-log78.1%
+-commutative78.1%
Applied egg-rr78.1%
Taylor expanded in a around 0 76.2%
associate--l+76.2%
+-commutative76.2%
*-commutative76.2%
Simplified76.2%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -0.5000005) (not (<= (- a 0.5) -0.4))) (- (* a (log t)) t) (- (log (* y (* z (pow t (+ a -0.5))))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -0.5000005) || !((a - 0.5) <= -0.4)) {
tmp = (a * log(t)) - t;
} else {
tmp = log((y * (z * pow(t, (a + -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) <= (-0.5000005d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
tmp = (a * log(t)) - t
else
tmp = log((y * (z * (t ** (a + (-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) <= -0.5000005) || !((a - 0.5) <= -0.4)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = Math.log((y * (z * Math.pow(t, (a + -0.5))))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -0.5000005) or not ((a - 0.5) <= -0.4): tmp = (a * math.log(t)) - t else: tmp = math.log((y * (z * math.pow(t, (a + -0.5))))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -0.5000005) || !(Float64(a - 0.5) <= -0.4)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(log(Float64(y * Float64(z * (t ^ Float64(a + -0.5))))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -0.5000005) || ~(((a - 0.5) <= -0.4))) tmp = (a * log(t)) - t; else tmp = log((y * (z * (t ^ (a + -0.5))))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -0.5000005], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y * N[(z * N[Power[t, N[(a + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -0.5000005 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -0.500000499999999959 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
add-sqr-sqrt52.7%
pow252.7%
Applied egg-rr52.7%
+-commutative52.7%
unpow252.7%
add-sqr-sqrt99.6%
fma-define99.6%
associate-+r-99.6%
sum-log78.6%
+-commutative78.6%
Applied egg-rr78.6%
Taylor expanded in y around 0 54.1%
Taylor expanded in a around inf 97.6%
if -0.500000499999999959 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002Initial program 99.3%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 64.6%
*-un-lft-identity64.6%
add-log-exp59.7%
sum-log50.8%
exp-sum50.9%
add-exp-log51.0%
sub-neg51.0%
metadata-eval51.0%
exp-to-pow51.1%
Applied egg-rr51.1%
*-lft-identity51.1%
Simplified51.1%
Final simplification74.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -0.5) (not (<= (- a 0.5) 2.0))) (- (* a (log t)) t) (- (log (* (* z y) (pow t -0.5))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -0.5) || !((a - 0.5) <= 2.0)) {
tmp = (a * log(t)) - t;
} else {
tmp = log(((z * 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) <= (-0.5d0)) .or. (.not. ((a - 0.5d0) <= 2.0d0))) then
tmp = (a * log(t)) - t
else
tmp = log(((z * 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) <= -0.5) || !((a - 0.5) <= 2.0)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = Math.log(((z * y) * Math.pow(t, -0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -0.5) or not ((a - 0.5) <= 2.0): tmp = (a * math.log(t)) - t else: tmp = math.log(((z * y) * math.pow(t, -0.5))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -0.5) || !(Float64(a - 0.5) <= 2.0)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(log(Float64(Float64(z * 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) <= -0.5) || ~(((a - 0.5) <= 2.0))) tmp = (a * log(t)) - t; else tmp = log(((z * y) * (t ^ -0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -0.5], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 2.0]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[(z * y), $MachinePrecision] * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -0.5 \lor \neg \left(a - 0.5 \leq 2\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\left(z \cdot y\right) \cdot {t}^{-0.5}\right) - t\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -0.5 or 2 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-sqr-sqrt26.2%
pow226.2%
Applied egg-rr26.2%
+-commutative26.2%
unpow226.2%
add-sqr-sqrt99.5%
fma-define99.5%
associate-+r-99.5%
sum-log77.4%
+-commutative77.4%
Applied egg-rr77.4%
Taylor expanded in y around 0 50.5%
Taylor expanded in a around inf 71.2%
if -0.5 < (-.f64 a #s(literal 1/2 binary64)) < 2Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.7%
+-commutative99.7%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 59.9%
*-un-lft-identity59.9%
add-log-exp59.9%
sum-log43.3%
exp-sum43.3%
add-exp-log43.3%
sub-neg43.3%
metadata-eval43.3%
exp-to-pow43.3%
Applied egg-rr43.3%
*-lft-identity43.3%
associate-*r*40.6%
Simplified40.6%
Taylor expanded in a around 0 57.7%
Final simplification70.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.7e+14) (+ (log (* z (+ x y))) (- (* (+ a -0.5) (log t)) t)) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.7e+14) {
tmp = log((z * (x + y))) + (((a + -0.5) * log(t)) - 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 <= 1.7d+14) then
tmp = log((z * (x + y))) + (((a + (-0.5d0)) * log(t)) - 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 <= 1.7e+14) {
tmp = Math.log((z * (x + y))) + (((a + -0.5) * Math.log(t)) - t);
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.7e+14: tmp = math.log((z * (x + y))) + (((a + -0.5) * math.log(t)) - t) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.7e+14) tmp = Float64(log(Float64(z * Float64(x + y))) + Float64(Float64(Float64(a + -0.5) * log(t)) - 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 <= 1.7e+14) tmp = log((z * (x + y))) + (((a + -0.5) * log(t)) - t); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.7e+14], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.7 \cdot 10^{+14}:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + \left(\left(a + -0.5\right) \cdot \log t - t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 1.7e14Initial program 99.2%
+-commutative99.2%
fma-define99.2%
sub-neg99.2%
metadata-eval99.2%
associate--l+99.2%
Simplified99.2%
fma-undefine99.2%
metadata-eval99.2%
sub-neg99.2%
+-commutative99.2%
associate-+r-99.2%
associate-+l-99.2%
+-commutative99.2%
sum-log78.5%
sub-neg78.5%
metadata-eval78.5%
Applied egg-rr78.5%
if 1.7e14 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-sqr-sqrt26.7%
pow226.7%
Applied egg-rr26.7%
+-commutative26.7%
unpow226.7%
add-sqr-sqrt99.9%
fma-define99.9%
associate-+r-99.9%
sum-log77.2%
+-commutative77.2%
Applied egg-rr77.2%
Taylor expanded in y around 0 60.0%
Taylor expanded in a around inf 99.9%
Final simplification87.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.1) (not (<= a 2.1))) (- (* a (log t)) t) (+ (- (log z) t) (log (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.1) || !(a <= 2.1)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(z) - t) + log((x + y));
}
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.1d0)) .or. (.not. (a <= 2.1d0))) then
tmp = (a * log(t)) - t
else
tmp = (log(z) - t) + log((x + y))
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.1) || !(a <= 2.1)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) - t) + Math.log((x + y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.1) or not (a <= 2.1): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) - t) + math.log((x + y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.1) || !(a <= 2.1)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(z) - t) + log(Float64(x + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.1) || ~((a <= 2.1))) tmp = (a * log(t)) - t; else tmp = (log(z) - t) + log((x + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.1], N[Not[LessEqual[a, 2.1]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \lor \neg \left(a \leq 2.1\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log \left(x + y\right)\\
\end{array}
\end{array}
if a < -1.1000000000000001 or 2.10000000000000009 < a Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
add-sqr-sqrt53.2%
pow253.2%
Applied egg-rr53.2%
+-commutative53.2%
unpow253.2%
add-sqr-sqrt99.6%
fma-define99.6%
associate-+r-99.6%
sum-log77.8%
+-commutative77.8%
Applied egg-rr77.8%
Taylor expanded in y around 0 54.5%
Taylor expanded in a around inf 99.0%
if -1.1000000000000001 < a < 2.10000000000000009Initial program 99.4%
associate-+l-99.4%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-undefine99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in t around inf 53.7%
Final simplification75.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.26e+14) (- (+ (* (+ a -0.5) (log t)) (log (* z y))) t) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.26e+14) {
tmp = (((a + -0.5) * log(t)) + log((z * y))) - 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 <= 1.26d+14) then
tmp = (((a + (-0.5d0)) * log(t)) + log((z * y))) - 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 <= 1.26e+14) {
tmp = (((a + -0.5) * Math.log(t)) + Math.log((z * y))) - t;
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.26e+14: tmp = (((a + -0.5) * math.log(t)) + math.log((z * y))) - t else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.26e+14) tmp = Float64(Float64(Float64(Float64(a + -0.5) * log(t)) + log(Float64(z * y))) - 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 <= 1.26e+14) tmp = (((a + -0.5) * log(t)) + log((z * y))) - t; else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.26e+14], N[(N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * y), $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 1.26 \cdot 10^{+14}:\\
\;\;\;\;\left(\left(a + -0.5\right) \cdot \log t + \log \left(z \cdot y\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 1.26e14Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.2%
+-commutative99.2%
fma-define99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 66.1%
*-un-lft-identity66.1%
add-log-exp28.5%
sum-log23.6%
exp-sum23.7%
add-exp-log23.7%
sub-neg23.7%
metadata-eval23.7%
exp-to-pow23.9%
Applied egg-rr23.9%
*-lft-identity23.9%
associate-*r*23.7%
Simplified23.7%
*-commutative23.7%
log-prod26.2%
log-pow55.9%
Applied egg-rr55.9%
if 1.26e14 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-sqr-sqrt26.7%
pow226.7%
Applied egg-rr26.7%
+-commutative26.7%
unpow226.7%
add-sqr-sqrt99.9%
fma-define99.9%
associate-+r-99.9%
sum-log77.2%
+-commutative77.2%
Applied egg-rr77.2%
Taylor expanded in y around 0 60.0%
Taylor expanded in a around inf 99.9%
Final simplification74.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.4e+26) (* a (log t)) (+ (* t (+ (/ 1.0 t) -1.0)) -1.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.4e+26) {
tmp = a * log(t);
} else {
tmp = (t * ((1.0 / t) + -1.0)) + -1.0;
}
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 <= 1.4d+26) then
tmp = a * log(t)
else
tmp = (t * ((1.0d0 / t) + (-1.0d0))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.4e+26) {
tmp = a * Math.log(t);
} else {
tmp = (t * ((1.0 / t) + -1.0)) + -1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.4e+26: tmp = a * math.log(t) else: tmp = (t * ((1.0 / t) + -1.0)) + -1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.4e+26) tmp = Float64(a * log(t)); else tmp = Float64(Float64(t * Float64(Float64(1.0 / t) + -1.0)) + -1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.4e+26) tmp = a * log(t); else tmp = (t * ((1.0 / t) + -1.0)) + -1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.4e+26], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(t * N[(N[(1.0 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{+26}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{1}{t} + -1\right) + -1\\
\end{array}
\end{array}
if t < 1.4e26Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.2%
+-commutative99.2%
fma-define99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in a around inf 50.3%
*-commutative50.3%
Simplified50.3%
if 1.4e26 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 77.2%
neg-mul-177.2%
Simplified77.2%
expm1-log1p-u0.0%
expm1-undefine0.0%
Applied egg-rr0.0%
sub-neg0.0%
log1p-undefine0.0%
rem-exp-log77.2%
unsub-neg77.2%
metadata-eval77.2%
Simplified77.2%
Taylor expanded in t around inf 77.2%
Final simplification61.2%
(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.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-sqr-sqrt26.3%
pow226.3%
Applied egg-rr26.3%
+-commutative26.3%
unpow226.3%
add-sqr-sqrt99.5%
fma-define99.5%
associate-+r-99.5%
sum-log78.0%
+-commutative78.0%
Applied egg-rr78.0%
Taylor expanded in y around 0 50.5%
Taylor expanded in a around inf 70.8%
(FPCore (x y z t a) :precision binary64 (+ (* t (+ (/ 1.0 t) -1.0)) -1.0))
double code(double x, double y, double z, double t, double a) {
return (t * ((1.0 / t) + -1.0)) + -1.0;
}
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 * ((1.0d0 / t) + (-1.0d0))) + (-1.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (t * ((1.0 / t) + -1.0)) + -1.0;
}
def code(x, y, z, t, a): return (t * ((1.0 / t) + -1.0)) + -1.0
function code(x, y, z, t, a) return Float64(Float64(t * Float64(Float64(1.0 / t) + -1.0)) + -1.0) end
function tmp = code(x, y, z, t, a) tmp = (t * ((1.0 / t) + -1.0)) + -1.0; end
code[x_, y_, z_, t_, a_] := N[(N[(t * N[(N[(1.0 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(\frac{1}{t} + -1\right) + -1
\end{array}
Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 33.5%
neg-mul-133.5%
Simplified33.5%
expm1-log1p-u1.6%
expm1-undefine1.6%
Applied egg-rr1.6%
sub-neg1.6%
log1p-undefine1.6%
rem-exp-log33.4%
unsub-neg33.4%
metadata-eval33.4%
Simplified33.4%
Taylor expanded in t around inf 33.5%
Final simplification33.5%
(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.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 33.5%
neg-mul-133.5%
Simplified33.5%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\end{array}
Initial program 99.5%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 33.5%
neg-mul-133.5%
Simplified33.5%
expm1-log1p-u1.6%
expm1-undefine1.6%
Applied egg-rr1.6%
sub-neg1.6%
log1p-undefine1.6%
rem-exp-log33.4%
unsub-neg33.4%
metadata-eval33.4%
Simplified33.4%
Taylor expanded in t around 0 2.5%
metadata-eval2.5%
Applied egg-rr2.5%
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t)))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log((x + y)) + ((log(z) - t) + ((a - 0.5d0) * log(t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) + ((Math.log(z) - t) + ((a - 0.5) * Math.log(t)));
}
def code(x, y, z, t, a): return math.log((x + y)) + ((math.log(z) - t) + ((a - 0.5) * math.log(t)))
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(Float64(log(z) - t) + Float64(Float64(a - 0.5) * log(t)))) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t))); end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right)
\end{array}
herbie shell --seed 2024141
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (+ (log (+ x y)) (+ (- (log z) t) (* (- a 1/2) (log t)))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))