
(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 (+ 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.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-udef99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Final simplification99.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (or (<= t_1 -750.0) (not (<= t_1 680.0)))
(- (* (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 <= -750.0) || !(t_1 <= 680.0)) {
tmp = (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 <= (-750.0d0)) .or. (.not. (t_1 <= 680.0d0))) then
tmp = (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 <= -750.0) || !(t_1 <= 680.0)) {
tmp = (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 <= -750.0) or not (t_1 <= 680.0): tmp = (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 <= -750.0) || !(t_1 <= 680.0)) tmp = Float64(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 <= -750.0) || ~((t_1 <= 680.0))) tmp = (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, -750.0], N[Not[LessEqual[t$95$1, 680.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $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 -750 \lor \neg \left(t_1 \leq 680\right):\\
\;\;\;\;\log t \cdot a - 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)) < -750 or 680 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.7%
Taylor expanded in a around inf 75.0%
*-commutative75.0%
Simplified75.0%
if -750 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 680Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-udef99.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-udef99.6%
associate--r+99.6%
+-commutative99.6%
sum-log99.6%
Applied egg-rr99.6%
Final simplification93.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (or (<= t_1 -750.0) (not (<= t_1 680.0)))
(- (* (log t) a) t)
(+ (log (* 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 <= -750.0) || !(t_1 <= 680.0)) {
tmp = (log(t) * a) - t;
} else {
tmp = log((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 <= (-750.0d0)) .or. (.not. (t_1 <= 680.0d0))) then
tmp = (log(t) * a) - t
else
tmp = log((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 <= -750.0) || !(t_1 <= 680.0)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log((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 <= -750.0) or not (t_1 <= 680.0): tmp = (math.log(t) * a) - t else: tmp = math.log((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 <= -750.0) || !(t_1 <= 680.0)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(Float64(y * z)) + Float64(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 <= -750.0) || ~((t_1 <= 680.0))) tmp = (log(t) * a) - t; else tmp = log((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, -750.0], N[Not[LessEqual[t$95$1, 680.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t_1 \leq -750 \lor \neg \left(t_1 \leq 680\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot z\right) + \left(\log t \cdot \left(a - 0.5\right) - t\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -750 or 680 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.7%
Taylor expanded in a around inf 75.0%
*-commutative75.0%
Simplified75.0%
if -750 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 680Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-udef99.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-udef99.6%
associate--r+99.6%
+-commutative99.6%
sum-log99.6%
Applied egg-rr99.6%
Taylor expanded in x around 0 64.3%
Final simplification66.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0073) (+ (log z) (+ (log (+ x y)) (* (log t) (- a 0.5)))) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0073) {
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5)));
} else {
tmp = (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.0073d0) then
tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5d0)))
else
tmp = (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.0073) {
tmp = Math.log(z) + (Math.log((x + y)) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0073: tmp = math.log(z) + (math.log((x + y)) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0073) tmp = Float64(log(z) + Float64(log(Float64(x + y)) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.0073) tmp = log(z) + (log((x + y)) + (log(t) * (a - 0.5))); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0073], N[(N[Log[z], $MachinePrecision] + N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0073:\\
\;\;\;\;\log z + \left(\log \left(x + y\right) + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 0.00730000000000000007Initial program 99.3%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around 0 98.3%
if 0.00730000000000000007 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0073) (+ (log (+ x y)) (+ (log z) (* (log t) (- a 0.5)))) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0073) {
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (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.0073d0) then
tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (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.0073) {
tmp = Math.log((x + y)) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0073: tmp = math.log((x + y)) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0073) tmp = Float64(log(Float64(x + y)) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.0073) tmp = log((x + y)) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0073], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0073:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 0.00730000000000000007Initial program 99.3%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-udef99.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 0 98.4%
if 0.00730000000000000007 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
Final simplification98.4%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0073) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0073) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} else {
tmp = (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.0073d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
else
tmp = (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.0073) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0073: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0073) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.0073) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0073], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0073:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 0.00730000000000000007Initial program 99.3%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in x around 0 64.9%
Taylor expanded in t around 0 64.2%
if 0.00730000000000000007 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
Final simplification81.6%
(FPCore (x y z t a) :precision binary64 (+ (+ (log (+ x y)) (- (log z) t)) (* (log t) (+ a -0.5))))
double code(double x, double y, double z, double t, double a) {
return (log((x + y)) + (log(z) - t)) + (log(t) * (a + -0.5));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log((x + y)) + (log(z) - t)) + (log(t) * (a + (-0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log((x + y)) + (Math.log(z) - t)) + (Math.log(t) * (a + -0.5));
}
def code(x, y, z, t, a): return (math.log((x + y)) + (math.log(z) - t)) + (math.log(t) * (a + -0.5))
function code(x, y, z, t, a) return Float64(Float64(log(Float64(x + y)) + Float64(log(z) - t)) + Float64(log(t) * Float64(a + -0.5))) end
function tmp = code(x, y, z, t, a) tmp = (log((x + y)) + (log(z) - t)) + (log(t) * (a + -0.5)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \log t \cdot \left(a + -0.5\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(FPCore (x y z t a) :precision binary64 (- (+ (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%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 68.1%
Final simplification68.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))) (t_2 (+ (log (* y z)) t_1)))
(if (<= t 1.5e-110)
t_2
(if (<= t 1.9e-69)
(+ (log y) t_1)
(if (<= t 0.0013) t_2 (- (* (log t) a) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * (a - 0.5);
double t_2 = log((y * z)) + t_1;
double tmp;
if (t <= 1.5e-110) {
tmp = t_2;
} else if (t <= 1.9e-69) {
tmp = log(y) + t_1;
} else if (t <= 0.0013) {
tmp = t_2;
} else {
tmp = (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log(t) * (a - 0.5d0)
t_2 = log((y * z)) + t_1
if (t <= 1.5d-110) then
tmp = t_2
else if (t <= 1.9d-69) then
tmp = log(y) + t_1
else if (t <= 0.0013d0) then
tmp = t_2
else
tmp = (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 t_1 = Math.log(t) * (a - 0.5);
double t_2 = Math.log((y * z)) + t_1;
double tmp;
if (t <= 1.5e-110) {
tmp = t_2;
} else if (t <= 1.9e-69) {
tmp = Math.log(y) + t_1;
} else if (t <= 0.0013) {
tmp = t_2;
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) t_2 = math.log((y * z)) + t_1 tmp = 0 if t <= 1.5e-110: tmp = t_2 elif t <= 1.9e-69: tmp = math.log(y) + t_1 elif t <= 0.0013: tmp = t_2 else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) t_2 = Float64(log(Float64(y * z)) + t_1) tmp = 0.0 if (t <= 1.5e-110) tmp = t_2; elseif (t <= 1.9e-69) tmp = Float64(log(y) + t_1); elseif (t <= 0.0013) tmp = t_2; else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); t_2 = log((y * z)) + t_1; tmp = 0.0; if (t <= 1.5e-110) tmp = t_2; elseif (t <= 1.9e-69) tmp = log(y) + t_1; elseif (t <= 0.0013) tmp = t_2; else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t, 1.5e-110], t$95$2, If[LessEqual[t, 1.9e-69], N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t, 0.0013], t$95$2, N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
t_2 := \log \left(y \cdot z\right) + t_1\\
\mathbf{if}\;t \leq 1.5 \cdot 10^{-110}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 1.9 \cdot 10^{-69}:\\
\;\;\;\;\log y + t_1\\
\mathbf{elif}\;t \leq 0.0013:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 1.49999999999999993e-110 or 1.8999999999999999e-69 < t < 0.0012999999999999999Initial program 99.3%
associate-+l-99.3%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-udef99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
associate-+r-99.3%
fma-udef99.3%
associate--r+99.3%
+-commutative99.3%
sum-log76.8%
Applied egg-rr76.8%
Taylor expanded in x around 0 49.3%
Taylor expanded in t around 0 48.4%
if 1.49999999999999993e-110 < t < 1.8999999999999999e-69Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in t around inf 88.6%
+-commutative88.6%
mul-1-neg88.6%
unsub-neg88.6%
log-rec88.6%
sub-neg88.6%
metadata-eval88.6%
distribute-lft-neg-in88.6%
distribute-rgt-neg-in88.6%
Simplified88.6%
Taylor expanded in x around 0 58.9%
if 0.0012999999999999999 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
Final simplification74.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -122000000000.0) (not (<= a 7.8e-24))) (- (* (log t) a) t) (- (log (* y z)) (+ t (* (log t) 0.5)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -122000000000.0) || !(a <= 7.8e-24)) {
tmp = (log(t) * a) - t;
} else {
tmp = log((y * z)) - (t + (log(t) * 0.5));
}
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 <= (-122000000000.0d0)) .or. (.not. (a <= 7.8d-24))) then
tmp = (log(t) * a) - t
else
tmp = log((y * z)) - (t + (log(t) * 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -122000000000.0) || !(a <= 7.8e-24)) {
tmp = (Math.log(t) * a) - t;
} else {
tmp = Math.log((y * z)) - (t + (Math.log(t) * 0.5));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -122000000000.0) or not (a <= 7.8e-24): tmp = (math.log(t) * a) - t else: tmp = math.log((y * z)) - (t + (math.log(t) * 0.5)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -122000000000.0) || !(a <= 7.8e-24)) tmp = Float64(Float64(log(t) * a) - t); else tmp = Float64(log(Float64(y * z)) - Float64(t + Float64(log(t) * 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -122000000000.0) || ~((a <= 7.8e-24))) tmp = (log(t) * a) - t; else tmp = log((y * z)) - (t + (log(t) * 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -122000000000.0], N[Not[LessEqual[a, 7.8e-24]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision] - N[(t + N[(N[Log[t], $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -122000000000 \lor \neg \left(a \leq 7.8 \cdot 10^{-24}\right):\\
\;\;\;\;\log t \cdot a - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot z\right) - \left(t + \log t \cdot 0.5\right)\\
\end{array}
\end{array}
if a < -1.22e11 or 7.8e-24 < a Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 74.4%
Taylor expanded in a around inf 97.7%
*-commutative97.7%
Simplified97.7%
if -1.22e11 < a < 7.8e-24Initial program 99.6%
associate-+l-99.6%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-udef99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
associate-+r-99.6%
fma-udef99.6%
associate--r+99.6%
+-commutative99.6%
sum-log80.0%
Applied egg-rr80.0%
Taylor expanded in x around 0 48.6%
Taylor expanded in a around 0 48.1%
*-commutative48.1%
Simplified48.1%
Final simplification74.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0073) (+ (log y) (* (log t) (- a 0.5))) (- (* (log t) a) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0073) {
tmp = log(y) + (log(t) * (a - 0.5));
} else {
tmp = (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.0073d0) then
tmp = log(y) + (log(t) * (a - 0.5d0))
else
tmp = (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.0073) {
tmp = Math.log(y) + (Math.log(t) * (a - 0.5));
} else {
tmp = (Math.log(t) * a) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0073: tmp = math.log(y) + (math.log(t) * (a - 0.5)) else: tmp = (math.log(t) * a) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0073) tmp = Float64(log(y) + Float64(log(t) * Float64(a - 0.5))); else tmp = Float64(Float64(log(t) * a) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.0073) tmp = log(y) + (log(t) * (a - 0.5)); else tmp = (log(t) * a) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0073], N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0073:\\
\;\;\;\;\log y + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\log t \cdot a - t\\
\end{array}
\end{array}
if t < 0.00730000000000000007Initial program 99.3%
associate--l+99.3%
sub-neg99.3%
metadata-eval99.3%
Simplified99.3%
add-cube-cbrt98.9%
pow398.9%
Applied egg-rr98.9%
Taylor expanded in t around inf 58.0%
+-commutative58.0%
mul-1-neg58.0%
unsub-neg58.0%
log-rec58.0%
sub-neg58.0%
metadata-eval58.0%
distribute-lft-neg-in58.0%
distribute-rgt-neg-in58.0%
Simplified58.0%
Taylor expanded in x around 0 45.5%
if 0.00730000000000000007 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
Final simplification72.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* (log t) a))) (if (<= t 0.0073) (+ (log y) t_1) (- t_1 t))))
double code(double x, double y, double z, double t, double a) {
double t_1 = log(t) * a;
double tmp;
if (t <= 0.0073) {
tmp = log(y) + t_1;
} 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(t) * a
if (t <= 0.0073d0) then
tmp = log(y) + t_1
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(t) * a;
double tmp;
if (t <= 0.0073) {
tmp = Math.log(y) + t_1;
} else {
tmp = t_1 - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * a tmp = 0 if t <= 0.0073: tmp = math.log(y) + t_1 else: tmp = t_1 - t return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * a) tmp = 0.0 if (t <= 0.0073) tmp = Float64(log(y) + t_1); else tmp = Float64(t_1 - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * a; tmp = 0.0; if (t <= 0.0073) tmp = log(y) + t_1; else tmp = t_1 - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, 0.0073], N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision], N[(t$95$1 - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot a\\
\mathbf{if}\;t \leq 0.0073:\\
\;\;\;\;\log y + t_1\\
\mathbf{else}:\\
\;\;\;\;t_1 - t\\
\end{array}
\end{array}
if t < 0.00730000000000000007Initial program 99.3%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-udef99.4%
sub-neg99.4%
+-commutative99.4%
distribute-neg-in99.4%
metadata-eval99.4%
metadata-eval99.4%
unsub-neg99.4%
Simplified99.4%
Taylor expanded in a around inf 57.9%
*-commutative57.9%
Simplified57.9%
Taylor expanded in x around 0 45.5%
*-commutative45.5%
Simplified45.5%
if 0.00730000000000000007 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 71.1%
Taylor expanded in a around inf 98.3%
*-commutative98.3%
Simplified98.3%
Final simplification72.5%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.0073) (log (+ x y)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.0073) {
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 <= 0.0073d0) 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 <= 0.0073) {
tmp = Math.log((x + y));
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.0073: tmp = math.log((x + y)) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.0073) 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 <= 0.0073) tmp = log((x + y)); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.0073], N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.0073:\\
\;\;\;\;\log \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 0.00730000000000000007Initial program 99.3%
associate-+l-99.4%
associate--l+99.4%
sub-neg99.4%
+-commutative99.4%
*-commutative99.4%
distribute-rgt-neg-in99.4%
fma-udef99.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.2%
neg-mul-19.2%
Simplified9.2%
Taylor expanded in t around 0 9.2%
+-commutative9.2%
Simplified9.2%
if 0.00730000000000000007 < t Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 71.1%
Taylor expanded in t around inf 71.4%
neg-mul-171.4%
Simplified71.4%
Final simplification41.0%
(FPCore (x y z t a) :precision binary64 (- (* (log t) a) t))
double code(double x, double y, double z, double t, double a) {
return (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(t) * a) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(t) * a) - t;
}
def code(x, y, z, t, a): return (math.log(t) * a) - t
function code(x, y, z, t, a) return Float64(Float64(log(t) * a) - t) end
function tmp = code(x, y, z, t, a) tmp = (log(t) * a) - t; end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log t \cdot a - 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 68.1%
Taylor expanded in a around inf 75.8%
*-commutative75.8%
Simplified75.8%
Final simplification75.8%
(FPCore (x y z t a) :precision binary64 (- (log y) t))
double code(double x, double y, double z, double t, double a) {
return log(y) - 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) - t
end function
public static double code(double x, double y, double z, double t, double a) {
return Math.log(y) - t;
}
def code(x, y, z, t, a): return math.log(y) - t
function code(x, y, z, t, a) return Float64(log(y) - t) end
function tmp = code(x, y, z, t, a) tmp = log(y) - t; end
code[x_, y_, z_, t_, a_] := N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]
\begin{array}{l}
\\
\log y - t
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-udef99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in t around inf 41.0%
neg-mul-141.0%
Simplified41.0%
Taylor expanded in x around 0 28.3%
Final simplification28.3%
(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 68.1%
Taylor expanded in t around inf 37.9%
neg-mul-137.9%
Simplified37.9%
Final simplification37.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 2024019
(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))))