
(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 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (- (log z) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (or (<= t_1 -700.0) (not (<= t_1 701.6)))
(- (+ (log y) (* (log t) a)) t)
(- (+ (log (* (+ x y) z)) (* (log t) (- a 0.5))) t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log((x + y)) + log(z);
double tmp;
if ((t_1 <= -700.0) || !(t_1 <= 701.6)) {
tmp = (log(y) + (log(t) * a)) - t;
} else {
tmp = (log(((x + y) * z)) + (log(t) * (a - 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 = log((x + y)) + log(z)
if ((t_1 <= (-700.0d0)) .or. (.not. (t_1 <= 701.6d0))) then
tmp = (log(y) + (log(t) * a)) - t
else
tmp = (log(((x + y) * z)) + (log(t) * (a - 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 = Math.log((x + y)) + Math.log(z);
double tmp;
if ((t_1 <= -700.0) || !(t_1 <= 701.6)) {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
} else {
tmp = (Math.log(((x + y) * z)) + (Math.log(t) * (a - 0.5))) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + math.log(z) tmp = 0 if (t_1 <= -700.0) or not (t_1 <= 701.6): tmp = (math.log(y) + (math.log(t) * a)) - t else: tmp = (math.log(((x + y) * z)) + (math.log(t) * (a - 0.5))) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(Float64(x + y)) + log(z)) tmp = 0.0 if ((t_1 <= -700.0) || !(t_1 <= 701.6)) tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); else tmp = Float64(Float64(log(Float64(Float64(x + y) * z)) + Float64(log(t) * Float64(a - 0.5))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + log(z); tmp = 0.0; if ((t_1 <= -700.0) || ~((t_1 <= 701.6))) tmp = (log(y) + (log(t) * a)) - t; else tmp = (log(((x + y) * z)) + (log(t) * (a - 0.5))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -700.0], N[Not[LessEqual[t$95$1, 701.6]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t\_1 \leq -700 \lor \neg \left(t\_1 \leq 701.6\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\mathbf{else}:\\
\;\;\;\;\left(\log \left(\left(x + y\right) \cdot z\right) + \log t \cdot \left(a - 0.5\right)\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -700 or 701.600000000000023 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 70.6%
Taylor expanded in a around inf 62.0%
*-commutative62.0%
Simplified62.0%
if -700 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 701.600000000000023Initial 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-log99.6%
Applied egg-rr99.6%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.032) (+ (log z) (- (log (+ x y)) (* (log t) (- 0.5 a)))) (- (+ (log y) (* (log t) a)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.032) {
tmp = log(z) + (log((x + y)) - (log(t) * (0.5 - a)));
} 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 <= 0.032d0) then
tmp = log(z) + (log((x + y)) - (log(t) * (0.5d0 - a)))
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 <= 0.032) {
tmp = Math.log(z) + (Math.log((x + y)) - (Math.log(t) * (0.5 - a)));
} else {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.032: tmp = math.log(z) + (math.log((x + y)) - (math.log(t) * (0.5 - a))) else: tmp = (math.log(y) + (math.log(t) * a)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.032) tmp = Float64(log(z) + Float64(log(Float64(x + y)) - Float64(log(t) * Float64(0.5 - a)))); 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 <= 0.032) tmp = log(z) + (log((x + y)) - (log(t) * (0.5 - a))); else tmp = (log(y) + (log(t) * a)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.032], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $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 0.032:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) - \log t \cdot \left(0.5 - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\end{array}
\end{array}
if t < 0.032000000000000001Initial program 99.3%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around 0 98.7%
if 0.032000000000000001 < t Initial program 100.0%
associate--l+100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 64.4%
Taylor expanded in a around inf 64.4%
*-commutative64.4%
Simplified64.4%
Final simplification82.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.032) (+ (log y) (- (log z) (* (log t) (- 0.5 a)))) (- (+ (log y) (* (log t) a)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.032) {
tmp = log(y) + (log(z) - (log(t) * (0.5 - a)));
} 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 <= 0.032d0) then
tmp = log(y) + (log(z) - (log(t) * (0.5d0 - a)))
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 <= 0.032) {
tmp = Math.log(y) + (Math.log(z) - (Math.log(t) * (0.5 - a)));
} else {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.032: tmp = math.log(y) + (math.log(z) - (math.log(t) * (0.5 - a))) else: tmp = (math.log(y) + (math.log(t) * a)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.032) tmp = Float64(log(y) + Float64(log(z) - Float64(log(t) * Float64(0.5 - a)))); 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 <= 0.032) tmp = log(y) + (log(z) - (log(t) * (0.5 - a))); else tmp = (log(y) + (log(t) * a)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.032], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $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 0.032:\\
\;\;\;\;\log y + \left(\log z - \log t \cdot \left(0.5 - a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\end{array}
\end{array}
if t < 0.032000000000000001Initial program 99.3%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 69.4%
Taylor expanded in t around 0 68.8%
if 0.032000000000000001 < t Initial program 100.0%
associate--l+100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 64.4%
Taylor expanded in a around inf 64.4%
*-commutative64.4%
Simplified64.4%
Final simplification66.8%
(FPCore (x y z t a) :precision binary64 (+ (+ (log z) (log y)) (- (* (log t) (- a 0.5)) t)))
double code(double x, double y, double z, double t, double a) {
return (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t);
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) + log(y)) + ((log(t) * (a - 0.5d0)) - t)
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) + Math.log(y)) + ((Math.log(t) * (a - 0.5)) - t);
}
def code(x, y, z, t, a): return (math.log(z) + math.log(y)) + ((math.log(t) * (a - 0.5)) - t)
function code(x, y, z, t, a) return Float64(Float64(log(z) + log(y)) + Float64(Float64(log(t) * Float64(a - 0.5)) - t)) end
function tmp = code(x, y, z, t, a) tmp = (log(z) + log(y)) + ((log(t) * (a - 0.5)) - t); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z + \log y\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in x around 0 67.1%
Final simplification67.1%
(FPCore (x y z t a) :precision binary64 (- (+ (log y) (- (log z) (* (log t) (- 0.5 a)))) t))
double code(double x, double y, double z, double t, double a) {
return (log(y) + (log(z) - (log(t) * (0.5 - 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(z) - (log(t) * (0.5d0 - a)))) - 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) * (0.5 - a)))) - t;
}
def code(x, y, z, t, a): return (math.log(y) + (math.log(z) - (math.log(t) * (0.5 - a)))) - t
function code(x, y, z, t, a) return Float64(Float64(log(y) + Float64(log(z) - Float64(log(t) * Float64(0.5 - a)))) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(y) + (log(z) - (log(t) * (0.5 - a)))) - 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[(0.5 - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\left(\log y + \left(\log z - \log t \cdot \left(0.5 - a\right)\right)\right) - t
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 67.1%
Final simplification67.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)) (t_2 (+ (log (+ x y)) (- (log z) t))))
(if (<= a -1.8e+26)
t_1
(if (<= a -4.2e-48)
t_2
(if (<= a -1.65e-102)
(+ (log (* y z)) (* (log t) -0.5))
(if (<= a 1.25e+59) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double t_2 = log((x + y)) + (log(z) - t);
double tmp;
if (a <= -1.8e+26) {
tmp = t_1;
} else if (a <= -4.2e-48) {
tmp = t_2;
} else if (a <= -1.65e-102) {
tmp = log((y * z)) + (log(t) * -0.5);
} else if (a <= 1.25e+59) {
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 = log(t) * a
t_2 = log((x + y)) + (log(z) - t)
if (a <= (-1.8d+26)) then
tmp = t_1
else if (a <= (-4.2d-48)) then
tmp = t_2
else if (a <= (-1.65d-102)) then
tmp = log((y * z)) + (log(t) * (-0.5d0))
else if (a <= 1.25d+59) 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 = Math.log(t) * a;
double t_2 = Math.log((x + y)) + (Math.log(z) - t);
double tmp;
if (a <= -1.8e+26) {
tmp = t_1;
} else if (a <= -4.2e-48) {
tmp = t_2;
} else if (a <= -1.65e-102) {
tmp = Math.log((y * z)) + (Math.log(t) * -0.5);
} else if (a <= 1.25e+59) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a t_2 = math.log((x + y)) + (math.log(z) - t) tmp = 0 if a <= -1.8e+26: tmp = t_1 elif a <= -4.2e-48: tmp = t_2 elif a <= -1.65e-102: tmp = math.log((y * z)) + (math.log(t) * -0.5) elif a <= 1.25e+59: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) t_2 = Float64(log(Float64(x + y)) + Float64(log(z) - t)) tmp = 0.0 if (a <= -1.8e+26) tmp = t_1; elseif (a <= -4.2e-48) tmp = t_2; elseif (a <= -1.65e-102) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * -0.5)); elseif (a <= 1.25e+59) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; t_2 = log((x + y)) + (log(z) - t); tmp = 0.0; if (a <= -1.8e+26) tmp = t_1; elseif (a <= -4.2e-48) tmp = t_2; elseif (a <= -1.65e-102) tmp = log((y * z)) + (log(t) * -0.5); elseif (a <= 1.25e+59) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.8e+26], t$95$1, If[LessEqual[a, -4.2e-48], t$95$2, If[LessEqual[a, -1.65e-102], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e+59], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
t_2 := \log \left(x + y\right) + \left(\log z - t\right)\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-48}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.65 \cdot 10^{-102}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot -0.5\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+59}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.80000000000000012e26 or 1.2499999999999999e59 < a 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.6%
Taylor expanded in a around inf 85.1%
*-commutative85.1%
Simplified85.1%
if -1.80000000000000012e26 < a < -4.19999999999999977e-48 or -1.65e-102 < a < 1.2499999999999999e59Initial 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 59.3%
if -4.19999999999999977e-48 < a < -1.65e-102Initial program 98.4%
associate--l+98.4%
sub-neg98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in x around 0 61.0%
Taylor expanded in t around 0 44.1%
Taylor expanded in a around 0 44.1%
log-pow44.1%
associate-+r+43.8%
log-prod38.7%
*-commutative38.7%
log-pow38.7%
*-commutative38.7%
Simplified38.7%
Final simplification69.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) a)) (t_2 (- (log (+ x y)) t)))
(if (<= a -4.6e+23)
t_1
(if (<= a -6.8e-49)
t_2
(if (<= a -2.4e-102)
(+ (log (* y z)) (* (log t) -0.5))
(if (<= a 1.25e+59) t_2 t_1))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double t_2 = log((x + y)) - t;
double tmp;
if (a <= -4.6e+23) {
tmp = t_1;
} else if (a <= -6.8e-49) {
tmp = t_2;
} else if (a <= -2.4e-102) {
tmp = log((y * z)) + (log(t) * -0.5);
} else if (a <= 1.25e+59) {
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 = log(t) * a
t_2 = log((x + y)) - t
if (a <= (-4.6d+23)) then
tmp = t_1
else if (a <= (-6.8d-49)) then
tmp = t_2
else if (a <= (-2.4d-102)) then
tmp = log((y * z)) + (log(t) * (-0.5d0))
else if (a <= 1.25d+59) 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 = Math.log(t) * a;
double t_2 = Math.log((x + y)) - t;
double tmp;
if (a <= -4.6e+23) {
tmp = t_1;
} else if (a <= -6.8e-49) {
tmp = t_2;
} else if (a <= -2.4e-102) {
tmp = Math.log((y * z)) + (Math.log(t) * -0.5);
} else if (a <= 1.25e+59) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a t_2 = math.log((x + y)) - t tmp = 0 if a <= -4.6e+23: tmp = t_1 elif a <= -6.8e-49: tmp = t_2 elif a <= -2.4e-102: tmp = math.log((y * z)) + (math.log(t) * -0.5) elif a <= 1.25e+59: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) t_2 = Float64(log(Float64(x + y)) - t) tmp = 0.0 if (a <= -4.6e+23) tmp = t_1; elseif (a <= -6.8e-49) tmp = t_2; elseif (a <= -2.4e-102) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * -0.5)); elseif (a <= 1.25e+59) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; t_2 = log((x + y)) - t; tmp = 0.0; if (a <= -4.6e+23) tmp = t_1; elseif (a <= -6.8e-49) tmp = t_2; elseif (a <= -2.4e-102) tmp = log((y * z)) + (log(t) * -0.5); elseif (a <= 1.25e+59) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -4.6e+23], t$95$1, If[LessEqual[a, -6.8e-49], t$95$2, If[LessEqual[a, -2.4e-102], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e+59], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
t_2 := \log \left(x + y\right) - t\\
\mathbf{if}\;a \leq -4.6 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{-49}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-102}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot -0.5\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+59}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.6000000000000001e23 or 1.2499999999999999e59 < a 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.6%
Taylor expanded in a around inf 85.1%
*-commutative85.1%
Simplified85.1%
if -4.6000000000000001e23 < a < -6.8000000000000001e-49 or -2.4e-102 < a < 1.2499999999999999e59Initial 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.1%
neg-mul-158.1%
Simplified58.1%
if -6.8000000000000001e-49 < a < -2.4e-102Initial program 98.4%
associate--l+98.4%
sub-neg98.4%
metadata-eval98.4%
Simplified98.4%
Taylor expanded in x around 0 61.0%
Taylor expanded in t around 0 44.1%
Taylor expanded in a around 0 44.1%
log-pow44.1%
associate-+r+43.8%
log-prod38.7%
*-commutative38.7%
log-pow38.7%
*-commutative38.7%
Simplified38.7%
Final simplification68.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log y) (* (log t) a))))
(if (<= t 4.1e-287)
t_1
(if (<= t 1e-39) (+ (log (* y z)) (* (log t) (- a 0.5))) (- t_1 t)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(y) + (log(t) * a);
double tmp;
if (t <= 4.1e-287) {
tmp = t_1;
} else if (t <= 1e-39) {
tmp = log((y * z)) + (log(t) * (a - 0.5));
} else {
tmp = t_1 - 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 = log(y) + (log(t) * a)
if (t <= 4.1d-287) then
tmp = t_1
else if (t <= 1d-39) then
tmp = log((y * z)) + (log(t) * (a - 0.5d0))
else
tmp = t_1 - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log(y) + (Math.log(t) * a);
double tmp;
if (t <= 4.1e-287) {
tmp = t_1;
} else if (t <= 1e-39) {
tmp = Math.log((y * z)) + (Math.log(t) * (a - 0.5));
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(y) + (math.log(t) * a) tmp = 0 if t <= 4.1e-287: tmp = t_1 elif t <= 1e-39: tmp = math.log((y * z)) + (math.log(t) * (a - 0.5)) else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(y) + Float64(log(t) * a)) tmp = 0.0 if (t <= 4.1e-287) tmp = t_1; elseif (t <= 1e-39) tmp = Float64(log(Float64(y * z)) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(y) + (log(t) * a); tmp = 0.0; if (t <= 4.1e-287) tmp = t_1; elseif (t <= 1e-39) tmp = log((y * z)) + (log(t) * (a - 0.5)); else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, 4.1e-287], t$95$1, If[LessEqual[t, 1e-39], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y + \log t \cdot a\\
\mathbf{if}\;t \leq 4.1 \cdot 10^{-287}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 10^{-39}:\\
\;\;\;\;\log \left(y \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - t\\
\end{array}
\end{array}
if t < 4.1000000000000002e-287Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 82.9%
Taylor expanded in t around 0 82.9%
Taylor expanded in a around inf 74.9%
*-commutative74.9%
Simplified74.9%
if 4.1000000000000002e-287 < t < 9.99999999999999929e-40Initial program 99.3%
associate-+l-99.3%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-undefine99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in t around 0 99.3%
log-prod84.1%
+-commutative84.1%
Simplified84.1%
Taylor expanded in y around inf 64.3%
mul-1-neg64.3%
log-rec64.3%
remove-double-neg64.3%
log-prod56.2%
Simplified56.2%
if 9.99999999999999929e-40 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 67.8%
Taylor expanded in a around inf 63.6%
*-commutative63.6%
Simplified63.6%
Final simplification61.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.56e-5) (not (<= a 1.85e-15))) (- (+ (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 <= -2.56e-5) || !(a <= 1.85e-15)) {
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 <= (-2.56d-5)) .or. (.not. (a <= 1.85d-15))) 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 <= -2.56e-5) || !(a <= 1.85e-15)) {
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 <= -2.56e-5) or not (a <= 1.85e-15): 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 <= -2.56e-5) || !(a <= 1.85e-15)) 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 <= -2.56e-5) || ~((a <= 1.85e-15))) 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, -2.56e-5], N[Not[LessEqual[a, 1.85e-15]], $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 -2.56 \cdot 10^{-5} \lor \neg \left(a \leq 1.85 \cdot 10^{-15}\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 < -2.5599999999999999e-5 or 1.85000000000000008e-15 < a Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 68.9%
Taylor expanded in a around inf 68.3%
*-commutative68.3%
Simplified68.3%
if -2.5599999999999999e-5 < a < 1.85000000000000008e-15Initial program 99.4%
associate--l+99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 64.9%
Taylor expanded in a around 0 64.9%
log-pow35.1%
associate-+r+35.1%
log-prod30.6%
*-commutative30.6%
log-pow30.6%
*-commutative30.6%
Simplified51.5%
Taylor expanded in z around 0 64.9%
associate-+r+64.8%
log-prod51.5%
log-pow51.5%
log-prod46.9%
associate-*l*47.5%
Simplified47.5%
Final simplification58.8%
(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%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 67.1%
Taylor expanded in a around inf 53.4%
*-commutative53.4%
Simplified53.4%
Final simplification53.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.2e+24) (not (<= a 1.95e+59))) (* (log t) a) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.2e+24) || !(a <= 1.95e+59)) {
tmp = log(t) * a;
} 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 <= (-1.2d+24)) .or. (.not. (a <= 1.95d+59))) then
tmp = log(t) * a
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 <= -1.2e+24) || !(a <= 1.95e+59)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log((x + y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.2e+24) or not (a <= 1.95e+59): tmp = math.log(t) * a else: tmp = math.log((x + y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.2e+24) || !(a <= 1.95e+59)) tmp = Float64(log(t) * a); 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 <= -1.2e+24) || ~((a <= 1.95e+59))) tmp = log(t) * a; else tmp = log((x + y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.2e+24], N[Not[LessEqual[a, 1.95e+59]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{+24} \lor \neg \left(a \leq 1.95 \cdot 10^{+59}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -1.2e24 or 1.95000000000000011e59 < a 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.6%
Taylor expanded in a around inf 85.1%
*-commutative85.1%
Simplified85.1%
if -1.2e24 < a < 1.95000000000000011e59Initial program 99.5%
associate-+l-99.5%
associate--l+99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-undefine99.5%
sub-neg99.5%
+-commutative99.5%
distribute-neg-in99.5%
metadata-eval99.5%
metadata-eval99.5%
unsub-neg99.5%
Simplified99.5%
Taylor expanded in t around inf 55.3%
neg-mul-155.3%
Simplified55.3%
Final simplification68.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -9e+18) (not (<= a 7e+59))) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -9e+18) || !(a <= 7e+59)) {
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 <= (-9d+18)) .or. (.not. (a <= 7d+59))) 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 <= -9e+18) || !(a <= 7e+59)) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -9e+18) or not (a <= 7e+59): tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -9e+18) || !(a <= 7e+59)) 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 <= -9e+18) || ~((a <= 7e+59))) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -9e+18], N[Not[LessEqual[a, 7e+59]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9 \cdot 10^{+18} \lor \neg \left(a \leq 7 \cdot 10^{+59}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -9e18 or 7e59 < a 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.9%
Taylor expanded in a around inf 84.0%
*-commutative84.0%
Simplified84.0%
if -9e18 < a < 7e59Initial program 99.4%
associate--l+99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 65.6%
Taylor expanded in t around inf 49.6%
neg-mul-149.6%
Simplified49.6%
Final simplification65.2%
(FPCore (x y z t a) :precision binary64 (if (<= t 26500.0) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 26500.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 <= 26500.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 <= 26500.0) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 26500.0: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 26500.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 <= 26500.0) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 26500.0], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 26500:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 26500Initial program 99.3%
associate-+l-99.3%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-undefine99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in t around inf 9.4%
neg-mul-19.4%
Simplified9.4%
Taylor expanded in t around 0 9.4%
+-commutative9.4%
Simplified9.4%
if 26500 < t Initial program 100.0%
associate--l+100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 65.5%
Taylor expanded in t around inf 71.9%
neg-mul-171.9%
Simplified71.9%
Final simplification38.5%
(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%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 67.1%
Taylor expanded in t around inf 34.9%
neg-mul-134.9%
Simplified34.9%
Final simplification34.9%
(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 2024067
(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))))