
(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 17 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 z) t) (fma (+ a -0.5) (log t) (log (+ x y)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + fma((a + -0.5), log(t), log((x + y)));
}
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + fma(Float64(a + -0.5), log(t), log(Float64(x + y)))) end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \mathsf{fma}\left(a + -0.5, \log t, \log \left(x + y\right)\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 373.0) (+ (* (+ a -0.5) (log t)) (- (log (* z (+ x y))) t)) (+ (- (log z) t) (log (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 373.0) {
tmp = ((a + -0.5) * log(t)) + (log((z * (x + y))) - t);
} else {
tmp = (log(z) - t) + log((x + y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (log(z) <= 373.0d0) then
tmp = ((a + (-0.5d0)) * log(t)) + (log((z * (x + y))) - t)
else
tmp = (log(z) - t) + log((x + y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (Math.log(z) <= 373.0) {
tmp = ((a + -0.5) * Math.log(t)) + (Math.log((z * (x + y))) - t);
} else {
tmp = (Math.log(z) - t) + Math.log((x + y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 373.0: tmp = ((a + -0.5) * math.log(t)) + (math.log((z * (x + y))) - t) else: tmp = (math.log(z) - t) + math.log((x + y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 373.0) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + Float64(log(Float64(z * Float64(x + y))) - t)); else tmp = Float64(Float64(log(z) - t) + log(Float64(x + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 373.0) tmp = ((a + -0.5) * log(t)) + (log((z * (x + y))) - t); else tmp = (log(z) - t) + log((x + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 373.0], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 373:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \left(\log \left(z \cdot \left(x + y\right)\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log \left(x + y\right)\\
\end{array}
\end{array}
if (log.f64 z) < 373Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
associate-+r-99.6%
sum-log86.3%
Applied egg-rr86.3%
if 373 < (log.f64 z) Initial program 99.9%
associate-+l-99.9%
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 50.1%
Final simplification79.1%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 373.0) (+ (* (+ a -0.5) (log t)) (- (log (* z y)) t)) (+ (- (log z) t) (log (+ x y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 373.0) {
tmp = ((a + -0.5) * log(t)) + (log((z * y)) - t);
} else {
tmp = (log(z) - t) + log((x + y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (log(z) <= 373.0d0) then
tmp = ((a + (-0.5d0)) * log(t)) + (log((z * y)) - t)
else
tmp = (log(z) - t) + log((x + y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (Math.log(z) <= 373.0) {
tmp = ((a + -0.5) * Math.log(t)) + (Math.log((z * y)) - t);
} else {
tmp = (Math.log(z) - t) + Math.log((x + y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 373.0: tmp = ((a + -0.5) * math.log(t)) + (math.log((z * y)) - t) else: tmp = (math.log(z) - t) + math.log((x + y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 373.0) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + Float64(log(Float64(z * y)) - t)); else tmp = Float64(Float64(log(z) - t) + log(Float64(x + y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 373.0) tmp = ((a + -0.5) * log(t)) + (log((z * y)) - t); else tmp = (log(z) - t) + log((x + y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 373.0], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 373:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \left(\log \left(z \cdot y\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log \left(x + y\right)\\
\end{array}
\end{array}
if (log.f64 z) < 373Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 69.6%
remove-double-neg69.6%
log-rec69.6%
mul-1-neg69.6%
+-commutative69.6%
associate--l+69.6%
mul-1-neg69.6%
log-rec69.6%
remove-double-neg69.6%
Simplified69.6%
associate-+r-69.6%
sum-log59.9%
Applied egg-rr59.9%
if 373 < (log.f64 z) Initial program 99.9%
associate-+l-99.9%
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 50.1%
Final simplification58.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (+ a -0.5) (log t))))
(if (<= t 7800000.0)
(+ (log z) (+ t_1 (log y)))
(if (<= t 1.5e+90) (+ t_1 (- (log (* z y)) t)) (- t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a + -0.5) * log(t);
double tmp;
if (t <= 7800000.0) {
tmp = log(z) + (t_1 + log(y));
} else if (t <= 1.5e+90) {
tmp = t_1 + (log((z * y)) - t);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (a + (-0.5d0)) * log(t)
if (t <= 7800000.0d0) then
tmp = log(z) + (t_1 + log(y))
else if (t <= 1.5d+90) then
tmp = t_1 + (log((z * y)) - t)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (a + -0.5) * Math.log(t);
double tmp;
if (t <= 7800000.0) {
tmp = Math.log(z) + (t_1 + Math.log(y));
} else if (t <= 1.5e+90) {
tmp = t_1 + (Math.log((z * y)) - t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a + -0.5) * math.log(t) tmp = 0 if t <= 7800000.0: tmp = math.log(z) + (t_1 + math.log(y)) elif t <= 1.5e+90: tmp = t_1 + (math.log((z * y)) - t) else: tmp = -t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a + -0.5) * log(t)) tmp = 0.0 if (t <= 7800000.0) tmp = Float64(log(z) + Float64(t_1 + log(y))); elseif (t <= 1.5e+90) tmp = Float64(t_1 + Float64(log(Float64(z * y)) - t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a + -0.5) * log(t); tmp = 0.0; if (t <= 7800000.0) tmp = log(z) + (t_1 + log(y)); elseif (t <= 1.5e+90) tmp = t_1 + (log((z * y)) - t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 7800000.0], N[(N[Log[z], $MachinePrecision] + N[(t$95$1 + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.5e+90], N[(t$95$1 + N[(N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], (-t)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot \log t\\
\mathbf{if}\;t \leq 7800000:\\
\;\;\;\;\log z + \left(t\_1 + \log y\right)\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{+90}:\\
\;\;\;\;t\_1 + \left(\log \left(z \cdot y\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 7.8e6Initial program 99.3%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 59.9%
remove-double-neg59.9%
log-rec59.9%
mul-1-neg59.9%
+-commutative59.9%
associate--l+59.9%
mul-1-neg59.9%
log-rec59.9%
remove-double-neg59.9%
Simplified59.9%
Taylor expanded in t around 0 58.4%
associate-+r+58.4%
+-commutative58.4%
associate-+r+58.4%
sub-neg58.4%
metadata-eval58.4%
+-commutative58.4%
Simplified58.4%
if 7.8e6 < t < 1.49999999999999989e90Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 82.1%
remove-double-neg82.1%
log-rec82.1%
mul-1-neg82.1%
+-commutative82.1%
associate--l+82.1%
mul-1-neg82.1%
log-rec82.1%
remove-double-neg82.1%
Simplified82.1%
associate-+r-82.1%
sum-log72.6%
Applied egg-rr72.6%
if 1.49999999999999989e90 < t Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-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 t around inf 86.3%
neg-mul-186.3%
Simplified86.3%
Taylor expanded in t around inf 86.3%
neg-mul-186.3%
Simplified86.3%
Final simplification70.0%
(FPCore (x y z t a) :precision binary64 (if (<= t 9600000.0) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (if (<= t 2.7e+91) (+ (* (+ a -0.5) (log t)) (- (log (* z y)) t)) (- t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 9600000.0) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else if (t <= 2.7e+91) {
tmp = ((a + -0.5) * log(t)) + (log((z * y)) - t);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 9600000.0d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else if (t <= 2.7d+91) then
tmp = ((a + (-0.5d0)) * log(t)) + (log((z * y)) - t)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 9600000.0) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else if (t <= 2.7e+91) {
tmp = ((a + -0.5) * Math.log(t)) + (Math.log((z * y)) - t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 9600000.0: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) elif t <= 2.7e+91: tmp = ((a + -0.5) * math.log(t)) + (math.log((z * y)) - t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 9600000.0) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); elseif (t <= 2.7e+91) tmp = Float64(Float64(Float64(a + -0.5) * log(t)) + Float64(log(Float64(z * y)) - t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 9600000.0) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); elseif (t <= 2.7e+91) tmp = ((a + -0.5) * log(t)) + (log((z * y)) - t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 9600000.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.7e+91], N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], (-t)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 9600000:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+91}:\\
\;\;\;\;\left(a + -0.5\right) \cdot \log t + \left(\log \left(z \cdot y\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 9.6e6Initial program 99.3%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 59.9%
remove-double-neg59.9%
log-rec59.9%
mul-1-neg59.9%
+-commutative59.9%
associate--l+59.9%
mul-1-neg59.9%
log-rec59.9%
remove-double-neg59.9%
Simplified59.9%
Taylor expanded in t around 0 58.4%
if 9.6e6 < t < 2.7e91Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 82.1%
remove-double-neg82.1%
log-rec82.1%
mul-1-neg82.1%
+-commutative82.1%
associate--l+82.1%
mul-1-neg82.1%
log-rec82.1%
remove-double-neg82.1%
Simplified82.1%
associate-+r-82.1%
sum-log72.6%
Applied egg-rr72.6%
if 2.7e91 < t Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-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 t around inf 86.3%
neg-mul-186.3%
Simplified86.3%
Taylor expanded in t around inf 86.3%
neg-mul-186.3%
Simplified86.3%
Final simplification70.0%
(FPCore (x y z t a) :precision binary64 (+ (+ (- (log z) t) (log (+ x y))) (* (+ a -0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log(z) - t) + log((x + y))) + ((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(z) - t) + log((x + y))) + ((a + (-0.5d0)) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log(z) - t) + Math.log((x + y))) + ((a + -0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log(z) - t) + math.log((x + y))) + ((a + -0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(z) - t) + log(Float64(x + y))) + Float64(Float64(a + -0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log(z) - t) + log((x + y))) + ((a + -0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log z - t\right) + \log \left(x + y\right)\right) + \left(a + -0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (+ (* (+ a -0.5) (log t)) (+ (log z) (- (log y) t))))
double code(double x, double y, double z, double t, double a) {
return ((a + -0.5) * log(t)) + (log(z) + (log(y) - t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((a + (-0.5d0)) * log(t)) + (log(z) + (log(y) - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((a + -0.5) * Math.log(t)) + (Math.log(z) + (Math.log(y) - t));
}
def code(x, y, z, t, a): return ((a + -0.5) * math.log(t)) + (math.log(z) + (math.log(y) - t))
function code(x, y, z, t, a) return Float64(Float64(Float64(a + -0.5) * log(t)) + Float64(log(z) + Float64(log(y) - t))) end
function tmp = code(x, y, z, t, a) tmp = ((a + -0.5) * log(t)) + (log(z) + (log(y) - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a + -0.5\right) \cdot \log t + \left(\log z + \left(\log y - t\right)\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.2%
remove-double-neg68.2%
log-rec68.2%
mul-1-neg68.2%
+-commutative68.2%
associate--l+68.2%
mul-1-neg68.2%
log-rec68.2%
remove-double-neg68.2%
Simplified68.2%
Final simplification68.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))))
(if (<= a -2.5e+21)
(* (log (cbrt t)) (* a 3.0))
(if (<= a -6.8e-56)
(- (fabs t_1) t)
(if (<= a 19.0)
(- (log (* y (* z (pow t (+ a -0.5))))) t)
(+ t_1 (* a (log t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double tmp;
if (a <= -2.5e+21) {
tmp = log(cbrt(t)) * (a * 3.0);
} else if (a <= -6.8e-56) {
tmp = fabs(t_1) - t;
} else if (a <= 19.0) {
tmp = log((y * (z * pow(t, (a + -0.5))))) - t;
} else {
tmp = t_1 + (a * log(t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y));
double tmp;
if (a <= -2.5e+21) {
tmp = Math.log(Math.cbrt(t)) * (a * 3.0);
} else if (a <= -6.8e-56) {
tmp = Math.abs(t_1) - t;
} else if (a <= 19.0) {
tmp = Math.log((y * (z * Math.pow(t, (a + -0.5))))) - t;
} else {
tmp = t_1 + (a * Math.log(t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) tmp = 0.0 if (a <= -2.5e+21) tmp = Float64(log(cbrt(t)) * Float64(a * 3.0)); elseif (a <= -6.8e-56) tmp = Float64(abs(t_1) - t); elseif (a <= 19.0) tmp = Float64(log(Float64(y * Float64(z * (t ^ Float64(a + -0.5))))) - t); else tmp = Float64(t_1 + Float64(a * log(t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a, -2.5e+21], N[(N[Log[N[Power[t, 1/3], $MachinePrecision]], $MachinePrecision] * N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -6.8e-56], N[(N[Abs[t$95$1], $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 19.0], N[(N[Log[N[(y * N[(z * N[Power[t, N[(a + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], N[(t$95$1 + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
\mathbf{if}\;a \leq -2.5 \cdot 10^{+21}:\\
\;\;\;\;\log \left(\sqrt[3]{t}\right) \cdot \left(a \cdot 3\right)\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{-56}:\\
\;\;\;\;\left|t\_1\right| - t\\
\mathbf{elif}\;a \leq 19:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1 + a \cdot \log t\\
\end{array}
\end{array}
if a < -2.5e21Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
log-prod99.6%
pow299.6%
Applied egg-rr99.6%
log-pow99.6%
fma-define99.6%
Applied egg-rr99.6%
fma-define99.6%
distribute-lft1-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around 0 99.5%
associate-*r*99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in a around inf 76.3%
associate-*r*76.5%
*-commutative76.5%
Simplified76.5%
if -2.5e21 < a < -6.79999999999999964e-56Initial program 99.9%
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 70.6%
neg-mul-170.6%
Simplified70.6%
add-sqr-sqrt57.9%
sqrt-unprod71.7%
pow271.7%
Applied egg-rr71.7%
unpow271.7%
rem-sqrt-square71.7%
+-commutative71.7%
Simplified71.7%
if -6.79999999999999964e-56 < a < 19Initial program 99.5%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 66.6%
remove-double-neg66.6%
log-rec66.6%
mul-1-neg66.6%
+-commutative66.6%
associate--l+66.6%
mul-1-neg66.6%
log-rec66.6%
remove-double-neg66.6%
Simplified66.6%
add-log-exp14.6%
exp-sum13.9%
exp-sum13.9%
add-exp-log14.0%
exp-diff14.0%
add-exp-log14.3%
*-commutative14.3%
exp-to-pow14.3%
Applied egg-rr14.3%
Taylor expanded in t around 0 48.4%
*-commutative48.4%
exp-to-pow48.4%
sub-neg48.4%
metadata-eval48.4%
*-commutative48.4%
neg-mul-148.4%
unsub-neg48.4%
Simplified48.4%
if 19 < 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-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 85.1%
*-commutative85.1%
Simplified85.1%
Final simplification66.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))))
(if (<= a -2.3e+20)
(* (log (cbrt t)) (* a 3.0))
(if (<= a 410000000.0) (+ (- (log z) t) t_1) (+ t_1 (* a (log t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double tmp;
if (a <= -2.3e+20) {
tmp = log(cbrt(t)) * (a * 3.0);
} else if (a <= 410000000.0) {
tmp = (log(z) - t) + t_1;
} else {
tmp = t_1 + (a * log(t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y));
double tmp;
if (a <= -2.3e+20) {
tmp = Math.log(Math.cbrt(t)) * (a * 3.0);
} else if (a <= 410000000.0) {
tmp = (Math.log(z) - t) + t_1;
} else {
tmp = t_1 + (a * Math.log(t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) tmp = 0.0 if (a <= -2.3e+20) tmp = Float64(log(cbrt(t)) * Float64(a * 3.0)); elseif (a <= 410000000.0) tmp = Float64(Float64(log(z) - t) + t_1); else tmp = Float64(t_1 + Float64(a * log(t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a, -2.3e+20], N[(N[Log[N[Power[t, 1/3], $MachinePrecision]], $MachinePrecision] * N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 410000000.0], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
\mathbf{if}\;a \leq -2.3 \cdot 10^{+20}:\\
\;\;\;\;\log \left(\sqrt[3]{t}\right) \cdot \left(a \cdot 3\right)\\
\mathbf{elif}\;a \leq 410000000:\\
\;\;\;\;\left(\log z - t\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_1 + a \cdot \log t\\
\end{array}
\end{array}
if a < -2.3e20Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
log-prod99.6%
pow299.6%
Applied egg-rr99.6%
log-pow99.6%
fma-define99.6%
Applied egg-rr99.6%
fma-define99.6%
distribute-lft1-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around 0 99.5%
associate-*r*99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in a around inf 76.3%
associate-*r*76.5%
*-commutative76.5%
Simplified76.5%
if -2.3e20 < a < 4.1e8Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 62.3%
if 4.1e8 < 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-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 85.1%
*-commutative85.1%
Simplified85.1%
Final simplification71.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))))
(if (<= a -5.5e+20)
(* (log (cbrt t)) (* a 3.0))
(if (<= a 1900000000.0) (- t_1 t) (+ t_1 (* a (log t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double tmp;
if (a <= -5.5e+20) {
tmp = log(cbrt(t)) * (a * 3.0);
} else if (a <= 1900000000.0) {
tmp = t_1 - t;
} else {
tmp = t_1 + (a * log(t));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y));
double tmp;
if (a <= -5.5e+20) {
tmp = Math.log(Math.cbrt(t)) * (a * 3.0);
} else if (a <= 1900000000.0) {
tmp = t_1 - t;
} else {
tmp = t_1 + (a * Math.log(t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) tmp = 0.0 if (a <= -5.5e+20) tmp = Float64(log(cbrt(t)) * Float64(a * 3.0)); elseif (a <= 1900000000.0) tmp = Float64(t_1 - t); else tmp = Float64(t_1 + Float64(a * log(t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[a, -5.5e+20], N[(N[Log[N[Power[t, 1/3], $MachinePrecision]], $MachinePrecision] * N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1900000000.0], N[(t$95$1 - t), $MachinePrecision], N[(t$95$1 + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
\mathbf{if}\;a \leq -5.5 \cdot 10^{+20}:\\
\;\;\;\;\log \left(\sqrt[3]{t}\right) \cdot \left(a \cdot 3\right)\\
\mathbf{elif}\;a \leq 1900000000:\\
\;\;\;\;t\_1 - t\\
\mathbf{else}:\\
\;\;\;\;t\_1 + a \cdot \log t\\
\end{array}
\end{array}
if a < -5.5e20Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
log-prod99.6%
pow299.6%
Applied egg-rr99.6%
log-pow99.6%
fma-define99.6%
Applied egg-rr99.6%
fma-define99.6%
distribute-lft1-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around 0 99.5%
associate-*r*99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in a around inf 76.3%
associate-*r*76.5%
*-commutative76.5%
Simplified76.5%
if -5.5e20 < a < 1.9e9Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 60.3%
neg-mul-160.3%
Simplified60.3%
if 1.9e9 < 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-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 85.1%
*-commutative85.1%
Simplified85.1%
Final simplification70.3%
(FPCore (x y z t a) :precision binary64 (if (<= a -3.8e+20) (* (log (cbrt t)) (* a 3.0)) (if (<= a 220000000.0) (- (log (+ x y)) t) (* a (log t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.8e+20) {
tmp = log(cbrt(t)) * (a * 3.0);
} else if (a <= 220000000.0) {
tmp = log((x + y)) - t;
} else {
tmp = a * log(t);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -3.8e+20) {
tmp = Math.log(Math.cbrt(t)) * (a * 3.0);
} else if (a <= 220000000.0) {
tmp = Math.log((x + y)) - t;
} else {
tmp = a * Math.log(t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -3.8e+20) tmp = Float64(log(cbrt(t)) * Float64(a * 3.0)); elseif (a <= 220000000.0) tmp = Float64(log(Float64(x + y)) - t); else tmp = Float64(a * log(t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -3.8e+20], N[(N[Log[N[Power[t, 1/3], $MachinePrecision]], $MachinePrecision] * N[(a * 3.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 220000000.0], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+20}:\\
\;\;\;\;\log \left(\sqrt[3]{t}\right) \cdot \left(a \cdot 3\right)\\
\mathbf{elif}\;a \leq 220000000:\\
\;\;\;\;\log \left(x + y\right) - t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \log t\\
\end{array}
\end{array}
if a < -3.8e20Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
add-cube-cbrt99.7%
log-prod99.6%
pow299.6%
Applied egg-rr99.6%
log-pow99.6%
fma-define99.6%
Applied egg-rr99.6%
fma-define99.6%
distribute-lft1-in99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in a around 0 99.5%
associate-*r*99.7%
distribute-rgt-out99.7%
Simplified99.7%
Taylor expanded in a around inf 76.3%
associate-*r*76.5%
*-commutative76.5%
Simplified76.5%
if -3.8e20 < a < 2.2e8Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 60.3%
neg-mul-160.3%
Simplified60.3%
if 2.2e8 < a Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 65.5%
remove-double-neg65.5%
log-rec65.5%
mul-1-neg65.5%
+-commutative65.5%
associate--l+65.5%
mul-1-neg65.5%
log-rec65.5%
remove-double-neg65.5%
Simplified65.5%
Taylor expanded in a around inf 84.8%
*-commutative84.8%
Simplified84.8%
Final simplification70.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.2e+21) (not (<= a 2400000000.0))) (* a (log t)) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.2e+21) || !(a <= 2400000000.0)) {
tmp = a * log(t);
} else {
tmp = log((x + 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 <= (-7.2d+21)) .or. (.not. (a <= 2400000000.0d0))) then
tmp = a * log(t)
else
tmp = log((x + 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 <= -7.2e+21) || !(a <= 2400000000.0)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.2e+21) or not (a <= 2400000000.0): tmp = a * math.log(t) else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.2e+21) || !(a <= 2400000000.0)) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(x + y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -7.2e+21) || ~((a <= 2400000000.0))) tmp = a * log(t); else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.2e+21], N[Not[LessEqual[a, 2400000000.0]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.2 \cdot 10^{+21} \lor \neg \left(a \leq 2400000000\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -7.2e21 or 2.4e9 < a Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 69.7%
remove-double-neg69.7%
log-rec69.7%
mul-1-neg69.7%
+-commutative69.7%
associate--l+69.7%
mul-1-neg69.7%
log-rec69.7%
remove-double-neg69.7%
Simplified69.7%
Taylor expanded in a around inf 81.0%
*-commutative81.0%
Simplified81.0%
if -7.2e21 < a < 2.4e9Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 60.3%
neg-mul-160.3%
Simplified60.3%
Final simplification70.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.8e+20) (not (<= a 540000000.0))) (* a (log t)) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.8e+20) || !(a <= 540000000.0)) {
tmp = a * log(t);
} else {
tmp = log(y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.8d+20)) .or. (.not. (a <= 540000000.0d0))) then
tmp = a * log(t)
else
tmp = log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.8e+20) || !(a <= 540000000.0)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.8e+20) or not (a <= 540000000.0): tmp = a * math.log(t) else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.8e+20) || !(a <= 540000000.0)) tmp = Float64(a * log(t)); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.8e+20) || ~((a <= 540000000.0))) tmp = a * log(t); else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.8e+20], N[Not[LessEqual[a, 540000000.0]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.8 \cdot 10^{+20} \lor \neg \left(a \leq 540000000\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -1.8e20 or 5.4e8 < a Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 69.7%
remove-double-neg69.7%
log-rec69.7%
mul-1-neg69.7%
+-commutative69.7%
associate--l+69.7%
mul-1-neg69.7%
log-rec69.7%
remove-double-neg69.7%
Simplified69.7%
Taylor expanded in a around inf 81.0%
*-commutative81.0%
Simplified81.0%
if -1.8e20 < a < 5.4e8Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 60.3%
neg-mul-160.3%
Simplified60.3%
Taylor expanded in x around 0 49.7%
Final simplification64.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.5e+72) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.5e+72) {
tmp = a * log(t);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 4.5d+72) then
tmp = a * log(t)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.5e+72) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.5e+72: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.5e+72) tmp = Float64(a * log(t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4.5e+72) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.5e+72], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4.5 \cdot 10^{+72}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 4.4999999999999998e72Initial program 99.4%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 62.2%
remove-double-neg62.2%
log-rec62.2%
mul-1-neg62.2%
+-commutative62.2%
associate--l+62.2%
mul-1-neg62.2%
log-rec62.2%
remove-double-neg62.2%
Simplified62.2%
Taylor expanded in a around inf 54.9%
*-commutative54.9%
Simplified54.9%
if 4.4999999999999998e72 < t Initial program 100.0%
associate-+l-100.0%
associate--l+100.0%
sub-neg100.0%
+-commutative100.0%
*-commutative100.0%
distribute-rgt-neg-in100.0%
fma-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 t around inf 83.8%
neg-mul-183.8%
Simplified83.8%
Taylor expanded in t around inf 83.8%
neg-mul-183.8%
Simplified83.8%
Final simplification66.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 510.0) (log (+ x y)) (+ (* t (+ (/ 1.0 t) -1.0)) -1.0)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 510.0) {
tmp = log((x + y));
} else {
tmp = (t * ((1.0 / t) + -1.0)) + -1.0;
}
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 <= 510.0d0) then
tmp = log((x + y))
else
tmp = (t * ((1.0d0 / t) + (-1.0d0))) + (-1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 510.0) {
tmp = Math.log((x + y));
} else {
tmp = (t * ((1.0 / t) + -1.0)) + -1.0;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 510.0: tmp = math.log((x + y)) else: tmp = (t * ((1.0 / t) + -1.0)) + -1.0 return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 510.0) tmp = log(Float64(x + y)); else tmp = Float64(Float64(t * Float64(Float64(1.0 / t) + -1.0)) + -1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 510.0) tmp = log((x + y)); else tmp = (t * ((1.0 / t) + -1.0)) + -1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 510.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], N[(N[(t * N[(N[(1.0 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 510:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{1}{t} + -1\right) + -1\\
\end{array}
\end{array}
if t < 510Initial program 99.3%
associate-+l-99.3%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-undefine99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in t around inf 8.5%
neg-mul-18.5%
Simplified8.5%
Taylor expanded in t around 0 8.5%
+-commutative8.5%
Simplified8.5%
if 510 < 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 t around inf 74.8%
neg-mul-174.8%
Simplified74.8%
Taylor expanded in t around inf 74.8%
neg-mul-174.8%
Simplified74.8%
expm1-log1p-u0.0%
expm1-undefine0.0%
Applied egg-rr0.0%
sub-neg0.0%
log1p-undefine0.0%
rem-exp-log74.8%
unsub-neg74.8%
metadata-eval74.8%
Simplified74.8%
Taylor expanded in t around inf 74.8%
Final simplification41.1%
(FPCore (x y z t a) :precision binary64 (+ (* t (+ (/ 1.0 t) -1.0)) -1.0))
double code(double x, double y, double z, double t, double a) {
return (t * ((1.0 / t) + -1.0)) + -1.0;
}
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 * ((1.0d0 / t) + (-1.0d0))) + (-1.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return (t * ((1.0 / t) + -1.0)) + -1.0;
}
def code(x, y, z, t, a): return (t * ((1.0 / t) + -1.0)) + -1.0
function code(x, y, z, t, a) return Float64(Float64(t * Float64(Float64(1.0 / t) + -1.0)) + -1.0) end
function tmp = code(x, y, z, t, a) tmp = (t * ((1.0 / t) + -1.0)) + -1.0; end
code[x_, y_, z_, t_, a_] := N[(N[(t * N[(N[(1.0 / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision] + -1.0), $MachinePrecision]
\begin{array}{l}
\\
t \cdot \left(\frac{1}{t} + -1\right) + -1
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 41.1%
neg-mul-141.1%
Simplified41.1%
Taylor expanded in t around inf 38.2%
neg-mul-138.2%
Simplified38.2%
expm1-log1p-u1.4%
expm1-undefine1.4%
Applied egg-rr1.4%
sub-neg1.4%
log1p-undefine1.4%
rem-exp-log38.2%
unsub-neg38.2%
metadata-eval38.2%
Simplified38.2%
Taylor expanded in t around inf 38.3%
Final simplification38.3%
(FPCore (x y z t a) :precision binary64 (- t))
double code(double x, double y, double z, double t, double a) {
return -t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = -t
end function
public static double code(double x, double y, double z, double t, double a) {
return -t;
}
def code(x, y, z, t, a): return -t
function code(x, y, z, t, a) return Float64(-t) end
function tmp = code(x, y, z, t, a) tmp = -t; end
code[x_, y_, z_, t_, a_] := (-t)
\begin{array}{l}
\\
-t
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 41.1%
neg-mul-141.1%
Simplified41.1%
Taylor expanded in t around inf 38.2%
neg-mul-138.2%
Simplified38.2%
(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 2024137
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (+ (log (+ x y)) (+ (- (log z) t) (* (- a 1/2) (log t)))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))