
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (- (- (- (log t) z) y) (* x (log (/ 1.0 y)))))
double code(double x, double y, double z, double t) {
return ((log(t) - z) - y) - (x * log((1.0 / y)));
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((log(t) - z) - y) - (x * log((1.0d0 / y)))
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(t) - z) - y) - (x * Math.log((1.0 / y)));
}
def code(x, y, z, t): return ((math.log(t) - z) - y) - (x * math.log((1.0 / y)))
function code(x, y, z, t) return Float64(Float64(Float64(log(t) - z) - y) - Float64(x * log(Float64(1.0 / y)))) end
function tmp = code(x, y, z, t) tmp = ((log(t) - z) - y) - (x * log((1.0 / y))); end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision] - N[(x * N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log t - z\right) - y\right) - x \cdot \log \left(\frac{1}{y}\right)
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = log(t) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -3.8e+92)
t_1
(if (<= x -1.5e-131)
(- (log t) y)
(if (<= x 1.35e+76) (- (log t) z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -3.8e+92) {
tmp = t_1;
} else if (x <= -1.5e-131) {
tmp = log(t) - y;
} else if (x <= 1.35e+76) {
tmp = log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-3.8d+92)) then
tmp = t_1
else if (x <= (-1.5d-131)) then
tmp = log(t) - y
else if (x <= 1.35d+76) then
tmp = log(t) - z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if (x <= -3.8e+92) {
tmp = t_1;
} else if (x <= -1.5e-131) {
tmp = Math.log(t) - y;
} else if (x <= 1.35e+76) {
tmp = Math.log(t) - z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -3.8e+92: tmp = t_1 elif x <= -1.5e-131: tmp = math.log(t) - y elif x <= 1.35e+76: tmp = math.log(t) - z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -3.8e+92) tmp = t_1; elseif (x <= -1.5e-131) tmp = Float64(log(t) - y); elseif (x <= 1.35e+76) tmp = Float64(log(t) - z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -3.8e+92) tmp = t_1; elseif (x <= -1.5e-131) tmp = log(t) - y; elseif (x <= 1.35e+76) tmp = log(t) - z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+92], t$95$1, If[LessEqual[x, -1.5e-131], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.35e+76], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-131}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+76}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.8e92 or 1.34999999999999995e76 < x Initial program 99.6%
sub-neg99.6%
associate--l+99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in z around inf 65.2%
associate--r+65.2%
associate-/l*65.1%
Simplified65.1%
clear-num65.0%
un-div-inv65.1%
Applied egg-rr65.1%
clear-num65.1%
inv-pow65.1%
Applied egg-rr65.1%
unpow-165.1%
Simplified65.1%
Taylor expanded in x around inf 70.3%
if -3.8e92 < x < -1.49999999999999998e-131Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around inf 72.6%
mul-1-neg72.6%
Simplified72.6%
Taylor expanded in y around 0 72.6%
neg-mul-172.6%
sub-neg72.6%
Simplified72.6%
if -1.49999999999999998e-131 < x < 1.34999999999999995e76Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 63.3%
neg-mul-163.3%
Simplified63.3%
Final simplification67.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -1.8e+91)
t_1
(if (<= x -1.45e-129) (- y) (if (<= x 1.35e+76) (- z) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.8e+91) {
tmp = t_1;
} else if (x <= -1.45e-129) {
tmp = -y;
} else if (x <= 1.35e+76) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-1.8d+91)) then
tmp = t_1
else if (x <= (-1.45d-129)) then
tmp = -y
else if (x <= 1.35d+76) then
tmp = -z
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double tmp;
if (x <= -1.8e+91) {
tmp = t_1;
} else if (x <= -1.45e-129) {
tmp = -y;
} else if (x <= 1.35e+76) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -1.8e+91: tmp = t_1 elif x <= -1.45e-129: tmp = -y elif x <= 1.35e+76: tmp = -z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -1.8e+91) tmp = t_1; elseif (x <= -1.45e-129) tmp = Float64(-y); elseif (x <= 1.35e+76) tmp = Float64(-z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -1.8e+91) tmp = t_1; elseif (x <= -1.45e-129) tmp = -y; elseif (x <= 1.35e+76) tmp = -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.8e+91], t$95$1, If[LessEqual[x, -1.45e-129], (-y), If[LessEqual[x, 1.35e+76], (-z), t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -1.8 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.45 \cdot 10^{-129}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+76}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.8e91 or 1.34999999999999995e76 < x Initial program 99.6%
sub-neg99.6%
associate--l+99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in z around inf 65.2%
associate--r+65.2%
associate-/l*65.1%
Simplified65.1%
clear-num65.0%
un-div-inv65.1%
Applied egg-rr65.1%
clear-num65.1%
inv-pow65.1%
Applied egg-rr65.1%
unpow-165.1%
Simplified65.1%
Taylor expanded in x around inf 70.3%
if -1.8e91 < x < -1.45000000000000008e-129Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around inf 72.6%
mul-1-neg72.6%
Simplified72.6%
Taylor expanded in y around inf 57.1%
neg-mul-157.1%
Simplified57.1%
if -1.45000000000000008e-129 < x < 1.34999999999999995e76Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 48.9%
Taylor expanded in x around 0 44.9%
neg-mul-144.9%
Simplified44.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.1e+91) (not (<= x 3.3e+63))) (- (* x (log y)) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e+91) || !(x <= 3.3e+63)) {
tmp = (x * log(y)) - z;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-3.1d+91)) .or. (.not. (x <= 3.3d+63))) then
tmp = (x * log(y)) - z
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e+91) || !(x <= 3.3e+63)) {
tmp = (x * Math.log(y)) - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.1e+91) or not (x <= 3.3e+63): tmp = (x * math.log(y)) - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.1e+91) || !(x <= 3.3e+63)) tmp = Float64(Float64(x * log(y)) - z); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.1e+91) || ~((x <= 3.3e+63))) tmp = (x * log(y)) - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.1e+91], N[Not[LessEqual[x, 3.3e+63]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+91} \lor \neg \left(x \leq 3.3 \cdot 10^{+63}\right):\\
\;\;\;\;x \cdot \log y - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -3.09999999999999998e91 or 3.3000000000000002e63 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 86.9%
if -3.09999999999999998e91 < x < 3.3000000000000002e63Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 95.5%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e+93) (not (<= x 3.6e+75))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e+93) || !(x <= 3.6e+75)) {
tmp = (x * log(y)) - y;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.8d+93)) .or. (.not. (x <= 3.6d+75))) then
tmp = (x * log(y)) - y
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e+93) || !(x <= 3.6e+75)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.8e+93) or not (x <= 3.6e+75): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.8e+93) || !(x <= 3.6e+75)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.8e+93) || ~((x <= 3.6e+75))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.8e+93], N[Not[LessEqual[x, 3.6e+75]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+93} \lor \neg \left(x \leq 3.6 \cdot 10^{+75}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -2.79999999999999989e93 or 3.6e75 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in y around inf 83.6%
if -2.79999999999999989e93 < x < 3.6e75Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 95.1%
Final simplification91.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e+91) (not (<= x 5.9e+190))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e+91) || !(x <= 5.9e+190)) {
tmp = x * log(y);
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.8d+91)) .or. (.not. (x <= 5.9d+190))) then
tmp = x * log(y)
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e+91) || !(x <= 5.9e+190)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.8e+91) or not (x <= 5.9e+190): tmp = x * math.log(y) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.8e+91) || !(x <= 5.9e+190)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.8e+91) || ~((x <= 5.9e+190))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.8e+91], N[Not[LessEqual[x, 5.9e+190]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+91} \lor \neg \left(x \leq 5.9 \cdot 10^{+190}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -2.7999999999999999e91 or 5.89999999999999972e190 < x Initial program 99.6%
sub-neg99.6%
associate--l+99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in z around inf 63.6%
associate--r+63.6%
associate-/l*63.5%
Simplified63.5%
clear-num63.3%
un-div-inv63.5%
Applied egg-rr63.5%
clear-num63.5%
inv-pow63.5%
Applied egg-rr63.5%
unpow-163.5%
Simplified63.5%
Taylor expanded in x around inf 76.4%
if -2.7999999999999999e91 < x < 5.89999999999999972e190Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 90.5%
Final simplification87.0%
(FPCore (x y z t) :precision binary64 (if (<= x -1.6e+108) (- (* (log (/ 1.0 y)) (- x)) z) (if (<= x 3.3e+63) (- (log t) (+ y z)) (- (* x (log y)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e+108) {
tmp = (log((1.0 / y)) * -x) - z;
} else if (x <= 3.3e+63) {
tmp = log(t) - (y + z);
} else {
tmp = (x * log(y)) - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.6d+108)) then
tmp = (log((1.0d0 / y)) * -x) - z
else if (x <= 3.3d+63) then
tmp = log(t) - (y + z)
else
tmp = (x * log(y)) - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e+108) {
tmp = (Math.log((1.0 / y)) * -x) - z;
} else if (x <= 3.3e+63) {
tmp = Math.log(t) - (y + z);
} else {
tmp = (x * Math.log(y)) - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.6e+108: tmp = (math.log((1.0 / y)) * -x) - z elif x <= 3.3e+63: tmp = math.log(t) - (y + z) else: tmp = (x * math.log(y)) - z return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.6e+108) tmp = Float64(Float64(log(Float64(1.0 / y)) * Float64(-x)) - z); elseif (x <= 3.3e+63) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(Float64(x * log(y)) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.6e+108) tmp = (log((1.0 / y)) * -x) - z; elseif (x <= 3.3e+63) tmp = log(t) - (y + z); else tmp = (x * log(y)) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.6e+108], N[(N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] * (-x)), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 3.3e+63], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+108}:\\
\;\;\;\;\log \left(\frac{1}{y}\right) \cdot \left(-x\right) - z\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+63}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - z\\
\end{array}
\end{array}
if x < -1.6e108Initial program 99.5%
associate-+l-99.5%
associate--l-99.5%
Simplified99.5%
Taylor expanded in z around inf 86.9%
Taylor expanded in y around inf 87.0%
if -1.6e108 < x < 3.3000000000000002e63Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 95.5%
if 3.3000000000000002e63 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 86.8%
Final simplification92.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.02e+22) (not (<= z 20000000.0))) (- z) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.02e+22) || !(z <= 20000000.0)) {
tmp = -z;
} else {
tmp = log(t) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-1.02d+22)) .or. (.not. (z <= 20000000.0d0))) then
tmp = -z
else
tmp = log(t) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.02e+22) || !(z <= 20000000.0)) {
tmp = -z;
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.02e+22) or not (z <= 20000000.0): tmp = -z else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.02e+22) || !(z <= 20000000.0)) tmp = Float64(-z); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.02e+22) || ~((z <= 20000000.0))) tmp = -z; else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.02e+22], N[Not[LessEqual[z, 20000000.0]], $MachinePrecision]], (-z), N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+22} \lor \neg \left(z \leq 20000000\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if z < -1.02e22 or 2e7 < z Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 81.7%
Taylor expanded in x around 0 63.4%
neg-mul-163.4%
Simplified63.4%
if -1.02e22 < z < 2e7Initial program 99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 65.0%
mul-1-neg65.0%
Simplified65.0%
Taylor expanded in y around 0 65.0%
neg-mul-165.0%
sub-neg65.0%
Simplified65.0%
Final simplification64.3%
(FPCore (x y z t) :precision binary64 (if (<= y 126000000.0) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 126000000.0) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 126000000.0d0) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 126000000.0) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 126000000.0: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 126000000.0) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 126000000.0) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 126000000.0], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 126000000:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.26e8Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 76.0%
Taylor expanded in x around 0 41.2%
neg-mul-141.2%
Simplified41.2%
if 1.26e8 < y Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 62.4%
mul-1-neg62.4%
Simplified62.4%
Taylor expanded in y around inf 60.1%
neg-mul-160.1%
Simplified60.1%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 43.2%
mul-1-neg43.2%
Simplified43.2%
Taylor expanded in y around inf 30.1%
neg-mul-130.1%
Simplified30.1%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return y end
function tmp = code(x, y, z, t) tmp = y; end
code[x_, y_, z_, t_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 43.2%
mul-1-neg43.2%
Simplified43.2%
*-un-lft-identity43.2%
add-sqr-sqrt0.0%
sqrt-unprod13.6%
sqr-neg13.6%
sqrt-unprod13.5%
add-sqr-sqrt13.5%
Applied egg-rr13.5%
*-lft-identity13.5%
Simplified13.5%
Taylor expanded in y around inf 2.3%
herbie shell --seed 2024137
(FPCore (x y z t)
:name "Numeric.SpecFunctions:incompleteGamma from math-functions-0.1.5.2, A"
:precision binary64
(+ (- (- (* x (log y)) y) z) (log t)))