
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (- (log z) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.6%
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%
Final simplification99.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5)))
(t_2 (log (+ x y)))
(t_3 (+ t_2 (log z)))
(t_4 (+ (+ (log z) (log y)) t_1)))
(if (<= t_3 -740.0)
t_4
(if (<= t_3 700.0)
(- (+ (log (* z (+ x y))) t_1) t)
(if (<= t_3 1220.0) (+ t_2 (- (log z) (+ (* (log t) 0.5) t))) t_4)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * (a - 0.5);
double t_2 = log((x + y));
double t_3 = t_2 + log(z);
double t_4 = (log(z) + log(y)) + t_1;
double tmp;
if (t_3 <= -740.0) {
tmp = t_4;
} else if (t_3 <= 700.0) {
tmp = (log((z * (x + y))) + t_1) - t;
} else if (t_3 <= 1220.0) {
tmp = t_2 + (log(z) - ((log(t) * 0.5) + t));
} else {
tmp = t_4;
}
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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = log(t) * (a - 0.5d0)
t_2 = log((x + y))
t_3 = t_2 + log(z)
t_4 = (log(z) + log(y)) + t_1
if (t_3 <= (-740.0d0)) then
tmp = t_4
else if (t_3 <= 700.0d0) then
tmp = (log((z * (x + y))) + t_1) - t
else if (t_3 <= 1220.0d0) then
tmp = t_2 + (log(z) - ((log(t) * 0.5d0) + t))
else
tmp = t_4
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 = Math.log((x + y));
double t_3 = t_2 + Math.log(z);
double t_4 = (Math.log(z) + Math.log(y)) + t_1;
double tmp;
if (t_3 <= -740.0) {
tmp = t_4;
} else if (t_3 <= 700.0) {
tmp = (Math.log((z * (x + y))) + t_1) - t;
} else if (t_3 <= 1220.0) {
tmp = t_2 + (Math.log(z) - ((Math.log(t) * 0.5) + t));
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) t_2 = math.log((x + y)) t_3 = t_2 + math.log(z) t_4 = (math.log(z) + math.log(y)) + t_1 tmp = 0 if t_3 <= -740.0: tmp = t_4 elif t_3 <= 700.0: tmp = (math.log((z * (x + y))) + t_1) - t elif t_3 <= 1220.0: tmp = t_2 + (math.log(z) - ((math.log(t) * 0.5) + t)) else: tmp = t_4 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) t_2 = log(Float64(x + y)) t_3 = Float64(t_2 + log(z)) t_4 = Float64(Float64(log(z) + log(y)) + t_1) tmp = 0.0 if (t_3 <= -740.0) tmp = t_4; elseif (t_3 <= 700.0) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + t_1) - t); elseif (t_3 <= 1220.0) tmp = Float64(t_2 + Float64(log(z) - Float64(Float64(log(t) * 0.5) + t))); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); t_2 = log((x + y)); t_3 = t_2 + log(z); t_4 = (log(z) + log(y)) + t_1; tmp = 0.0; if (t_3 <= -740.0) tmp = t_4; elseif (t_3 <= 700.0) tmp = (log((z * (x + y))) + t_1) - t; elseif (t_3 <= 1220.0) tmp = t_2 + (log(z) - ((log(t) * 0.5) + t)); else tmp = t_4; 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[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[Log[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -740.0], t$95$4, If[LessEqual[t$95$3, 700.0], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$3, 1220.0], N[(t$95$2 + N[(N[Log[z], $MachinePrecision] - N[(N[(N[Log[t], $MachinePrecision] * 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
t_2 := \log \left(x + y\right)\\
t_3 := t_2 + \log z\\
t_4 := \left(\log z + \log y\right) + t_1\\
\mathbf{if}\;t_3 \leq -740:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_3 \leq 700:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + t_1\right) - t\\
\mathbf{elif}\;t_3 \leq 1220:\\
\;\;\;\;t_2 + \left(\log z - \left(\log t \cdot 0.5 + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -740 or 1220 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.4%
associate-+l-99.4%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
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 66.4%
+-commutative66.4%
+-commutative66.4%
fma-def66.6%
Simplified66.6%
Taylor expanded in t around 0 44.1%
if -740 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial 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%
associate-+r-99.7%
fma-udef99.7%
associate--r+99.7%
+-commutative99.7%
sum-log99.7%
Applied egg-rr99.7%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1220Initial 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 a around 0 69.5%
*-commutative69.5%
Simplified69.5%
Final simplification91.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5)))
(t_2 (+ (log (+ x y)) (log z)))
(t_3 (+ (+ (log z) (log y)) t_1)))
(if (<= t_2 -740.0)
t_3
(if (<= t_2 700.0)
(- (+ (log (* z (+ x y))) t_1) t)
(if (<= t_2 1220.0)
(- (+ (log y) (+ (log z) (* (log t) -0.5))) t)
t_3)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * (a - 0.5);
double t_2 = log((x + y)) + log(z);
double t_3 = (log(z) + log(y)) + t_1;
double tmp;
if (t_2 <= -740.0) {
tmp = t_3;
} else if (t_2 <= 700.0) {
tmp = (log((z * (x + y))) + t_1) - t;
} else if (t_2 <= 1220.0) {
tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = log(t) * (a - 0.5d0)
t_2 = log((x + y)) + log(z)
t_3 = (log(z) + log(y)) + t_1
if (t_2 <= (-740.0d0)) then
tmp = t_3
else if (t_2 <= 700.0d0) then
tmp = (log((z * (x + y))) + t_1) - t
else if (t_2 <= 1220.0d0) then
tmp = (log(y) + (log(z) + (log(t) * (-0.5d0)))) - t
else
tmp = t_3
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 = Math.log((x + y)) + Math.log(z);
double t_3 = (Math.log(z) + Math.log(y)) + t_1;
double tmp;
if (t_2 <= -740.0) {
tmp = t_3;
} else if (t_2 <= 700.0) {
tmp = (Math.log((z * (x + y))) + t_1) - t;
} else if (t_2 <= 1220.0) {
tmp = (Math.log(y) + (Math.log(z) + (Math.log(t) * -0.5))) - t;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) t_2 = math.log((x + y)) + math.log(z) t_3 = (math.log(z) + math.log(y)) + t_1 tmp = 0 if t_2 <= -740.0: tmp = t_3 elif t_2 <= 700.0: tmp = (math.log((z * (x + y))) + t_1) - t elif t_2 <= 1220.0: tmp = (math.log(y) + (math.log(z) + (math.log(t) * -0.5))) - t else: tmp = t_3 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) t_2 = Float64(log(Float64(x + y)) + log(z)) t_3 = Float64(Float64(log(z) + log(y)) + t_1) tmp = 0.0 if (t_2 <= -740.0) tmp = t_3; elseif (t_2 <= 700.0) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + t_1) - t); elseif (t_2 <= 1220.0) tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * -0.5))) - t); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); t_2 = log((x + y)) + log(z); t_3 = (log(z) + log(y)) + t_1; tmp = 0.0; if (t_2 <= -740.0) tmp = t_3; elseif (t_2 <= 700.0) tmp = (log((z * (x + y))) + t_1) - t; elseif (t_2 <= 1220.0) tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t; else tmp = t_3; 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[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -740.0], t$95$3, If[LessEqual[t$95$2, 700.0], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 1220.0], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
t_2 := \log \left(x + y\right) + \log z\\
t_3 := \left(\log z + \log y\right) + t_1\\
\mathbf{if}\;t_2 \leq -740:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 700:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + t_1\right) - t\\
\mathbf{elif}\;t_2 \leq 1220:\\
\;\;\;\;\left(\log y + \left(\log z + \log t \cdot -0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -740 or 1220 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.4%
associate-+l-99.4%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
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 66.4%
+-commutative66.4%
+-commutative66.4%
fma-def66.6%
Simplified66.6%
Taylor expanded in t around 0 44.1%
if -740 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial 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%
associate-+r-99.7%
fma-udef99.7%
associate--r+99.7%
+-commutative99.7%
sum-log99.7%
Applied egg-rr99.7%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1220Initial program 99.7%
+-commutative99.7%
associate-+r-99.7%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 62.4%
+-commutative62.4%
Simplified62.4%
Taylor expanded in a around 0 36.9%
Final simplification86.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log z) (log y)))
(t_2 (* (log t) (- a 0.5)))
(t_3 (+ (log (+ x y)) (log z)))
(t_4 (+ t_1 t_2)))
(if (<= t_3 -740.0)
t_4
(if (<= t_3 700.0)
(- (+ (log (* z (+ x y))) t_2) t)
(if (<= t_3 1220.0) (- t_1 (+ (* (log t) 0.5) t)) t_4)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(z) + log(y);
double t_2 = log(t) * (a - 0.5);
double t_3 = log((x + y)) + log(z);
double t_4 = t_1 + t_2;
double tmp;
if (t_3 <= -740.0) {
tmp = t_4;
} else if (t_3 <= 700.0) {
tmp = (log((z * (x + y))) + t_2) - t;
} else if (t_3 <= 1220.0) {
tmp = t_1 - ((log(t) * 0.5) + t);
} else {
tmp = t_4;
}
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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = log(z) + log(y)
t_2 = log(t) * (a - 0.5d0)
t_3 = log((x + y)) + log(z)
t_4 = t_1 + t_2
if (t_3 <= (-740.0d0)) then
tmp = t_4
else if (t_3 <= 700.0d0) then
tmp = (log((z * (x + y))) + t_2) - t
else if (t_3 <= 1220.0d0) then
tmp = t_1 - ((log(t) * 0.5d0) + t)
else
tmp = t_4
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 t_2 = Math.log(t) * (a - 0.5);
double t_3 = Math.log((x + y)) + Math.log(z);
double t_4 = t_1 + t_2;
double tmp;
if (t_3 <= -740.0) {
tmp = t_4;
} else if (t_3 <= 700.0) {
tmp = (Math.log((z * (x + y))) + t_2) - t;
} else if (t_3 <= 1220.0) {
tmp = t_1 - ((Math.log(t) * 0.5) + t);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(z) + math.log(y) t_2 = math.log(t) * (a - 0.5) t_3 = math.log((x + y)) + math.log(z) t_4 = t_1 + t_2 tmp = 0 if t_3 <= -740.0: tmp = t_4 elif t_3 <= 700.0: tmp = (math.log((z * (x + y))) + t_2) - t elif t_3 <= 1220.0: tmp = t_1 - ((math.log(t) * 0.5) + t) else: tmp = t_4 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(z) + log(y)) t_2 = Float64(log(t) * Float64(a - 0.5)) t_3 = Float64(log(Float64(x + y)) + log(z)) t_4 = Float64(t_1 + t_2) tmp = 0.0 if (t_3 <= -740.0) tmp = t_4; elseif (t_3 <= 700.0) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + t_2) - t); elseif (t_3 <= 1220.0) tmp = Float64(t_1 - Float64(Float64(log(t) * 0.5) + t)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(z) + log(y); t_2 = log(t) * (a - 0.5); t_3 = log((x + y)) + log(z); t_4 = t_1 + t_2; tmp = 0.0; if (t_3 <= -740.0) tmp = t_4; elseif (t_3 <= 700.0) tmp = (log((z * (x + y))) + t_2) - t; elseif (t_3 <= 1220.0) tmp = t_1 - ((log(t) * 0.5) + t); else tmp = t_4; 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]}, Block[{t$95$2 = N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$1 + t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, -740.0], t$95$4, If[LessEqual[t$95$3, 700.0], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + t$95$2), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$3, 1220.0], N[(t$95$1 - N[(N[(N[Log[t], $MachinePrecision] * 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log z + \log y\\
t_2 := \log t \cdot \left(a - 0.5\right)\\
t_3 := \log \left(x + y\right) + \log z\\
t_4 := t_1 + t_2\\
\mathbf{if}\;t_3 \leq -740:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t_3 \leq 700:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + t_2\right) - t\\
\mathbf{elif}\;t_3 \leq 1220:\\
\;\;\;\;t_1 - \left(\log t \cdot 0.5 + t\right)\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -740 or 1220 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.4%
associate-+l-99.4%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
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 66.4%
+-commutative66.4%
+-commutative66.4%
fma-def66.6%
Simplified66.6%
Taylor expanded in t around 0 44.1%
if -740 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial 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%
associate-+r-99.7%
fma-udef99.7%
associate--r+99.7%
+-commutative99.7%
sum-log99.7%
Applied egg-rr99.7%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1220Initial 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 62.4%
+-commutative62.4%
+-commutative62.4%
fma-def62.4%
Simplified62.4%
Taylor expanded in a around 0 37.0%
*-commutative37.0%
Simplified37.0%
Final simplification86.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))) (t_2 (+ t_1 (log z))) (t_3 (+ t_1 (* (log t) a))))
(if (<= t_2 -740.0)
t_3
(if (<= t_2 700.0)
(+ (- (log (* y z)) t) (* (log t) (- a 0.5)))
(if (<= t_2 1220.0) (- (+ (log z) (log y)) t) t_3)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double t_2 = t_1 + log(z);
double t_3 = t_1 + (log(t) * a);
double tmp;
if (t_2 <= -740.0) {
tmp = t_3;
} else if (t_2 <= 700.0) {
tmp = (log((y * z)) - t) + (log(t) * (a - 0.5));
} else if (t_2 <= 1220.0) {
tmp = (log(z) + log(y)) - t;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = log((x + y))
t_2 = t_1 + log(z)
t_3 = t_1 + (log(t) * a)
if (t_2 <= (-740.0d0)) then
tmp = t_3
else if (t_2 <= 700.0d0) then
tmp = (log((y * z)) - t) + (log(t) * (a - 0.5d0))
else if (t_2 <= 1220.0d0) then
tmp = (log(z) + log(y)) - t
else
tmp = t_3
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((x + y));
double t_2 = t_1 + Math.log(z);
double t_3 = t_1 + (Math.log(t) * a);
double tmp;
if (t_2 <= -740.0) {
tmp = t_3;
} else if (t_2 <= 700.0) {
tmp = (Math.log((y * z)) - t) + (Math.log(t) * (a - 0.5));
} else if (t_2 <= 1220.0) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) t_2 = t_1 + math.log(z) t_3 = t_1 + (math.log(t) * a) tmp = 0 if t_2 <= -740.0: tmp = t_3 elif t_2 <= 700.0: tmp = (math.log((y * z)) - t) + (math.log(t) * (a - 0.5)) elif t_2 <= 1220.0: tmp = (math.log(z) + math.log(y)) - t else: tmp = t_3 return tmp
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) t_2 = Float64(t_1 + log(z)) t_3 = Float64(t_1 + Float64(log(t) * a)) tmp = 0.0 if (t_2 <= -740.0) tmp = t_3; elseif (t_2 <= 700.0) tmp = Float64(Float64(log(Float64(y * z)) - t) + Float64(log(t) * Float64(a - 0.5))); elseif (t_2 <= 1220.0) tmp = Float64(Float64(log(z) + log(y)) - t); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)); t_2 = t_1 + log(z); t_3 = t_1 + (log(t) * a); tmp = 0.0; if (t_2 <= -740.0) tmp = t_3; elseif (t_2 <= 700.0) tmp = (log((y * z)) - t) + (log(t) * (a - 0.5)); elseif (t_2 <= 1220.0) tmp = (log(z) + log(y)) - t; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[Log[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -740.0], t$95$3, If[LessEqual[t$95$2, 700.0], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1220.0], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
t_2 := t_1 + \log z\\
t_3 := t_1 + \log t \cdot a\\
\mathbf{if}\;t_2 \leq -740:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 700:\\
\;\;\;\;\left(\log \left(y \cdot z\right) - t\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{elif}\;t_2 \leq 1220:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -740 or 1220 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.4%
associate-+l-99.4%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
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 a around inf 56.4%
*-commutative56.4%
Simplified56.4%
if -740 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial 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 68.0%
+-commutative68.0%
+-commutative68.0%
fma-def68.0%
Simplified68.0%
Taylor expanded in z around 0 68.0%
log-prod62.7%
associate--r+62.7%
Simplified62.7%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1220Initial 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 62.4%
+-commutative62.4%
+-commutative62.4%
fma-def62.4%
Simplified62.4%
Taylor expanded in t around inf 31.9%
Final simplification57.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))) (t_2 (+ t_1 (log z))) (t_3 (+ t_1 (* (log t) a))))
(if (<= t_2 -740.0)
t_3
(if (<= t_2 700.0)
(- (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) t)
(if (<= t_2 1220.0) (- (+ (log z) (log y)) t) t_3)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double t_2 = t_1 + log(z);
double t_3 = t_1 + (log(t) * a);
double tmp;
if (t_2 <= -740.0) {
tmp = t_3;
} else if (t_2 <= 700.0) {
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t;
} else if (t_2 <= 1220.0) {
tmp = (log(z) + log(y)) - t;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = log((x + y))
t_2 = t_1 + log(z)
t_3 = t_1 + (log(t) * a)
if (t_2 <= (-740.0d0)) then
tmp = t_3
else if (t_2 <= 700.0d0) then
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5d0))) - t
else if (t_2 <= 1220.0d0) then
tmp = (log(z) + log(y)) - t
else
tmp = t_3
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((x + y));
double t_2 = t_1 + Math.log(z);
double t_3 = t_1 + (Math.log(t) * a);
double tmp;
if (t_2 <= -740.0) {
tmp = t_3;
} else if (t_2 <= 700.0) {
tmp = (Math.log((z * (x + y))) + (Math.log(t) * (a - 0.5))) - t;
} else if (t_2 <= 1220.0) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) t_2 = t_1 + math.log(z) t_3 = t_1 + (math.log(t) * a) tmp = 0 if t_2 <= -740.0: tmp = t_3 elif t_2 <= 700.0: tmp = (math.log((z * (x + y))) + (math.log(t) * (a - 0.5))) - t elif t_2 <= 1220.0: tmp = (math.log(z) + math.log(y)) - t else: tmp = t_3 return tmp
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) t_2 = Float64(t_1 + log(z)) t_3 = Float64(t_1 + Float64(log(t) * a)) tmp = 0.0 if (t_2 <= -740.0) tmp = t_3; elseif (t_2 <= 700.0) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))) - t); elseif (t_2 <= 1220.0) tmp = Float64(Float64(log(z) + log(y)) - t); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)); t_2 = t_1 + log(z); t_3 = t_1 + (log(t) * a); tmp = 0.0; if (t_2 <= -740.0) tmp = t_3; elseif (t_2 <= 700.0) tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t; elseif (t_2 <= 1220.0) tmp = (log(z) + log(y)) - t; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[Log[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -740.0], t$95$3, If[LessEqual[t$95$2, 700.0], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$2, 1220.0], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
t_2 := t_1 + \log z\\
t_3 := t_1 + \log t \cdot a\\
\mathbf{if}\;t_2 \leq -740:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 700:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{elif}\;t_2 \leq 1220:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -740 or 1220 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.4%
associate-+l-99.4%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
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 a around inf 56.4%
*-commutative56.4%
Simplified56.4%
if -740 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial 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%
associate-+r-99.7%
fma-udef99.7%
associate--r+99.7%
+-commutative99.7%
sum-log99.7%
Applied egg-rr99.7%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1220Initial 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 62.4%
+-commutative62.4%
+-commutative62.4%
fma-def62.4%
Simplified62.4%
Taylor expanded in t around inf 31.9%
Final simplification86.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (<= t_1 -740.0)
(+ (+ (log z) (log y)) (* (log t) a))
(if (<= t_1 700.0)
(- (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) t)
(- (+ (log y) (+ (log z) (* (log t) -0.5))) t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y)) + log(z);
double tmp;
if (t_1 <= -740.0) {
tmp = (log(z) + log(y)) + (log(t) * a);
} else if (t_1 <= 700.0) {
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t;
} else {
tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log((x + y)) + log(z)
if (t_1 <= (-740.0d0)) then
tmp = (log(z) + log(y)) + (log(t) * a)
else if (t_1 <= 700.0d0) then
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5d0))) - t
else
tmp = (log(y) + (log(z) + (log(t) * (-0.5d0)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y)) + Math.log(z);
double tmp;
if (t_1 <= -740.0) {
tmp = (Math.log(z) + Math.log(y)) + (Math.log(t) * a);
} else if (t_1 <= 700.0) {
tmp = (Math.log((z * (x + y))) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = (Math.log(y) + (Math.log(z) + (Math.log(t) * -0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + math.log(z) tmp = 0 if t_1 <= -740.0: tmp = (math.log(z) + math.log(y)) + (math.log(t) * a) elif t_1 <= 700.0: tmp = (math.log((z * (x + y))) + (math.log(t) * (a - 0.5))) - t else: tmp = (math.log(y) + (math.log(z) + (math.log(t) * -0.5))) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(x + y)) + log(z)) tmp = 0.0 if (t_1 <= -740.0) tmp = Float64(Float64(log(z) + log(y)) + Float64(log(t) * a)); elseif (t_1 <= 700.0) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * -0.5))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + log(z); tmp = 0.0; if (t_1 <= -740.0) tmp = (log(z) + log(y)) + (log(t) * a); elseif (t_1 <= 700.0) tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t; else tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -740.0], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 700.0], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t_1 \leq -740:\\
\;\;\;\;\left(\log z + \log y\right) + \log t \cdot a\\
\mathbf{elif}\;t_1 \leq 700:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \left(\log z + \log t \cdot -0.5\right)\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -740Initial program 99.5%
associate-+l-99.5%
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 69.8%
+-commutative69.8%
+-commutative69.8%
fma-def69.8%
Simplified69.8%
Taylor expanded in a around inf 33.6%
mul-1-neg33.6%
*-commutative33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
if -740 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial 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%
associate-+r-99.7%
fma-udef99.7%
associate--r+99.7%
+-commutative99.7%
sum-log99.7%
Applied egg-rr99.7%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.6%
+-commutative99.6%
associate-+r-99.6%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 62.4%
+-commutative62.4%
Simplified62.4%
Taylor expanded in a around 0 30.7%
Final simplification84.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))) (t_2 (+ t_1 (log z))))
(if (<= t_2 -740.0)
(+ t_1 (* (log t) a))
(if (<= t_2 700.0)
(- (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) t)
(+ (log y) (- (log (* z (pow t -0.5))) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double t_2 = t_1 + log(z);
double tmp;
if (t_2 <= -740.0) {
tmp = t_1 + (log(t) * a);
} else if (t_2 <= 700.0) {
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t;
} else {
tmp = log(y) + (log((z * pow(t, -0.5))) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log((x + y))
t_2 = t_1 + log(z)
if (t_2 <= (-740.0d0)) then
tmp = t_1 + (log(t) * a)
else if (t_2 <= 700.0d0) then
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5d0))) - t
else
tmp = log(y) + (log((z * (t ** (-0.5d0)))) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y));
double t_2 = t_1 + Math.log(z);
double tmp;
if (t_2 <= -740.0) {
tmp = t_1 + (Math.log(t) * a);
} else if (t_2 <= 700.0) {
tmp = (Math.log((z * (x + y))) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = Math.log(y) + (Math.log((z * Math.pow(t, -0.5))) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) t_2 = t_1 + math.log(z) tmp = 0 if t_2 <= -740.0: tmp = t_1 + (math.log(t) * a) elif t_2 <= 700.0: tmp = (math.log((z * (x + y))) + (math.log(t) * (a - 0.5))) - t else: tmp = math.log(y) + (math.log((z * math.pow(t, -0.5))) - t) return tmp
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) t_2 = Float64(t_1 + log(z)) tmp = 0.0 if (t_2 <= -740.0) tmp = Float64(t_1 + Float64(log(t) * a)); elseif (t_2 <= 700.0) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = Float64(log(y) + Float64(log(Float64(z * (t ^ -0.5))) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)); t_2 = t_1 + log(z); tmp = 0.0; if (t_2 <= -740.0) tmp = t_1 + (log(t) * a); elseif (t_2 <= 700.0) tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t; else tmp = log(y) + (log((z * (t ^ -0.5))) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -740.0], N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 700.0], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] + N[(N[Log[N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
t_2 := t_1 + \log z\\
\mathbf{if}\;t_2 \leq -740:\\
\;\;\;\;t_1 + \log t \cdot a\\
\mathbf{elif}\;t_2 \leq 700:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y + \left(\log \left(z \cdot {t}^{-0.5}\right) - t\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -740Initial program 99.5%
associate-+l-99.5%
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 a around inf 54.6%
*-commutative54.6%
Simplified54.6%
if -740 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial 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%
associate-+r-99.7%
fma-udef99.7%
associate--r+99.7%
+-commutative99.7%
sum-log99.7%
Applied egg-rr99.7%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.6%
+-commutative99.6%
associate-+r-99.6%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 62.4%
+-commutative62.4%
Simplified62.4%
Taylor expanded in a around 0 30.7%
associate--l+30.7%
add-log-exp30.7%
sum-log30.4%
*-commutative30.4%
pow-to-exp30.4%
Applied egg-rr30.4%
Final simplification85.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (<= t_1 -740.0)
(+ (+ (log z) (log y)) (* (log t) a))
(if (<= t_1 700.0)
(- (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) t)
(+ (log y) (- (log (* z (pow t -0.5))) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y)) + log(z);
double tmp;
if (t_1 <= -740.0) {
tmp = (log(z) + log(y)) + (log(t) * a);
} else if (t_1 <= 700.0) {
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t;
} else {
tmp = log(y) + (log((z * pow(t, -0.5))) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log((x + y)) + log(z)
if (t_1 <= (-740.0d0)) then
tmp = (log(z) + log(y)) + (log(t) * a)
else if (t_1 <= 700.0d0) then
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5d0))) - t
else
tmp = log(y) + (log((z * (t ** (-0.5d0)))) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y)) + Math.log(z);
double tmp;
if (t_1 <= -740.0) {
tmp = (Math.log(z) + Math.log(y)) + (Math.log(t) * a);
} else if (t_1 <= 700.0) {
tmp = (Math.log((z * (x + y))) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = Math.log(y) + (Math.log((z * Math.pow(t, -0.5))) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + math.log(z) tmp = 0 if t_1 <= -740.0: tmp = (math.log(z) + math.log(y)) + (math.log(t) * a) elif t_1 <= 700.0: tmp = (math.log((z * (x + y))) + (math.log(t) * (a - 0.5))) - t else: tmp = math.log(y) + (math.log((z * math.pow(t, -0.5))) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(x + y)) + log(z)) tmp = 0.0 if (t_1 <= -740.0) tmp = Float64(Float64(log(z) + log(y)) + Float64(log(t) * a)); elseif (t_1 <= 700.0) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = Float64(log(y) + Float64(log(Float64(z * (t ^ -0.5))) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + log(z); tmp = 0.0; if (t_1 <= -740.0) tmp = (log(z) + log(y)) + (log(t) * a); elseif (t_1 <= 700.0) tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t; else tmp = log(y) + (log((z * (t ^ -0.5))) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -740.0], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 700.0], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] + N[(N[Log[N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t_1 \leq -740:\\
\;\;\;\;\left(\log z + \log y\right) + \log t \cdot a\\
\mathbf{elif}\;t_1 \leq 700:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y + \left(\log \left(z \cdot {t}^{-0.5}\right) - t\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -740Initial program 99.5%
associate-+l-99.5%
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 69.8%
+-commutative69.8%
+-commutative69.8%
fma-def69.8%
Simplified69.8%
Taylor expanded in a around inf 33.6%
mul-1-neg33.6%
*-commutative33.6%
distribute-rgt-neg-in33.6%
Simplified33.6%
if -740 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 700Initial 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%
associate-+r-99.7%
fma-udef99.7%
associate--r+99.7%
+-commutative99.7%
sum-log99.7%
Applied egg-rr99.7%
if 700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.6%
+-commutative99.6%
associate-+r-99.6%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 62.4%
+-commutative62.4%
Simplified62.4%
Taylor expanded in a around 0 30.7%
associate--l+30.7%
add-log-exp30.7%
sum-log30.4%
*-commutative30.4%
pow-to-exp30.4%
Applied egg-rr30.4%
Final simplification84.7%
(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%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Final simplification99.7%
(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.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 67.0%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.4e+26) (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.4e+26) {
tmp = log((z * (x + y))) + (log(t) * (a - 0.5));
} 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 <= 1.4d+26) then
tmp = log((z * (x + y))) + (log(t) * (a - 0.5d0))
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 <= 1.4e+26) {
tmp = Math.log((z * (x + y))) + (Math.log(t) * (a - 0.5));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.4e+26: tmp = math.log((z * (x + y))) + (math.log(t) * (a - 0.5)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.4e+26) tmp = Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.4e+26) tmp = log((z * (x + y))) + (log(t) * (a - 0.5)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.4e+26], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.4 \cdot 10^{+26}:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.4e26Initial program 99.4%
associate-+l-99.4%
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 0 96.7%
log-prod77.7%
+-commutative77.7%
Simplified77.7%
if 1.4e26 < 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 72.9%
+-commutative72.9%
+-commutative72.9%
fma-def72.9%
Simplified72.9%
Taylor expanded in t around inf 73.5%
mul-1-neg73.5%
Simplified73.5%
Final simplification75.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)))
(if (<= a -105000000000.0)
(+ (log (+ x y)) t_1)
(if (<= a 620000000000.0) (- (log (* y (* z (pow t -0.5)))) t) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if (a <= -105000000000.0) {
tmp = log((x + y)) + t_1;
} else if (a <= 620000000000.0) {
tmp = log((y * (z * pow(t, -0.5)))) - t;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log(t) * a
if (a <= (-105000000000.0d0)) then
tmp = log((x + y)) + t_1
else if (a <= 620000000000.0d0) then
tmp = log((y * (z * (t ** (-0.5d0))))) - t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(t) * a;
double tmp;
if (a <= -105000000000.0) {
tmp = Math.log((x + y)) + t_1;
} else if (a <= 620000000000.0) {
tmp = Math.log((y * (z * Math.pow(t, -0.5)))) - t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if a <= -105000000000.0: tmp = math.log((x + y)) + t_1 elif a <= 620000000000.0: tmp = math.log((y * (z * math.pow(t, -0.5)))) - t else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (a <= -105000000000.0) tmp = Float64(log(Float64(x + y)) + t_1); elseif (a <= 620000000000.0) tmp = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; tmp = 0.0; if (a <= -105000000000.0) tmp = log((x + y)) + t_1; elseif (a <= 620000000000.0) tmp = log((y * (z * (t ^ -0.5)))) - t; else tmp = 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[a, -105000000000.0], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[a, 620000000000.0], N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;a \leq -105000000000:\\
\;\;\;\;\log \left(x + y\right) + t_1\\
\mathbf{elif}\;a \leq 620000000000:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -1.05e11Initial 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 a around inf 82.2%
*-commutative82.2%
Simplified82.2%
if -1.05e11 < a < 6.2e11Initial program 99.6%
+-commutative99.6%
associate-+r-99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 61.1%
+-commutative61.1%
Simplified61.1%
Taylor expanded in a around 0 59.2%
Taylor expanded in y around inf 59.1%
+-commutative59.1%
log-pow59.1%
mul-1-neg59.1%
log-rec59.1%
remove-double-neg59.1%
associate-+r+59.2%
+-commutative59.2%
log-prod55.0%
log-prod41.9%
Simplified41.9%
if 6.2e11 < a 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.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 71.9%
+-commutative71.9%
+-commutative71.9%
fma-def71.9%
Simplified71.9%
Taylor expanded in a around inf 80.5%
*-commutative80.5%
Simplified80.5%
Final simplification59.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 3.05e+26) (+ (log (* y z)) (* (log t) (- a 0.5))) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.05e+26) {
tmp = log((y * z)) + (log(t) * (a - 0.5));
} 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 <= 3.05d+26) then
tmp = log((y * z)) + (log(t) * (a - 0.5d0))
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 <= 3.05e+26) {
tmp = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.05e+26: tmp = math.log((y * z)) + (math.log(t) * (a - 0.5)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.05e+26) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.05e+26) tmp = log((y * z)) + (log(t) * (a - 0.5)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.05e+26], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.05 \cdot 10^{+26}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 3.0500000000000001e26Initial program 99.4%
associate-+l-99.4%
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 61.7%
+-commutative61.7%
+-commutative61.7%
fma-def61.7%
Simplified61.7%
Taylor expanded in t around 0 61.0%
log-prod48.8%
Simplified48.8%
if 3.0500000000000001e26 < 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 72.9%
+-commutative72.9%
+-commutative72.9%
fma-def72.9%
Simplified72.9%
Taylor expanded in t around inf 73.5%
mul-1-neg73.5%
Simplified73.5%
Final simplification60.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3e+23) (not (<= a 920000000000.0))) (* (log t) a) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e+23) || !(a <= 920000000000.0)) {
tmp = log(t) * a;
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3d+23)) .or. (.not. (a <= 920000000000.0d0))) then
tmp = log(t) * a
else
tmp = (log(z) + log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e+23) || !(a <= 920000000000.0)) {
tmp = Math.log(t) * a;
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3e+23) or not (a <= 920000000000.0): tmp = math.log(t) * a else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3e+23) || !(a <= 920000000000.0)) tmp = Float64(log(t) * a); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3e+23) || ~((a <= 920000000000.0))) tmp = log(t) * a; else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3e+23], N[Not[LessEqual[a, 920000000000.0]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+23} \lor \neg \left(a \leq 920000000000\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -3.0000000000000001e23 or 9.2e11 < 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 74.6%
+-commutative74.6%
+-commutative74.6%
fma-def74.6%
Simplified74.6%
Taylor expanded in a around inf 81.9%
*-commutative81.9%
Simplified81.9%
if -3.0000000000000001e23 < a < 9.2e11Initial program 99.6%
associate-+l-99.6%
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 60.9%
+-commutative60.9%
+-commutative60.9%
fma-def60.9%
Simplified60.9%
Taylor expanded in t around inf 42.3%
Final simplification60.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.8e+28) (not (<= a 5000000000000.0))) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.8e+28) || !(a <= 5000000000000.0)) {
tmp = log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-5.8d+28)) .or. (.not. (a <= 5000000000000.0d0))) then
tmp = log(t) * a
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.8e+28) || !(a <= 5000000000000.0)) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.8e+28) or not (a <= 5000000000000.0): tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.8e+28) || !(a <= 5000000000000.0)) tmp = Float64(log(t) * a); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.8e+28) || ~((a <= 5000000000000.0))) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.8e+28], N[Not[LessEqual[a, 5000000000000.0]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.8 \cdot 10^{+28} \lor \neg \left(a \leq 5000000000000\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -5.8000000000000002e28 or 5e12 < 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 74.6%
+-commutative74.6%
+-commutative74.6%
fma-def74.6%
Simplified74.6%
Taylor expanded in a around inf 81.9%
*-commutative81.9%
Simplified81.9%
if -5.8000000000000002e28 < a < 5e12Initial program 99.6%
associate-+l-99.6%
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 60.9%
+-commutative60.9%
+-commutative60.9%
fma-def60.9%
Simplified60.9%
Taylor expanded in t around inf 52.8%
mul-1-neg52.8%
Simplified52.8%
Final simplification65.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.6e+22) (not (<= a 9500000000000.0))) (* (log t) a) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.6e+22) || !(a <= 9500000000000.0)) {
tmp = log(t) * a;
} 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 <= (-1.6d+22)) .or. (.not. (a <= 9500000000000.0d0))) then
tmp = log(t) * a
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 <= -1.6e+22) || !(a <= 9500000000000.0)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.6e+22) or not (a <= 9500000000000.0): tmp = math.log(t) * a else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.6e+22) || !(a <= 9500000000000.0)) tmp = Float64(log(t) * a); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.6e+22) || ~((a <= 9500000000000.0))) tmp = log(t) * a; else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.6e+22], N[Not[LessEqual[a, 9500000000000.0]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.6 \cdot 10^{+22} \lor \neg \left(a \leq 9500000000000\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -1.6e22 or 9.5e12 < 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 74.6%
+-commutative74.6%
+-commutative74.6%
fma-def74.6%
Simplified74.6%
Taylor expanded in a around inf 81.9%
*-commutative81.9%
Simplified81.9%
if -1.6e22 < a < 9.5e12Initial program 99.6%
associate-+l-99.6%
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 t around inf 58.0%
neg-mul-158.0%
Simplified58.0%
Taylor expanded in x around 0 40.9%
Final simplification59.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 2700000000.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 2700000000.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 <= 2700000000.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 <= 2700000000.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 2700000000.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 2700000000.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 <= 2700000000.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 2700000000.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2700000000:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 2.7e9Initial program 99.4%
associate-+l-99.4%
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 8.5%
neg-mul-18.5%
Simplified8.5%
Taylor expanded in t around 0 8.6%
+-commutative8.6%
Simplified8.6%
if 2.7e9 < 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 72.9%
+-commutative72.9%
+-commutative72.9%
fma-def72.9%
Simplified72.9%
Taylor expanded in t around inf 72.3%
mul-1-neg72.3%
Simplified72.3%
Final simplification40.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.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 67.0%
+-commutative67.0%
+-commutative67.0%
fma-def67.0%
Simplified67.0%
Taylor expanded in t around inf 37.0%
mul-1-neg37.0%
Simplified37.0%
Final simplification37.0%
(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 2024010
(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))))