
(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 (fma (+ a -0.5) (log t) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
return fma((a + -0.5), log(t), (log((x + y)) + (log(z) - t)));
}
function code(x, y, z, t, a) return fma(Float64(a + -0.5), log(t), Float64(log(Float64(x + y)) + Float64(log(z) - t))) end
code[x_, y_, z_, t_, a_] := N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a + -0.5, \log t, \log \left(x + y\right) + \left(\log z - t\right)\right)
\end{array}
Initial program 99.7%
+-commutative99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
associate--l+99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 200.0) (- (+ (log (* (+ x y) z)) (* (log t) (- a 0.5))) t) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 200.0) {
tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5))) - t;
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (log(z) <= 200.0d0) then
tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5d0))) - t
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (Math.log(z) <= 200.0) {
tmp = (Math.log(((x + y) * z)) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 200.0: tmp = (math.log(((x + y) * z)) + (math.log(t) * (a - 0.5))) - t else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 200.0) tmp = Float64(Float64(log(Float64(Float64(x + y) * z)) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 200.0) tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5))) - t; else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 200.0], N[(N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 200:\\
\;\;\;\;\left(\log \left(\left(x + y\right) \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if (log.f64 z) < 200Initial program 99.7%
associate-+l-99.7%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-udef99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
associate-+r-99.7%
fma-udef99.7%
associate--r+99.7%
sum-log93.4%
Applied egg-rr93.4%
if 200 < (log.f64 z) Initial program 99.7%
Taylor expanded in x around 0 64.0%
Taylor expanded in a around inf 80.2%
*-commutative80.2%
Simplified80.2%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 200.0) (- (+ (log (* y z)) (* (log t) (- a 0.5))) t) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 200.0) {
tmp = (log((y * z)) + (log(t) * (a - 0.5))) - t;
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (log(z) <= 200.0d0) then
tmp = (log((y * z)) + (log(t) * (a - 0.5d0))) - t
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (Math.log(z) <= 200.0) {
tmp = (Math.log((y * z)) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 200.0: tmp = (math.log((y * z)) + (math.log(t) * (a - 0.5))) - t else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 200.0) tmp = Float64(Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 200.0) tmp = (log((y * z)) + (log(t) * (a - 0.5))) - t; else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 200.0], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 200:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if (log.f64 z) < 200Initial program 99.7%
associate-+l-99.7%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-udef99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
associate-+r-99.7%
fma-udef99.7%
associate--r+99.7%
sum-log93.4%
Applied egg-rr93.4%
Taylor expanded in x around 0 58.1%
if 200 < (log.f64 z) Initial program 99.7%
Taylor expanded in x around 0 64.0%
Taylor expanded in a around inf 80.2%
*-commutative80.2%
Simplified80.2%
Final simplification65.8%
(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.7%
Final simplification99.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 140.0) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 140.0) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 140.0d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 140.0) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 140.0: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 140.0) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 140.0) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 140.0], 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[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 140:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 140Initial program 99.4%
Taylor expanded in x around 0 63.6%
Taylor expanded in t around 0 63.5%
if 140 < t Initial program 99.9%
Taylor expanded in x around 0 56.9%
Taylor expanded in a around inf 98.8%
*-commutative98.8%
Simplified98.8%
Final simplification80.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.43) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (+ (log y) (+ (log z) (* a (log t)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.43) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(y) + (log(z) + (a * log(t)))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 0.43d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(y) + (log(z) + (a * log(t)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.43) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(y) + (Math.log(z) + (a * Math.log(t)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.43: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(y) + (math.log(z) + (a * math.log(t)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.43) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(a * log(t)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.43) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(y) + (log(z) + (a * log(t)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.43], 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[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.43:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \left(\log z + a \cdot \log t\right)\right) - t\\
\end{array}
\end{array}
if t < 0.429999999999999993Initial program 99.4%
Taylor expanded in x around 0 64.1%
Taylor expanded in t around 0 63.9%
if 0.429999999999999993 < 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-udef99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 71.4%
Taylor expanded in a around inf 71.2%
associate-*r*71.2%
neg-mul-171.2%
Simplified71.2%
Taylor expanded in a around 0 71.2%
Final simplification67.4%
(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.7%
associate-+l-99.7%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-udef99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 67.6%
Final simplification67.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2400000.0) (not (<= a 1.45e-24))) (- (* a (log t)) t) (- (+ (log (* (+ x y) z)) (* -0.5 (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2400000.0) || !(a <= 1.45e-24)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(((x + y) * z)) + (-0.5 * log(t))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2400000.0d0)) .or. (.not. (a <= 1.45d-24))) then
tmp = (a * log(t)) - t
else
tmp = (log(((x + y) * z)) + ((-0.5d0) * log(t))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2400000.0) || !(a <= 1.45e-24)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(((x + y) * z)) + (-0.5 * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2400000.0) or not (a <= 1.45e-24): tmp = (a * math.log(t)) - t else: tmp = (math.log(((x + y) * z)) + (-0.5 * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2400000.0) || !(a <= 1.45e-24)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(Float64(Float64(x + y) * z)) + Float64(-0.5 * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2400000.0) || ~((a <= 1.45e-24))) tmp = (a * log(t)) - t; else tmp = (log(((x + y) * z)) + (-0.5 * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2400000.0], N[Not[LessEqual[a, 1.45e-24]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2400000 \lor \neg \left(a \leq 1.45 \cdot 10^{-24}\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(\left(x + y\right) \cdot z\right) + -0.5 \cdot \log t\right) - t\\
\end{array}
\end{array}
if a < -2.4e6 or 1.4499999999999999e-24 < a Initial program 99.8%
Taylor expanded in x around 0 60.1%
Taylor expanded in a around inf 97.9%
*-commutative97.9%
Simplified97.9%
if -2.4e6 < a < 1.4499999999999999e-24Initial program 99.6%
Taylor expanded in a around 0 99.0%
+-commutative99.0%
+-commutative99.0%
associate-+l+99.0%
*-commutative99.0%
log-prod81.2%
*-commutative81.2%
+-commutative81.2%
Simplified81.2%
Final simplification89.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2400000.0) (not (<= a 1.45e-24))) (- (* a (log t)) t) (- (+ (log (* y z)) (* -0.5 (log t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2400000.0) || !(a <= 1.45e-24)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log((y * z)) + (-0.5 * log(t))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2400000.0d0)) .or. (.not. (a <= 1.45d-24))) then
tmp = (a * log(t)) - t
else
tmp = (log((y * z)) + ((-0.5d0) * log(t))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2400000.0) || !(a <= 1.45e-24)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log((y * z)) + (-0.5 * Math.log(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2400000.0) or not (a <= 1.45e-24): tmp = (a * math.log(t)) - t else: tmp = (math.log((y * z)) + (-0.5 * math.log(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2400000.0) || !(a <= 1.45e-24)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(Float64(y * z)) + Float64(-0.5 * log(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2400000.0) || ~((a <= 1.45e-24))) tmp = (a * log(t)) - t; else tmp = (log((y * z)) + (-0.5 * log(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2400000.0], N[Not[LessEqual[a, 1.45e-24]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2400000 \lor \neg \left(a \leq 1.45 \cdot 10^{-24}\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + -0.5 \cdot \log t\right) - t\\
\end{array}
\end{array}
if a < -2.4e6 or 1.4499999999999999e-24 < a Initial program 99.8%
Taylor expanded in x around 0 60.1%
Taylor expanded in a around inf 97.9%
*-commutative97.9%
Simplified97.9%
if -2.4e6 < a < 1.4499999999999999e-24Initial program 99.6%
Taylor expanded in a around 0 99.0%
Taylor expanded in x around 0 62.9%
associate-+r+62.9%
log-prod47.6%
*-commutative47.6%
Simplified47.6%
Final simplification73.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.2e-15) (not (<= a 1.8))) (- (* a (log t)) t) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.2e-15) || !(a <= 1.8)) {
tmp = (a * log(t)) - 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 <= (-1.2d-15)) .or. (.not. (a <= 1.8d0))) then
tmp = (a * log(t)) - 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 <= -1.2e-15) || !(a <= 1.8)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = Math.log((x + y)) + (Math.log(z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.2e-15) or not (a <= 1.8): tmp = (a * math.log(t)) - t else: tmp = math.log((x + y)) + (math.log(z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.2e-15) || !(a <= 1.8)) tmp = Float64(Float64(a * log(t)) - 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 <= -1.2e-15) || ~((a <= 1.8))) tmp = (a * log(t)) - t; else tmp = log((x + y)) + (log(z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.2e-15], N[Not[LessEqual[a, 1.8]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $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 \leq -1.2 \cdot 10^{-15} \lor \neg \left(a \leq 1.8\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\end{array}
\end{array}
if a < -1.19999999999999997e-15 or 1.80000000000000004 < a Initial program 99.8%
Taylor expanded in x around 0 59.8%
Taylor expanded in a around inf 98.0%
*-commutative98.0%
Simplified98.0%
if -1.19999999999999997e-15 < a < 1.80000000000000004Initial program 99.6%
associate-+l-99.6%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-udef99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 56.5%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.6e-12) (not (<= a 1.45e-24))) (- (* a (log t)) t) (- (log (/ (* y z) (sqrt t))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.6e-12) || !(a <= 1.45e-24)) {
tmp = (a * log(t)) - t;
} else {
tmp = log(((y * z) / sqrt(t))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-6.6d-12)) .or. (.not. (a <= 1.45d-24))) then
tmp = (a * log(t)) - t
else
tmp = log(((y * z) / sqrt(t))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.6e-12) || !(a <= 1.45e-24)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = Math.log(((y * z) / Math.sqrt(t))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.6e-12) or not (a <= 1.45e-24): tmp = (a * math.log(t)) - t else: tmp = math.log(((y * z) / math.sqrt(t))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.6e-12) || !(a <= 1.45e-24)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(log(Float64(Float64(y * z) / sqrt(t))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6.6e-12) || ~((a <= 1.45e-24))) tmp = (a * log(t)) - t; else tmp = log(((y * z) / sqrt(t))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.6e-12], N[Not[LessEqual[a, 1.45e-24]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[(y * z), $MachinePrecision] / N[Sqrt[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.6 \cdot 10^{-12} \lor \neg \left(a \leq 1.45 \cdot 10^{-24}\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{y \cdot z}{\sqrt{t}}\right) - t\\
\end{array}
\end{array}
if a < -6.6000000000000001e-12 or 1.4499999999999999e-24 < a Initial program 99.8%
Taylor expanded in x around 0 59.8%
Taylor expanded in a around inf 97.3%
*-commutative97.3%
Simplified97.3%
if -6.6000000000000001e-12 < a < 1.4499999999999999e-24Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-udef99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
associate-+r-99.5%
fma-udef99.5%
associate--r+99.5%
sum-log81.2%
Applied egg-rr81.2%
Taylor expanded in x around 0 48.1%
Taylor expanded in a around 0 48.0%
*-commutative48.0%
Simplified48.0%
sum-log63.8%
*-un-lft-identity63.8%
sum-log48.0%
add-log-exp48.0%
diff-log44.7%
exp-to-pow44.7%
pow1/244.7%
Applied egg-rr44.7%
*-lft-identity44.7%
*-commutative44.7%
Simplified44.7%
Final simplification72.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 2.55e-52) (+ (log (* y z)) (* (log t) (- a 0.5))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.55e-52) {
tmp = log((y * z)) + (log(t) * (a - 0.5));
} else {
tmp = (a * log(t)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 2.55d-52) then
tmp = log((y * z)) + (log(t) * (a - 0.5d0))
else
tmp = (a * log(t)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2.55e-52) {
tmp = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2.55e-52: tmp = math.log((y * z)) + (math.log(t) * (a - 0.5)) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2.55e-52) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(Float64(a * log(t)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 2.55e-52) tmp = log((y * z)) + (log(t) * (a - 0.5)); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2.55e-52], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.55 \cdot 10^{-52}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 2.54999999999999995e-52Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-udef99.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 63.9%
+-commutative63.9%
fma-def63.9%
Simplified63.9%
Taylor expanded in t around 0 63.9%
log-prod47.6%
*-commutative47.6%
Simplified47.6%
if 2.54999999999999995e-52 < t Initial program 99.9%
Taylor expanded in x around 0 55.6%
Taylor expanded in a around inf 94.2%
*-commutative94.2%
Simplified94.2%
Final simplification74.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.2e-15) (not (<= a 1.75))) (- (* a (log t)) t) (+ (- (log z) t) (log y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.2e-15) || !(a <= 1.75)) {
tmp = (a * log(t)) - t;
} else {
tmp = (log(z) - t) + log(y);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.2d-15)) .or. (.not. (a <= 1.75d0))) then
tmp = (a * log(t)) - t
else
tmp = (log(z) - t) + log(y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.2e-15) || !(a <= 1.75)) {
tmp = (a * Math.log(t)) - t;
} else {
tmp = (Math.log(z) - t) + Math.log(y);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.2e-15) or not (a <= 1.75): tmp = (a * math.log(t)) - t else: tmp = (math.log(z) - t) + math.log(y) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.2e-15) || !(a <= 1.75)) tmp = Float64(Float64(a * log(t)) - t); else tmp = Float64(Float64(log(z) - t) + log(y)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.2e-15) || ~((a <= 1.75))) tmp = (a * log(t)) - t; else tmp = (log(z) - t) + log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.2e-15], N[Not[LessEqual[a, 1.75]], $MachinePrecision]], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{-15} \lor \neg \left(a \leq 1.75\right):\\
\;\;\;\;a \cdot \log t - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log y\\
\end{array}
\end{array}
if a < -1.19999999999999997e-15 or 1.75 < a Initial program 99.8%
Taylor expanded in x around 0 59.8%
Taylor expanded in a around inf 98.0%
*-commutative98.0%
Simplified98.0%
if -1.19999999999999997e-15 < a < 1.75Initial program 99.6%
associate-+l-99.6%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-udef99.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 63.7%
Taylor expanded in t around inf 40.8%
associate--l+40.8%
Applied egg-rr40.8%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 420.0) (log (* y z)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 420.0) {
tmp = log((y * z));
} 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 <= 420.0d0) then
tmp = log((y * z))
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 <= 420.0) {
tmp = Math.log((y * z));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 420.0: tmp = math.log((y * z)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 420.0) tmp = log(Float64(y * z)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 420.0) tmp = log((y * z)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 420.0], N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 420:\\
\;\;\;\;\log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 420Initial program 99.4%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-udef99.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 63.6%
Taylor expanded in t around inf 6.8%
Taylor expanded in t around 0 6.8%
log-prod5.0%
*-commutative5.0%
Simplified5.0%
if 420 < 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-udef100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 76.0%
neg-mul-176.0%
Simplified76.0%
Final simplification38.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 5.1e+30) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 5.1e+30) {
tmp = a * log(t);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 5.1d+30) then
tmp = a * log(t)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 5.1e+30) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 5.1e+30: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 5.1e+30) tmp = Float64(a * log(t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 5.1e+30) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 5.1e+30], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.1 \cdot 10^{+30}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 5.10000000000000035e30Initial program 99.5%
associate-+l-99.5%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-udef99.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 52.7%
*-commutative52.7%
Simplified52.7%
if 5.10000000000000035e30 < t Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-udef100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in t around inf 81.8%
neg-mul-181.8%
Simplified81.8%
Final simplification64.8%
(FPCore (x y z t a) :precision binary64 (- (* a (log t)) t))
double code(double x, double y, double z, double t, double a) {
return (a * log(t)) - t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (a * log(t)) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (a * Math.log(t)) - t;
}
def code(x, y, z, t, a): return (a * math.log(t)) - t
function code(x, y, z, t, a) return Float64(Float64(a * log(t)) - t) end
function tmp = code(x, y, z, t, a) tmp = (a * log(t)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \log t - t
\end{array}
Initial program 99.7%
Taylor expanded in x around 0 57.7%
Taylor expanded in a around inf 73.6%
*-commutative73.6%
Simplified73.6%
Final simplification73.6%
(FPCore (x y z t a) :precision binary64 (- (/ x y) t))
double code(double x, double y, double z, double t, double a) {
return (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 = (x / y) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (x / y) - t;
}
def code(x, y, z, t, a): return (x / y) - t
function code(x, y, z, t, a) return Float64(Float64(x / y) - t) end
function tmp = code(x, y, z, t, a) tmp = (x / y) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(x / y), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y} - t
\end{array}
Initial program 99.7%
Taylor expanded in x around 0 57.7%
Taylor expanded in y around 0 26.0%
Final simplification26.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.7%
associate-+l-99.7%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-udef99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in t around inf 36.8%
neg-mul-136.8%
Simplified36.8%
Final simplification36.8%
(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 2023334
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))