
(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 14 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.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.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 (+ x y)) (log z)))
(t_2 (* (log t) (- 0.5 a)))
(t_3 (+ (log z) (- (log y) t))))
(if (<= t_1 -700.0)
t_3
(if (<= t_1 685.0)
(- (log (* y z)) (+ t t_2))
(if (or (<= t_1 900.0) (not (<= t_1 1120.0)))
t_3
(- (- (log (* x z)) t_2) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y)) + log(z);
double t_2 = log(t) * (0.5 - a);
double t_3 = log(z) + (log(y) - t);
double tmp;
if (t_1 <= -700.0) {
tmp = t_3;
} else if (t_1 <= 685.0) {
tmp = log((y * z)) - (t + t_2);
} else if ((t_1 <= 900.0) || !(t_1 <= 1120.0)) {
tmp = t_3;
} else {
tmp = (log((x * z)) - 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) :: t_3
real(8) :: tmp
t_1 = log((x + y)) + log(z)
t_2 = log(t) * (0.5d0 - a)
t_3 = log(z) + (log(y) - t)
if (t_1 <= (-700.0d0)) then
tmp = t_3
else if (t_1 <= 685.0d0) then
tmp = log((y * z)) - (t + t_2)
else if ((t_1 <= 900.0d0) .or. (.not. (t_1 <= 1120.0d0))) then
tmp = t_3
else
tmp = (log((x * z)) - 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((x + y)) + Math.log(z);
double t_2 = Math.log(t) * (0.5 - a);
double t_3 = Math.log(z) + (Math.log(y) - t);
double tmp;
if (t_1 <= -700.0) {
tmp = t_3;
} else if (t_1 <= 685.0) {
tmp = Math.log((y * z)) - (t + t_2);
} else if ((t_1 <= 900.0) || !(t_1 <= 1120.0)) {
tmp = t_3;
} else {
tmp = (Math.log((x * z)) - t_2) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + math.log(z) t_2 = math.log(t) * (0.5 - a) t_3 = math.log(z) + (math.log(y) - t) tmp = 0 if t_1 <= -700.0: tmp = t_3 elif t_1 <= 685.0: tmp = math.log((y * z)) - (t + t_2) elif (t_1 <= 900.0) or not (t_1 <= 1120.0): tmp = t_3 else: tmp = (math.log((x * z)) - t_2) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(x + y)) + log(z)) t_2 = Float64(log(t) * Float64(0.5 - a)) t_3 = Float64(log(z) + Float64(log(y) - t)) tmp = 0.0 if (t_1 <= -700.0) tmp = t_3; elseif (t_1 <= 685.0) tmp = Float64(log(Float64(y * z)) - Float64(t + t_2)); elseif ((t_1 <= 900.0) || !(t_1 <= 1120.0)) tmp = t_3; else tmp = Float64(Float64(log(Float64(x * z)) - t_2) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + log(z); t_2 = log(t) * (0.5 - a); t_3 = log(z) + (log(y) - t); tmp = 0.0; if (t_1 <= -700.0) tmp = t_3; elseif (t_1 <= 685.0) tmp = log((y * z)) - (t + t_2); elseif ((t_1 <= 900.0) || ~((t_1 <= 1120.0))) tmp = t_3; else tmp = (log((x * z)) - t_2) - 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]}, Block[{t$95$2 = N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -700.0], t$95$3, If[LessEqual[t$95$1, 685.0], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - N[(t + t$95$2), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$1, 900.0], N[Not[LessEqual[t$95$1, 1120.0]], $MachinePrecision]], t$95$3, N[(N[(N[Log[N[(x * z), $MachinePrecision]], $MachinePrecision] - t$95$2), $MachinePrecision] - t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
t_2 := \log t \cdot \left(0.5 - a\right)\\
t_3 := \log z + \left(\log y - t\right)\\
\mathbf{if}\;t\_1 \leq -700:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 685:\\
\;\;\;\;\log \left(y \cdot z\right) - \left(t + t\_2\right)\\
\mathbf{elif}\;t\_1 \leq 900 \lor \neg \left(t\_1 \leq 1120\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(x \cdot z\right) - t\_2\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -700 or 685 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 900 or 1120 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.8%
associate-+l-99.8%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.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 55.4%
Taylor expanded in x around 0 29.9%
+-commutative29.9%
remove-double-neg29.9%
log-rec29.9%
mul-1-neg29.9%
associate--l+29.9%
mul-1-neg29.9%
log-rec29.9%
remove-double-neg29.9%
Simplified29.9%
if -700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 685Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.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 77.7%
*-un-lft-identity77.7%
sum-log74.1%
Applied egg-rr74.1%
*-lft-identity74.1%
*-commutative74.1%
Simplified74.1%
if 900 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1120Initial program 99.7%
add-cube-cbrt98.9%
pow398.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
Applied egg-rr98.8%
*-un-lft-identity98.8%
+-commutative98.8%
sum-log2.2%
Applied egg-rr2.2%
*-lft-identity2.2%
+-commutative2.2%
Simplified2.2%
Taylor expanded in y around 0 31.2%
Final simplification62.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))) (t_2 (+ (log z) (- (log y) t))))
(if (<= t_1 -700.0)
t_2
(if (<= t_1 685.0)
(- (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) t)
(if (or (<= t_1 900.0) (not (<= t_1 1120.0)))
t_2
(- (- (log (* x z)) (* (log t) (- 0.5 a))) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y)) + log(z);
double t_2 = log(z) + (log(y) - t);
double tmp;
if (t_1 <= -700.0) {
tmp = t_2;
} else if (t_1 <= 685.0) {
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t;
} else if ((t_1 <= 900.0) || !(t_1 <= 1120.0)) {
tmp = t_2;
} else {
tmp = (log((x * z)) - (log(t) * (0.5 - a))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log((x + y)) + log(z)
t_2 = log(z) + (log(y) - t)
if (t_1 <= (-700.0d0)) then
tmp = t_2
else if (t_1 <= 685.0d0) then
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5d0))) - t
else if ((t_1 <= 900.0d0) .or. (.not. (t_1 <= 1120.0d0))) then
tmp = t_2
else
tmp = (log((x * z)) - (log(t) * (0.5d0 - a))) - 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 t_2 = Math.log(z) + (Math.log(y) - t);
double tmp;
if (t_1 <= -700.0) {
tmp = t_2;
} else if (t_1 <= 685.0) {
tmp = (Math.log((z * (x + y))) + (Math.log(t) * (a - 0.5))) - t;
} else if ((t_1 <= 900.0) || !(t_1 <= 1120.0)) {
tmp = t_2;
} else {
tmp = (Math.log((x * z)) - (Math.log(t) * (0.5 - a))) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + math.log(z) t_2 = math.log(z) + (math.log(y) - t) tmp = 0 if t_1 <= -700.0: tmp = t_2 elif t_1 <= 685.0: tmp = (math.log((z * (x + y))) + (math.log(t) * (a - 0.5))) - t elif (t_1 <= 900.0) or not (t_1 <= 1120.0): tmp = t_2 else: tmp = (math.log((x * z)) - (math.log(t) * (0.5 - a))) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(x + y)) + log(z)) t_2 = Float64(log(z) + Float64(log(y) - t)) tmp = 0.0 if (t_1 <= -700.0) tmp = t_2; elseif (t_1 <= 685.0) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))) - t); elseif ((t_1 <= 900.0) || !(t_1 <= 1120.0)) tmp = t_2; else tmp = Float64(Float64(log(Float64(x * z)) - Float64(log(t) * Float64(0.5 - a))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + log(z); t_2 = log(z) + (log(y) - t); tmp = 0.0; if (t_1 <= -700.0) tmp = t_2; elseif (t_1 <= 685.0) tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t; elseif ((t_1 <= 900.0) || ~((t_1 <= 1120.0))) tmp = t_2; else tmp = (log((x * z)) - (log(t) * (0.5 - a))) - 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]}, Block[{t$95$2 = N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -700.0], t$95$2, If[LessEqual[t$95$1, 685.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[Or[LessEqual[t$95$1, 900.0], N[Not[LessEqual[t$95$1, 1120.0]], $MachinePrecision]], t$95$2, N[(N[(N[Log[N[(x * z), $MachinePrecision]], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
t_2 := \log z + \left(\log y - t\right)\\
\mathbf{if}\;t\_1 \leq -700:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 685:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{elif}\;t\_1 \leq 900 \lor \neg \left(t\_1 \leq 1120\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(x \cdot z\right) - \log t \cdot \left(0.5 - a\right)\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -700 or 685 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 900 or 1120 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.8%
associate-+l-99.8%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.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 55.4%
Taylor expanded in x around 0 29.9%
+-commutative29.9%
remove-double-neg29.9%
log-rec29.9%
mul-1-neg29.9%
associate--l+29.9%
mul-1-neg29.9%
log-rec29.9%
remove-double-neg29.9%
Simplified29.9%
if -700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 685Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.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-undefine99.7%
associate--r+99.7%
+-commutative99.7%
sum-log99.8%
Applied egg-rr99.8%
if 900 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1120Initial program 99.7%
add-cube-cbrt98.9%
pow398.8%
sub-neg98.8%
metadata-eval98.8%
*-commutative98.8%
Applied egg-rr98.8%
*-un-lft-identity98.8%
+-commutative98.8%
sum-log2.2%
Applied egg-rr2.2%
*-lft-identity2.2%
+-commutative2.2%
Simplified2.2%
Taylor expanded in y around 0 31.2%
Final simplification81.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y)))
(t_2 (+ t_1 (log z)))
(t_3 (+ (log z) (- (log y) t))))
(if (<= t_2 -700.0)
t_3
(if (<= t_2 685.0)
(- (log (* y z)) (+ t (* (log t) (- 0.5 a))))
(if (or (<= t_2 860.0) (not (<= t_2 1120.0)))
t_3
(+ t_1 (* (log t) a)))))))
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 = log(z) + (log(y) - t);
double tmp;
if (t_2 <= -700.0) {
tmp = t_3;
} else if (t_2 <= 685.0) {
tmp = log((y * z)) - (t + (log(t) * (0.5 - a)));
} else if ((t_2 <= 860.0) || !(t_2 <= 1120.0)) {
tmp = t_3;
} else {
tmp = t_1 + (log(t) * a);
}
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 = log(z) + (log(y) - t)
if (t_2 <= (-700.0d0)) then
tmp = t_3
else if (t_2 <= 685.0d0) then
tmp = log((y * z)) - (t + (log(t) * (0.5d0 - a)))
else if ((t_2 <= 860.0d0) .or. (.not. (t_2 <= 1120.0d0))) then
tmp = t_3
else
tmp = t_1 + (log(t) * a)
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 = Math.log(z) + (Math.log(y) - t);
double tmp;
if (t_2 <= -700.0) {
tmp = t_3;
} else if (t_2 <= 685.0) {
tmp = Math.log((y * z)) - (t + (Math.log(t) * (0.5 - a)));
} else if ((t_2 <= 860.0) || !(t_2 <= 1120.0)) {
tmp = t_3;
} else {
tmp = t_1 + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) t_2 = t_1 + math.log(z) t_3 = math.log(z) + (math.log(y) - t) tmp = 0 if t_2 <= -700.0: tmp = t_3 elif t_2 <= 685.0: tmp = math.log((y * z)) - (t + (math.log(t) * (0.5 - a))) elif (t_2 <= 860.0) or not (t_2 <= 1120.0): tmp = t_3 else: tmp = t_1 + (math.log(t) * a) 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(log(z) + Float64(log(y) - t)) tmp = 0.0 if (t_2 <= -700.0) tmp = t_3; elseif (t_2 <= 685.0) tmp = Float64(log(Float64(y * z)) - Float64(t + Float64(log(t) * Float64(0.5 - a)))); elseif ((t_2 <= 860.0) || !(t_2 <= 1120.0)) tmp = t_3; else tmp = Float64(t_1 + Float64(log(t) * a)); 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 = log(z) + (log(y) - t); tmp = 0.0; if (t_2 <= -700.0) tmp = t_3; elseif (t_2 <= 685.0) tmp = log((y * z)) - (t + (log(t) * (0.5 - a))); elseif ((t_2 <= 860.0) || ~((t_2 <= 1120.0))) tmp = t_3; else tmp = t_1 + (log(t) * a); 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[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -700.0], t$95$3, If[LessEqual[t$95$2, 685.0], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - N[(t + N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$2, 860.0], N[Not[LessEqual[t$95$2, 1120.0]], $MachinePrecision]], t$95$3, N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
t_2 := t\_1 + \log z\\
t_3 := \log z + \left(\log y - t\right)\\
\mathbf{if}\;t\_2 \leq -700:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 685:\\
\;\;\;\;\log \left(y \cdot z\right) - \left(t + \log t \cdot \left(0.5 - a\right)\right)\\
\mathbf{elif}\;t\_2 \leq 860 \lor \neg \left(t\_2 \leq 1120\right):\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \log t \cdot a\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -700 or 685 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 860 or 1120 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in t around inf 58.6%
Taylor expanded in x around 0 31.9%
+-commutative31.9%
remove-double-neg31.9%
log-rec31.9%
mul-1-neg31.9%
associate--l+31.9%
mul-1-neg31.9%
log-rec31.9%
remove-double-neg31.9%
Simplified31.9%
if -700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 685Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.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 77.7%
*-un-lft-identity77.7%
sum-log74.1%
Applied egg-rr74.1%
*-lft-identity74.1%
*-commutative74.1%
Simplified74.1%
if 860 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1120Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in a around inf 53.7%
*-commutative53.7%
Simplified53.7%
Final simplification64.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.15e-11) (+ (log (+ x y)) (+ (log z) (* (log t) (- a 0.5)))) (+ (+ (log z) (log y)) (- (* (log t) a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.15e-11) {
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) + log(y)) + ((log(t) * a) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.15d-11) then
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) + log(y)) + ((log(t) * a) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.15e-11) {
tmp = Math.log((x + y)) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) + Math.log(y)) + ((Math.log(t) * a) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.15e-11: tmp = math.log((x + y)) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) + math.log(y)) + ((math.log(t) * a) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.15e-11) tmp = Float64(log(Float64(x + y)) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * a) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.15e-11) tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(z) + log(y)) + ((log(t) * a) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.15e-11], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.15 \cdot 10^{-11}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) + \left(\log t \cdot a - t\right)\\
\end{array}
\end{array}
if t < 1.15000000000000007e-11Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around 0 99.5%
if 1.15000000000000007e-11 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 77.1%
Taylor expanded in a around inf 76.3%
mul-1-neg76.3%
distribute-rgt-neg-in76.3%
Simplified76.3%
Final simplification86.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 6.8e+35) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 6.8e+35) {
tmp = log(y) + (log(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 <= 6.8d+35) then
tmp = log(y) + (log(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 <= 6.8e+35) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 6.8e+35: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 6.8e+35) tmp = Float64(log(y) + Float64(log(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 <= 6.8e+35) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 6.8e+35], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 6.8 \cdot 10^{+35}:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 6.8000000000000002e35Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in x around 0 73.8%
Taylor expanded in t around inf 53.0%
associate--r+53.0%
log-rec53.0%
*-commutative53.0%
cancel-sign-sub-inv53.0%
metadata-eval53.0%
*-lft-identity53.0%
associate--r-53.0%
associate-+r-53.1%
sub-neg53.1%
Simplified53.1%
Taylor expanded in t around 0 70.3%
associate--l+70.3%
Simplified70.3%
if 6.8000000000000002e35 < 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-undefine100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 75.0%
Taylor expanded in t around inf 85.4%
neg-mul-185.4%
Simplified85.4%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.15e-11) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (+ (+ (log z) (log y)) (- (* (log t) a) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.15e-11) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) + log(y)) + ((log(t) * a) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.15d-11) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) + log(y)) + ((log(t) * a) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.15e-11) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) + Math.log(y)) + ((Math.log(t) * a) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.15e-11: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) + math.log(y)) + ((math.log(t) * a) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.15e-11) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * a) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.15e-11) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(z) + log(y)) + ((log(t) * a) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.15e-11], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.15 \cdot 10^{-11}:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) + \left(\log t \cdot a - t\right)\\
\end{array}
\end{array}
if t < 1.15000000000000007e-11Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in x around 0 70.9%
Taylor expanded in t around inf 46.6%
associate--r+46.6%
log-rec46.6%
*-commutative46.6%
cancel-sign-sub-inv46.6%
metadata-eval46.6%
*-lft-identity46.6%
associate--r-46.6%
associate-+r-46.7%
sub-neg46.7%
Simplified46.7%
Taylor expanded in t around 0 70.9%
associate--l+70.9%
Simplified70.9%
if 1.15000000000000007e-11 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 77.1%
Taylor expanded in a around inf 76.3%
mul-1-neg76.3%
distribute-rgt-neg-in76.3%
Simplified76.3%
Final simplification73.9%
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \log t \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.7%
Final simplification99.7%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (log y)) (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) + log(y)) + ((log(t) * (a - 0.5d0)) - t)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + Math.log(y)) + ((Math.log(t) * (a - 0.5)) - t);
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) + ((math.log(t) * (a - 0.5)) - t)
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)
\end{array}
Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.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.4%
Final simplification74.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.6e-16) (+ (log (* z (+ x y))) (* (log t) (+ a -0.5))) (if (<= t 5.7e+35) (+ (log (+ x y)) (* (log t) a)) (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.6e-16) {
tmp = log((z * (x + y))) + (log(t) * (a + -0.5));
} else if (t <= 5.7e+35) {
tmp = log((x + y)) + (log(t) * a);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.6d-16) then
tmp = log((z * (x + y))) + (log(t) * (a + (-0.5d0)))
else if (t <= 5.7d+35) then
tmp = log((x + y)) + (log(t) * a)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.6e-16) {
tmp = Math.log((z * (x + y))) + (Math.log(t) * (a + -0.5));
} else if (t <= 5.7e+35) {
tmp = Math.log((x + y)) + (Math.log(t) * a);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.6e-16: tmp = math.log((z * (x + y))) + (math.log(t) * (a + -0.5)) elif t <= 5.7e+35: tmp = math.log((x + y)) + (math.log(t) * a) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.6e-16) tmp = Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a + -0.5))); elseif (t <= 5.7e+35) tmp = Float64(log(Float64(x + y)) + Float64(log(t) * a)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.6e-16) tmp = log((z * (x + y))) + (log(t) * (a + -0.5)); elseif (t <= 5.7e+35) tmp = log((x + y)) + (log(t) * a); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.6e-16], N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.7e+35], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.6 \cdot 10^{-16}:\\
\;\;\;\;\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a + -0.5\right)\\
\mathbf{elif}\;t \leq 5.7 \cdot 10^{+35}:\\
\;\;\;\;\log \left(x + y\right) + \log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.60000000000000011e-16Initial program 99.5%
add-cube-cbrt98.4%
pow398.3%
sub-neg98.3%
metadata-eval98.3%
*-commutative98.3%
Applied egg-rr98.3%
*-un-lft-identity98.3%
+-commutative98.3%
sum-log74.1%
Applied egg-rr74.1%
*-lft-identity74.1%
+-commutative74.1%
Simplified74.1%
Taylor expanded in t around 0 75.0%
+-commutative75.0%
sub-neg75.0%
metadata-eval75.0%
+-commutative75.0%
Simplified75.0%
if 1.60000000000000011e-16 < t < 5.69999999999999993e35Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.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 70.1%
*-commutative70.1%
Simplified70.1%
if 5.69999999999999993e35 < 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-undefine100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 75.0%
Taylor expanded in t around inf 85.4%
neg-mul-185.4%
Simplified85.4%
Final simplification79.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.04e+36) (+ (log (+ x y)) (* (log t) a)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.04e+36) {
tmp = log((x + y)) + (log(t) * a);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.04d+36) then
tmp = log((x + y)) + (log(t) * a)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.04e+36) {
tmp = Math.log((x + y)) + (Math.log(t) * a);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.04e+36: tmp = math.log((x + y)) + (math.log(t) * a) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.04e+36) tmp = Float64(log(Float64(x + y)) + Float64(log(t) * a)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.04e+36) tmp = log((x + y)) + (log(t) * a); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.04e+36], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.04 \cdot 10^{+36}:\\
\;\;\;\;\log \left(x + y\right) + \log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.04000000000000003e36Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in a around inf 63.4%
*-commutative63.4%
Simplified63.4%
if 1.04000000000000003e36 < 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-undefine100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 75.0%
Taylor expanded in t around inf 85.4%
neg-mul-185.4%
Simplified85.4%
Final simplification74.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 435.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 435.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 <= 435.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 <= 435.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 435.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 435.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 <= 435.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 435.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 435:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 435Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 9.1%
neg-mul-19.1%
Simplified9.1%
Taylor expanded in t around 0 9.1%
+-commutative9.1%
Simplified9.1%
if 435 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 77.5%
Taylor expanded in t around inf 77.8%
neg-mul-177.8%
Simplified77.8%
Final simplification47.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 8.5e+35) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 8.5e+35) {
tmp = log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 8.5d+35) then
tmp = log(t) * a
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 8.5e+35) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 8.5e+35: tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 8.5e+35) tmp = Float64(log(t) * a); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 8.5e+35) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 8.5e+35], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8.5 \cdot 10^{+35}:\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 8.4999999999999995e35Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in x around 0 73.8%
Taylor expanded in a around inf 58.5%
if 8.4999999999999995e35 < 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-undefine100.0%
sub-neg100.0%
+-commutative100.0%
distribute-neg-in100.0%
metadata-eval100.0%
metadata-eval100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 75.0%
Taylor expanded in t around inf 85.4%
neg-mul-185.4%
Simplified85.4%
Final simplification71.6%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.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.4%
Taylor expanded in t around inf 44.0%
neg-mul-144.0%
Simplified44.0%
Final simplification44.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 2024082
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))