
(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 (+ 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.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
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 (<= t 0.00088) (+ (log (+ x y)) (+ (log z) (* (log t) (- a 0.5)))) (- (- (log z) t) (* a (log (/ 1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00088) {
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) - t) - (a * log((1.0 / 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 <= 0.00088d0) then
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) - t) - (a * log((1.0d0 / 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 <= 0.00088) {
tmp = Math.log((x + y)) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) - t) - (a * Math.log((1.0 / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.00088: tmp = math.log((x + y)) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) - t) - (a * math.log((1.0 / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.00088) tmp = Float64(log(Float64(x + y)) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) - t) - Float64(a * log(Float64(1.0 / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.00088) tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(z) - t) - (a * log((1.0 / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.00088], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] - N[(a * N[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.00088:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) - a \cdot \log \left(\frac{1}{t}\right)\\
\end{array}
\end{array}
if t < 8.80000000000000031e-4Initial program 99.3%
associate-+l-99.3%
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 0 99.0%
if 8.80000000000000031e-4 < 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 99.9%
Taylor expanded in a around inf 98.3%
Final simplification98.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.00088) (+ (log z) (+ (log (+ x y)) (* (log t) (- a 0.5)))) (- (- (log z) t) (* a (log (/ 1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00088) {
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) - t) - (a * log((1.0 / 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 <= 0.00088d0) then
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) - t) - (a * log((1.0d0 / 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 <= 0.00088) {
tmp = Math.log(z) + (Math.log((x + y)) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) - t) - (a * Math.log((1.0 / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.00088: tmp = math.log(z) + (math.log((x + y)) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) - t) - (a * math.log((1.0 / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.00088) tmp = Float64(log(z) + Float64(log(Float64(x + y)) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) - t) - Float64(a * log(Float64(1.0 / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.00088) tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5))); else tmp = (log(z) - t) - (a * log((1.0 / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.00088], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] - N[(a * N[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.00088:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) - a \cdot \log \left(\frac{1}{t}\right)\\
\end{array}
\end{array}
if t < 8.80000000000000031e-4Initial program 99.3%
associate-+l-99.3%
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 0 99.0%
associate--l+99.0%
+-commutative99.0%
Simplified99.0%
if 8.80000000000000031e-4 < 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 99.9%
Taylor expanded in a around inf 98.3%
Final simplification98.6%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (- (log (+ x y)) (* (log (/ 1.0 t)) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log((x + y)) - (log((1.0 / 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((x + y)) - (log((1.0d0 / 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((x + y)) - (Math.log((1.0 / t)) * (a - 0.5)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log((x + y)) - (math.log((1.0 / t)) * (a - 0.5)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(Float64(x + y)) - Float64(log(Float64(1.0 / t)) * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log((x + y)) - (log((1.0 / t)) * (a - 0.5))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - N[(N[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log \left(x + y\right) - \log \left(\frac{1}{t}\right) \cdot \left(a - 0.5\right)\right)
\end{array}
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 t around inf 99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.00088) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (- (log z) t) (* a (log (/ 1.0 t))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.00088) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) - t) - (a * log((1.0 / 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 <= 0.00088d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) - t) - (a * log((1.0d0 / 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 <= 0.00088) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) - t) - (a * Math.log((1.0 / t)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.00088: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) - t) - (a * math.log((1.0 / t))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.00088) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) - t) - Float64(a * log(Float64(1.0 / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.00088) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(z) - t) - (a * log((1.0 / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.00088], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] - N[(a * N[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.00088:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) - a \cdot \log \left(\frac{1}{t}\right)\\
\end{array}
\end{array}
if t < 8.80000000000000031e-4Initial program 99.3%
associate-+l-99.3%
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 59.4%
Taylor expanded in t around 0 59.4%
associate--l+59.4%
Simplified59.4%
if 8.80000000000000031e-4 < 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 99.9%
Taylor expanded in a around inf 98.3%
Final simplification78.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(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.6%
remove-double-neg99.6%
associate--l+99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(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.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 67.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (* y z)) (* (log t) (- a 0.5)))))
(if (<= t 3.4e-176)
t_1
(if (<= t 4e-157)
(+ (log y) (* (log t) a))
(if (<= t 2.6e-80) t_1 (- (- (log z) t) (* a (log (/ 1.0 t)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((y * z)) + (log(t) * (a - 0.5));
double tmp;
if (t <= 3.4e-176) {
tmp = t_1;
} else if (t <= 4e-157) {
tmp = log(y) + (log(t) * a);
} else if (t <= 2.6e-80) {
tmp = t_1;
} else {
tmp = (log(z) - t) - (a * log((1.0 / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log((y * z)) + (log(t) * (a - 0.5d0))
if (t <= 3.4d-176) then
tmp = t_1
else if (t <= 4d-157) then
tmp = log(y) + (log(t) * a)
else if (t <= 2.6d-80) then
tmp = t_1
else
tmp = (log(z) - t) - (a * log((1.0d0 / 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((y * z)) + (Math.log(t) * (a - 0.5));
double tmp;
if (t <= 3.4e-176) {
tmp = t_1;
} else if (t <= 4e-157) {
tmp = Math.log(y) + (Math.log(t) * a);
} else if (t <= 2.6e-80) {
tmp = t_1;
} else {
tmp = (Math.log(z) - t) - (a * Math.log((1.0 / t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((y * z)) + (math.log(t) * (a - 0.5)) tmp = 0 if t <= 3.4e-176: tmp = t_1 elif t <= 4e-157: tmp = math.log(y) + (math.log(t) * a) elif t <= 2.6e-80: tmp = t_1 else: tmp = (math.log(z) - t) - (a * math.log((1.0 / t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))) tmp = 0.0 if (t <= 3.4e-176) tmp = t_1; elseif (t <= 4e-157) tmp = Float64(log(y) + Float64(log(t) * a)); elseif (t <= 2.6e-80) tmp = t_1; else tmp = Float64(Float64(log(z) - t) - Float64(a * log(Float64(1.0 / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((y * z)) + (log(t) * (a - 0.5)); tmp = 0.0; if (t <= 3.4e-176) tmp = t_1; elseif (t <= 4e-157) tmp = log(y) + (log(t) * a); elseif (t <= 2.6e-80) tmp = t_1; else tmp = (log(z) - t) - (a * log((1.0 / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 3.4e-176], t$95$1, If[LessEqual[t, 4e-157], N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e-80], t$95$1, N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] - N[(a * N[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 3.4 \cdot 10^{-176}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{-157}:\\
\;\;\;\;\log y + \log t \cdot a\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-80}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) - a \cdot \log \left(\frac{1}{t}\right)\\
\end{array}
\end{array}
if t < 3.3999999999999997e-176 or 3.99999999999999977e-157 < t < 2.6000000000000001e-80Initial program 99.2%
associate-+l-99.2%
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 x around 0 60.4%
Taylor expanded in t around 0 60.4%
associate--l+60.5%
Simplified60.5%
associate-+r-60.4%
sum-log47.1%
Applied egg-rr47.1%
if 3.3999999999999997e-176 < t < 3.99999999999999977e-157Initial program 99.5%
associate-+l-99.5%
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 a around inf 83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in x around 0 61.4%
*-commutative61.4%
Simplified61.4%
if 2.6000000000000001e-80 < t Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
Taylor expanded in a around inf 93.3%
Final simplification75.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)) (t_2 (+ (log (* y z)) (* (log t) (- a 0.5)))))
(if (<= t 6e-176)
t_2
(if (<= t 2.8e-157)
(+ (log y) t_1)
(if (<= t 2.6e-80) t_2 (+ (- (log z) t) t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double t_2 = log((y * z)) + (log(t) * (a - 0.5));
double tmp;
if (t <= 6e-176) {
tmp = t_2;
} else if (t <= 2.8e-157) {
tmp = log(y) + t_1;
} else if (t <= 2.6e-80) {
tmp = t_2;
} else {
tmp = (log(z) - t) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log(t) * a
t_2 = log((y * z)) + (log(t) * (a - 0.5d0))
if (t <= 6d-176) then
tmp = t_2
else if (t <= 2.8d-157) then
tmp = log(y) + t_1
else if (t <= 2.6d-80) then
tmp = t_2
else
tmp = (log(z) - t) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double t_2 = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
double tmp;
if (t <= 6e-176) {
tmp = t_2;
} else if (t <= 2.8e-157) {
tmp = Math.log(y) + t_1;
} else if (t <= 2.6e-80) {
tmp = t_2;
} else {
tmp = (Math.log(z) - t) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a t_2 = math.log((y * z)) + (math.log(t) * (a - 0.5)) tmp = 0 if t <= 6e-176: tmp = t_2 elif t <= 2.8e-157: tmp = math.log(y) + t_1 elif t <= 2.6e-80: tmp = t_2 else: tmp = (math.log(z) - t) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) t_2 = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))) tmp = 0.0 if (t <= 6e-176) tmp = t_2; elseif (t <= 2.8e-157) tmp = Float64(log(y) + t_1); elseif (t <= 2.6e-80) tmp = t_2; else tmp = Float64(Float64(log(z) - t) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; t_2 = log((y * z)) + (log(t) * (a - 0.5)); tmp = 0.0; if (t <= 6e-176) tmp = t_2; elseif (t <= 2.8e-157) tmp = log(y) + t_1; elseif (t <= 2.6e-80) tmp = t_2; else tmp = (log(z) - t) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 6e-176], t$95$2, If[LessEqual[t, 2.8e-157], N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 2.6e-80], t$95$2, N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
t_2 := \log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 6 \cdot 10^{-176}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-157}:\\
\;\;\;\;\log y + t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-80}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + t\_1\\
\end{array}
\end{array}
if t < 6e-176 or 2.8000000000000001e-157 < t < 2.6000000000000001e-80Initial program 99.2%
associate-+l-99.2%
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 x around 0 60.4%
Taylor expanded in t around 0 60.4%
associate--l+60.5%
Simplified60.5%
associate-+r-60.4%
sum-log47.1%
Applied egg-rr47.1%
if 6e-176 < t < 2.8000000000000001e-157Initial program 99.5%
associate-+l-99.5%
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 a around inf 83.4%
*-commutative83.4%
Simplified83.4%
Taylor expanded in x around 0 61.4%
*-commutative61.4%
Simplified61.4%
if 2.6000000000000001e-80 < t Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in t around inf 99.9%
Taylor expanded in a around inf 93.3%
mul-1-neg93.3%
log-rec93.2%
distribute-rgt-neg-in93.2%
remove-double-neg93.2%
Simplified93.2%
Final simplification75.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (log z) t)))
(if (<= a -1.6e+14)
(+ t_1 (* (log t) a))
(if (<= a 1.4e-9)
(+ (- (log (* z (+ x y))) t) (* (log t) (- a 0.5)))
(- t_1 (* a (log (/ 1.0 t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) - t;
double tmp;
if (a <= -1.6e+14) {
tmp = t_1 + (log(t) * a);
} else if (a <= 1.4e-9) {
tmp = (log((z * (x + y))) - t) + (log(t) * (a - 0.5));
} else {
tmp = t_1 - (a * log((1.0 / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(z) - t
if (a <= (-1.6d+14)) then
tmp = t_1 + (log(t) * a)
else if (a <= 1.4d-9) then
tmp = (log((z * (x + y))) - t) + (log(t) * (a - 0.5d0))
else
tmp = t_1 - (a * log((1.0d0 / 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(z) - t;
double tmp;
if (a <= -1.6e+14) {
tmp = t_1 + (Math.log(t) * a);
} else if (a <= 1.4e-9) {
tmp = (Math.log((z * (x + y))) - t) + (Math.log(t) * (a - 0.5));
} else {
tmp = t_1 - (a * Math.log((1.0 / t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) - t tmp = 0 if a <= -1.6e+14: tmp = t_1 + (math.log(t) * a) elif a <= 1.4e-9: tmp = (math.log((z * (x + y))) - t) + (math.log(t) * (a - 0.5)) else: tmp = t_1 - (a * math.log((1.0 / t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) - t) tmp = 0.0 if (a <= -1.6e+14) tmp = Float64(t_1 + Float64(log(t) * a)); elseif (a <= 1.4e-9) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) - t) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(t_1 - Float64(a * log(Float64(1.0 / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) - t; tmp = 0.0; if (a <= -1.6e+14) tmp = t_1 + (log(t) * a); elseif (a <= 1.4e-9) tmp = (log((z * (x + y))) - t) + (log(t) * (a - 0.5)); else tmp = t_1 - (a * log((1.0 / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -1.6e+14], N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.4e-9], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(a * N[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z - t\\
\mathbf{if}\;a \leq -1.6 \cdot 10^{+14}:\\
\;\;\;\;t\_1 + \log t \cdot a\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-9}:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) - t\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - a \cdot \log \left(\frac{1}{t}\right)\\
\end{array}
\end{array}
if a < -1.6e14Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in t around inf 99.7%
Taylor expanded in a around inf 99.7%
mul-1-neg99.7%
log-rec99.7%
distribute-rgt-neg-in99.7%
remove-double-neg99.7%
Simplified99.7%
if -1.6e14 < a < 1.39999999999999992e-9Initial program 99.5%
*-un-lft-identity99.5%
+-commutative99.5%
sum-log77.4%
Applied egg-rr77.4%
*-lft-identity77.4%
+-commutative77.4%
Simplified77.4%
if 1.39999999999999992e-9 < a Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 99.8%
Taylor expanded in a around inf 97.0%
Final simplification87.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (log z) t)))
(if (<= a -1.6e+14)
(+ t_1 (* (log t) a))
(if (<= a 1.8e-9)
(+ (log (* y z)) (- (* (log t) (- a 0.5)) t))
(- t_1 (* a (log (/ 1.0 t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) - t;
double tmp;
if (a <= -1.6e+14) {
tmp = t_1 + (log(t) * a);
} else if (a <= 1.8e-9) {
tmp = log((y * z)) + ((log(t) * (a - 0.5)) - t);
} else {
tmp = t_1 - (a * log((1.0 / t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(z) - t
if (a <= (-1.6d+14)) then
tmp = t_1 + (log(t) * a)
else if (a <= 1.8d-9) then
tmp = log((y * z)) + ((log(t) * (a - 0.5d0)) - t)
else
tmp = t_1 - (a * log((1.0d0 / 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(z) - t;
double tmp;
if (a <= -1.6e+14) {
tmp = t_1 + (Math.log(t) * a);
} else if (a <= 1.8e-9) {
tmp = Math.log((y * z)) + ((Math.log(t) * (a - 0.5)) - t);
} else {
tmp = t_1 - (a * Math.log((1.0 / t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) - t tmp = 0 if a <= -1.6e+14: tmp = t_1 + (math.log(t) * a) elif a <= 1.8e-9: tmp = math.log((y * z)) + ((math.log(t) * (a - 0.5)) - t) else: tmp = t_1 - (a * math.log((1.0 / t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) - t) tmp = 0.0 if (a <= -1.6e+14) tmp = Float64(t_1 + Float64(log(t) * a)); elseif (a <= 1.8e-9) tmp = Float64(log(Float64(y * z)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)); else tmp = Float64(t_1 - Float64(a * log(Float64(1.0 / t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) - t; tmp = 0.0; if (a <= -1.6e+14) tmp = t_1 + (log(t) * a); elseif (a <= 1.8e-9) tmp = log((y * z)) + ((log(t) * (a - 0.5)) - t); else tmp = t_1 - (a * log((1.0 / t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -1.6e+14], N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e-9], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(a * N[Log[N[(1.0 / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z - t\\
\mathbf{if}\;a \leq -1.6 \cdot 10^{+14}:\\
\;\;\;\;t\_1 + \log t \cdot a\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-9}:\\
\;\;\;\;\log \left(y \cdot z\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - a \cdot \log \left(\frac{1}{t}\right)\\
\end{array}
\end{array}
if a < -1.6e14Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in t around inf 99.7%
Taylor expanded in a around inf 99.7%
mul-1-neg99.7%
log-rec99.7%
distribute-rgt-neg-in99.7%
remove-double-neg99.7%
Simplified99.7%
if -1.6e14 < a < 1.8e-9Initial 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 62.1%
*-un-lft-identity62.1%
sum-log47.9%
Applied egg-rr47.9%
*-lft-identity47.9%
Simplified47.9%
if 1.8e-9 < a Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in t around inf 99.8%
Taylor expanded in a around inf 97.0%
Final simplification73.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)))
(if (<= t 7.8e+21)
(+ (log (+ x y)) t_1)
(if (or (<= t 2.6e+32) (not (<= t 2.6e+92))) (- t) (+ (log y) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if (t <= 7.8e+21) {
tmp = log((x + y)) + t_1;
} else if ((t <= 2.6e+32) || !(t <= 2.6e+92)) {
tmp = -t;
} else {
tmp = log(y) + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) * a
if (t <= 7.8d+21) then
tmp = log((x + y)) + t_1
else if ((t <= 2.6d+32) .or. (.not. (t <= 2.6d+92))) then
tmp = -t
else
tmp = log(y) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double tmp;
if (t <= 7.8e+21) {
tmp = Math.log((x + y)) + t_1;
} else if ((t <= 2.6e+32) || !(t <= 2.6e+92)) {
tmp = -t;
} else {
tmp = Math.log(y) + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if t <= 7.8e+21: tmp = math.log((x + y)) + t_1 elif (t <= 2.6e+32) or not (t <= 2.6e+92): tmp = -t else: tmp = math.log(y) + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (t <= 7.8e+21) tmp = Float64(log(Float64(x + y)) + t_1); elseif ((t <= 2.6e+32) || !(t <= 2.6e+92)) tmp = Float64(-t); else tmp = Float64(log(y) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; tmp = 0.0; if (t <= 7.8e+21) tmp = log((x + y)) + t_1; elseif ((t <= 2.6e+32) || ~((t <= 2.6e+92))) tmp = -t; else tmp = log(y) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, 7.8e+21], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], If[Or[LessEqual[t, 2.6e+32], N[Not[LessEqual[t, 2.6e+92]], $MachinePrecision]], (-t), N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;t \leq 7.8 \cdot 10^{+21}:\\
\;\;\;\;\log \left(x + y\right) + t\_1\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+32} \lor \neg \left(t \leq 2.6 \cdot 10^{+92}\right):\\
\;\;\;\;-t\\
\mathbf{else}:\\
\;\;\;\;\log y + t\_1\\
\end{array}
\end{array}
if t < 7.8e21Initial program 99.4%
associate-+l-99.3%
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 a around inf 60.0%
*-commutative60.0%
Simplified60.0%
if 7.8e21 < t < 2.6000000000000002e32 or 2.5999999999999999e92 < t Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in t around inf 91.1%
neg-mul-191.1%
Simplified91.1%
if 2.6000000000000002e32 < t < 2.5999999999999999e92Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in a around inf 71.7%
*-commutative71.7%
Simplified71.7%
Taylor expanded in x around 0 51.8%
*-commutative51.8%
Simplified51.8%
Final simplification69.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= t 5.2e+21) (and (not (<= t 2.5e+32)) (<= t 1.9e+91))) (+ (log y) (* (log t) a)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= 5.2e+21) || (!(t <= 2.5e+32) && (t <= 1.9e+91))) {
tmp = log(y) + (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 <= 5.2d+21) .or. (.not. (t <= 2.5d+32)) .and. (t <= 1.9d+91)) then
tmp = log(y) + (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 <= 5.2e+21) || (!(t <= 2.5e+32) && (t <= 1.9e+91))) {
tmp = Math.log(y) + (Math.log(t) * a);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= 5.2e+21) or (not (t <= 2.5e+32) and (t <= 1.9e+91)): tmp = math.log(y) + (math.log(t) * a) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= 5.2e+21) || (!(t <= 2.5e+32) && (t <= 1.9e+91))) tmp = Float64(log(y) + 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 <= 5.2e+21) || (~((t <= 2.5e+32)) && (t <= 1.9e+91))) tmp = log(y) + (log(t) * a); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, 5.2e+21], And[N[Not[LessEqual[t, 2.5e+32]], $MachinePrecision], LessEqual[t, 1.9e+91]]], N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.2 \cdot 10^{+21} \lor \neg \left(t \leq 2.5 \cdot 10^{+32}\right) \land t \leq 1.9 \cdot 10^{+91}:\\
\;\;\;\;\log y + \log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 5.2e21 or 2.4999999999999999e32 < t < 1.8999999999999999e91Initial program 99.4%
associate-+l-99.4%
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 a around inf 61.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in x around 0 45.8%
*-commutative45.8%
Simplified45.8%
if 5.2e21 < t < 2.4999999999999999e32 or 1.8999999999999999e91 < t Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in t around inf 100.0%
Taylor expanded in t around inf 91.1%
neg-mul-191.1%
Simplified91.1%
Final simplification61.0%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (* (log t) a)))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(t) * a);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) - t) + (log(t) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(t) * a);
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(t) * a)
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(t) * a)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(t) * a); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \log t \cdot a
\end{array}
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 t around inf 99.6%
Taylor expanded in a around inf 77.4%
mul-1-neg77.4%
log-rec77.4%
distribute-rgt-neg-in77.4%
remove-double-neg77.4%
Simplified77.4%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.51) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.51) {
tmp = log((x + y));
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 0.51d0) then
tmp = log((x + y))
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.51) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.51: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.51) tmp = log(Float64(x + y)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.51) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.51], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.51:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 0.51000000000000001Initial program 99.3%
associate-+l-99.3%
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 9.2%
neg-mul-19.2%
Simplified9.2%
Taylor expanded in t around 0 9.2%
+-commutative9.2%
Simplified9.2%
if 0.51000000000000001 < 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 99.9%
Taylor expanded in t around inf 71.6%
neg-mul-171.6%
Simplified71.6%
Final simplification38.9%
(FPCore (x y z t a) :precision binary64 (- (log (+ x y)) t))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log((x + y)) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) - t;
}
def code(x, y, z, t, a): return math.log((x + y)) - t
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) - t) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) - t
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
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 38.9%
neg-mul-138.9%
Simplified38.9%
Final simplification38.9%
(FPCore (x y z t a) :precision binary64 (- (log y) t))
double code(double x, double y, double z, double t, double a) {
return log(y) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log(y) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log(y) - t;
}
def code(x, y, z, t, a): return math.log(y) - t
function code(x, y, z, t, a) return Float64(log(y) - t) end
function tmp = code(x, y, z, t, a) tmp = log(y) - t; end
code[x_, y_, z_, t_, a_] := N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log y - t
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
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 38.9%
neg-mul-138.9%
Simplified38.9%
Taylor expanded in x around 0 30.0%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in t around inf 99.6%
Taylor expanded in t around inf 35.5%
neg-mul-135.5%
Simplified35.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 2024101
(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))))