
(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 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log z) (- (log (+ x y)) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log(z) + (log((x + y)) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(z) + Float64(log(Float64(x + y)) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log z + \left(\log \left(x + y\right) - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
+-commutative99.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%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -0.6) (not (<= (- a 0.5) -0.48))) (- (+ (log y) (* (log t) a)) t) (- (+ (log y) (+ (log z) (* (log t) -0.5))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -0.6) || !((a - 0.5) <= -0.48)) {
tmp = (log(y) + (log(t) * a)) - t;
} else {
tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (((a - 0.5d0) <= (-0.6d0)) .or. (.not. ((a - 0.5d0) <= (-0.48d0)))) then
tmp = (log(y) + (log(t) * a)) - t
else
tmp = (log(y) + (log(z) + (log(t) * (-0.5d0)))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -0.6) || !((a - 0.5) <= -0.48)) {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
} else {
tmp = (Math.log(y) + (Math.log(z) + (Math.log(t) * -0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -0.6) or not ((a - 0.5) <= -0.48): tmp = (math.log(y) + (math.log(t) * a)) - t else: tmp = (math.log(y) + (math.log(z) + (math.log(t) * -0.5))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -0.6) || !(Float64(a - 0.5) <= -0.48)) tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); else tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * -0.5))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -0.6) || ~(((a - 0.5) <= -0.48))) tmp = (log(y) + (log(t) * a)) - t; else tmp = (log(y) + (log(z) + (log(t) * -0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -0.6], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.48]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -0.6 \lor \neg \left(a - 0.5 \leq -0.48\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \left(\log z + \log t \cdot -0.5\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a 1/2) < -0.599999999999999978 or -0.47999999999999998 < (-.f64 a 1/2) Initial program 99.7%
Taylor expanded in x around 0 75.3%
Taylor expanded in a around inf 73.6%
*-commutative73.6%
Simplified73.6%
if -0.599999999999999978 < (-.f64 a 1/2) < -0.47999999999999998Initial program 99.5%
Taylor expanded in x around 0 63.7%
Taylor expanded in a around 0 63.4%
*-commutative63.4%
Simplified63.4%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.065) (not (<= a 0.00095))) (- (+ (log y) (* (log t) a)) t) (- (+ (log y) (log (* z (pow t -0.5)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.065) || !(a <= 0.00095)) {
tmp = (log(y) + (log(t) * a)) - t;
} else {
tmp = (log(y) + log((z * pow(t, -0.5)))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-0.065d0)) .or. (.not. (a <= 0.00095d0))) then
tmp = (log(y) + (log(t) * a)) - t
else
tmp = (log(y) + log((z * (t ** (-0.5d0))))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.065) || !(a <= 0.00095)) {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
} else {
tmp = (Math.log(y) + Math.log((z * Math.pow(t, -0.5)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.065) or not (a <= 0.00095): tmp = (math.log(y) + (math.log(t) * a)) - t else: tmp = (math.log(y) + math.log((z * math.pow(t, -0.5)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.065) || !(a <= 0.00095)) tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); else tmp = Float64(Float64(log(y) + log(Float64(z * (t ^ -0.5)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.065) || ~((a <= 0.00095))) tmp = (log(y) + (log(t) * a)) - t; else tmp = (log(y) + log((z * (t ^ -0.5)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.065], N[Not[LessEqual[a, 0.00095]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[Log[N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.065 \lor \neg \left(a \leq 0.00095\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\end{array}
\end{array}
if a < -0.065000000000000002 or 9.49999999999999998e-4 < a Initial program 99.7%
Taylor expanded in x around 0 75.3%
Taylor expanded in a around inf 73.6%
*-commutative73.6%
Simplified73.6%
if -0.065000000000000002 < a < 9.49999999999999998e-4Initial program 99.5%
Taylor expanded in x around 0 63.7%
add-cube-cbrt63.6%
pow363.6%
sub-neg63.6%
metadata-eval63.6%
Applied egg-rr63.6%
Taylor expanded in a around 0 63.4%
pow-base-163.4%
*-lft-identity63.4%
log-pow63.4%
log-prod56.4%
Simplified56.4%
Final simplification64.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -0.038) (not (<= a 0.0051))) (- (+ (log y) (* (log t) a)) t) (- (+ (log z) (log (* y (pow t -0.5)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -0.038) || !(a <= 0.0051)) {
tmp = (log(y) + (log(t) * a)) - t;
} else {
tmp = (log(z) + log((y * pow(t, -0.5)))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-0.038d0)) .or. (.not. (a <= 0.0051d0))) then
tmp = (log(y) + (log(t) * a)) - t
else
tmp = (log(z) + log((y * (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 <= -0.038) || !(a <= 0.0051)) {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
} else {
tmp = (Math.log(z) + Math.log((y * Math.pow(t, -0.5)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -0.038) or not (a <= 0.0051): tmp = (math.log(y) + (math.log(t) * a)) - t else: tmp = (math.log(z) + math.log((y * math.pow(t, -0.5)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -0.038) || !(a <= 0.0051)) tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); else tmp = Float64(Float64(log(z) + log(Float64(y * (t ^ -0.5)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -0.038) || ~((a <= 0.0051))) tmp = (log(y) + (log(t) * a)) - t; else tmp = (log(z) + log((y * (t ^ -0.5)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -0.038], N[Not[LessEqual[a, 0.0051]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.038 \lor \neg \left(a \leq 0.0051\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log \left(y \cdot {t}^{-0.5}\right)\right) - t\\
\end{array}
\end{array}
if a < -0.0379999999999999991 or 0.0051000000000000004 < a Initial program 99.7%
Taylor expanded in x around 0 75.3%
Taylor expanded in a around inf 73.6%
*-commutative73.6%
Simplified73.6%
if -0.0379999999999999991 < a < 0.0051000000000000004Initial program 99.5%
Taylor expanded in a around 0 98.4%
associate-+r+98.3%
log-prod68.6%
*-commutative68.6%
Simplified68.6%
Taylor expanded in y around inf 63.5%
+-commutative63.5%
mul-1-neg63.5%
unsub-neg63.5%
*-commutative63.5%
log-rec63.5%
Simplified63.5%
add-sqr-sqrt20.1%
sqrt-unprod48.3%
sqr-neg48.3%
sqrt-unprod28.2%
add-sqr-sqrt44.0%
unsub-neg44.0%
add-log-exp44.0%
neg-log44.0%
sum-log40.9%
pow-to-exp40.9%
add-exp-log40.9%
neg-log40.9%
add-sqr-sqrt15.5%
sqrt-unprod54.4%
sqr-neg54.4%
sqrt-unprod38.9%
add-sqr-sqrt55.3%
add-exp-log55.5%
Applied egg-rr55.5%
Final simplification64.5%
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log z) (log (+ x y))) t) (* (log t) (- a 0.5))))
double code(double x, double y, double z, double t, double a) {
return ((log(z) + log((x + y))) - 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(z) + log((x + y))) - 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(z) + Math.log((x + y))) - t) + (Math.log(t) * (a - 0.5));
}
def code(x, y, z, t, a): return ((math.log(z) + math.log((x + y))) - t) + (math.log(t) * (a - 0.5))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(z) + log(Float64(x + y))) - t) + Float64(log(t) * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a) tmp = ((log(z) + log((x + y))) - t) + (log(t) * (a - 0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[z], $MachinePrecision] + N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log z + \log \left(x + y\right)\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 y) (+ (log z) (* (log t) (- a 0.5)))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(z) + (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(y) + (log(z) + (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(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5)))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (log(z) + (log(t) * (a - 0.5)))) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\right) - t
\end{array}
Initial program 99.6%
Taylor expanded in x around 0 69.5%
Final simplification69.5%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -3.5e-7)
(not
(or (<= a 2.3e-177) (and (not (<= a 1.16e-108)) (<= a 9.5e-41)))))
(- (+ (log y) (* (log t) a)) t)
(- (log (* z (* y (pow t -0.5)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.5e-7) || !((a <= 2.3e-177) || (!(a <= 1.16e-108) && (a <= 9.5e-41)))) {
tmp = (log(y) + (log(t) * a)) - t;
} else {
tmp = log((z * (y * pow(t, -0.5)))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3.5d-7)) .or. (.not. (a <= 2.3d-177) .or. (.not. (a <= 1.16d-108)) .and. (a <= 9.5d-41))) then
tmp = (log(y) + (log(t) * a)) - t
else
tmp = log((z * (y * (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 <= -3.5e-7) || !((a <= 2.3e-177) || (!(a <= 1.16e-108) && (a <= 9.5e-41)))) {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
} else {
tmp = Math.log((z * (y * Math.pow(t, -0.5)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.5e-7) or not ((a <= 2.3e-177) or (not (a <= 1.16e-108) and (a <= 9.5e-41))): tmp = (math.log(y) + (math.log(t) * a)) - t else: tmp = math.log((z * (y * math.pow(t, -0.5)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.5e-7) || !((a <= 2.3e-177) || (!(a <= 1.16e-108) && (a <= 9.5e-41)))) tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); else tmp = Float64(log(Float64(z * Float64(y * (t ^ -0.5)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.5e-7) || ~(((a <= 2.3e-177) || (~((a <= 1.16e-108)) && (a <= 9.5e-41))))) tmp = (log(y) + (log(t) * a)) - t; else tmp = log((z * (y * (t ^ -0.5)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.5e-7], N[Not[Or[LessEqual[a, 2.3e-177], And[N[Not[LessEqual[a, 1.16e-108]], $MachinePrecision], LessEqual[a, 9.5e-41]]]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(z * N[(y * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{-7} \lor \neg \left(a \leq 2.3 \cdot 10^{-177} \lor \neg \left(a \leq 1.16 \cdot 10^{-108}\right) \land a \leq 9.5 \cdot 10^{-41}\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(z \cdot \left(y \cdot {t}^{-0.5}\right)\right) - t\\
\end{array}
\end{array}
if a < -3.49999999999999984e-7 or 2.30000000000000022e-177 < a < 1.16e-108 or 9.4999999999999997e-41 < a Initial program 99.7%
Taylor expanded in x around 0 72.8%
Taylor expanded in a around inf 68.5%
*-commutative68.5%
Simplified68.5%
if -3.49999999999999984e-7 < a < 2.30000000000000022e-177 or 1.16e-108 < a < 9.4999999999999997e-41Initial program 99.5%
Taylor expanded in a around 0 99.5%
associate-+r+99.5%
log-prod74.9%
*-commutative74.9%
Simplified74.9%
Taylor expanded in y around inf 64.3%
+-commutative64.3%
mul-1-neg64.3%
unsub-neg64.3%
*-commutative64.3%
log-rec64.3%
Simplified64.3%
add-log-exp57.5%
sum-log49.3%
sub-neg49.3%
exp-sum49.3%
pow-to-exp49.4%
remove-double-neg49.4%
add-exp-log49.7%
Applied egg-rr49.7%
Final simplification61.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.02e-17) (not (<= a 1.55e-40))) (- (+ (log y) (* (log t) a)) t) (- (log (* (pow t -0.5) (* z y))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.02e-17) || !(a <= 1.55e-40)) {
tmp = (log(y) + (log(t) * a)) - t;
} else {
tmp = log((pow(t, -0.5) * (z * 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.02d-17)) .or. (.not. (a <= 1.55d-40))) then
tmp = (log(y) + (log(t) * a)) - t
else
tmp = log(((t ** (-0.5d0)) * (z * 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.02e-17) || !(a <= 1.55e-40)) {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
} else {
tmp = Math.log((Math.pow(t, -0.5) * (z * y))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.02e-17) or not (a <= 1.55e-40): tmp = (math.log(y) + (math.log(t) * a)) - t else: tmp = math.log((math.pow(t, -0.5) * (z * y))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.02e-17) || !(a <= 1.55e-40)) tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); else tmp = Float64(log(Float64((t ^ -0.5) * Float64(z * y))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.02e-17) || ~((a <= 1.55e-40))) tmp = (log(y) + (log(t) * a)) - t; else tmp = log(((t ^ -0.5) * (z * y))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.02e-17], N[Not[LessEqual[a, 1.55e-40]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[Power[t, -0.5], $MachinePrecision] * N[(z * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{-17} \lor \neg \left(a \leq 1.55 \cdot 10^{-40}\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left({t}^{-0.5} \cdot \left(z \cdot y\right)\right) - t\\
\end{array}
\end{array}
if a < -1.01999999999999997e-17 or 1.55000000000000005e-40 < a Initial program 99.7%
Taylor expanded in x around 0 73.8%
Taylor expanded in a around inf 70.9%
*-commutative70.9%
Simplified70.9%
if -1.01999999999999997e-17 < a < 1.55000000000000005e-40Initial program 99.5%
Taylor expanded in x around 0 64.2%
add-cube-cbrt64.0%
pow364.0%
sub-neg64.0%
metadata-eval64.0%
Applied egg-rr64.0%
rem-cube-cbrt64.2%
*-commutative64.2%
add-cube-cbrt64.1%
associate-*r*64.1%
pow264.1%
Applied egg-rr64.1%
Taylor expanded in a around 0 64.2%
associate-+r+64.1%
log-prod46.7%
log-pow46.7%
log-prod46.7%
Simplified46.7%
Final simplification60.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.02e-45) (not (<= a 1.32e-40))) (- (+ (log y) (* (log t) a)) t) (- (log (* y (* z (pow t -0.5)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.02e-45) || !(a <= 1.32e-40)) {
tmp = (log(y) + (log(t) * a)) - t;
} else {
tmp = log((y * (z * pow(t, -0.5)))) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.02d-45)) .or. (.not. (a <= 1.32d-40))) then
tmp = (log(y) + (log(t) * a)) - t
else
tmp = log((y * (z * (t ** (-0.5d0))))) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.02e-45) || !(a <= 1.32e-40)) {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
} else {
tmp = Math.log((y * (z * Math.pow(t, -0.5)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.02e-45) or not (a <= 1.32e-40): tmp = (math.log(y) + (math.log(t) * a)) - t else: tmp = math.log((y * (z * math.pow(t, -0.5)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.02e-45) || !(a <= 1.32e-40)) tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); else tmp = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.02e-45) || ~((a <= 1.32e-40))) tmp = (log(y) + (log(t) * a)) - t; else tmp = log((y * (z * (t ^ -0.5)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.02e-45], N[Not[LessEqual[a, 1.32e-40]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.02 \cdot 10^{-45} \lor \neg \left(a \leq 1.32 \cdot 10^{-40}\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\end{array}
\end{array}
if a < -1.0199999999999999e-45 or 1.32000000000000009e-40 < a Initial program 99.7%
Taylor expanded in x around 0 71.9%
Taylor expanded in a around inf 68.3%
*-commutative68.3%
Simplified68.3%
if -1.0199999999999999e-45 < a < 1.32000000000000009e-40Initial program 99.5%
Taylor expanded in x around 0 66.1%
add-cube-cbrt66.0%
pow366.0%
sub-neg66.0%
metadata-eval66.0%
Applied egg-rr66.0%
Taylor expanded in a around 0 66.1%
associate-+r+66.1%
pow-base-166.1%
*-lft-identity66.1%
+-commutative66.1%
remove-double-neg66.1%
log-rec66.1%
mul-1-neg66.1%
associate-+r+66.2%
mul-1-neg66.2%
log-rec66.2%
remove-double-neg66.2%
log-pow66.2%
log-prod57.5%
*-commutative57.5%
log-prod49.9%
associate-*r*52.6%
Simplified52.6%
Final simplification61.7%
(FPCore (x y z t a) :precision binary64 (if (<= t 3.7e+18) (+ (* (log t) (- a 0.5)) (- (log (* z (+ x y))) t)) (- (+ (log y) (* (log t) a)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.7e+18) {
tmp = (log(t) * (a - 0.5)) + (log((z * (x + y))) - t);
} else {
tmp = (log(y) + (log(t) * a)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 3.7d+18) then
tmp = (log(t) * (a - 0.5d0)) + (log((z * (x + y))) - t)
else
tmp = (log(y) + (log(t) * a)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.7e+18) {
tmp = (Math.log(t) * (a - 0.5)) + (Math.log((z * (x + y))) - t);
} else {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.7e+18: tmp = (math.log(t) * (a - 0.5)) + (math.log((z * (x + y))) - t) else: tmp = (math.log(y) + (math.log(t) * a)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.7e+18) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(Float64(z * Float64(x + y))) - t)); else tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.7e+18) tmp = (log(t) * (a - 0.5)) + (log((z * (x + y))) - t); else tmp = (log(y) + (log(t) * a)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.7e+18], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.7 \cdot 10^{+18}:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \left(\log \left(z \cdot \left(x + y\right)\right) - t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\end{array}
\end{array}
if t < 3.7e18Initial program 99.3%
Taylor expanded in z around 0 99.3%
log-prod74.7%
Simplified74.7%
if 3.7e18 < t Initial program 99.9%
Taylor expanded in x around 0 80.4%
Taylor expanded in a around inf 80.4%
*-commutative80.4%
Simplified80.4%
Final simplification77.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 7.5) (+ (* (log t) (- a 0.5)) (log (* z (+ x y)))) (- (+ (log y) (* (log t) a)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 7.5) {
tmp = (log(t) * (a - 0.5)) + log((z * (x + y)));
} else {
tmp = (log(y) + (log(t) * a)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 7.5d0) then
tmp = (log(t) * (a - 0.5d0)) + log((z * (x + y)))
else
tmp = (log(y) + (log(t) * a)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 7.5) {
tmp = (Math.log(t) * (a - 0.5)) + Math.log((z * (x + y)));
} else {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 7.5: tmp = (math.log(t) * (a - 0.5)) + math.log((z * (x + y))) else: tmp = (math.log(y) + (math.log(t) * a)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 7.5) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(z * Float64(x + y)))); else tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 7.5) tmp = (log(t) * (a - 0.5)) + log((z * (x + y))); else tmp = (log(y) + (log(t) * a)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 7.5], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 7.5:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \log \left(z \cdot \left(x + y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\end{array}
\end{array}
if t < 7.5Initial program 99.3%
associate-+l-99.3%
+-commutative99.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 0 97.6%
log-prod72.1%
Simplified72.1%
if 7.5 < t Initial program 99.9%
Taylor expanded in x around 0 80.1%
Taylor expanded in a around inf 80.0%
*-commutative80.0%
Simplified80.0%
Final simplification76.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 3.7e+18) (- (+ (* (log t) (- a 0.5)) (log (* z y))) t) (- (+ (log y) (* (log t) a)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.7e+18) {
tmp = ((log(t) * (a - 0.5)) + log((z * y))) - t;
} else {
tmp = (log(y) + (log(t) * a)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 3.7d+18) then
tmp = ((log(t) * (a - 0.5d0)) + log((z * y))) - t
else
tmp = (log(y) + (log(t) * a)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 3.7e+18) {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((z * y))) - t;
} else {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 3.7e+18: tmp = ((math.log(t) * (a - 0.5)) + math.log((z * y))) - t else: tmp = (math.log(y) + (math.log(t) * a)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 3.7e+18) tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(z * y))) - t); else tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 3.7e+18) tmp = ((log(t) * (a - 0.5)) + log((z * y))) - t; else tmp = (log(y) + (log(t) * a)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 3.7e+18], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(z * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 3.7 \cdot 10^{+18}:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(z \cdot y\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\end{array}
\end{array}
if t < 3.7e18Initial program 99.3%
add-sqr-sqrt63.2%
pow263.2%
+-commutative63.2%
*-commutative63.2%
fma-define63.2%
sub-neg63.2%
metadata-eval63.2%
+-commutative63.2%
sum-log45.2%
Applied egg-rr45.2%
Taylor expanded in x around 0 45.8%
if 3.7e18 < t Initial program 99.9%
Taylor expanded in x around 0 80.4%
Taylor expanded in a around inf 80.4%
*-commutative80.4%
Simplified80.4%
Final simplification62.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.5e+52) (not (<= a 1.45e+20))) (* (log t) a) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.5e+52) || !(a <= 1.45e+20)) {
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 <= (-6.5d+52)) .or. (.not. (a <= 1.45d+20))) 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 <= -6.5e+52) || !(a <= 1.45e+20)) {
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 <= -6.5e+52) or not (a <= 1.45e+20): 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 <= -6.5e+52) || !(a <= 1.45e+20)) tmp = Float64(log(t) * a); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -6.5e+52) || ~((a <= 1.45e+20))) 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, -6.5e+52], N[Not[LessEqual[a, 1.45e+20]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+52} \lor \neg \left(a \leq 1.45 \cdot 10^{+20}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -6.49999999999999996e52 or 1.45e20 < a Initial program 99.7%
associate-+l-99.7%
+-commutative99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in a around inf 76.9%
*-commutative76.9%
Simplified76.9%
if -6.49999999999999996e52 < a < 1.45e20Initial program 99.6%
Taylor expanded in x around 0 67.2%
add-cube-cbrt67.0%
pow367.0%
sub-neg67.0%
metadata-eval67.0%
Applied egg-rr67.0%
Taylor expanded in a around inf 46.4%
Final simplification59.1%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (* (log t) a)) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(t) * a)) - 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(y) + (log(t) * a)) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(y) + (Math.log(t) * a)) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (math.log(t) * a)) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(t) * a)) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (log(t) * a)) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + \log t \cdot a\right) - t
\end{array}
Initial program 99.6%
Taylor expanded in x around 0 69.5%
Taylor expanded in a around inf 58.5%
*-commutative58.5%
Simplified58.5%
Final simplification58.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 5.5e+16) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 5.5e+16) {
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 <= 5.5d+16) 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 <= 5.5e+16) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 5.5e+16: tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 5.5e+16) 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 <= 5.5e+16) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 5.5e+16], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.5 \cdot 10^{+16}:\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 5.5e16Initial program 99.3%
associate-+l-99.3%
+-commutative99.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 50.9%
*-commutative50.9%
Simplified50.9%
if 5.5e16 < t Initial program 99.9%
associate-+l-99.9%
+-commutative99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 80.1%
mul-1-neg80.1%
Simplified80.1%
Final simplification65.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%
+-commutative99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 40.6%
mul-1-neg40.6%
Simplified40.6%
Final simplification40.6%
(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 2024034
(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))))