
(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) 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(log(Float64(x + y)) + 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[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log \left(x + y\right) + \left(\log z - t\right)\right) + \left(a + -0.5\right) \cdot \log t
\end{array}
Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5)))
(t_2 (+ (log (+ x y)) (log z)))
(t_3 (+ (log z) (+ (log y) t_1))))
(if (<= t_2 -750.0)
t_3
(if (<= t_2 670.0)
(+ t_1 (- (log (* (+ x y) z)) t))
(if (<= t_2 1050.0)
t_3
(+ (- (log z) t) (+ (log y) (* -0.5 (log 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((x + y)) + log(z);
double t_3 = log(z) + (log(y) + t_1);
double tmp;
if (t_2 <= -750.0) {
tmp = t_3;
} else if (t_2 <= 670.0) {
tmp = t_1 + (log(((x + y) * z)) - t);
} else if (t_2 <= 1050.0) {
tmp = t_3;
} else {
tmp = (log(z) - t) + (log(y) + (-0.5 * log(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) :: t_3
real(8) :: tmp
t_1 = log(t) * (a - 0.5d0)
t_2 = log((x + y)) + log(z)
t_3 = log(z) + (log(y) + t_1)
if (t_2 <= (-750.0d0)) then
tmp = t_3
else if (t_2 <= 670.0d0) then
tmp = t_1 + (log(((x + y) * z)) - t)
else if (t_2 <= 1050.0d0) then
tmp = t_3
else
tmp = (log(z) - t) + (log(y) + ((-0.5d0) * log(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((x + y)) + Math.log(z);
double t_3 = Math.log(z) + (Math.log(y) + t_1);
double tmp;
if (t_2 <= -750.0) {
tmp = t_3;
} else if (t_2 <= 670.0) {
tmp = t_1 + (Math.log(((x + y) * z)) - t);
} else if (t_2 <= 1050.0) {
tmp = t_3;
} else {
tmp = (Math.log(z) - t) + (Math.log(y) + (-0.5 * Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) t_2 = math.log((x + y)) + math.log(z) t_3 = math.log(z) + (math.log(y) + t_1) tmp = 0 if t_2 <= -750.0: tmp = t_3 elif t_2 <= 670.0: tmp = t_1 + (math.log(((x + y) * z)) - t) elif t_2 <= 1050.0: tmp = t_3 else: tmp = (math.log(z) - t) + (math.log(y) + (-0.5 * math.log(t))) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) t_2 = Float64(log(Float64(x + y)) + log(z)) t_3 = Float64(log(z) + Float64(log(y) + t_1)) tmp = 0.0 if (t_2 <= -750.0) tmp = t_3; elseif (t_2 <= 670.0) tmp = Float64(t_1 + Float64(log(Float64(Float64(x + y) * z)) - t)); elseif (t_2 <= 1050.0) tmp = t_3; else tmp = Float64(Float64(log(z) - t) + Float64(log(y) + Float64(-0.5 * log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); t_2 = log((x + y)) + log(z); t_3 = log(z) + (log(y) + t_1); tmp = 0.0; if (t_2 <= -750.0) tmp = t_3; elseif (t_2 <= 670.0) tmp = t_1 + (log(((x + y) * z)) - t); elseif (t_2 <= 1050.0) tmp = t_3; else tmp = (log(z) - t) + (log(y) + (-0.5 * log(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[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -750.0], t$95$3, If[LessEqual[t$95$2, 670.0], N[(t$95$1 + N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1050.0], t$95$3, N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(-0.5 * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
t_2 := \log \left(x + y\right) + \log z\\
t_3 := \log z + \left(\log y + t\_1\right)\\
\mathbf{if}\;t\_2 \leq -750:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 670:\\
\;\;\;\;t\_1 + \left(\log \left(\left(x + y\right) \cdot z\right) - t\right)\\
\mathbf{elif}\;t\_2 \leq 1050:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\left(\log z - t\right) + \left(\log y + -0.5 \cdot \log t\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -750 or 670 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1050Initial program 99.7%
associate--l+99.7%
+-commutative99.7%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 71.8%
Taylor expanded in t around 0 50.3%
if -750 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 670Initial program 99.6%
sum-log99.7%
Applied egg-rr99.7%
if 1050 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 66.7%
Taylor expanded in a around 0 58.6%
*-commutative58.6%
Simplified58.6%
Final simplification87.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))) (t_2 (+ (log (+ x y)) (log z))))
(if (or (<= t_2 -750.0) (not (<= t_2 670.0)))
(+ (log z) (+ (log y) t_1))
(+ t_1 (- (log (* (+ x y) z)) 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((x + y)) + log(z);
double tmp;
if ((t_2 <= -750.0) || !(t_2 <= 670.0)) {
tmp = log(z) + (log(y) + t_1);
} else {
tmp = t_1 + (log(((x + y) * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log(t) * (a - 0.5d0)
t_2 = log((x + y)) + log(z)
if ((t_2 <= (-750.0d0)) .or. (.not. (t_2 <= 670.0d0))) then
tmp = log(z) + (log(y) + t_1)
else
tmp = t_1 + (log(((x + y) * z)) - 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((x + y)) + Math.log(z);
double tmp;
if ((t_2 <= -750.0) || !(t_2 <= 670.0)) {
tmp = Math.log(z) + (Math.log(y) + t_1);
} else {
tmp = t_1 + (Math.log(((x + y) * z)) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) t_2 = math.log((x + y)) + math.log(z) tmp = 0 if (t_2 <= -750.0) or not (t_2 <= 670.0): tmp = math.log(z) + (math.log(y) + t_1) else: tmp = t_1 + (math.log(((x + y) * z)) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) t_2 = Float64(log(Float64(x + y)) + log(z)) tmp = 0.0 if ((t_2 <= -750.0) || !(t_2 <= 670.0)) tmp = Float64(log(z) + Float64(log(y) + t_1)); else tmp = Float64(t_1 + Float64(log(Float64(Float64(x + y) * z)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); t_2 = log((x + y)) + log(z); tmp = 0.0; if ((t_2 <= -750.0) || ~((t_2 <= 670.0))) tmp = log(z) + (log(y) + t_1); else tmp = t_1 + (log(((x + y) * z)) - 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[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -750.0], N[Not[LessEqual[t$95$2, 670.0]], $MachinePrecision]], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
t_2 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t\_2 \leq -750 \lor \neg \left(t\_2 \leq 670\right):\\
\;\;\;\;\log z + \left(\log y + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\log \left(\left(x + y\right) \cdot z\right) - t\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -750 or 670 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.7%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 70.8%
Taylor expanded in t around 0 45.7%
if -750 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 670Initial program 99.6%
sum-log99.7%
Applied egg-rr99.7%
Final simplification86.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (log t) (- a 0.5))) (t_2 (+ (log (+ x y)) (log z))))
(if (or (<= t_2 -750.0) (not (<= t_2 670.0)))
(+ (log y) (+ (log z) t_1))
(+ t_1 (- (log (* (+ x y) z)) 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((x + y)) + log(z);
double tmp;
if ((t_2 <= -750.0) || !(t_2 <= 670.0)) {
tmp = log(y) + (log(z) + t_1);
} else {
tmp = t_1 + (log(((x + y) * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log(t) * (a - 0.5d0)
t_2 = log((x + y)) + log(z)
if ((t_2 <= (-750.0d0)) .or. (.not. (t_2 <= 670.0d0))) then
tmp = log(y) + (log(z) + t_1)
else
tmp = t_1 + (log(((x + y) * z)) - 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((x + y)) + Math.log(z);
double tmp;
if ((t_2 <= -750.0) || !(t_2 <= 670.0)) {
tmp = Math.log(y) + (Math.log(z) + t_1);
} else {
tmp = t_1 + (Math.log(((x + y) * z)) - t);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log(t) * (a - 0.5) t_2 = math.log((x + y)) + math.log(z) tmp = 0 if (t_2 <= -750.0) or not (t_2 <= 670.0): tmp = math.log(y) + (math.log(z) + t_1) else: tmp = t_1 + (math.log(((x + y) * z)) - t) return tmp
function code(x, y, z, t, a) t_1 = Float64(log(t) * Float64(a - 0.5)) t_2 = Float64(log(Float64(x + y)) + log(z)) tmp = 0.0 if ((t_2 <= -750.0) || !(t_2 <= 670.0)) tmp = Float64(log(y) + Float64(log(z) + t_1)); else tmp = Float64(t_1 + Float64(log(Float64(Float64(x + y) * z)) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log(t) * (a - 0.5); t_2 = log((x + y)) + log(z); tmp = 0.0; if ((t_2 <= -750.0) || ~((t_2 <= 670.0))) tmp = log(y) + (log(z) + t_1); else tmp = t_1 + (log(((x + y) * z)) - 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[(x + y), $MachinePrecision]], $MachinePrecision] + N[Log[z], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -750.0], N[Not[LessEqual[t$95$2, 670.0]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t \cdot \left(a - 0.5\right)\\
t_2 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t\_2 \leq -750 \lor \neg \left(t\_2 \leq 670\right):\\
\;\;\;\;\log y + \left(\log z + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 + \left(\log \left(\left(x + y\right) \cdot z\right) - t\right)\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < -750 or 670 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.7%
associate--l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 70.8%
Taylor expanded in t around 0 45.6%
if -750 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 670Initial program 99.6%
sum-log99.7%
Applied egg-rr99.7%
Final simplification86.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (<= t_1 670.0)
(+ (* (log t) (- a 0.5)) (- (log (* (+ x y) z)) t))
(if (<= t_1 1050.0)
(+ (log z) (+ (log y) (* a (log t))))
(- (+ (log z) (log y)) 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 <= 670.0) {
tmp = (log(t) * (a - 0.5)) + (log(((x + y) * z)) - t);
} else if (t_1 <= 1050.0) {
tmp = log(z) + (log(y) + (a * log(t)));
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log((x + y)) + log(z)
if (t_1 <= 670.0d0) then
tmp = (log(t) * (a - 0.5d0)) + (log(((x + y) * z)) - t)
else if (t_1 <= 1050.0d0) then
tmp = log(z) + (log(y) + (a * log(t)))
else
tmp = (log(z) + log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y)) + Math.log(z);
double tmp;
if (t_1 <= 670.0) {
tmp = (Math.log(t) * (a - 0.5)) + (Math.log(((x + y) * z)) - t);
} else if (t_1 <= 1050.0) {
tmp = Math.log(z) + (Math.log(y) + (a * Math.log(t)));
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + math.log(z) tmp = 0 if t_1 <= 670.0: tmp = (math.log(t) * (a - 0.5)) + (math.log(((x + y) * z)) - t) elif t_1 <= 1050.0: tmp = math.log(z) + (math.log(y) + (a * math.log(t))) else: tmp = (math.log(z) + math.log(y)) - 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 <= 670.0) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(Float64(Float64(x + y) * z)) - t)); elseif (t_1 <= 1050.0) tmp = Float64(log(z) + Float64(log(y) + Float64(a * log(t)))); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + log(z); tmp = 0.0; if (t_1 <= 670.0) tmp = (log(t) * (a - 0.5)) + (log(((x + y) * z)) - t); elseif (t_1 <= 1050.0) tmp = log(z) + (log(y) + (a * log(t))); else tmp = (log(z) + log(y)) - 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[LessEqual[t$95$1, 670.0], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1050.0], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t\_1 \leq 670:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \left(\log \left(\left(x + y\right) \cdot z\right) - t\right)\\
\mathbf{elif}\;t\_1 \leq 1050:\\
\;\;\;\;\log z + \left(\log y + a \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 670Initial program 99.6%
sum-log96.8%
Applied egg-rr96.8%
if 670 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 1050Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in a around inf 56.1%
mul-1-neg56.1%
*-commutative56.1%
distribute-rgt-neg-in56.1%
Simplified56.1%
Taylor expanded in x around 0 40.4%
+-commutative40.4%
remove-double-neg40.4%
log-rec40.4%
mul-1-neg40.4%
associate--l+40.4%
sub-neg40.4%
mul-1-neg40.4%
log-rec40.4%
remove-double-neg40.4%
mul-1-neg40.4%
remove-double-neg40.4%
Simplified40.4%
if 1050 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 100.0%
associate--l+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 66.7%
Taylor expanded in a around inf 54.1%
Taylor expanded in a around 0 46.1%
+-commutative46.1%
Simplified46.1%
Final simplification84.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (<= t_1 711.5)
(+ (* (log t) (- a 0.5)) (- (log (* (+ x y) z)) t))
(if (<= t_1 887.5) (* a (log t)) (- (+ (log z) (log y)) 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 <= 711.5) {
tmp = (log(t) * (a - 0.5)) + (log(((x + y) * z)) - t);
} else if (t_1 <= 887.5) {
tmp = a * log(t);
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log((x + y)) + log(z)
if (t_1 <= 711.5d0) then
tmp = (log(t) * (a - 0.5d0)) + (log(((x + y) * z)) - t)
else if (t_1 <= 887.5d0) then
tmp = a * log(t)
else
tmp = (log(z) + log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y)) + Math.log(z);
double tmp;
if (t_1 <= 711.5) {
tmp = (Math.log(t) * (a - 0.5)) + (Math.log(((x + y) * z)) - t);
} else if (t_1 <= 887.5) {
tmp = a * Math.log(t);
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + math.log(z) tmp = 0 if t_1 <= 711.5: tmp = (math.log(t) * (a - 0.5)) + (math.log(((x + y) * z)) - t) elif t_1 <= 887.5: tmp = a * math.log(t) else: tmp = (math.log(z) + math.log(y)) - 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 <= 711.5) tmp = Float64(Float64(log(t) * Float64(a - 0.5)) + Float64(log(Float64(Float64(x + y) * z)) - t)); elseif (t_1 <= 887.5) tmp = Float64(a * log(t)); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + log(z); tmp = 0.0; if (t_1 <= 711.5) tmp = (log(t) * (a - 0.5)) + (log(((x + y) * z)) - t); elseif (t_1 <= 887.5) tmp = a * log(t); else tmp = (log(z) + log(y)) - 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[LessEqual[t$95$1, 711.5], N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 887.5], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t\_1 \leq 711.5:\\
\;\;\;\;\log t \cdot \left(a - 0.5\right) + \left(\log \left(\left(x + y\right) \cdot z\right) - t\right)\\
\mathbf{elif}\;t\_1 \leq 887.5:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 711.5Initial program 99.6%
sum-log95.9%
Applied egg-rr95.9%
if 711.5 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 887.5Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in a around inf 57.3%
*-commutative57.3%
Simplified57.3%
if 887.5 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 74.9%
Taylor expanded in a around inf 61.5%
Taylor expanded in a around 0 40.7%
+-commutative40.7%
Simplified40.7%
Final simplification86.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ (log (+ x y)) (log z))))
(if (<= t_1 711.5)
(- (+ (* (log t) (- a 0.5)) (log (* y z))) t)
(if (<= t_1 887.5) (* a (log t)) (- (+ (log z) (log y)) 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 <= 711.5) {
tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t;
} else if (t_1 <= 887.5) {
tmp = a * log(t);
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = log((x + y)) + log(z)
if (t_1 <= 711.5d0) then
tmp = ((log(t) * (a - 0.5d0)) + log((y * z))) - t
else if (t_1 <= 887.5d0) then
tmp = a * log(t)
else
tmp = (log(z) + log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = Math.log((x + y)) + Math.log(z);
double tmp;
if (t_1 <= 711.5) {
tmp = ((Math.log(t) * (a - 0.5)) + Math.log((y * z))) - t;
} else if (t_1 <= 887.5) {
tmp = a * Math.log(t);
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = math.log((x + y)) + math.log(z) tmp = 0 if t_1 <= 711.5: tmp = ((math.log(t) * (a - 0.5)) + math.log((y * z))) - t elif t_1 <= 887.5: tmp = a * math.log(t) else: tmp = (math.log(z) + math.log(y)) - 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 <= 711.5) tmp = Float64(Float64(Float64(log(t) * Float64(a - 0.5)) + log(Float64(y * z))) - t); elseif (t_1 <= 887.5) tmp = Float64(a * log(t)); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = log((x + y)) + log(z); tmp = 0.0; if (t_1 <= 711.5) tmp = ((log(t) * (a - 0.5)) + log((y * z))) - t; elseif (t_1 <= 887.5) tmp = a * log(t); else tmp = (log(z) + log(y)) - 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[LessEqual[t$95$1, 711.5], N[(N[(N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[Log[N[(y * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision], If[LessEqual[t$95$1, 887.5], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log \left(x + y\right) + \log z\\
\mathbf{if}\;t\_1 \leq 711.5:\\
\;\;\;\;\left(\log t \cdot \left(a - 0.5\right) + \log \left(y \cdot z\right)\right) - t\\
\mathbf{elif}\;t\_1 \leq 887.5:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 711.5Initial program 99.6%
associate--l+99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
add-cube-cbrt97.9%
pow397.9%
+-commutative97.9%
*-commutative97.9%
fma-define97.9%
associate-+r-97.9%
sum-log94.3%
Applied egg-rr94.3%
Taylor expanded in x around 0 63.9%
if 711.5 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) < 887.5Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in a around inf 57.3%
*-commutative57.3%
Simplified57.3%
if 887.5 < (+.f64 (log.f64 (+.f64 x y)) (log.f64 z)) Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 74.9%
Taylor expanded in a around inf 61.5%
Taylor expanded in a around 0 40.7%
+-commutative40.7%
Simplified40.7%
Final simplification60.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 0.43) (+ (log z) (+ (log y) (* (log t) (- a 0.5)))) (- (+ (log y) (+ (log z) (* a (log t)))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 0.43) {
tmp = log(z) + (log(y) + (log(t) * (a - 0.5)));
} else {
tmp = (log(y) + (log(z) + (a * log(t)))) - 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.43d0) then
tmp = log(z) + (log(y) + (log(t) * (a - 0.5d0)))
else
tmp = (log(y) + (log(z) + (a * log(t)))) - 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.43) {
tmp = Math.log(z) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
} else {
tmp = (Math.log(y) + (Math.log(z) + (a * Math.log(t)))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 0.43: tmp = math.log(z) + (math.log(y) + (math.log(t) * (a - 0.5))) else: tmp = (math.log(y) + (math.log(z) + (a * math.log(t)))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 0.43) tmp = Float64(log(z) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))); else tmp = Float64(Float64(log(y) + Float64(log(z) + Float64(a * log(t)))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 0.43) tmp = log(z) + (log(y) + (log(t) * (a - 0.5))); else tmp = (log(y) + (log(z) + (a * log(t)))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 0.43], N[(N[Log[z], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] + N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 0.43:\\
\;\;\;\;\log z + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\log y + \left(\log z + a \cdot \log t\right)\right) - t\\
\end{array}
\end{array}
if t < 0.429999999999999993Initial program 99.4%
associate--l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.4%
sub-neg99.4%
metadata-eval99.4%
Simplified99.4%
Taylor expanded in x around 0 59.9%
Taylor expanded in t around 0 58.4%
if 0.429999999999999993 < t Initial program 99.9%
associate--l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 82.9%
Taylor expanded in a around inf 82.7%
(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%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.4%
(FPCore (x y z t a) :precision binary64 (+ (- (log z) t) (+ (log y) (* (log t) (- a 0.5)))))
double code(double x, double y, double z, double t, double a) {
return (log(z) - t) + (log(y) + (log(t) * (a - 0.5)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (log(z) - t) + (log(y) + (log(t) * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a) {
return (Math.log(z) - t) + (Math.log(y) + (Math.log(t) * (a - 0.5)));
}
def code(x, y, z, t, a): return (math.log(z) - t) + (math.log(y) + (math.log(t) * (a - 0.5)))
function code(x, y, z, t, a) return Float64(Float64(log(z) - t) + Float64(log(y) + Float64(log(t) * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a) tmp = (log(z) - t) + (log(y) + (log(t) * (a - 0.5))); end
code[x_, y_, z_, t_, a_] := N[(N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\log z - t\right) + \left(\log y + \log t \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 71.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= (- a 0.5) -100000.0) (not (<= (- a 0.5) -0.4))) (* a (log t)) (- (log (* y (* z (pow t (+ a -0.5))))) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (((a - 0.5) <= -100000.0) || !((a - 0.5) <= -0.4)) {
tmp = a * log(t);
} else {
tmp = log((y * (z * pow(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) :: tmp
if (((a - 0.5d0) <= (-100000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.4d0)))) then
tmp = a * log(t)
else
tmp = log((y * (z * (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 tmp;
if (((a - 0.5) <= -100000.0) || !((a - 0.5) <= -0.4)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((y * (z * Math.pow(t, (a + -0.5))))) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if ((a - 0.5) <= -100000.0) or not ((a - 0.5) <= -0.4): tmp = a * math.log(t) else: tmp = math.log((y * (z * math.pow(t, (a + -0.5))))) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((Float64(a - 0.5) <= -100000.0) || !(Float64(a - 0.5) <= -0.4)) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(y * Float64(z * (t ^ Float64(a + -0.5))))) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (((a - 0.5) <= -100000.0) || ~(((a - 0.5) <= -0.4))) tmp = a * log(t); else tmp = log((y * (z * (t ^ (a + -0.5))))) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -100000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.4]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(y * N[(z * N[Power[t, N[(a + -0.5), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -100000 \lor \neg \left(a - 0.5 \leq -0.4\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(y \cdot \left(z \cdot {t}^{\left(a + -0.5\right)}\right)\right) - t\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -1e5 or -0.40000000000000002 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in a around inf 73.4%
*-commutative73.4%
Simplified73.4%
if -1e5 < (-.f64 a #s(literal 1/2 binary64)) < -0.40000000000000002Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 67.0%
*-un-lft-identity67.0%
add-log-exp55.6%
sum-log44.1%
exp-sum44.1%
add-exp-log44.1%
sub-neg44.1%
metadata-eval44.1%
pow-to-exp44.1%
Applied egg-rr44.1%
*-lft-identity44.1%
Simplified44.1%
Final simplification58.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -1.55e+18) (not (<= a 1e+79))) (* a (log t)) (+ (log (+ x y)) (- (log z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.55e+18) || !(a <= 1e+79)) {
tmp = a * log(t);
} else {
tmp = log((x + y)) + (log(z) - t);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-1.55d+18)) .or. (.not. (a <= 1d+79))) then
tmp = a * log(t)
else
tmp = log((x + y)) + (log(z) - t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.55e+18) || !(a <= 1e+79)) {
tmp = a * Math.log(t);
} else {
tmp = Math.log((x + y)) + (Math.log(z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.55e+18) or not (a <= 1e+79): tmp = a * math.log(t) else: tmp = math.log((x + y)) + (math.log(z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.55e+18) || !(a <= 1e+79)) tmp = Float64(a * log(t)); else tmp = Float64(log(Float64(x + y)) + Float64(log(z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -1.55e+18) || ~((a <= 1e+79))) tmp = a * log(t); else tmp = log((x + y)) + (log(z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -1.55e+18], N[Not[LessEqual[a, 1e+79]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[Log[N[(x + y), $MachinePrecision]], $MachinePrecision] + N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+18} \lor \neg \left(a \leq 10^{+79}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\log \left(x + y\right) + \left(\log z - t\right)\\
\end{array}
\end{array}
if a < -1.55e18 or 9.99999999999999967e78 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in a around inf 80.5%
*-commutative80.5%
Simplified80.5%
if -1.55e18 < a < 9.99999999999999967e78Initial program 99.6%
associate-+l-99.6%
associate--l+99.6%
sub-neg99.6%
+-commutative99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
fma-undefine99.6%
sub-neg99.6%
+-commutative99.6%
distribute-neg-in99.6%
metadata-eval99.6%
metadata-eval99.6%
unsub-neg99.6%
Simplified99.6%
Taylor expanded in t around inf 58.5%
Final simplification67.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -4.1e+15) (not (<= a 2.5e+79))) (* a (log t)) (- (+ (log z) (log y)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.1e+15) || !(a <= 2.5e+79)) {
tmp = a * log(t);
} else {
tmp = (log(z) + log(y)) - t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((a <= (-4.1d+15)) .or. (.not. (a <= 2.5d+79))) then
tmp = a * log(t)
else
tmp = (log(z) + log(y)) - t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -4.1e+15) || !(a <= 2.5e+79)) {
tmp = a * Math.log(t);
} else {
tmp = (Math.log(z) + Math.log(y)) - t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -4.1e+15) or not (a <= 2.5e+79): tmp = a * math.log(t) else: tmp = (math.log(z) + math.log(y)) - t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -4.1e+15) || !(a <= 2.5e+79)) tmp = Float64(a * log(t)); else tmp = Float64(Float64(log(z) + log(y)) - t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -4.1e+15) || ~((a <= 2.5e+79))) tmp = a * log(t); else tmp = (log(z) + log(y)) - t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -4.1e+15], N[Not[LessEqual[a, 2.5e+79]], $MachinePrecision]], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[z], $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] - t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.1 \cdot 10^{+15} \lor \neg \left(a \leq 2.5 \cdot 10^{+79}\right):\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(\log z + \log y\right) - t\\
\end{array}
\end{array}
if a < -4.1e15 or 2.5e79 < a Initial program 99.7%
associate-+l-99.7%
associate--l+99.7%
sub-neg99.7%
+-commutative99.7%
*-commutative99.7%
distribute-rgt-neg-in99.7%
fma-undefine99.7%
sub-neg99.7%
+-commutative99.7%
distribute-neg-in99.7%
metadata-eval99.7%
metadata-eval99.7%
unsub-neg99.7%
Simplified99.7%
Taylor expanded in a around inf 80.5%
*-commutative80.5%
Simplified80.5%
if -4.1e15 < a < 2.5e79Initial program 99.6%
associate--l+99.6%
+-commutative99.6%
associate-+l+99.6%
+-commutative99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 69.1%
Taylor expanded in a around inf 51.5%
Taylor expanded in a around 0 48.0%
+-commutative48.0%
Simplified48.0%
Final simplification60.8%
(FPCore (x y z t a) :precision binary64 (if (<= t 5.8e+16) (* a (log t)) (- t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 5.8e+16) {
tmp = a * log(t);
} else {
tmp = -t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (t <= 5.8d+16) then
tmp = a * log(t)
else
tmp = -t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (t <= 5.8e+16) {
tmp = a * Math.log(t);
} else {
tmp = -t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if t <= 5.8e+16: tmp = a * math.log(t) else: tmp = -t return tmp
function code(x, y, z, t, a) tmp = 0.0 if (t <= 5.8e+16) tmp = Float64(a * log(t)); else tmp = Float64(-t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (t <= 5.8e+16) tmp = a * log(t); else tmp = -t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[t, 5.8e+16], N[(a * N[Log[t], $MachinePrecision]), $MachinePrecision], (-t)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 5.8 \cdot 10^{+16}:\\
\;\;\;\;a \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;-t\\
\end{array}
\end{array}
if t < 5.8e16Initial program 99.4%
associate-+l-99.4%
associate--l+99.3%
sub-neg99.3%
+-commutative99.3%
*-commutative99.3%
distribute-rgt-neg-in99.3%
fma-undefine99.3%
sub-neg99.3%
+-commutative99.3%
distribute-neg-in99.3%
metadata-eval99.3%
metadata-eval99.3%
unsub-neg99.3%
Simplified99.3%
Taylor expanded in a around inf 48.9%
*-commutative48.9%
Simplified48.9%
if 5.8e16 < t Initial program 99.9%
associate-+l-99.9%
associate--l+99.9%
sub-neg99.9%
+-commutative99.9%
*-commutative99.9%
distribute-rgt-neg-in99.9%
fma-undefine99.9%
sub-neg99.9%
+-commutative99.9%
distribute-neg-in99.9%
metadata-eval99.9%
metadata-eval99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in t around inf 77.3%
neg-mul-177.3%
Simplified77.3%
Final simplification62.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%
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 39.3%
neg-mul-139.3%
Simplified39.3%
(FPCore (x y z t a) :precision binary64 0.0)
double code(double x, double y, double z, double t, double a) {
return 0.0;
}
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 = 0.0d0
end function
public static double code(double x, double y, double z, double t, double a) {
return 0.0;
}
def code(x, y, z, t, a): return 0.0
function code(x, y, z, t, a) return 0.0 end
function tmp = code(x, y, z, t, a) tmp = 0.0; end
code[x_, y_, z_, t_, a_] := 0.0
\begin{array}{l}
\\
0
\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 t around inf 39.3%
neg-mul-139.3%
Simplified39.3%
expm1-log1p-u1.5%
expm1-undefine1.4%
Applied egg-rr1.4%
sub-neg1.4%
log1p-undefine1.4%
rem-exp-log39.2%
unsub-neg39.2%
metadata-eval39.2%
Simplified39.2%
Taylor expanded in t around 0 2.4%
metadata-eval2.4%
Applied egg-rr2.4%
(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 2024180
(FPCore (x y z t a)
:name "Numeric.SpecFunctions:logGammaL from math-functions-0.1.5.2"
:precision binary64
:alt
(! :herbie-platform default (+ (log (+ x y)) (+ (- (log z) t) (* (- a 1/2) (log t)))))
(+ (- (+ (log (+ x y)) (log z)) t) (* (- a 0.5) (log t))))