
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) 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}
Initial program 99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -5e+215)
t_1
(if (<= (- a 0.5) -1e+151)
(- (+ (log (* y z)) (* (- a 0.5) (log t))) t)
(if (or (<= (- a 0.5) -2e+46) (not (<= (- a 0.5) 1e+14)))
t_1
(+ (log y) (- (+ (log z) (* (log t) -0.5)) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -5e+215) {
tmp = t_1;
} else if ((a - 0.5) <= -1e+151) {
tmp = (log((y * z)) + ((a - 0.5) * log(t))) - t;
} else if (((a - 0.5) <= -2e+46) || !((a - 0.5) <= 1e+14)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if ((a - 0.5d0) <= (-5d+215)) then
tmp = t_1
else if ((a - 0.5d0) <= (-1d+151)) then
tmp = (log((y * z)) + ((a - 0.5d0) * log(t))) - t
else if (((a - 0.5d0) <= (-2d+46)) .or. (.not. ((a - 0.5d0) <= 1d+14))) then
tmp = t_1
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 t_1 = a * Math.log(t);
double tmp;
if ((a - 0.5) <= -5e+215) {
tmp = t_1;
} else if ((a - 0.5) <= -1e+151) {
tmp = (Math.log((y * z)) + ((a - 0.5) * Math.log(t))) - t;
} else if (((a - 0.5) <= -2e+46) || !((a - 0.5) <= 1e+14)) {
tmp = t_1;
} else {
tmp = Math.log(y) + ((Math.log(z) + (Math.log(t) * -0.5)) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -5e+215: tmp = t_1 elif (a - 0.5) <= -1e+151: tmp = (math.log((y * z)) + ((a - 0.5) * math.log(t))) - t elif ((a - 0.5) <= -2e+46) or not ((a - 0.5) <= 1e+14): tmp = t_1 else: tmp = math.log(y) + ((math.log(z) + (math.log(t) * -0.5)) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -5e+215) tmp = t_1; elseif (Float64(a - 0.5) <= -1e+151) tmp = Float64(Float64(log(Float64(y * z)) + Float64(Float64(a - 0.5) * log(t))) - t); elseif ((Float64(a - 0.5) <= -2e+46) || !(Float64(a - 0.5) <= 1e+14)) tmp = t_1; else tmp = Float64(log(y) + Float64(Float64(log(z) + Float64(log(t) * -0.5)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -5e+215) tmp = t_1; elseif ((a - 0.5) <= -1e+151) tmp = (log((y * z)) + ((a - 0.5) * log(t))) - t; elseif (((a - 0.5) <= -2e+46) || ~(((a - 0.5) <= 1e+14))) tmp = t_1; else tmp = log(y) + ((log(z) + (log(t) * -0.5)) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+215], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], -1e+151], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+46], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 1e+14]], $MachinePrecision]], t$95$1, N[(N[Log[y], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a - 0.5 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \left(a - 0.5\right) \cdot \log t\right) - t\\
\mathbf{elif}\;a - 0.5 \leq -2 \cdot 10^{+46} \lor \neg \left(a - 0.5 \leq 10^{+14}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\log y + \left(\left(\log z + \log t \cdot -0.5\right) - t\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -5.0000000000000001e215 or -1.00000000000000002e151 < (-.f64 a #s(literal 1/2 binary64)) < -2e46 or 1e14 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 72.9%
Taylor expanded in a around inf 79.8%
*-commutative79.8%
Simplified79.8%
if -5.0000000000000001e215 < (-.f64 a #s(literal 1/2 binary64)) < -1.00000000000000002e151Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
add-cube-cbrt97.5%
pow397.4%
Applied egg-rr97.4%
Taylor expanded in x around 0 70.6%
if -2e46 < (-.f64 a #s(literal 1/2 binary64)) < 1e14Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 57.0%
associate--l+57.0%
sub-neg57.0%
metadata-eval57.0%
+-commutative57.0%
distribute-rgt-out57.0%
+-commutative57.0%
distribute-rgt-in57.0%
Simplified57.0%
Taylor expanded in a around 0 55.0%
*-commutative55.0%
Simplified55.0%
Final simplification66.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))))
(if (<= (- a 0.5) -5e+215)
t_1
(if (<= (- a 0.5) -1e+151)
(- (+ (log (* y z)) (* (- a 0.5) (log t))) t)
(if (or (<= (- a 0.5) -2e+46) (not (<= (- a 0.5) 1e+14)))
t_1
(+ (log y) (- (log (* z (pow t -0.5))) t)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double tmp;
if ((a - 0.5) <= -5e+215) {
tmp = t_1;
} else if ((a - 0.5) <= -1e+151) {
tmp = (log((y * z)) + ((a - 0.5) * log(t))) - t;
} else if (((a - 0.5) <= -2e+46) || !((a - 0.5) <= 1e+14)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * log(t)
if ((a - 0.5d0) <= (-5d+215)) then
tmp = t_1
else if ((a - 0.5d0) <= (-1d+151)) then
tmp = (log((y * z)) + ((a - 0.5d0) * log(t))) - t
else if (((a - 0.5d0) <= (-2d+46)) .or. (.not. ((a - 0.5d0) <= 1d+14))) then
tmp = t_1
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 t_1 = a * Math.log(t);
double tmp;
if ((a - 0.5) <= -5e+215) {
tmp = t_1;
} else if ((a - 0.5) <= -1e+151) {
tmp = (Math.log((y * z)) + ((a - 0.5) * Math.log(t))) - t;
} else if (((a - 0.5) <= -2e+46) || !((a - 0.5) <= 1e+14)) {
tmp = t_1;
} else {
tmp = Math.log(y) + (Math.log((z * Math.pow(t, -0.5))) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) tmp = 0 if (a - 0.5) <= -5e+215: tmp = t_1 elif (a - 0.5) <= -1e+151: tmp = (math.log((y * z)) + ((a - 0.5) * math.log(t))) - t elif ((a - 0.5) <= -2e+46) or not ((a - 0.5) <= 1e+14): tmp = t_1 else: tmp = math.log(y) + (math.log((z * math.pow(t, -0.5))) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) tmp = 0.0 if (Float64(a - 0.5) <= -5e+215) tmp = t_1; elseif (Float64(a - 0.5) <= -1e+151) tmp = Float64(Float64(log(Float64(y * z)) + Float64(Float64(a - 0.5) * log(t))) - t); elseif ((Float64(a - 0.5) <= -2e+46) || !(Float64(a - 0.5) <= 1e+14)) tmp = t_1; else tmp = Float64(log(y) + Float64(log(Float64(z * (t ^ -0.5))) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); tmp = 0.0; if ((a - 0.5) <= -5e+215) tmp = t_1; elseif ((a - 0.5) <= -1e+151) tmp = (log((y * z)) + ((a - 0.5) * log(t))) - t; elseif (((a - 0.5) <= -2e+46) || ~(((a - 0.5) <= 1e+14))) tmp = t_1; else tmp = log(y) + (log((z * (t ^ -0.5))) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+215], t$95$1, If[LessEqual[N[(a - 0.5), $MachinePrecision], -1e+151], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -2e+46], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 1e+14]], $MachinePrecision]], t$95$1, N[(N[Log[y], $MachinePrecision] + N[(N[Log[N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+215}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a - 0.5 \leq -1 \cdot 10^{+151}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \left(a - 0.5\right) \cdot \log t\right) - t\\
\mathbf{elif}\;a - 0.5 \leq -2 \cdot 10^{+46} \lor \neg \left(a - 0.5 \leq 10^{+14}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\log y + \left(\log \left(z \cdot {t}^{-0.5}\right) - t\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -5.0000000000000001e215 or -1.00000000000000002e151 < (-.f64 a #s(literal 1/2 binary64)) < -2e46 or 1e14 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 72.9%
Taylor expanded in a around inf 79.8%
*-commutative79.8%
Simplified79.8%
if -5.0000000000000001e215 < (-.f64 a #s(literal 1/2 binary64)) < -1.00000000000000002e151Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
add-cube-cbrt97.5%
pow397.4%
Applied egg-rr97.4%
Taylor expanded in x around 0 70.6%
if -2e46 < (-.f64 a #s(literal 1/2 binary64)) < 1e14Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 57.0%
associate--l+57.0%
sub-neg57.0%
metadata-eval57.0%
+-commutative57.0%
distribute-rgt-out57.0%
+-commutative57.0%
distribute-rgt-in57.0%
Simplified57.0%
Taylor expanded in a around 0 55.0%
*-commutative55.0%
Simplified55.0%
add-log-exp55.0%
sum-log52.6%
pow-to-exp52.7%
Applied egg-rr52.7%
Final simplification64.8%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 350.0) (- (+ (log (* (+ x y) z)) (* (- a 0.5) (log t))) t) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 350.0) {
tmp = (log(((x + y) * z)) + ((a - 0.5) * log(t))) - t;
} 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 (log(z) <= 350.0d0) then
tmp = (log(((x + y) * z)) + ((a - 0.5d0) * log(t))) - t
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 (Math.log(z) <= 350.0) {
tmp = (Math.log(((x + y) * z)) + ((a - 0.5) * Math.log(t))) - t;
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 350.0: tmp = (math.log(((x + y) * z)) + ((a - 0.5) * math.log(t))) - t else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 350.0) tmp = Float64(Float64(log(Float64(Float64(x + y) * z)) + Float64(Float64(a - 0.5) * log(t))) - t); 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 (log(z) <= 350.0) tmp = (log(((x + y) * z)) + ((a - 0.5) * log(t))) - t; else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 350.0], N[(N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 350:\\
\;\;\;\;\left(\log \left(\left(x + y\right) \cdot z\right) + \left(a - 0.5\right) \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if (log.f64 z) < 350Initial 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-log84.8%
Applied egg-rr84.8%
if 350 < (log.f64 z) Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 68.7%
Taylor expanded in t around inf 39.3%
Final simplification73.1%
(FPCore (x y z t a) :precision binary64 (if (<= (log z) 350.0) (- (+ (log (* y z)) (* (- a 0.5) (log t))) t) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (log(z) <= 350.0) {
tmp = (log((y * z)) + ((a - 0.5) * log(t))) - t;
} 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 (log(z) <= 350.0d0) then
tmp = (log((y * z)) + ((a - 0.5d0) * log(t))) - t
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 (Math.log(z) <= 350.0) {
tmp = (Math.log((y * z)) + ((a - 0.5) * Math.log(t))) - t;
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if math.log(z) <= 350.0: tmp = (math.log((y * z)) + ((a - 0.5) * math.log(t))) - t else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (log(z) <= 350.0) tmp = Float64(Float64(log(Float64(y * z)) + Float64(Float64(a - 0.5) * log(t))) - t); 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 (log(z) <= 350.0) tmp = (log((y * z)) + ((a - 0.5) * log(t))) - t; else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[N[Log[z], $MachinePrecision], 350.0], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log z \leq 350:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + \left(a - 0.5\right) \cdot \log t\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if (log.f64 z) < 350Initial program 99.6%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
add-cube-cbrt97.9%
pow397.9%
Applied egg-rr83.4%
Taylor expanded in x around 0 52.1%
if 350 < (log.f64 z) Initial program 99.8%
associate-+l-99.8%
associate--l+99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-undefine99.8%
sub-neg99.8%
+-commutative99.8%
distribute-neg-in99.8%
metadata-eval99.8%
metadata-eval99.8%
unsub-neg99.8%
Simplified99.8%
Taylor expanded in x around 0 68.7%
Taylor expanded in t around inf 39.3%
Final simplification48.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (- a 0.5) (log t))))
(if (<= t 330.0)
(+ (+ (log z) (log y)) t_1)
(if (<= t 3.65e+84) (- (+ (log (* y z)) t_1) t) (- t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a - 0.5) * log(t);
double tmp;
if (t <= 330.0) {
tmp = (log(z) + log(y)) + t_1;
} else if (t <= 3.65e+84) {
tmp = (log((y * z)) + t_1) - t;
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (a - 0.5d0) * log(t)
if (t <= 330.0d0) then
tmp = (log(z) + log(y)) + t_1
else if (t <= 3.65d+84) then
tmp = (log((y * z)) + t_1) - t
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (a - 0.5) * Math.log(t);
double tmp;
if (t <= 330.0) {
tmp = (Math.log(z) + Math.log(y)) + t_1;
} else if (t <= 3.65e+84) {
tmp = (Math.log((y * z)) + t_1) - t;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a - 0.5) * math.log(t) tmp = 0 if t <= 330.0: tmp = (math.log(z) + math.log(y)) + t_1 elif t <= 3.65e+84: tmp = (math.log((y * z)) + t_1) - t else: tmp = -t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a - 0.5) * log(t)) tmp = 0.0 if (t <= 330.0) tmp = Float64(Float64(log(z) + log(y)) + t_1); elseif (t <= 3.65e+84) tmp = Float64(Float64(log(Float64(y * z)) + t_1) - t); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a - 0.5) * log(t); tmp = 0.0; if (t <= 330.0) tmp = (log(z) + log(y)) + t_1; elseif (t <= 3.65e+84) tmp = (log((y * z)) + t_1) - t; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 330.0], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 3.65e+84], N[(N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision] - t), $MachinePrecision], (-t)]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a - 0.5\right) \cdot \log t\\
\mathbf{if}\;t \leq 330:\\
\;\;\;\;\left(\log z + \log y\right) + t\_1\\
\mathbf{elif}\;t \leq 3.65 \cdot 10^{+84}:\\
\;\;\;\;\left(\log \left(y \cdot z\right) + t\_1\right) - t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 330Initial program 99.4%
associate-+l-99.4%
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 56.3%
Taylor expanded in t around 0 56.3%
+-commutative56.3%
Simplified56.3%
if 330 < t < 3.65e84Initial program 99.8%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
add-cube-cbrt98.3%
pow398.2%
Applied egg-rr85.6%
Taylor expanded in x around 0 64.0%
if 3.65e84 < 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 73.6%
Taylor expanded in t around inf 78.5%
mul-1-neg78.5%
Simplified78.5%
Final simplification65.7%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (log y)) (- (* (- a 0.5) (log t)) t)))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) + (((a - 0.5) * log(t)) - 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)) + (((a - 0.5d0) * log(t)) - t)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + Math.log(y)) + (((a - 0.5) * Math.log(t)) - t);
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) + (((a - 0.5) * math.log(t)) - t)
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) + Float64(Float64(Float64(a - 0.5) * log(t)) - t)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) + (((a - 0.5) * log(t)) - t); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) + \left(\left(a - 0.5\right) \cdot \log t - 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 64.6%
Final simplification64.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(log(y) + Float64(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[Log[y], $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log y + \left(\left(\log z + \log t \cdot \left(a + -0.5\right)\right) - t\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 64.6%
associate--l+64.6%
sub-neg64.6%
metadata-eval64.6%
+-commutative64.6%
distribute-rgt-out64.6%
+-commutative64.6%
distribute-rgt-in64.6%
Simplified64.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* a (log t))) (t_2 (- (log (* y (* z (pow t -0.5)))) t)))
(if (<= a -7.2e+37)
t_1
(if (<= a 8.4e-178)
t_2
(if (<= a 2.9e-94)
(- (+ (log z) (log y)) t)
(if (<= a 1.7e+14) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = a * log(t);
double t_2 = log((y * (z * pow(t, -0.5)))) - t;
double tmp;
if (a <= -7.2e+37) {
tmp = t_1;
} else if (a <= 8.4e-178) {
tmp = t_2;
} else if (a <= 2.9e-94) {
tmp = (log(z) + log(y)) - t;
} else if (a <= 1.7e+14) {
tmp = t_2;
} else {
tmp = t_1;
}
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 = a * log(t)
t_2 = log((y * (z * (t ** (-0.5d0))))) - t
if (a <= (-7.2d+37)) then
tmp = t_1
else if (a <= 8.4d-178) then
tmp = t_2
else if (a <= 2.9d-94) then
tmp = (log(z) + log(y)) - t
else if (a <= 1.7d+14) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = a * Math.log(t);
double t_2 = Math.log((y * (z * Math.pow(t, -0.5)))) - t;
double tmp;
if (a <= -7.2e+37) {
tmp = t_1;
} else if (a <= 8.4e-178) {
tmp = t_2;
} else if (a <= 2.9e-94) {
tmp = (Math.log(z) + Math.log(y)) - t;
} else if (a <= 1.7e+14) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = a * math.log(t) t_2 = math.log((y * (z * math.pow(t, -0.5)))) - t tmp = 0 if a <= -7.2e+37: tmp = t_1 elif a <= 8.4e-178: tmp = t_2 elif a <= 2.9e-94: tmp = (math.log(z) + math.log(y)) - t elif a <= 1.7e+14: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(a * log(t)) t_2 = Float64(log(Float64(y * Float64(z * (t ^ -0.5)))) - t) tmp = 0.0 if (a <= -7.2e+37) tmp = t_1; elseif (a <= 8.4e-178) tmp = t_2; elseif (a <= 2.9e-94) tmp = Float64(Float64(log(z) + log(y)) - t); elseif (a <= 1.7e+14) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = a * log(t); t_2 = log((y * (z * (t ^ -0.5)))) - t; tmp = 0.0; if (a <= -7.2e+37) tmp = t_1; elseif (a <= 8.4e-178) tmp = t_2; elseif (a <= 2.9e-94) tmp = (log(z) + log(y)) - t; elseif (a <= 1.7e+14) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(y * N[(z * N[Power[t, -0.5], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -7.2e+37], t$95$1, If[LessEqual[a, 8.4e-178], t$95$2, If[LessEqual[a, 2.9e-94], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 1.7e+14], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \log t\\
t_2 := \log \left(y \cdot \left(z \cdot {t}^{-0.5}\right)\right) - t\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.4 \cdot 10^{-178}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 2.9 \cdot 10^{-94}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+14}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.19999999999999995e37 or 1.7e14 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 73.5%
Taylor expanded in a around inf 77.3%
*-commutative77.3%
Simplified77.3%
if -7.19999999999999995e37 < a < 8.4e-178 or 2.89999999999999995e-94 < a < 1.7e14Initial program 99.6%
associate--l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 54.9%
associate--l+54.9%
sub-neg54.9%
metadata-eval54.9%
+-commutative54.9%
distribute-rgt-out54.9%
+-commutative54.9%
distribute-rgt-in54.9%
Simplified54.9%
Taylor expanded in a around 0 52.5%
*-commutative52.5%
Simplified52.5%
associate-+r-52.5%
add-log-exp52.3%
sum-log39.9%
exp-sum39.9%
add-exp-log40.0%
pow-to-exp40.0%
Applied egg-rr40.0%
if 8.4e-178 < a < 2.89999999999999995e-94Initial program 99.7%
associate-+l-99.7%
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 65.8%
Taylor expanded in t around inf 45.0%
Final simplification57.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.3e+41) (not (<= a 3.9e+19))) (* a (log t)) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.3e+41) || !(a <= 3.9e+19)) {
tmp = a * log(t);
} 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 <= (-1.3d+41)) .or. (.not. (a <= 3.9d+19))) then
tmp = a * log(t)
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 <= -1.3e+41) || !(a <= 3.9e+19)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) + (Math.log(z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.3e+41) or not (a <= 3.9e+19): tmp = a * math.log(t) else: tmp = math.log((x + y)) + (math.log(z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.3e+41) || !(a <= 3.9e+19)) tmp = Float64(a * log(t)); 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 <= -1.3e+41) || ~((a <= 3.9e+19))) tmp = a * log(t); else tmp = log((x + y)) + (log(z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.3e+41], N[Not[LessEqual[a, 3.9e+19]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $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 -1.3 \cdot 10^{+41} \lor \neg \left(a \leq 3.9 \cdot 10^{+19}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\end{array}
\end{array}
if a < -1.3e41 or 3.9e19 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 73.5%
Taylor expanded in a around inf 77.3%
*-commutative77.3%
Simplified77.3%
if -1.3e41 < a < 3.9e19Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 58.5%
Final simplification67.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -8.5e+38) (not (<= a 2.75e+20))) (* a (log t)) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -8.5e+38) || !(a <= 2.75e+20)) {
tmp = a * log(t);
} 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 <= (-8.5d+38)) .or. (.not. (a <= 2.75d+20))) then
tmp = a * log(t)
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 <= -8.5e+38) || !(a <= 2.75e+20)) {
tmp = a * Math.log(t);
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -8.5e+38) or not (a <= 2.75e+20): tmp = a * math.log(t) else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -8.5e+38) || !(a <= 2.75e+20)) tmp = Float64(a * log(t)); 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 <= -8.5e+38) || ~((a <= 2.75e+20))) tmp = a * log(t); else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -8.5e+38], N[Not[LessEqual[a, 2.75e+20]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -8.5 \cdot 10^{+38} \lor \neg \left(a \leq 2.75 \cdot 10^{+20}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -8.4999999999999997e38 or 2.75e20 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 73.5%
Taylor expanded in a around inf 77.3%
*-commutative77.3%
Simplified77.3%
if -8.4999999999999997e38 < a < 2.75e20Initial 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 57.0%
Taylor expanded in t around inf 38.2%
Final simplification56.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1e+39) (not (<= a 1.55e+18))) (* a (log t)) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1e+39) || !(a <= 1.55e+18)) {
tmp = a * log(t);
} else {
tmp = log((x + y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1d+39)) .or. (.not. (a <= 1.55d+18))) then
tmp = a * log(t)
else
tmp = log((x + y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1e+39) || !(a <= 1.55e+18)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1e+39) or not (a <= 1.55e+18): tmp = a * math.log(t) else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1e+39) || !(a <= 1.55e+18)) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(x + y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1e+39) || ~((a <= 1.55e+18))) tmp = a * log(t); else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1e+39], N[Not[LessEqual[a, 1.55e+18]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+39} \lor \neg \left(a \leq 1.55 \cdot 10^{+18}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -9.9999999999999994e38 or 1.55e18 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 73.5%
Taylor expanded in a around inf 77.3%
*-commutative77.3%
Simplified77.3%
if -9.9999999999999994e38 < a < 1.55e18Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 57.1%
neg-mul-157.1%
Simplified57.1%
Final simplification66.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3e+38) (not (<= a 4.5e+14))) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e+38) || !(a <= 4.5e+14)) {
tmp = a * log(t);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3d+38)) .or. (.not. (a <= 4.5d+14))) then
tmp = a * log(t)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3e+38) || !(a <= 4.5e+14)) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3e+38) or not (a <= 4.5e+14): tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3e+38) || !(a <= 4.5e+14)) tmp = Float64(a * log(t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3e+38) || ~((a <= 4.5e+14))) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3e+38], N[Not[LessEqual[a, 4.5e+14]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3 \cdot 10^{+38} \lor \neg \left(a \leq 4.5 \cdot 10^{+14}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -3.0000000000000001e38 or 4.5e14 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in x around 0 73.5%
Taylor expanded in a around inf 77.3%
*-commutative77.3%
Simplified77.3%
if -3.0000000000000001e38 < a < 4.5e14Initial 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 57.0%
Taylor expanded in t around inf 50.4%
mul-1-neg50.4%
Simplified50.4%
Final simplification62.8%
(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 64.6%
Taylor expanded in t around inf 37.1%
mul-1-neg37.1%
Simplified37.1%
(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 2024084
(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))))