
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (- (log z) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.5) (not (<= a 940000000000.0))) (- (* (log t) a) t) (- (+ (log y) (+ (log z) (* (log t) -0.5))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.5) || !(a <= 940000000000.0)) {
tmp = (log(t) * a) - t;
} else {
tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.5d0)) .or. (.not. (a <= 940000000000.0d0))) then
tmp = (log(t) * a) - t
else
tmp = (log(y) + (log(z) + (log(t) * (-0.5d0)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.5) || !(a <= 940000000000.0)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = (Math.log(y) + (Math.log(z) + (Math.log(t) * -0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.5) or not (a <= 940000000000.0): tmp = (math.log(t) * a) - t else: tmp = (math.log(y) + (math.log(z) + (math.log(t) * -0.5))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.5) || !(a <= 940000000000.0)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * -0.5))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.5) || ~((a <= 940000000000.0))) tmp = (log(t) * a) - t; else tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.5], N[Not[LessEqual[a, 940000000000.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \lor \neg \left(a \leq 940000000000\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \left(\log z + \log t \cdot -0.5\right)\right) - t\\
\end{array}
\end{array}
if a < -1.5 or 9.4e11 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 77.4%
Taylor expanded in a around inf 99.0%
*-commutative99.0%
Simplified99.0%
if -1.5 < a < 9.4e11Initial program 99.4%
remove-double-neg99.4%
associate--l+99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 60.4%
Taylor expanded in a around 0 60.4%
*-commutative60.4%
Simplified60.4%
Final simplification78.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 31000000.0) (+ (log z) (+ (log y) (* (log t) (- a 0.5)))) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 31000000.0) {
tmp = log(z) + (log(y) + (log(t) * (a - 0.5)));
} else {
tmp = (log(t) * a) - 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 <= 31000000.0d0) then
tmp = log(z) + (log(y) + (log(t) * (a - 0.5d0)))
else
tmp = (log(t) * a) - 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 <= 31000000.0) {
tmp = Math.log(z) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 31000000.0: tmp = math.log(z) + (math.log(y) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 31000000.0) tmp = Float64(log(z) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 31000000.0) tmp = log(z) + (log(y) + (log(t) * (a - 0.5))); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 31000000.0], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 31000000:\\
\;\;\;\;\log z + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 3.1e7Initial 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 63.6%
Taylor expanded in t around 0 62.4%
if 3.1e7 < t Initial program 99.9%
remove-double-neg99.9%
associate--l+99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 73.7%
Taylor expanded in a around inf 98.2%
*-commutative98.2%
Simplified98.2%
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (+ (+ (log (+ x y)) (- (log z) t)) (* (log t) (+ a -0.5))))
double code(double x, double y, double z, double t, double a) {
return (log((x + y)) + (log(z) - t)) + (log(t) * (a + -0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log((x + y)) + (log(z) - t)) + (log(t) * (a + (-0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log((x + y)) + (Math.log(z) - t)) + (Math.log(t) * (a + -0.5));
}
def code(x, y, z, t, a): return (math.log((x + y)) + (math.log(z) - t)) + (math.log(t) * (a + -0.5))
function code(x, y, z, t, a) return Float64(Float64(log(Float64(x + y)) + Float64(log(z) - t)) + Float64(log(t) * Float64(a + -0.5))) end
function tmp = code(x, y, z, t, a) tmp = (log((x + y)) + (log(z) - t)) + (log(t) * (a + -0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \log t \cdot \left(a + -0.5\right)
\end{array}
Initial program 99.5%
remove-double-neg99.5%
associate--l+99.5%
remove-double-neg99.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%
remove-double-neg99.5%
associate--l+99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 68.5%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (log y)) (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) + ((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(z) + log(y)) + ((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(z) + Math.log(y)) + ((Math.log(t) * (a - 0.5)) - t);
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) + ((math.log(t) * (a - 0.5)) - t)
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)
\end{array}
Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 68.5%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.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 68.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)) (t_2 (+ (* (log t) (+ a -0.5)) (log (* y z)))))
(if (<= t 2.4e-250)
t_2
(if (<= t 4e-228) t_1 (if (<= t 19000000.0) t_2 (- t_1 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double t_2 = (log(t) * (a + -0.5)) + log((y * z));
double tmp;
if (t <= 2.4e-250) {
tmp = t_2;
} else if (t <= 4e-228) {
tmp = t_1;
} else if (t <= 19000000.0) {
tmp = t_2;
} else {
tmp = t_1 - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log(t) * a
t_2 = (log(t) * (a + (-0.5d0))) + log((y * z))
if (t <= 2.4d-250) then
tmp = t_2
else if (t <= 4d-228) then
tmp = t_1
else if (t <= 19000000.0d0) then
tmp = t_2
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double t_2 = (Math.log(t) * (a + -0.5)) + Math.log((y * z));
double tmp;
if (t <= 2.4e-250) {
tmp = t_2;
} else if (t <= 4e-228) {
tmp = t_1;
} else if (t <= 19000000.0) {
tmp = t_2;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a t_2 = (math.log(t) * (a + -0.5)) + math.log((y * z)) tmp = 0 if t <= 2.4e-250: tmp = t_2 elif t <= 4e-228: tmp = t_1 elif t <= 19000000.0: tmp = t_2 else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) t_2 = Float64(Float64(log(t) * Float64(a + -0.5)) + log(Float64(y * z))) tmp = 0.0 if (t <= 2.4e-250) tmp = t_2; elseif (t <= 4e-228) tmp = t_1; elseif (t <= 19000000.0) tmp = t_2; else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; t_2 = (log(t) * (a + -0.5)) + log((y * z)); tmp = 0.0; if (t <= 2.4e-250) tmp = t_2; elseif (t <= 4e-228) tmp = t_1; elseif (t <= 19000000.0) tmp = t_2; else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 2.4e-250], t$95$2, If[LessEqual[t, 4e-228], t$95$1, If[LessEqual[t, 19000000.0], t$95$2, N[(t$95$1 - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
t_2 := \log t \cdot \left(a + -0.5\right) + \log \left(y \cdot z\right)\\
\mathbf{if}\;t \leq 2.4 \cdot 10^{-250}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-228}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 19000000:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < 2.3999999999999999e-250Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.1%
+-commutative99.1%
fma-define99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 63.0%
Taylor expanded in t around 0 63.0%
associate-+r+63.0%
+-commutative63.0%
*-un-lft-identity63.0%
fma-define63.0%
sum-log52.4%
sub-neg52.4%
metadata-eval52.4%
Applied egg-rr52.4%
fma-undefine52.4%
*-lft-identity52.4%
*-commutative52.4%
Simplified52.4%
if 2.3999999999999999e-250 < t < 4.00000000000000013e-228Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in a around inf 66.0%
*-commutative66.0%
Simplified66.0%
if 4.00000000000000013e-228 < t < 1.9e7Initial program 99.2%
associate--l+99.2%
+-commutative99.2%
associate-+l+99.1%
+-commutative99.1%
fma-define99.1%
sub-neg99.1%
metadata-eval99.1%
Simplified99.1%
Taylor expanded in x around 0 63.4%
Taylor expanded in t around 0 61.8%
*-un-lft-identity61.8%
add-log-exp18.8%
sum-log14.9%
exp-sum15.0%
add-exp-log15.3%
exp-to-pow15.3%
sub-neg15.3%
metadata-eval15.3%
Applied egg-rr15.3%
*-lft-identity15.3%
associate-*r*17.9%
Simplified17.9%
*-commutative17.9%
log-prod19.5%
pow-to-exp19.5%
rem-log-exp44.2%
*-commutative44.2%
Applied egg-rr44.2%
if 1.9e7 < t Initial program 99.9%
remove-double-neg99.9%
associate--l+99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 73.1%
Taylor expanded in a around inf 98.2%
*-commutative98.2%
Simplified98.2%
Final simplification72.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.1e-42) (not (<= a 2750000000000.0))) (- (* (log t) a) t) (+ (log (* (+ x y) z)) (- (* (log t) (+ a -0.5)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.1e-42) || !(a <= 2750000000000.0)) {
tmp = (log(t) * a) - t;
} else {
tmp = log(((x + y) * z)) + ((log(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 <= (-2.1d-42)) .or. (.not. (a <= 2750000000000.0d0))) then
tmp = (log(t) * a) - t
else
tmp = log(((x + y) * z)) + ((log(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 <= -2.1e-42) || !(a <= 2750000000000.0)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log(((x + y) * z)) + ((Math.log(t) * (a + -0.5)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.1e-42) or not (a <= 2750000000000.0): tmp = (math.log(t) * a) - t else: tmp = math.log(((x + y) * z)) + ((math.log(t) * (a + -0.5)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.1e-42) || !(a <= 2750000000000.0)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(log(t) * Float64(a + -0.5)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.1e-42) || ~((a <= 2750000000000.0))) tmp = (log(t) * a) - t; else tmp = log(((x + y) * z)) + ((log(t) * (a + -0.5)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.1e-42], N[Not[LessEqual[a, 2750000000000.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.1 \cdot 10^{-42} \lor \neg \left(a \leq 2750000000000\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \left(\log t \cdot \left(a + -0.5\right) - t\right)\\
\end{array}
\end{array}
if a < -2.10000000000000006e-42 or 2.75e12 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.9%
Taylor expanded in a around inf 95.5%
*-commutative95.5%
Simplified95.5%
if -2.10000000000000006e-42 < a < 2.75e12Initial program 99.4%
remove-double-neg99.4%
associate--l+99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
metadata-eval99.4%
sub-neg99.4%
associate-+r-99.4%
associate-+l-99.4%
sum-log84.8%
sub-neg84.8%
metadata-eval84.8%
*-commutative84.8%
Applied egg-rr84.8%
Final simplification90.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* (log t) a) t)))
(if (<= a -0.95)
t_1
(if (<= a 7.4e-68)
(- (+ (log z) (log y)) t)
(if (<= a 2.3e-40) (log (* (* y z) (sqrt (/ 1.0 t)))) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (log(t) * a) - t;
double tmp;
if (a <= -0.95) {
tmp = t_1;
} else if (a <= 7.4e-68) {
tmp = (log(z) + log(y)) - t;
} else if (a <= 2.3e-40) {
tmp = log(((y * z) * sqrt((1.0 / t))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (log(t) * a) - t
if (a <= (-0.95d0)) then
tmp = t_1
else if (a <= 7.4d-68) then
tmp = (log(z) + log(y)) - t
else if (a <= 2.3d-40) then
tmp = log(((y * z) * sqrt((1.0d0 / t))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (Math.log(t) * a) - t;
double tmp;
if (a <= -0.95) {
tmp = t_1;
} else if (a <= 7.4e-68) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else if (a <= 2.3e-40) {
tmp = Math.log(((y * z) * Math.sqrt((1.0 / t))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (math.log(t) * a) - t tmp = 0 if a <= -0.95: tmp = t_1 elif a <= 7.4e-68: tmp = (math.log(z) + math.log(y)) - t elif a <= 2.3e-40: tmp = math.log(((y * z) * math.sqrt((1.0 / t)))) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(log(t) * a) - t) tmp = 0.0 if (a <= -0.95) tmp = t_1; elseif (a <= 7.4e-68) tmp = Float64(Float64(log(z) + log(y)) - t); elseif (a <= 2.3e-40) tmp = log(Float64(Float64(y * z) * sqrt(Float64(1.0 / t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (log(t) * a) - t; tmp = 0.0; if (a <= -0.95) tmp = t_1; elseif (a <= 7.4e-68) tmp = (log(z) + log(y)) - t; elseif (a <= 2.3e-40) tmp = log(((y * z) * sqrt((1.0 / t)))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -0.95], t$95$1, If[LessEqual[a, 7.4e-68], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 2.3e-40], N[Log[N[(N[(y * z), $MachinePrecision] * N[Sqrt[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a - t\\
\mathbf{if}\;a \leq -0.95:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.4 \cdot 10^{-68}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-40}:\\
\;\;\;\;\log \left(\left(y \cdot z\right) \cdot \sqrt{\frac{1}{t}}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -0.94999999999999996 or 2.3e-40 < a Initial program 99.6%
remove-double-neg99.6%
associate--l+99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 77.1%
Taylor expanded in a around inf 97.5%
*-commutative97.5%
Simplified97.5%
if -0.94999999999999996 < a < 7.40000000000000004e-68Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in x around 0 60.0%
Taylor expanded in t around inf 38.9%
if 7.40000000000000004e-68 < a < 2.3e-40Initial program 98.7%
associate--l+98.7%
+-commutative98.7%
associate-+l+97.3%
+-commutative97.3%
fma-define97.3%
sub-neg97.3%
metadata-eval97.3%
Simplified97.3%
Taylor expanded in x around 0 55.7%
Taylor expanded in t around 0 55.7%
*-un-lft-identity55.7%
add-log-exp55.7%
sum-log55.9%
exp-sum56.7%
add-exp-log57.0%
exp-to-pow57.6%
sub-neg57.6%
metadata-eval57.6%
Applied egg-rr57.6%
*-lft-identity57.6%
associate-*r*57.5%
Simplified57.5%
Taylor expanded in a around 0 57.5%
Final simplification68.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.55e-36) (not (<= a 940000000000.0))) (- (* (log t) a) 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 <= -2.55e-36) || !(a <= 940000000000.0)) {
tmp = (log(t) * a) - 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 <= (-2.55d-36)) .or. (.not. (a <= 940000000000.0d0))) then
tmp = (log(t) * a) - 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 <= -2.55e-36) || !(a <= 940000000000.0)) {
tmp = (Math.log(t) * a) - 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 <= -2.55e-36) or not (a <= 940000000000.0): tmp = (math.log(t) * a) - 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 <= -2.55e-36) || !(a <= 940000000000.0)) tmp = Float64(Float64(log(t) * a) - 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 <= -2.55e-36) || ~((a <= 940000000000.0))) tmp = (log(t) * a) - 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, -2.55e-36], N[Not[LessEqual[a, 940000000000.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $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 -2.55 \cdot 10^{-36} \lor \neg \left(a \leq 940000000000\right):\\
\;\;\;\;\log t \cdot a - 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 < -2.54999999999999987e-36 or 9.4e11 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.9%
Taylor expanded in a around inf 95.5%
*-commutative95.5%
Simplified95.5%
if -2.54999999999999987e-36 < a < 9.4e11Initial program 99.4%
remove-double-neg99.4%
associate--l+99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
add-cube-cbrt97.5%
pow397.6%
+-commutative97.6%
*-commutative97.6%
fma-define97.6%
associate-+r-97.6%
sum-log83.2%
Applied egg-rr83.2%
Taylor expanded in a around 0 84.7%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.55e-36) (not (<= a 1900000000000.0))) (- (* (log t) a) t) (- (+ (* (log t) (- a 0.5)) (log (* y z))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.55e-36) || !(a <= 1900000000000.0)) {
tmp = (log(t) * a) - t;
} else {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.55d-36)) .or. (.not. (a <= 1900000000000.0d0))) then
tmp = (log(t) * a) - t
else
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.55e-36) || !(a <= 1900000000000.0)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.55e-36) or not (a <= 1900000000000.0): tmp = (math.log(t) * a) - t else: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.55e-36) || !(a <= 1900000000000.0)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.55e-36) || ~((a <= 1900000000000.0))) tmp = (log(t) * a) - t; else tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.55e-36], N[Not[LessEqual[a, 1900000000000.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.55 \cdot 10^{-36} \lor \neg \left(a \leq 1900000000000\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\end{array}
\end{array}
if a < -2.54999999999999987e-36 or 1.9e12 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 76.9%
Taylor expanded in a around inf 95.5%
*-commutative95.5%
Simplified95.5%
if -2.54999999999999987e-36 < a < 1.9e12Initial program 99.4%
remove-double-neg99.4%
associate--l+99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
add-cube-cbrt97.5%
pow397.6%
+-commutative97.6%
*-commutative97.6%
fma-define97.6%
associate-+r-97.6%
sum-log83.2%
Applied egg-rr83.2%
Taylor expanded in x around 0 48.4%
Final simplification72.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -100000.0) (not (<= (- a 0.5) -0.5))) (- (* (log t) a) t) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -100000.0) || !((a - 0.5) <= -0.5)) {
tmp = (log(t) * a) - t;
} else {
tmp = log((x + y)) + (log(z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a - 0.5d0) <= (-100000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.5d0)))) then
tmp = (log(t) * a) - t
else
tmp = log((x + y)) + (log(z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -100000.0) || !((a - 0.5) <= -0.5)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log((x + y)) + (Math.log(z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -100000.0) or not ((a - 0.5) <= -0.5): tmp = (math.log(t) * a) - t else: tmp = math.log((x + y)) + (math.log(z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -100000.0) || !(Float64(a - 0.5) <= -0.5)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -100000.0) || ~(((a - 0.5) <= -0.5))) tmp = (log(t) * a) - t; else tmp = log((x + y)) + (log(z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -100000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.5]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -100000 \lor \neg \left(a - 0.5 \leq -0.5\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -1e5 or -0.5 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
remove-double-neg99.6%
associate--l+99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 76.8%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
if -1e5 < (-.f64 a #s(literal 1/2 binary64)) < -0.5Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in t around inf 57.1%
Final simplification77.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.55e-15) (not (<= a 1.7))) (- (* (log t) a) 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 <= -1.55e-15) || !(a <= 1.7)) {
tmp = (log(t) * a) - 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 <= (-1.55d-15)) .or. (.not. (a <= 1.7d0))) then
tmp = (log(t) * a) - 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 <= -1.55e-15) || !(a <= 1.7)) {
tmp = (Math.log(t) * a) - 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 <= -1.55e-15) or not (a <= 1.7): tmp = (math.log(t) * a) - 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 ((a <= -1.55e-15) || !(a <= 1.7)) tmp = Float64(Float64(log(t) * a) - 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 <= -1.55e-15) || ~((a <= 1.7))) tmp = (log(t) * a) - 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[a, -1.55e-15], N[Not[LessEqual[a, 1.7]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $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 \leq -1.55 \cdot 10^{-15} \lor \neg \left(a \leq 1.7\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right) - t\\
\end{array}
\end{array}
if a < -1.5499999999999999e-15 or 1.69999999999999996 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.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.3%
*-commutative98.3%
Simplified98.3%
if -1.5499999999999999e-15 < a < 1.69999999999999996Initial program 99.4%
remove-double-neg99.4%
associate--l+99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 61.0%
add-log-exp56.0%
sum-log43.8%
exp-sum43.9%
add-exp-log43.9%
sub-neg43.9%
metadata-eval43.9%
exp-to-pow44.0%
Applied egg-rr44.0%
Final simplification70.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.3) (not (<= a 7.8e-14))) (- (* (log t) a) t) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.3) || !(a <= 7.8e-14)) {
tmp = (log(t) * a) - t;
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-0.3d0)) .or. (.not. (a <= 7.8d-14))) then
tmp = (log(t) * a) - t
else
tmp = (log(z) + log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.3) || !(a <= 7.8e-14)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.3) or not (a <= 7.8e-14): tmp = (math.log(t) * a) - t else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.3) || !(a <= 7.8e-14)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.3) || ~((a <= 7.8e-14))) tmp = (log(t) * a) - t; else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.3], N[Not[LessEqual[a, 7.8e-14]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.3 \lor \neg \left(a \leq 7.8 \cdot 10^{-14}\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -0.299999999999999989 or 7.7999999999999996e-14 < a Initial program 99.6%
remove-double-neg99.6%
associate--l+99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 76.8%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
if -0.299999999999999989 < a < 7.7999999999999996e-14Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 60.4%
Taylor expanded in t around inf 37.9%
Final simplification67.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 4500000000000.0) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4500000000000.0) {
tmp = log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 4500000000000.0d0) then
tmp = log(t) * a
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4500000000000.0) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4500000000000.0: tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4500000000000.0) tmp = Float64(log(t) * a); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4500000000000.0) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4500000000000.0], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4500000000000:\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 4.5e12Initial program 99.2%
associate-+l-99.2%
associate--l+99.2%
sub-neg99.2%
+-commutative99.2%
*-commutative99.2%
distribute-rgt-neg-in99.2%
fma-undefine99.2%
sub-neg99.2%
+-commutative99.2%
distribute-neg-in99.2%
metadata-eval99.2%
metadata-eval99.2%
unsub-neg99.2%
Simplified99.2%
Taylor expanded in a around inf 50.2%
*-commutative50.2%
Simplified50.2%
if 4.5e12 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 80.8%
neg-mul-180.8%
Simplified80.8%
(FPCore (x y z t a) :precision binary64 (- (* (log t) a) t))
double code(double x, double y, double z, double t, double a) {
return (log(t) * a) - 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(t) * a) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(t) * a) - t;
}
def code(x, y, z, t, a): return (math.log(t) * a) - t
function code(x, y, z, t, a) return Float64(Float64(log(t) * a) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(t) * a) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log t \cdot a - t
\end{array}
Initial program 99.5%
remove-double-neg99.5%
associate--l+99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 68.5%
Taylor expanded in a around inf 73.6%
*-commutative73.6%
Simplified73.6%
(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%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 39.3%
neg-mul-139.3%
Simplified39.3%
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t)))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log((x + y)) + ((log(z) - t) + ((a - 0.5d0) * log(t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) + ((Math.log(z) - t) + ((a - 0.5) * Math.log(t)));
}
def code(x, y, z, t, a): return math.log((x + y)) + ((math.log(z) - t) + ((a - 0.5) * math.log(t)))
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(Float64(log(z) - t) + Float64(Float64(a - 0.5) * log(t)))) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t))); end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right)
\end{array}
herbie shell --seed 2024103
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))