
(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 (+ 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%
cancel-sign-sub-inv99.6%
+-commutative99.6%
*-commutative99.6%
fma-def99.6%
neg-sub099.6%
sub-neg99.6%
+-commutative99.6%
associate--r+99.6%
metadata-eval99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 210.0) (- (+ (log (* z (+ x y))) (* (log t) (- a 0.5))) t) (+ (- (log z) t) (* (log t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 210.0) {
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t;
} else {
tmp = (log(z) - t) + (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) :: tmp
if (log(z) <= 210.0d0) then
tmp = (log((z * (x + y))) + (log(t) * (a - 0.5d0))) - t
else
tmp = (log(z) - t) + (log(t) * a)
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) <= 210.0) {
tmp = (Math.log((z * (x + y))) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = (Math.log(z) - t) + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 210.0: tmp = (math.log((z * (x + y))) + (math.log(t) * (a - 0.5))) - t else: tmp = (math.log(z) - t) + (math.log(t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 210.0) tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = Float64(Float64(log(z) - t) + Float64(log(t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 210.0) tmp = (log((z * (x + y))) + (log(t) * (a - 0.5))) - t; else tmp = (log(z) - t) + (log(t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 210.0], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 210:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log t \cdot a\\
\end{array}
\end{array}
if (log.f64 z) < 210Initial program 99.4%
associate-+l-99.4%
associate--l+99.5%
cancel-sign-sub-inv99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
neg-sub099.5%
sub-neg99.5%
+-commutative99.5%
associate--r+99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
associate-+r-99.4%
fma-udef99.4%
associate--r+99.4%
+-commutative99.4%
sum-log93.3%
Applied egg-rr93.3%
if 210 < (log.f64 z) Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 73.6%
Taylor expanded in a around inf 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification89.7%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 210.0) (- (+ (log (* y z)) (* (log t) (- a 0.5))) t) (+ (- (log z) t) (* (log t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 210.0) {
tmp = (log((y * z)) + (log(t) * (a - 0.5))) - t;
} else {
tmp = (log(z) - t) + (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) :: tmp
if (log(z) <= 210.0d0) then
tmp = (log((y * z)) + (log(t) * (a - 0.5d0))) - t
else
tmp = (log(z) - t) + (log(t) * a)
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) <= 210.0) {
tmp = (Math.log((y * z)) + (Math.log(t) * (a - 0.5))) - t;
} else {
tmp = (Math.log(z) - t) + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 210.0: tmp = (math.log((y * z)) + (math.log(t) * (a - 0.5))) - t else: tmp = (math.log(z) - t) + (math.log(t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 210.0) tmp = Float64(Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))) - t); else tmp = Float64(Float64(log(z) - t) + Float64(log(t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (log(z) <= 210.0) tmp = (log((y * z)) + (log(t) * (a - 0.5))) - t; else tmp = (log(z) - t) + (log(t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 210.0], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 210:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log t \cdot a\\
\end{array}
\end{array}
if (log.f64 z) < 210Initial program 99.4%
associate-+l-99.4%
associate--l+99.5%
cancel-sign-sub-inv99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
neg-sub099.5%
sub-neg99.5%
+-commutative99.5%
associate--r+99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
associate-+r-99.4%
fma-udef99.4%
associate--r+99.4%
+-commutative99.4%
sum-log93.3%
Applied egg-rr93.3%
Taylor expanded in x around 0 60.2%
if 210 < (log.f64 z) Initial program 99.7%
+-commutative99.7%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 73.6%
Taylor expanded in a around inf 84.2%
*-commutative84.2%
Simplified84.2%
Final simplification69.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 710.0) (+ (log (+ x y)) (+ (log z) (* (log t) (- a 0.5)))) (+ (- (log z) t) (* (log t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 710.0) {
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) - t) + (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) :: tmp
if (t <= 710.0d0) then
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) - t) + (log(t) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 710.0) {
tmp = Math.log((x + y)) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) - t) + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 710.0: tmp = math.log((x + y)) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) - t) + (math.log(t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 710.0) tmp = Float64(log(Float64(x + y)) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) - t) + Float64(log(t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 710.0) tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(z) - t) + (log(t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 710.0], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 710:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log t \cdot a\\
\end{array}
\end{array}
if t < 710Initial program 99.2%
associate-+l-99.2%
associate--l+99.3%
cancel-sign-sub-inv99.3%
+-commutative99.3%
*-commutative99.3%
fma-def99.3%
neg-sub099.3%
sub-neg99.3%
+-commutative99.3%
associate--r+99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around 0 98.0%
if 710 < t Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 77.4%
Taylor expanded in a around inf 99.1%
*-commutative99.1%
Simplified99.1%
Final simplification98.6%
(FPCore (x y z t a) :precision binary64 (+ (+ (log (+ x y)) (- (log z) t)) (* (log t) (+ a -0.5))))
double code(double x, double y, double z, double t, double a) {
return (log((x + y)) + (log(z) - t)) + (log(t) * (a + -0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log((x + y)) + (log(z) - t)) + (log(t) * (a + (-0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log((x + y)) + (Math.log(z) - t)) + (Math.log(t) * (a + -0.5));
}
def code(x, y, z, t, a): return (math.log((x + y)) + (math.log(z) - t)) + (math.log(t) * (a + -0.5))
function code(x, y, z, t, a) return Float64(Float64(log(Float64(x + y)) + Float64(log(z) - t)) + Float64(log(t) * Float64(a + -0.5))) end
function tmp = code(x, y, z, t, a) tmp = (log((x + y)) + (log(z) - t)) + (log(t) * (a + -0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \log t \cdot \left(a + -0.5\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 650.0) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (+ (- (log z) t) (* (log t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 650.0) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (log(z) - t) + (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) :: tmp
if (t <= 650.0d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (log(z) - t) + (log(t) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 650.0) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(z) - t) + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 650.0: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(z) - t) + (math.log(t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 650.0) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(z) - t) + Float64(log(t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 650.0) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(z) - t) + (log(t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 650.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 650:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log t \cdot a\\
\end{array}
\end{array}
if t < 650Initial program 99.2%
+-commutative99.2%
associate--l+99.2%
associate-+r+99.2%
+-commutative99.2%
fma-def99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 62.5%
Taylor expanded in t around 0 61.4%
if 650 < t Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 77.4%
Taylor expanded in a around inf 99.1%
*-commutative99.1%
Simplified99.1%
Final simplification81.0%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) + (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(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
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) * (a - 0.5)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5))); 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[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 70.2%
Final simplification70.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.55e-163) (not (<= a 0.028))) (+ (- (log z) t) (* (log t) a)) (- (+ (log (* z (+ x y))) (* (log t) -0.5)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.55e-163) || !(a <= 0.028)) {
tmp = (log(z) - t) + (log(t) * a);
} else {
tmp = (log((z * (x + y))) + (log(t) * -0.5)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.55d-163)) .or. (.not. (a <= 0.028d0))) then
tmp = (log(z) - t) + (log(t) * a)
else
tmp = (log((z * (x + y))) + (log(t) * (-0.5d0))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.55e-163) || !(a <= 0.028)) {
tmp = (Math.log(z) - t) + (Math.log(t) * a);
} else {
tmp = (Math.log((z * (x + y))) + (Math.log(t) * -0.5)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.55e-163) or not (a <= 0.028): tmp = (math.log(z) - t) + (math.log(t) * a) else: tmp = (math.log((z * (x + y))) + (math.log(t) * -0.5)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.55e-163) || !(a <= 0.028)) tmp = Float64(Float64(log(z) - t) + Float64(log(t) * a)); else tmp = Float64(Float64(log(Float64(z * Float64(x + y))) + Float64(log(t) * -0.5)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.55e-163) || ~((a <= 0.028))) tmp = (log(z) - t) + (log(t) * a); else tmp = (log((z * (x + y))) + (log(t) * -0.5)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.55e-163], N[Not[LessEqual[a, 0.028]], $MachinePrecision]], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{-163} \lor \neg \left(a \leq 0.028\right):\\
\;\;\;\;\left(\log z - t\right) + \log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(z \cdot \left(x + y\right)\right) + \log t \cdot -0.5\right) - t\\
\end{array}
\end{array}
if a < -1.54999999999999987e-163 or 0.0280000000000000006 < a Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 74.8%
Taylor expanded in a around inf 96.6%
*-commutative96.6%
Simplified96.6%
if -1.54999999999999987e-163 < a < 0.0280000000000000006Initial program 99.3%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in a around 0 96.7%
*-commutative96.7%
associate-+r+96.6%
log-prod74.8%
+-commutative74.8%
Simplified74.8%
Final simplification88.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.38e-163) (not (<= a 0.00125))) (+ (- (log z) t) (* (log t) a)) (- (+ (log (* y z)) (* (log t) -0.5)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.38e-163) || !(a <= 0.00125)) {
tmp = (log(z) - t) + (log(t) * a);
} else {
tmp = (log((y * z)) + (log(t) * -0.5)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.38d-163)) .or. (.not. (a <= 0.00125d0))) then
tmp = (log(z) - t) + (log(t) * a)
else
tmp = (log((y * z)) + (log(t) * (-0.5d0))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.38e-163) || !(a <= 0.00125)) {
tmp = (Math.log(z) - t) + (Math.log(t) * a);
} else {
tmp = (Math.log((y * z)) + (Math.log(t) * -0.5)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.38e-163) or not (a <= 0.00125): tmp = (math.log(z) - t) + (math.log(t) * a) else: tmp = (math.log((y * z)) + (math.log(t) * -0.5)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.38e-163) || !(a <= 0.00125)) tmp = Float64(Float64(log(z) - t) + Float64(log(t) * a)); else tmp = Float64(Float64(log(Float64(y * z)) + Float64(log(t) * -0.5)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.38e-163) || ~((a <= 0.00125))) tmp = (log(z) - t) + (log(t) * a); else tmp = (log((y * z)) + (log(t) * -0.5)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.38e-163], N[Not[LessEqual[a, 0.00125]], $MachinePrecision]], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.38 \cdot 10^{-163} \lor \neg \left(a \leq 0.00125\right):\\
\;\;\;\;\left(\log z - t\right) + \log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \log t \cdot -0.5\right) - t\\
\end{array}
\end{array}
if a < -1.37999999999999999e-163 or 0.00125000000000000003 < a Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 74.8%
Taylor expanded in a around inf 96.6%
*-commutative96.6%
Simplified96.6%
if -1.37999999999999999e-163 < a < 0.00125000000000000003Initial program 99.3%
+-commutative99.3%
associate--l+99.4%
associate-+r+99.4%
+-commutative99.4%
fma-def99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 62.1%
Taylor expanded in a around 0 61.2%
*-commutative61.2%
associate-+r+61.2%
log-prod43.9%
Simplified43.9%
Final simplification77.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.4e+56) (not (<= a 1.06e+52))) (* (log t) a) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.4e+56) || !(a <= 1.06e+52)) {
tmp = log(t) * a;
} else {
tmp = log((x + y)) + (log(z) - 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 <= (-2.4d+56)) .or. (.not. (a <= 1.06d+52))) then
tmp = log(t) * a
else
tmp = log((x + y)) + (log(z) - 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 <= -2.4e+56) || !(a <= 1.06e+52)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log((x + y)) + (Math.log(z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.4e+56) or not (a <= 1.06e+52): tmp = math.log(t) * a else: tmp = math.log((x + y)) + (math.log(z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.4e+56) || !(a <= 1.06e+52)) tmp = Float64(log(t) * a); else tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.4e+56) || ~((a <= 1.06e+52))) tmp = log(t) * a; else tmp = log((x + y)) + (log(z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.4e+56], N[Not[LessEqual[a, 1.06e+52]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+56} \lor \neg \left(a \leq 1.06 \cdot 10^{+52}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\end{array}
\end{array}
if a < -2.40000000000000013e56 or 1.0599999999999999e52 < a Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 74.7%
flip--32.4%
metadata-eval32.4%
metadata-eval32.4%
fma-neg32.4%
metadata-eval32.4%
metadata-eval32.4%
associate-*r/32.3%
associate-*l/32.3%
associate-/r/32.4%
clear-num32.3%
clear-num32.4%
metadata-eval32.4%
metadata-eval32.4%
fma-neg32.4%
metadata-eval32.4%
metadata-eval32.4%
flip--74.5%
sub-neg74.5%
metadata-eval74.5%
Applied egg-rr74.5%
Taylor expanded in a around inf 80.7%
*-commutative80.7%
Simplified80.7%
if -2.40000000000000013e56 < a < 1.0599999999999999e52Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
cancel-sign-sub-inv99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
neg-sub099.5%
sub-neg99.5%
+-commutative99.5%
associate--r+99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 58.4%
Final simplification69.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 8e-81) (+ (log (* y z)) (* (log t) (+ a -0.5))) (+ (- (log z) t) (* (log t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 8e-81) {
tmp = log((y * z)) + (log(t) * (a + -0.5));
} else {
tmp = (log(z) - t) + (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) :: tmp
if (t <= 8d-81) then
tmp = log((y * z)) + (log(t) * (a + (-0.5d0)))
else
tmp = (log(z) - t) + (log(t) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 8e-81) {
tmp = Math.log((y * z)) + (Math.log(t) * (a + -0.5));
} else {
tmp = (Math.log(z) - t) + (Math.log(t) * a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 8e-81: tmp = math.log((y * z)) + (math.log(t) * (a + -0.5)) else: tmp = (math.log(z) - t) + (math.log(t) * a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 8e-81) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a + -0.5))); else tmp = Float64(Float64(log(z) - t) + Float64(log(t) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 8e-81) tmp = log((y * z)) + (log(t) * (a + -0.5)); else tmp = (log(z) - t) + (log(t) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 8e-81], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 8 \cdot 10^{-81}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a + -0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \log t \cdot a\\
\end{array}
\end{array}
if t < 7.9999999999999997e-81Initial program 99.2%
+-commutative99.2%
associate--l+99.2%
associate-+r+99.3%
+-commutative99.3%
fma-def99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 60.1%
Taylor expanded in t around 0 60.1%
associate-+r+60.1%
log-prod46.6%
sub-neg46.6%
metadata-eval46.6%
Simplified46.6%
if 7.9999999999999997e-81 < t Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.7%
+-commutative99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 75.7%
Taylor expanded in a around inf 91.2%
*-commutative91.2%
Simplified91.2%
Final simplification75.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 1.02e+30) (+ (log (+ x y)) (* (log t) a)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.02e+30) {
tmp = log((x + y)) + (log(t) * a);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 1.02d+30) then
tmp = log((x + y)) + (log(t) * a)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 1.02e+30) {
tmp = Math.log((x + y)) + (Math.log(t) * a);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 1.02e+30: tmp = math.log((x + y)) + (math.log(t) * a) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 1.02e+30) tmp = Float64(log(Float64(x + y)) + Float64(log(t) * a)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 1.02e+30) tmp = log((x + y)) + (log(t) * a); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 1.02e+30], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.02 \cdot 10^{+30}:\\
\;\;\;\;\log \left(x + y\right) + \log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 1.02e30Initial program 99.3%
associate-+l-99.3%
associate--l+99.3%
cancel-sign-sub-inv99.3%
+-commutative99.3%
*-commutative99.3%
fma-def99.3%
neg-sub099.3%
sub-neg99.3%
+-commutative99.3%
associate--r+99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in a around inf 61.3%
*-commutative61.3%
Simplified61.3%
if 1.02e30 < t Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 78.4%
Taylor expanded in t around inf 74.3%
mul-1-neg74.3%
Simplified74.3%
Final simplification67.4%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (* (log t) a)))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(t) * 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(t) * a)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(t) * a);
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(t) * a)
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(t) * a)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(t) * a); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \log t \cdot a
\end{array}
Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 70.2%
Taylor expanded in a around inf 79.4%
*-commutative79.4%
Simplified79.4%
Final simplification79.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.25e+56) (not (<= a 6e+54))) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.25e+56) || !(a <= 6e+54)) {
tmp = log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.25d+56)) .or. (.not. (a <= 6d+54))) then
tmp = log(t) * a
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.25e+56) || !(a <= 6e+54)) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.25e+56) or not (a <= 6e+54): tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.25e+56) || !(a <= 6e+54)) tmp = Float64(log(t) * a); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.25e+56) || ~((a <= 6e+54))) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.25e+56], N[Not[LessEqual[a, 6e+54]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.25 \cdot 10^{+56} \lor \neg \left(a \leq 6 \cdot 10^{+54}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -1.25000000000000006e56 or 5.9999999999999998e54 < a Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 74.7%
flip--32.4%
metadata-eval32.4%
metadata-eval32.4%
fma-neg32.4%
metadata-eval32.4%
metadata-eval32.4%
associate-*r/32.3%
associate-*l/32.3%
associate-/r/32.4%
clear-num32.3%
clear-num32.4%
metadata-eval32.4%
metadata-eval32.4%
fma-neg32.4%
metadata-eval32.4%
metadata-eval32.4%
flip--74.5%
sub-neg74.5%
metadata-eval74.5%
Applied egg-rr74.5%
Taylor expanded in a around inf 80.7%
*-commutative80.7%
Simplified80.7%
if -1.25000000000000006e56 < a < 5.9999999999999998e54Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 66.0%
Taylor expanded in t around inf 51.6%
mul-1-neg51.6%
Simplified51.6%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.5e+55) (not (<= a 1.95e+52))) (* (log t) a) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.5e+55) || !(a <= 1.95e+52)) {
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 <= (-4.5d+55)) .or. (.not. (a <= 1.95d+52))) 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 <= -4.5e+55) || !(a <= 1.95e+52)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.5e+55) or not (a <= 1.95e+52): 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 <= -4.5e+55) || !(a <= 1.95e+52)) 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 <= -4.5e+55) || ~((a <= 1.95e+52))) tmp = log(t) * a; else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.5e+55], N[Not[LessEqual[a, 1.95e+52]], $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 -4.5 \cdot 10^{+55} \lor \neg \left(a \leq 1.95 \cdot 10^{+52}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -4.49999999999999998e55 or 1.95e52 < a Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 74.7%
flip--32.4%
metadata-eval32.4%
metadata-eval32.4%
fma-neg32.4%
metadata-eval32.4%
metadata-eval32.4%
associate-*r/32.3%
associate-*l/32.3%
associate-/r/32.4%
clear-num32.3%
clear-num32.4%
metadata-eval32.4%
metadata-eval32.4%
fma-neg32.4%
metadata-eval32.4%
metadata-eval32.4%
flip--74.5%
sub-neg74.5%
metadata-eval74.5%
Applied egg-rr74.5%
Taylor expanded in a around inf 80.7%
*-commutative80.7%
Simplified80.7%
if -4.49999999999999998e55 < a < 1.95e52Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
cancel-sign-sub-inv99.5%
+-commutative99.5%
*-commutative99.5%
fma-def99.5%
neg-sub099.5%
sub-neg99.5%
+-commutative99.5%
associate--r+99.5%
metadata-eval99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in t around inf 56.8%
mul-1-neg56.8%
Simplified56.8%
Taylor expanded in x around 0 45.6%
Final simplification62.6%
(FPCore (x y z t a) :precision binary64 (if (<= t 580.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 580.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 <= 580.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 <= 580.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 580.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 580.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 <= 580.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 580.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 580:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 580Initial program 99.2%
associate-+l-99.2%
associate--l+99.3%
cancel-sign-sub-inv99.3%
+-commutative99.3%
*-commutative99.3%
fma-def99.3%
neg-sub099.3%
sub-neg99.3%
+-commutative99.3%
associate--r+99.3%
metadata-eval99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around inf 8.7%
mul-1-neg8.7%
Simplified8.7%
Taylor expanded in t around 0 8.9%
+-commutative8.9%
Simplified8.9%
if 580 < t Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 77.4%
Taylor expanded in t around inf 68.6%
mul-1-neg68.6%
Simplified68.6%
Final simplification39.9%
(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%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 70.2%
Taylor expanded in t around inf 37.0%
mul-1-neg37.0%
Simplified37.0%
Final simplification37.0%
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t)))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = log((x + y)) + ((log(z) - t) + ((a - 0.5d0) * log(t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log((x + y)) + ((Math.log(z) - t) + ((a - 0.5) * Math.log(t)));
}
def code(x, y, z, t, a): return math.log((x + y)) + ((math.log(z) - t) + ((a - 0.5) * math.log(t)))
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(Float64(log(z) - t) + Float64(Float64(a - 0.5) * log(t)))) end
function tmp = code(x, y, z, t, a) tmp = log((x + y)) + ((log(z) - t) + ((a - 0.5) * log(t))); end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\left(\log z - t\right) + \left(a - 0.5\right) \cdot \log t\right)
\end{array}
herbie shell --seed 2023297
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))