
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (- (log z) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.6%
associate-+l-99.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%
(FPCore (x y z t a) :precision binary64 (if (<= (+ (log (+ x y)) (log z)) 720.0) (- (+ (log (* (+ x y) z)) (* (log t) (- a 0.5))) t) (+ (* (log t) a) (+ (log z) (log y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((log((x + y)) + log(z)) <= 720.0) {
tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5))) - t;
} else {
tmp = (log(t) * a) + (log(z) + log(y));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((log((x + y)) + log(z)) <= 720.0d0) then
tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5d0))) - t
else
tmp = (log(t) * a) + (log(z) + log(y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((Math.log((x + y)) + Math.log(z)) <= 720.0) {
tmp = (Math.log(((x + y) * z)) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = (Math.log(t) * a) + (Math.log(z) + Math.log(y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (math.log((x + y)) + math.log(z)) <= 720.0: tmp = (math.log(((x + y) * z)) + (math.log(t) * (a - 0.5))) - t else: tmp = (math.log(t) * a) + (math.log(z) + math.log(y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (Float64(log(Float64(x + y)) + log(z)) <= 720.0) tmp = Float64(Float64(log(Float64(Float64(x + y) * z)) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = Float64(Float64(log(t) * a) + Float64(log(z) + log(y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((log((x + y)) + log(z)) <= 720.0) tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5))) - t; else tmp = (log(t) * a) + (log(z) + log(y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision], 720.0], N[(N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log \left(x + y\right) + \log z \leq 720:\\
\;\;\;\;\left(\log \left(\left(x + y\right) \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a + \left(\log z + \log y\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 720Initial 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%
associate-+r-99.6%
fma-undefine99.6%
associate--r+99.6%
+-commutative99.6%
sum-log97.3%
Applied egg-rr97.3%
if 720 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) 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 a around inf 48.1%
mul-1-neg48.1%
*-commutative48.1%
distribute-rgt-neg-in48.1%
Simplified48.1%
Taylor expanded in x around 0 42.2%
associate-*r*42.2%
neg-mul-142.2%
cancel-sign-sub42.2%
+-commutative42.2%
Simplified42.2%
Final simplification85.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))))
(if (<= (+ t_1 (log z)) 720.0)
(- (+ (log (* (+ x y) z)) (* (log t) (- a 0.5))) t)
(+ t_1 (* (log t) a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double tmp;
if ((t_1 + log(z)) <= 720.0) {
tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5))) - t;
} 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) :: tmp
t_1 = log((x + y))
if ((t_1 + log(z)) <= 720.0d0) then
tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5d0))) - t
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 tmp;
if ((t_1 + Math.log(z)) <= 720.0) {
tmp = (Math.log(((x + y) * z)) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = t_1 + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) tmp = 0 if (t_1 + math.log(z)) <= 720.0: tmp = (math.log(((x + y) * z)) + (math.log(t) * (a - 0.5))) - t else: tmp = t_1 + (math.log(t) * a) return tmp
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) tmp = 0.0 if (Float64(t_1 + log(z)) <= 720.0) tmp = Float64(Float64(log(Float64(Float64(x + y) * z)) + Float64(log(t) * Float64(a - 0.5))) - t); 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)); tmp = 0.0; if ((t_1 + log(z)) <= 720.0) tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5))) - t; 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]}, If[LessEqual[N[(t$95$1 + N[Log[z], $MachinePrecision]), $MachinePrecision], 720.0], N[(N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(t$95$1 + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
\mathbf{if}\;t\_1 + \log z \leq 720:\\
\;\;\;\;\left(\log \left(\left(x + y\right) \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \log t \cdot a\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 720Initial 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%
associate-+r-99.6%
fma-undefine99.6%
associate--r+99.6%
+-commutative99.6%
sum-log97.3%
Applied egg-rr97.3%
if 720 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) 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 a around inf 46.5%
*-commutative46.5%
Simplified46.5%
Final simplification86.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))))
(if (<= (+ t_1 (log z)) 720.0)
(- (+ (* (log t) (- a 0.5)) (log (* y z))) t)
(+ t_1 (* (log t) a)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double tmp;
if ((t_1 + log(z)) <= 720.0) {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
} 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) :: tmp
t_1 = log((x + y))
if ((t_1 + log(z)) <= 720.0d0) then
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
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 tmp;
if ((t_1 + Math.log(z)) <= 720.0) {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
} else {
tmp = t_1 + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) tmp = 0 if (t_1 + math.log(z)) <= 720.0: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t else: tmp = t_1 + (math.log(t) * a) return tmp
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) tmp = 0.0 if (Float64(t_1 + log(z)) <= 720.0) tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); 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)); tmp = 0.0; if ((t_1 + log(z)) <= 720.0) tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; 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]}, If[LessEqual[N[(t$95$1 + N[Log[z], $MachinePrecision]), $MachinePrecision], 720.0], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], 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)\\
\mathbf{if}\;t\_1 + \log z \leq 720:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \log t \cdot a\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 720Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
add-cube-cbrt97.9%
pow397.8%
Applied egg-rr95.5%
Taylor expanded in x around 0 57.2%
if 720 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) 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 a around inf 46.5%
*-commutative46.5%
Simplified46.5%
Final simplification54.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.43) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (+ (log y) (+ (log z) (* (log t) a))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.43) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(y) + (log(z) + (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 <= 0.43d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(y) + (log(z) + (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 <= 0.43) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(y) + (Math.log(z) + (Math.log(t) * a))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.43: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(y) + (math.log(z) + (math.log(t) * a))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.43) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * a))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.43) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(y) + (log(z) + (log(t) * a))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.43], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.43:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \left(\log z + \log t \cdot a\right)\right) - t\\
\end{array}
\end{array}
if t < 0.429999999999999993Initial 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 x around 0 61.7%
Taylor expanded in t around 0 61.7%
associate--l+61.7%
*-commutative61.7%
Simplified61.7%
if 0.429999999999999993 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-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 71.3%
Taylor expanded in a around inf 69.7%
mul-1-neg69.7%
distribute-rgt-neg-in69.7%
Simplified69.7%
Taylor expanded in a around 0 69.7%
Final simplification65.6%
(FPCore (x y z t a)
:precision binary64
(if (<= t 65000000000000.0)
(+ (log y) (- (log z) (* (log t) (- 0.5 a))))
(if (<= t 1.05e+173)
(- (+ (log (* y z)) (* (log t) (- a 0.5))) t)
(- (log y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 65000000000000.0) {
tmp = log(y) + (log(z) - (log(t) * (0.5 - a)));
} else if (t <= 1.05e+173) {
tmp = (log((y * z)) + (log(t) * (a - 0.5))) - 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 (t <= 65000000000000.0d0) then
tmp = log(y) + (log(z) - (log(t) * (0.5d0 - a)))
else if (t <= 1.05d+173) then
tmp = (log((y * z)) + (log(t) * (a - 0.5d0))) - 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 (t <= 65000000000000.0) {
tmp = Math.log(y) + (Math.log(z) - (Math.log(t) * (0.5 - a)));
} else if (t <= 1.05e+173) {
tmp = (Math.log((y * z)) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 65000000000000.0: tmp = math.log(y) + (math.log(z) - (math.log(t) * (0.5 - a))) elif t <= 1.05e+173: tmp = (math.log((y * z)) + (math.log(t) * (a - 0.5))) - t else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 65000000000000.0) tmp = Float64(log(y) + Float64(log(z) - Float64(log(t) * Float64(0.5 - a)))); elseif (t <= 1.05e+173) tmp = Float64(Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 65000000000000.0) tmp = log(y) + (log(z) - (log(t) * (0.5 - a))); elseif (t <= 1.05e+173) tmp = (log((y * z)) + (log(t) * (a - 0.5))) - t; else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 65000000000000.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.05e+173], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 65000000000000:\\
\;\;\;\;\log y + \left(\log z - \log t \cdot \left(0.5 - a\right)\right)\\
\mathbf{elif}\;t \leq 1.05 \cdot 10^{+173}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if t < 6.5e13Initial program 99.3%
associate-+l-99.3%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 63.2%
Taylor expanded in t around 0 61.5%
associate--l+61.5%
*-commutative61.5%
Simplified61.5%
if 6.5e13 < t < 1.05e173Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-cube-cbrt97.6%
pow397.7%
Applied egg-rr83.8%
Taylor expanded in x around 0 44.3%
if 1.05e173 < 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 96.8%
neg-mul-196.8%
Simplified96.8%
Taylor expanded in x around 0 74.8%
Final simplification60.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.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (log y)) (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) + log(y)) + ((log(t) * (a - 0.5d0)) - t)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + Math.log(y)) + ((Math.log(t) * (a - 0.5)) - t);
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) + ((math.log(t) * (a - 0.5)) - t)
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-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 x around 0 66.3%
Final simplification66.3%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (- (log y) (* (log t) (- 0.5 a)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) - (log(t) * (0.5 - a)));
}
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(y) - (log(t) * (0.5d0 - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(y) - (Math.log(t) * (0.5 - a)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) - (math.log(t) * (0.5 - a)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) - Float64(log(t) * Float64(0.5 - a)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(y) - (log(t) * (0.5 - a))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log y - \log t \cdot \left(0.5 - a\right)\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 66.3%
Final simplification66.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3e+29) (not (<= a 1.55e+41))) (* (log t) a) (+ (log z) (- (log (+ x y)) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e+29) || !(a <= 1.55e+41)) {
tmp = log(t) * a;
} else {
tmp = log(z) + (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 <= (-3d+29)) .or. (.not. (a <= 1.55d+41))) then
tmp = log(t) * a
else
tmp = log(z) + (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 <= -3e+29) || !(a <= 1.55e+41)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log(z) + (Math.log((x + y)) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3e+29) or not (a <= 1.55e+41): tmp = math.log(t) * a else: tmp = math.log(z) + (math.log((x + y)) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3e+29) || !(a <= 1.55e+41)) tmp = Float64(log(t) * a); else tmp = Float64(log(z) + Float64(log(Float64(x + y)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3e+29) || ~((a <= 1.55e+41))) tmp = log(t) * a; else tmp = log(z) + (log((x + y)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3e+29], N[Not[LessEqual[a, 1.55e+41]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+29} \lor \neg \left(a \leq 1.55 \cdot 10^{+41}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) - t\right)\\
\end{array}
\end{array}
if a < -2.9999999999999999e29 or 1.55e41 < 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.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 81.5%
Taylor expanded in a around inf 85.5%
if -2.9999999999999999e29 < a < 1.55e41Initial program 99.5%
associate-+l-99.5%
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 99.0%
mul-1-neg99.0%
unsub-neg99.0%
*-commutative99.0%
log-rec99.0%
Simplified99.0%
Taylor expanded in a around inf 62.6%
Taylor expanded in a around 0 59.6%
associate--l+59.6%
Simplified59.6%
Final simplification69.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (log (+ x y))) (t_2 (* (log t) a)))
(if (<= a -1.32e+29)
t_2
(if (<= a 1.75e+41) (+ (log z) (- t_1 t)) (+ t_1 t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y));
double t_2 = log(t) * a;
double tmp;
if (a <= -1.32e+29) {
tmp = t_2;
} else if (a <= 1.75e+41) {
tmp = log(z) + (t_1 - t);
} else {
tmp = t_1 + t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log((x + y))
t_2 = log(t) * a
if (a <= (-1.32d+29)) then
tmp = t_2
else if (a <= 1.75d+41) then
tmp = log(z) + (t_1 - t)
else
tmp = t_1 + t_2
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 = Math.log(t) * a;
double tmp;
if (a <= -1.32e+29) {
tmp = t_2;
} else if (a <= 1.75e+41) {
tmp = Math.log(z) + (t_1 - t);
} else {
tmp = t_1 + t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) t_2 = math.log(t) * a tmp = 0 if a <= -1.32e+29: tmp = t_2 elif a <= 1.75e+41: tmp = math.log(z) + (t_1 - t) else: tmp = t_1 + t_2 return tmp
function code(x, y, z, t, a) t_1 = log(Float64(x + y)) t_2 = Float64(log(t) * a) tmp = 0.0 if (a <= -1.32e+29) tmp = t_2; elseif (a <= 1.75e+41) tmp = Float64(log(z) + Float64(t_1 - t)); else tmp = Float64(t_1 + t_2); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)); t_2 = log(t) * a; tmp = 0.0; if (a <= -1.32e+29) tmp = t_2; elseif (a <= 1.75e+41) tmp = log(z) + (t_1 - t); else tmp = t_1 + t_2; 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[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -1.32e+29], t$95$2, If[LessEqual[a, 1.75e+41], N[(N[Log[z], $MachinePrecision] + N[(t$95$1 - t), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + t$95$2), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right)\\
t_2 := \log t \cdot a\\
\mathbf{if}\;a \leq -1.32 \cdot 10^{+29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 1.75 \cdot 10^{+41}:\\
\;\;\;\;\log z + \left(t\_1 - t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + t\_2\\
\end{array}
\end{array}
if a < -1.32e29Initial 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.8%
Taylor expanded in a around inf 86.6%
if -1.32e29 < a < 1.75e41Initial program 99.5%
associate-+l-99.5%
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 99.0%
mul-1-neg99.0%
unsub-neg99.0%
*-commutative99.0%
log-rec99.0%
Simplified99.0%
Taylor expanded in a around inf 62.6%
Taylor expanded in a around 0 59.6%
associate--l+59.6%
Simplified59.6%
if 1.75e41 < 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.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 84.3%
*-commutative84.3%
Simplified84.3%
Final simplification69.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.5e+31) (not (<= a 1.55e+41))) (* (log t) a) (+ (log z) (- (log y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.5e+31) || !(a <= 1.55e+41)) {
tmp = log(t) * a;
} else {
tmp = log(z) + (log(y) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.5d+31)) .or. (.not. (a <= 1.55d+41))) then
tmp = log(t) * a
else
tmp = log(z) + (log(y) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.5e+31) || !(a <= 1.55e+41)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log(z) + (Math.log(y) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.5e+31) or not (a <= 1.55e+41): tmp = math.log(t) * a else: tmp = math.log(z) + (math.log(y) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.5e+31) || !(a <= 1.55e+41)) tmp = Float64(log(t) * a); else tmp = Float64(log(z) + Float64(log(y) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.5e+31) || ~((a <= 1.55e+41))) tmp = log(t) * a; else tmp = log(z) + (log(y) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.5e+31], N[Not[LessEqual[a, 1.55e+41]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.5 \cdot 10^{+31} \lor \neg \left(a \leq 1.55 \cdot 10^{+41}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log z + \left(\log y - t\right)\\
\end{array}
\end{array}
if a < -1.49999999999999995e31 or 1.55e41 < 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.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 81.5%
Taylor expanded in a around inf 85.5%
if -1.49999999999999995e31 < a < 1.55e41Initial program 99.5%
associate-+l-99.5%
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 x around 0 56.7%
Taylor expanded in a around inf 42.1%
mul-1-neg42.1%
distribute-rgt-neg-in42.1%
Simplified42.1%
Taylor expanded in a around 0 39.8%
+-commutative39.8%
associate--l+39.8%
Simplified39.8%
Final simplification57.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 4100000000000.0) (+ (* (log t) (+ a -0.5)) (log (* y z))) (+ (log z) (- (log y) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4100000000000.0) {
tmp = (log(t) * (a + -0.5)) + log((y * z));
} else {
tmp = log(z) + (log(y) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 4100000000000.0d0) then
tmp = (log(t) * (a + (-0.5d0))) + log((y * z))
else
tmp = log(z) + (log(y) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4100000000000.0) {
tmp = (Math.log(t) * (a + -0.5)) + Math.log((y * z));
} else {
tmp = Math.log(z) + (Math.log(y) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4100000000000.0: tmp = (math.log(t) * (a + -0.5)) + math.log((y * z)) else: tmp = math.log(z) + (math.log(y) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4100000000000.0) tmp = Float64(Float64(log(t) * Float64(a + -0.5)) + log(Float64(y * z))); else tmp = Float64(log(z) + Float64(log(y) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 4100000000000.0) tmp = (log(t) * (a + -0.5)) + log((y * z)); else tmp = log(z) + (log(y) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4100000000000.0], N[(N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 4100000000000:\\
\;\;\;\;\log t \cdot \left(a + -0.5\right) + \log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\log z + \left(\log y - t\right)\\
\end{array}
\end{array}
if t < 4.1e12Initial program 99.3%
associate--l+99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
fma-define99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
add-cube-cbrt97.8%
pow397.7%
Applied egg-rr71.4%
Taylor expanded in t around inf 56.4%
Taylor expanded in x around 0 33.9%
associate--l+33.9%
sub-neg33.9%
metadata-eval33.9%
associate-*r/33.9%
associate-*r*33.9%
mul-1-neg33.9%
log-rec33.9%
remove-double-neg33.9%
sub-neg33.9%
*-commutative33.9%
metadata-eval33.9%
Simplified33.9%
Taylor expanded in t around 0 44.3%
+-commutative44.3%
sub-neg44.3%
metadata-eval44.3%
*-commutative44.3%
Simplified44.3%
if 4.1e12 < 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 70.6%
Taylor expanded in a around inf 70.5%
mul-1-neg70.5%
distribute-rgt-neg-in70.5%
Simplified70.5%
Taylor expanded in a around 0 54.8%
+-commutative54.8%
associate--l+54.8%
Simplified54.8%
Final simplification49.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9.2e+30) (not (<= a 1.55e+41))) (* (log t) a) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.2e+30) || !(a <= 1.55e+41)) {
tmp = log(t) * a;
} else {
tmp = log(y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-9.2d+30)) .or. (.not. (a <= 1.55d+41))) then
tmp = log(t) * a
else
tmp = log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9.2e+30) || !(a <= 1.55e+41)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9.2e+30) or not (a <= 1.55e+41): tmp = math.log(t) * a else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -9.2e+30) || !(a <= 1.55e+41)) tmp = Float64(log(t) * a); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -9.2e+30) || ~((a <= 1.55e+41))) tmp = log(t) * a; else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9.2e+30], N[Not[LessEqual[a, 1.55e+41]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9.2 \cdot 10^{+30} \lor \neg \left(a \leq 1.55 \cdot 10^{+41}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -9.2e30 or 1.55e41 < 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.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 81.5%
Taylor expanded in a around inf 85.5%
if -9.2e30 < a < 1.55e41Initial program 99.5%
associate-+l-99.5%
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 57.9%
neg-mul-157.9%
Simplified57.9%
Taylor expanded in x around 0 38.8%
Final simplification56.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 65000000000000.0) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 65000000000000.0) {
tmp = log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 65000000000000.0d0) then
tmp = log(t) * a
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 65000000000000.0) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 65000000000000.0: tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 65000000000000.0) tmp = Float64(log(t) * a); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 65000000000000.0) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 65000000000000.0], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 65000000000000:\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 6.5e13Initial program 99.3%
associate-+l-99.3%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in x around 0 63.2%
Taylor expanded in a around inf 50.0%
if 6.5e13 < 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 70.1%
Taylor expanded in t around inf 80.4%
neg-mul-180.4%
Simplified80.4%
Final simplification63.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 250.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 250.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 <= 250.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 <= 250.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 250.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 250.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 <= 250.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 250.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 250:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 250Initial 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 10.1%
neg-mul-110.1%
Simplified10.1%
Taylor expanded in t around 0 10.1%
+-commutative10.1%
Simplified10.1%
if 250 < 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 71.0%
Taylor expanded in t around inf 75.6%
neg-mul-175.6%
Simplified75.6%
Final simplification41.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 390.0) (log (* y z)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 390.0) {
tmp = log((y * z));
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 390.0d0) then
tmp = log((y * z))
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 390.0) {
tmp = Math.log((y * z));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 390.0: tmp = math.log((y * z)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 390.0) tmp = log(Float64(y * z)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 390.0) tmp = log((y * z)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 390.0], N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 390:\\
\;\;\;\;\log \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 390Initial 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 a around inf 57.0%
mul-1-neg57.0%
*-commutative57.0%
distribute-rgt-neg-in57.0%
Simplified57.0%
Taylor expanded in a around 0 11.9%
Taylor expanded in x around 0 7.9%
+-commutative7.9%
Simplified7.9%
sum-log5.9%
*-un-lft-identity5.9%
Applied egg-rr5.9%
*-lft-identity5.9%
Simplified5.9%
if 390 < 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 71.0%
Taylor expanded in t around inf 75.6%
neg-mul-175.6%
Simplified75.6%
Final simplification39.1%
(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 x around 0 66.3%
Taylor expanded in t around inf 37.5%
neg-mul-137.5%
Simplified37.5%
(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 2024085
(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))))