
(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 16 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) 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(log(Float64(x + y)) + 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[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 300.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) <= 300.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) <= 300.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) <= 300.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) <= 300.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) <= 300.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) <= 300.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], 300.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 300:\\
\;\;\;\;\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) < 300Initial program 99.6%
associate-+l-99.6%
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.6%
fma-udef99.6%
associate--r+99.6%
+-commutative99.6%
sum-log89.4%
Applied egg-rr89.4%
Taylor expanded in x around 0 51.8%
*-commutative51.8%
Simplified51.8%
if 300 < (log.f64 z) Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
add-exp-log46.1%
metadata-eval46.1%
sub-neg46.1%
*-commutative46.1%
sub-neg46.1%
metadata-eval46.1%
Applied egg-rr46.1%
Taylor expanded in x around 0 69.6%
Taylor expanded in a around inf 77.0%
*-commutative77.0%
Simplified77.0%
Final simplification58.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.43) (+ (log z) (+ (log (+ x y)) (* (log t) (- a 0.5)))) (+ (+ (log z) (log y)) (- (* a (log t)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.43) {
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) + log(y)) + ((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(z) + (log((x + y)) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) + log(y)) + ((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(z) + (Math.log((x + y)) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) + Math.log(y)) + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.43: tmp = math.log(z) + (math.log((x + y)) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) + math.log(y)) + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.43) tmp = Float64(log(z) + Float64(log(Float64(x + y)) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) + log(y)) + Float64(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(z) + (log((x + y)) + (log(t) * (a - 0.5))); else tmp = (log(z) + log(y)) + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.43], 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] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.43:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 0.429999999999999993Initial program 99.4%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in t around 0 99.0%
if 0.429999999999999993 < t Initial program 99.8%
associate-+l-99.8%
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 69.5%
Taylor expanded in a around inf 69.0%
mul-1-neg69.0%
*-commutative69.0%
distribute-rgt-neg-in69.0%
Simplified69.0%
Final simplification83.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 520.0) (+ (log y) (- (log z) (* (log t) (- 0.5 a)))) (- (* a (log t)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 520.0) {
tmp = log(y) + (log(z) - (log(t) * (0.5 - a)));
} 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 <= 520.0d0) then
tmp = log(y) + (log(z) - (log(t) * (0.5d0 - a)))
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 <= 520.0) {
tmp = Math.log(y) + (Math.log(z) - (Math.log(t) * (0.5 - a)));
} else {
tmp = (a * Math.log(t)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 520.0: tmp = math.log(y) + (math.log(z) - (math.log(t) * (0.5 - a))) else: tmp = (a * math.log(t)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 520.0) tmp = Float64(log(y) + Float64(log(z) - Float64(log(t) * Float64(0.5 - a)))); 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 <= 520.0) tmp = log(y) + (log(z) - (log(t) * (0.5 - a))); else tmp = (a * log(t)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 520.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 520:\\
\;\;\;\;\log y + \left(\log z - \log t \cdot \left(0.5 - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 520Initial program 99.4%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
add-exp-log70.7%
metadata-eval70.7%
sub-neg70.7%
*-commutative70.7%
sub-neg70.7%
metadata-eval70.7%
Applied egg-rr70.7%
Taylor expanded in x around 0 60.8%
Taylor expanded in t around 0 60.2%
if 520 < t Initial program 99.8%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-exp-log24.2%
metadata-eval24.2%
sub-neg24.2%
*-commutative24.2%
sub-neg24.2%
metadata-eval24.2%
Applied egg-rr24.2%
Taylor expanded in x around 0 69.3%
Taylor expanded in a around inf 99.6%
*-commutative99.6%
Simplified99.6%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 200.0) (+ (+ (log z) (log y)) (* (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 <= 200.0) {
tmp = (log(z) + log(y)) + (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 <= 200.0d0) then
tmp = (log(z) + log(y)) + (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 <= 200.0) {
tmp = (Math.log(z) + Math.log(y)) + (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 <= 200.0: tmp = (math.log(z) + math.log(y)) + (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 <= 200.0) tmp = Float64(Float64(log(z) + log(y)) + 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 <= 200.0) tmp = (log(z) + log(y)) + (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, 200.0], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $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 200:\\
\;\;\;\;\left(\log z + \log y\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t - t\\
\end{array}
\end{array}
if t < 200Initial 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 60.9%
Taylor expanded in t around 0 60.3%
if 200 < t Initial program 99.8%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-exp-log24.2%
metadata-eval24.2%
sub-neg24.2%
*-commutative24.2%
sub-neg24.2%
metadata-eval24.2%
Applied egg-rr24.2%
Taylor expanded in x around 0 69.3%
Taylor expanded in a around inf 99.6%
*-commutative99.6%
Simplified99.6%
Final simplification80.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ (log z) (log y)))) (if (<= t 0.43) (+ t_1 (* (log t) (- a 0.5))) (+ t_1 (- (* a (log t)) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) + log(y);
double tmp;
if (t <= 0.43) {
tmp = t_1 + (log(t) * (a - 0.5));
} else {
tmp = t_1 + ((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) :: t_1
real(8) :: tmp
t_1 = log(z) + log(y)
if (t <= 0.43d0) then
tmp = t_1 + (log(t) * (a - 0.5d0))
else
tmp = t_1 + ((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 t_1 = Math.log(z) + Math.log(y);
double tmp;
if (t <= 0.43) {
tmp = t_1 + (Math.log(t) * (a - 0.5));
} else {
tmp = t_1 + ((a * Math.log(t)) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) + math.log(y) tmp = 0 if t <= 0.43: tmp = t_1 + (math.log(t) * (a - 0.5)) else: tmp = t_1 + ((a * math.log(t)) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) + log(y)) tmp = 0.0 if (t <= 0.43) tmp = Float64(t_1 + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(t_1 + Float64(Float64(a * log(t)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) + log(y); tmp = 0.0; if (t <= 0.43) tmp = t_1 + (log(t) * (a - 0.5)); else tmp = t_1 + ((a * log(t)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 0.43], N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z + \log y\\
\mathbf{if}\;t \leq 0.43:\\
\;\;\;\;t_1 + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(a \cdot \log t - t\right)\\
\end{array}
\end{array}
if t < 0.429999999999999993Initial 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 60.6%
Taylor expanded in t around 0 60.6%
if 0.429999999999999993 < t Initial program 99.8%
associate-+l-99.8%
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 69.5%
Taylor expanded in a around inf 69.0%
mul-1-neg69.0%
*-commutative69.0%
distribute-rgt-neg-in69.0%
Simplified69.0%
Final simplification65.0%
(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.6%
associate-+l-99.6%
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%
Taylor expanded in x around 0 65.2%
Final simplification65.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))) (t_2 (+ (log (* y z)) (* (log t) (- a 0.5)))))
(if (<= t 3e-116)
t_2
(if (<= t 1.55e-38) (+ (log y) t_1) (if (<= t 0.65) t_2 (- t_1 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double t_2 = log((y * z)) + (log(t) * (a - 0.5));
double tmp;
if (t <= 3e-116) {
tmp = t_2;
} else if (t <= 1.55e-38) {
tmp = log(y) + t_1;
} else if (t <= 0.65) {
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 = a * log(t)
t_2 = log((y * z)) + (log(t) * (a - 0.5d0))
if (t <= 3d-116) then
tmp = t_2
else if (t <= 1.55d-38) then
tmp = log(y) + t_1
else if (t <= 0.65d0) 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 = a * Math.log(t);
double t_2 = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
double tmp;
if (t <= 3e-116) {
tmp = t_2;
} else if (t <= 1.55e-38) {
tmp = Math.log(y) + t_1;
} else if (t <= 0.65) {
tmp = t_2;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) t_2 = math.log((y * z)) + (math.log(t) * (a - 0.5)) tmp = 0 if t <= 3e-116: tmp = t_2 elif t <= 1.55e-38: tmp = math.log(y) + t_1 elif t <= 0.65: tmp = t_2 else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) t_2 = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))) tmp = 0.0 if (t <= 3e-116) tmp = t_2; elseif (t <= 1.55e-38) tmp = Float64(log(y) + t_1); elseif (t <= 0.65) tmp = t_2; else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); t_2 = log((y * z)) + (log(t) * (a - 0.5)); tmp = 0.0; if (t <= 3e-116) tmp = t_2; elseif (t <= 1.55e-38) tmp = log(y) + t_1; elseif (t <= 0.65) tmp = t_2; else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, 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, 3e-116], t$95$2, If[LessEqual[t, 1.55e-38], N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 0.65], t$95$2, N[(t$95$1 - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t \leq 3 \cdot 10^{-116}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-38}:\\
\;\;\;\;\log y + t_1\\
\mathbf{elif}\;t \leq 0.65:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if t < 3.00000000000000026e-116 or 1.54999999999999991e-38 < t < 0.650000000000000022Initial program 99.3%
associate-+l-99.4%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-udef99.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.7%
Taylor expanded in t around 0 60.7%
log-prod41.5%
*-commutative41.5%
Simplified41.5%
if 3.00000000000000026e-116 < t < 1.54999999999999991e-38Initial program 99.6%
associate-+l-99.6%
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%
Taylor expanded in a around inf 76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in x around 0 53.2%
*-commutative53.2%
Simplified53.2%
if 0.650000000000000022 < t Initial program 99.8%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-exp-log24.1%
metadata-eval24.1%
sub-neg24.1%
*-commutative24.1%
sub-neg24.1%
metadata-eval24.1%
Applied egg-rr24.1%
Taylor expanded in x around 0 69.5%
Taylor expanded in a around inf 98.9%
*-commutative98.9%
Simplified98.9%
Final simplification72.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))) (t_2 (* a (log t))))
(if (<= t 3.2e-119)
(+ (log (* z (+ x y))) t_1)
(if (<= t 2.05e-38)
(+ (log y) t_2)
(if (<= t 0.0048) (+ (log (* y z)) t_1) (- t_2 t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * (a - 0.5);
double t_2 = a * log(t);
double tmp;
if (t <= 3.2e-119) {
tmp = log((z * (x + y))) + t_1;
} else if (t <= 2.05e-38) {
tmp = log(y) + t_2;
} else if (t <= 0.0048) {
tmp = log((y * z)) + t_1;
} else {
tmp = t_2 - 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 - 0.5d0)
t_2 = a * log(t)
if (t <= 3.2d-119) then
tmp = log((z * (x + y))) + t_1
else if (t <= 2.05d-38) then
tmp = log(y) + t_2
else if (t <= 0.0048d0) then
tmp = log((y * z)) + t_1
else
tmp = t_2 - 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 - 0.5);
double t_2 = a * Math.log(t);
double tmp;
if (t <= 3.2e-119) {
tmp = Math.log((z * (x + y))) + t_1;
} else if (t <= 2.05e-38) {
tmp = Math.log(y) + t_2;
} else if (t <= 0.0048) {
tmp = Math.log((y * z)) + t_1;
} else {
tmp = t_2 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) t_2 = a * math.log(t) tmp = 0 if t <= 3.2e-119: tmp = math.log((z * (x + y))) + t_1 elif t <= 2.05e-38: tmp = math.log(y) + t_2 elif t <= 0.0048: tmp = math.log((y * z)) + t_1 else: tmp = t_2 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) t_2 = Float64(a * log(t)) tmp = 0.0 if (t <= 3.2e-119) tmp = Float64(log(Float64(z * Float64(x + y))) + t_1); elseif (t <= 2.05e-38) tmp = Float64(log(y) + t_2); elseif (t <= 0.0048) tmp = Float64(log(Float64(y * z)) + t_1); else tmp = Float64(t_2 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); t_2 = a * log(t); tmp = 0.0; if (t <= 3.2e-119) tmp = log((z * (x + y))) + t_1; elseif (t <= 2.05e-38) tmp = log(y) + t_2; elseif (t <= 0.0048) tmp = log((y * z)) + t_1; else tmp = t_2 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 3.2e-119], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 2.05e-38], N[(N[Log[y], $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t, 0.0048], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$2 - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
t_2 := a \cdot \log t\\
\mathbf{if}\;t \leq 3.2 \cdot 10^{-119}:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + t_1\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-38}:\\
\;\;\;\;\log y + t_2\\
\mathbf{elif}\;t \leq 0.0048:\\
\;\;\;\;\log \left(y \cdot z\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 - t\\
\end{array}
\end{array}
if t < 3.19999999999999993e-119Initial program 99.3%
associate-+l-99.3%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-udef99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in t around 0 99.3%
log-prod75.8%
+-commutative75.8%
Simplified75.8%
if 3.19999999999999993e-119 < t < 2.0499999999999999e-38Initial program 99.6%
associate-+l-99.6%
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%
Taylor expanded in a around inf 76.3%
*-commutative76.3%
Simplified76.3%
Taylor expanded in x around 0 53.2%
*-commutative53.2%
Simplified53.2%
if 2.0499999999999999e-38 < t < 0.00479999999999999958Initial program 99.3%
associate-+l-99.5%
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%
Taylor expanded in x around 0 38.7%
Taylor expanded in t around 0 38.7%
log-prod31.9%
*-commutative31.9%
Simplified31.9%
if 0.00479999999999999958 < t Initial program 99.8%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-exp-log24.1%
metadata-eval24.1%
sub-neg24.1%
*-commutative24.1%
sub-neg24.1%
metadata-eval24.1%
Applied egg-rr24.1%
Taylor expanded in x around 0 69.5%
Taylor expanded in a around inf 98.9%
*-commutative98.9%
Simplified98.9%
Final simplification83.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* a (log t)))) (if (<= t 200.0) (+ (log y) t_1) (- t_1 t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if (t <= 200.0) {
tmp = log(y) + t_1;
} else {
tmp = t_1 - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if (t <= 200.0d0) then
tmp = log(y) + t_1
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double tmp;
if (t <= 200.0) {
tmp = Math.log(y) + t_1;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if t <= 200.0: tmp = math.log(y) + t_1 else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (t <= 200.0) tmp = Float64(log(y) + t_1); else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if (t <= 200.0) tmp = log(y) + t_1; else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 200.0], N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;t \leq 200:\\
\;\;\;\;\log y + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if t < 200Initial 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 a around inf 57.5%
*-commutative57.5%
Simplified57.5%
Taylor expanded in x around 0 39.8%
*-commutative39.8%
Simplified39.8%
if 200 < t Initial program 99.8%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-exp-log24.2%
metadata-eval24.2%
sub-neg24.2%
*-commutative24.2%
sub-neg24.2%
metadata-eval24.2%
Applied egg-rr24.2%
Taylor expanded in x around 0 69.3%
Taylor expanded in a around inf 99.6%
*-commutative99.6%
Simplified99.6%
Final simplification70.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -11.8) (not (<= a 1.35e+16))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -11.8) || !(a <= 1.35e+16)) {
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 ((a <= (-11.8d0)) .or. (.not. (a <= 1.35d+16))) 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 ((a <= -11.8) || !(a <= 1.35e+16)) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -11.8) or not (a <= 1.35e+16): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -11.8) || !(a <= 1.35e+16)) 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 ((a <= -11.8) || ~((a <= 1.35e+16))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -11.8], N[Not[LessEqual[a, 1.35e+16]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -11.8 \lor \neg \left(a \leq 1.35 \cdot 10^{+16}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -11.800000000000001 or 1.35e16 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-udef99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 71.7%
Taylor expanded in a around inf 77.7%
*-commutative77.7%
Simplified77.7%
if -11.800000000000001 < a < 1.35e16Initial 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%
Taylor expanded in x around 0 58.7%
Taylor expanded in t around inf 52.9%
neg-mul-152.9%
Simplified52.9%
Final simplification65.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8.5e+70) (not (<= a 1.8e+15))) (* a (log t)) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e+70) || !(a <= 1.8e+15)) {
tmp = a * log(t);
} else {
tmp = 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 <= (-8.5d+70)) .or. (.not. (a <= 1.8d+15))) then
tmp = a * log(t)
else
tmp = 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 <= -8.5e+70) || !(a <= 1.8e+15)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -8.5e+70) or not (a <= 1.8e+15): tmp = a * math.log(t) else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8.5e+70) || !(a <= 1.8e+15)) tmp = Float64(a * log(t)); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -8.5e+70) || ~((a <= 1.8e+15))) tmp = a * log(t); else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8.5e+70], N[Not[LessEqual[a, 1.8e+15]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+70} \lor \neg \left(a \leq 1.8 \cdot 10^{+15}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -8.4999999999999996e70 or 1.8e15 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
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 70.3%
Taylor expanded in a around inf 82.0%
*-commutative82.0%
Simplified82.0%
if -8.4999999999999996e70 < a < 1.8e15Initial program 99.5%
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 57.4%
neg-mul-157.4%
Simplified57.4%
Taylor expanded in x around 0 38.5%
Final simplification57.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 4800000000000.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4800000000000.0) {
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 <= 4800000000000.0d0) 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 <= 4800000000000.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4800000000000.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4800000000000.0) 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 <= 4800000000000.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4800000000000.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4800000000000:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 4.8e12Initial 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 t around inf 9.0%
neg-mul-19.0%
Simplified9.0%
Taylor expanded in t around 0 9.1%
+-commutative9.1%
Simplified9.1%
if 4.8e12 < 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 69.7%
Taylor expanded in t around inf 71.9%
neg-mul-171.9%
Simplified71.9%
Final simplification40.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 4800000000000.0) (log y) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4800000000000.0) {
tmp = log(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 <= 4800000000000.0d0) then
tmp = log(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 <= 4800000000000.0) {
tmp = Math.log(y);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4800000000000.0: tmp = math.log(y) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4800000000000.0) tmp = log(y); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4800000000000.0) tmp = log(y); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4800000000000.0], N[Log[y], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4800000000000:\\
\;\;\;\;\log y\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 4.8e12Initial 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 a around inf 59.1%
*-commutative59.1%
Simplified59.1%
Taylor expanded in x around 0 40.6%
*-commutative40.6%
Simplified40.6%
Taylor expanded in a around 0 6.1%
if 4.8e12 < 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 69.7%
Taylor expanded in t around inf 71.9%
neg-mul-171.9%
Simplified71.9%
Final simplification38.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.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
add-exp-log46.8%
metadata-eval46.8%
sub-neg46.8%
*-commutative46.8%
sub-neg46.8%
metadata-eval46.8%
Applied egg-rr46.8%
Taylor expanded in x around 0 65.2%
Taylor expanded in a around inf 76.4%
*-commutative76.4%
Simplified76.4%
Final simplification76.4%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
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%
Taylor expanded in x around 0 65.2%
Taylor expanded in t around inf 37.1%
neg-mul-137.1%
Simplified37.1%
Final simplification37.1%
(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 2024018
(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))))