
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))
double code(double x, double y, double z, double t, double a) {
return ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = ((log((x + y)) + log(z)) - t) + ((a - 0.5d0) * log(t))
end function
public static double code(double x, double y, double z, double t, double a) {
return ((Math.log((x + y)) + Math.log(z)) - t) + ((a - 0.5) * Math.log(t));
}
def code(x, y, z, t, a): return ((math.log((x + y)) + math.log(z)) - t) + ((a - 0.5) * math.log(t))
function code(x, y, z, t, a) return Float64(Float64(Float64(log(Float64(x + y)) + log(z)) - t) + Float64(Float64(a - 0.5) * log(t))) end
function tmp = code(x, y, z, t, a) tmp = ((log((x + y)) + log(z)) - t) + ((a - 0.5) * log(t)); end
code[x_, y_, z_, t_, a_] := N[(N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log \left(x + y\right) + \log z\right) - t\right) + \left(a - 0.5\right) \cdot \log t
\end{array}
(FPCore (x y z t a) :precision binary64 (+ (log (+ x y)) (- (log z) (fma (log t) (- 0.5 a) t))))
double code(double x, double y, double z, double t, double a) {
return log((x + y)) + (log(z) - fma(log(t), (0.5 - a), t));
}
function code(x, y, z, t, a) return Float64(log(Float64(x + y)) + Float64(log(z) - fma(log(t), Float64(0.5 - a), t))) end
code[x_, y_, z_, t_, a_] := N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - N[(N[Log[t], $MachinePrecision] * N[(0.5 - a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log \left(x + y\right) + \left(\log z - \mathsf{fma}\left(\log t, 0.5 - a, t\right)\right)
\end{array}
Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
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 -750.0) (not (<= t_1 702.0)))
(- (+ (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 <= -750.0) || !(t_1 <= 702.0)) {
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 <= (-750.0d0)) .or. (.not. (t_1 <= 702.0d0))) 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 <= -750.0) || !(t_1 <= 702.0)) {
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 <= -750.0) or not (t_1 <= 702.0): 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 <= -750.0) || !(t_1 <= 702.0)) tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); else tmp = Float64(log(Float64(Float64(x + 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 <= 702.0))) 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, -750.0], N[Not[LessEqual[t$95$1, 702.0]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], N[(N[Log[N[(N[(x + y), $MachinePrecision] * 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 702\right):\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\mathbf{else}:\\
\;\;\;\;\log \left(\left(x + y\right) \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 702 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.8%
remove-double-neg99.8%
associate--l+99.8%
remove-double-neg99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 78.7%
Taylor expanded in a around inf 66.7%
*-commutative66.7%
Simplified66.7%
if -750 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 702Initial program 99.5%
remove-double-neg99.5%
associate--l+99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
associate-+r-99.5%
associate-+l-99.5%
sum-log99.7%
*-commutative99.7%
Applied egg-rr99.7%
Final simplification91.9%
(FPCore (x y z t a) :precision binary64 (if (<= t 425.0) (+ (log y) (+ (log z) (* (log t) (- a 0.5)))) (- (+ (log y) (* (log t) a)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 425.0) {
tmp = log(y) + (log(z) + (log(t) * (a - 0.5)));
} 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 <= 425.0d0) then
tmp = log(y) + (log(z) + (log(t) * (a - 0.5d0)))
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 <= 425.0) {
tmp = Math.log(y) + (Math.log(z) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 425.0: tmp = math.log(y) + (math.log(z) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(y) + (math.log(t) * a)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 425.0) tmp = Float64(log(y) + Float64(log(z) + Float64(log(t) * Float64(a - 0.5)))); 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 <= 425.0) tmp = log(y) + (log(z) + (log(t) * (a - 0.5))); else tmp = (log(y) + (log(t) * a)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 425.0], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 425:\\
\;\;\;\;\log y + \left(\log z + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\end{array}
\end{array}
if t < 425Initial program 99.2%
remove-double-neg99.2%
associate--l+99.2%
remove-double-neg99.2%
sub-neg99.2%
metadata-eval99.2%
Simplified99.2%
Taylor expanded in x around 0 66.2%
Taylor expanded in t around 0 65.8%
if 425 < t Initial program 99.9%
remove-double-neg99.9%
associate--l+99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 77.6%
Taylor expanded in a around inf 77.6%
*-commutative77.6%
Simplified77.6%
Final simplification71.7%
(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%
remove-double-neg99.6%
associate--l+99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Final simplification99.6%
(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 71.8%
Final simplification71.8%
(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%
remove-double-neg99.6%
associate--l+99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.9%
Final simplification71.9%
(FPCore (x y z t a)
:precision binary64
(if (<= a -0.0265)
(- (+ (log y) (* (log t) a)) t)
(if (<= a 4.9e-5)
(- (log (* y (* z (pow t (+ a -0.5))))) t)
(- (* a (+ (log t) (/ (log y) a))) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -0.0265) {
tmp = (log(y) + (log(t) * a)) - t;
} else if (a <= 4.9e-5) {
tmp = log((y * (z * pow(t, (a + -0.5))))) - t;
} else {
tmp = (a * (log(t) + (log(y) / 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 (a <= (-0.0265d0)) then
tmp = (log(y) + (log(t) * a)) - t
else if (a <= 4.9d-5) then
tmp = log((y * (z * (t ** (a + (-0.5d0)))))) - t
else
tmp = (a * (log(t) + (log(y) / 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 (a <= -0.0265) {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
} else if (a <= 4.9e-5) {
tmp = Math.log((y * (z * Math.pow(t, (a + -0.5))))) - t;
} else {
tmp = (a * (Math.log(t) + (Math.log(y) / a))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= -0.0265: tmp = (math.log(y) + (math.log(t) * a)) - t elif a <= 4.9e-5: tmp = math.log((y * (z * math.pow(t, (a + -0.5))))) - t else: tmp = (a * (math.log(t) + (math.log(y) / a))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= -0.0265) tmp = Float64(Float64(log(y) + Float64(log(t) * a)) - t); elseif (a <= 4.9e-5) tmp = Float64(log(Float64(y * Float64(z * (t ^ Float64(a + -0.5))))) - t); else tmp = Float64(Float64(a * Float64(log(t) + Float64(log(y) / a))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= -0.0265) tmp = (log(y) + (log(t) * a)) - t; elseif (a <= 4.9e-5) tmp = log((y * (z * (t ^ (a + -0.5))))) - t; else tmp = (a * (log(t) + (log(y) / a))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -0.0265], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[a, 4.9e-5], N[(N[Log[N[(y * N[(z * N[Power[t, N[(a + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision], N[(N[(a * N[(N[Log[t], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.0265:\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\mathbf{elif}\;a \leq 4.9 \cdot 10^{-5}:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right) - t\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(\log t + \frac{\log y}{a}\right) - t\\
\end{array}
\end{array}
if a < -0.0264999999999999993Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 78.9%
Taylor expanded in a around inf 78.4%
*-commutative78.4%
Simplified78.4%
if -0.0264999999999999993 < a < 4.9e-5Initial program 99.4%
remove-double-neg99.4%
associate--l+99.4%
remove-double-neg99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 64.4%
add-log-exp57.6%
sum-log42.8%
exp-sum42.8%
add-exp-log42.9%
exp-to-pow43.0%
sub-neg43.0%
metadata-eval43.0%
Applied egg-rr43.0%
if 4.9e-5 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 78.5%
Taylor expanded in a around inf 77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in a around inf 77.2%
Final simplification61.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.6e+25) (not (<= a 1.8e+66))) (* (log t) a) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.6e+25) || !(a <= 1.8e+66)) {
tmp = log(t) * a;
} else {
tmp = log((x + y)) + (log(z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-2.6d+25)) .or. (.not. (a <= 1.8d+66))) then
tmp = log(t) * a
else
tmp = log((x + y)) + (log(z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.6e+25) || !(a <= 1.8e+66)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log((x + y)) + (Math.log(z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.6e+25) or not (a <= 1.8e+66): tmp = math.log(t) * a else: tmp = math.log((x + y)) + (math.log(z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.6e+25) || !(a <= 1.8e+66)) tmp = Float64(log(t) * a); else tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.6e+25) || ~((a <= 1.8e+66))) tmp = log(t) * a; else tmp = log((x + y)) + (log(z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.6e+25], N[Not[LessEqual[a, 1.8e+66]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{+25} \lor \neg \left(a \leq 1.8 \cdot 10^{+66}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\end{array}
\end{array}
if a < -2.5999999999999998e25 or 1.8e66 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.8%
Taylor expanded in t around inf 55.5%
sub-neg55.5%
associate-+r+55.5%
mul-1-neg55.5%
log-rec55.5%
sub-neg55.5%
metadata-eval55.5%
associate-/l*55.4%
distribute-lft-neg-in55.4%
remove-double-neg55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in a around inf 84.8%
*-commutative84.8%
Simplified84.8%
if -2.5999999999999998e25 < a < 1.8e66Initial 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 60.2%
Final simplification70.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 4.9e-12) (+ (log (* (+ x y) z)) (* (log t) (- a 0.5))) (- (+ (log y) (* (log t) a)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 4.9e-12) {
tmp = log(((x + y) * z)) + (log(t) * (a - 0.5));
} 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 <= 4.9d-12) then
tmp = log(((x + y) * z)) + (log(t) * (a - 0.5d0))
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 <= 4.9e-12) {
tmp = Math.log(((x + y) * z)) + (Math.log(t) * (a - 0.5));
} else {
tmp = (Math.log(y) + (Math.log(t) * a)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 4.9e-12: tmp = math.log(((x + y) * z)) + (math.log(t) * (a - 0.5)) else: tmp = (math.log(y) + (math.log(t) * a)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 4.9e-12) tmp = Float64(log(Float64(Float64(x + y) * z)) + Float64(log(t) * Float64(a - 0.5))); 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 <= 4.9e-12) tmp = log(((x + y) * z)) + (log(t) * (a - 0.5)); else tmp = (log(y) + (log(t) * a)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 4.9e-12], N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $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 4.9 \cdot 10^{-12}:\\
\;\;\;\;\log \left(\left(x + y\right) \cdot z\right) + \log t \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \log t \cdot a\right) - t\\
\end{array}
\end{array}
if t < 4.89999999999999972e-12Initial program 99.2%
associate-+l-99.2%
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 inf 72.2%
mul-1-neg72.2%
unsub-neg72.2%
associate-/l*72.1%
log-rec72.1%
Simplified72.1%
associate-+r-72.1%
sum-log61.8%
+-commutative61.8%
cancel-sign-sub61.8%
Applied egg-rr61.8%
Taylor expanded in t around 0 82.2%
if 4.89999999999999972e-12 < t Initial program 99.9%
remove-double-neg99.9%
associate--l+99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 77.3%
Taylor expanded in a around inf 75.9%
*-commutative75.9%
Simplified75.9%
Final simplification78.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -3.8e+26) (not (<= a 2.4e+65))) (* (log t) a) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.8e+26) || !(a <= 2.4e+65)) {
tmp = log(t) * a;
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-3.8d+26)) .or. (.not. (a <= 2.4d+65))) then
tmp = log(t) * a
else
tmp = (log(z) + log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -3.8e+26) || !(a <= 2.4e+65)) {
tmp = Math.log(t) * a;
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -3.8e+26) or not (a <= 2.4e+65): tmp = math.log(t) * a else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -3.8e+26) || !(a <= 2.4e+65)) tmp = Float64(log(t) * a); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -3.8e+26) || ~((a <= 2.4e+65))) tmp = log(t) * a; else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -3.8e+26], N[Not[LessEqual[a, 2.4e+65]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+26} \lor \neg \left(a \leq 2.4 \cdot 10^{+65}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -3.8000000000000002e26 or 2.4000000000000002e65 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.8%
Taylor expanded in t around inf 55.5%
sub-neg55.5%
associate-+r+55.5%
mul-1-neg55.5%
log-rec55.5%
sub-neg55.5%
metadata-eval55.5%
associate-/l*55.4%
distribute-lft-neg-in55.4%
remove-double-neg55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in a around inf 84.8%
*-commutative84.8%
Simplified84.8%
if -3.8000000000000002e26 < a < 2.4000000000000002e65Initial 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 60.2%
Taylor expanded in x around 0 46.0%
Final simplification62.7%
(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%
remove-double-neg99.6%
associate--l+99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.9%
Taylor expanded in a around inf 61.9%
*-commutative61.9%
Simplified61.9%
Final simplification61.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.3e+23) (not (<= a 1.25e+65))) (* (log t) a) (* t (+ (/ (log (+ x y)) t) -1.0))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.3e+23) || !(a <= 1.25e+65)) {
tmp = log(t) * a;
} else {
tmp = t * ((log((x + y)) / t) + -1.0);
}
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 <= (-5.3d+23)) .or. (.not. (a <= 1.25d+65))) then
tmp = log(t) * a
else
tmp = t * ((log((x + y)) / t) + (-1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.3e+23) || !(a <= 1.25e+65)) {
tmp = Math.log(t) * a;
} else {
tmp = t * ((Math.log((x + y)) / t) + -1.0);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.3e+23) or not (a <= 1.25e+65): tmp = math.log(t) * a else: tmp = t * ((math.log((x + y)) / t) + -1.0) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.3e+23) || !(a <= 1.25e+65)) tmp = Float64(log(t) * a); else tmp = Float64(t * Float64(Float64(log(Float64(x + y)) / t) + -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.3e+23) || ~((a <= 1.25e+65))) tmp = log(t) * a; else tmp = t * ((log((x + y)) / t) + -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.3e+23], N[Not[LessEqual[a, 1.25e+65]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(t * N[(N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] / t), $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.3 \cdot 10^{+23} \lor \neg \left(a \leq 1.25 \cdot 10^{+65}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(\frac{\log \left(x + y\right)}{t} + -1\right)\\
\end{array}
\end{array}
if a < -5.3000000000000001e23 or 1.24999999999999993e65 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.8%
Taylor expanded in t around inf 55.5%
sub-neg55.5%
associate-+r+55.5%
mul-1-neg55.5%
log-rec55.5%
sub-neg55.5%
metadata-eval55.5%
associate-/l*55.4%
distribute-lft-neg-in55.4%
remove-double-neg55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in a around inf 84.8%
*-commutative84.8%
Simplified84.8%
if -5.3000000000000001e23 < a < 1.24999999999999993e65Initial 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 58.6%
neg-mul-158.6%
Simplified58.6%
Taylor expanded in t around inf 58.6%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.2e+23) (not (<= a 1.5e+65))) (* (log t) a) (- (log (+ x y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.2e+23) || !(a <= 1.5e+65)) {
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 <= (-5.2d+23)) .or. (.not. (a <= 1.5d+65))) 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 <= -5.2e+23) || !(a <= 1.5e+65)) {
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 <= -5.2e+23) or not (a <= 1.5e+65): 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 <= -5.2e+23) || !(a <= 1.5e+65)) 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 <= -5.2e+23) || ~((a <= 1.5e+65))) 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, -5.2e+23], N[Not[LessEqual[a, 1.5e+65]], $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 -5.2 \cdot 10^{+23} \lor \neg \left(a \leq 1.5 \cdot 10^{+65}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) - t\\
\end{array}
\end{array}
if a < -5.19999999999999983e23 or 1.5000000000000001e65 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.8%
Taylor expanded in t around inf 55.5%
sub-neg55.5%
associate-+r+55.5%
mul-1-neg55.5%
log-rec55.5%
sub-neg55.5%
metadata-eval55.5%
associate-/l*55.4%
distribute-lft-neg-in55.4%
remove-double-neg55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in a around inf 84.8%
*-commutative84.8%
Simplified84.8%
if -5.19999999999999983e23 < a < 1.5000000000000001e65Initial 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 58.6%
neg-mul-158.6%
Simplified58.6%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -7.8e+27) (not (<= a 1.3e+65))) (* (log t) a) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -7.8e+27) || !(a <= 1.3e+65)) {
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 <= (-7.8d+27)) .or. (.not. (a <= 1.3d+65))) 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 <= -7.8e+27) || !(a <= 1.3e+65)) {
tmp = Math.log(t) * a;
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -7.8e+27) or not (a <= 1.3e+65): tmp = math.log(t) * a else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -7.8e+27) || !(a <= 1.3e+65)) 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 <= -7.8e+27) || ~((a <= 1.3e+65))) tmp = log(t) * a; else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -7.8e+27], N[Not[LessEqual[a, 1.3e+65]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.8 \cdot 10^{+27} \lor \neg \left(a \leq 1.3 \cdot 10^{+65}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if a < -7.7999999999999997e27 or 1.30000000000000001e65 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.8%
Taylor expanded in t around inf 55.5%
sub-neg55.5%
associate-+r+55.5%
mul-1-neg55.5%
log-rec55.5%
sub-neg55.5%
metadata-eval55.5%
associate-/l*55.4%
distribute-lft-neg-in55.4%
remove-double-neg55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in a around inf 84.8%
*-commutative84.8%
Simplified84.8%
if -7.7999999999999997e27 < a < 1.30000000000000001e65Initial program 99.5%
remove-double-neg99.5%
associate--l+99.5%
remove-double-neg99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 65.9%
Taylor expanded in t around inf 53.4%
neg-mul-153.4%
Simplified53.4%
Final simplification66.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -5.5e+25) (not (<= a 4.8e+65))) (* (log t) a) (- (log y) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.5e+25) || !(a <= 4.8e+65)) {
tmp = log(t) * a;
} else {
tmp = log(y) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-5.5d+25)) .or. (.not. (a <= 4.8d+65))) then
tmp = log(t) * a
else
tmp = log(y) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -5.5e+25) || !(a <= 4.8e+65)) {
tmp = Math.log(t) * a;
} else {
tmp = Math.log(y) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -5.5e+25) or not (a <= 4.8e+65): tmp = math.log(t) * a else: tmp = math.log(y) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -5.5e+25) || !(a <= 4.8e+65)) tmp = Float64(log(t) * a); else tmp = Float64(log(y) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -5.5e+25) || ~((a <= 4.8e+65))) tmp = log(t) * a; else tmp = log(y) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -5.5e+25], N[Not[LessEqual[a, 4.8e+65]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] * a), $MachinePrecision], N[(N[Log[y], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+25} \lor \neg \left(a \leq 4.8 \cdot 10^{+65}\right):\\
\;\;\;\;\log t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\log y - t\\
\end{array}
\end{array}
if a < -5.50000000000000018e25 or 4.8000000000000003e65 < a Initial program 99.7%
remove-double-neg99.7%
associate--l+99.7%
remove-double-neg99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 79.8%
Taylor expanded in t around inf 55.5%
sub-neg55.5%
associate-+r+55.5%
mul-1-neg55.5%
log-rec55.5%
sub-neg55.5%
metadata-eval55.5%
associate-/l*55.4%
distribute-lft-neg-in55.4%
remove-double-neg55.4%
metadata-eval55.4%
Simplified55.4%
Taylor expanded in a around inf 84.8%
*-commutative84.8%
Simplified84.8%
if -5.50000000000000018e25 < a < 4.8000000000000003e65Initial 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 58.6%
neg-mul-158.6%
Simplified58.6%
Taylor expanded in x around 0 44.9%
Final simplification62.1%
(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.2%
associate-+l-99.2%
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 inf 9.1%
neg-mul-19.1%
Simplified9.1%
Taylor expanded in t around 0 9.1%
+-commutative9.1%
Simplified9.1%
if 26500 < t Initial program 99.9%
remove-double-neg99.9%
associate--l+99.9%
remove-double-neg99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 78.2%
Taylor expanded in t around inf 73.2%
neg-mul-173.2%
Simplified73.2%
Final simplification40.7%
(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%
remove-double-neg99.6%
associate--l+99.6%
remove-double-neg99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.9%
Taylor expanded in t around inf 37.5%
neg-mul-137.5%
Simplified37.5%
Final simplification37.5%
(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
:alt
(+ (log (+ x y)) (+ (- (log z) t) (* (- a 0.5) (log t))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))