
(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 (fma (* (log (cbrt y)) x) 3.0 (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
return fma((log(cbrt(y)) * x), 3.0, ((log(t) - z) - y));
}
function code(x, y, z, t) return fma(Float64(log(cbrt(y)) * x), 3.0, Float64(Float64(log(t) - z) - y)) end
code[x_, y_, z_, t_] := N[(N[(N[Log[N[Power[y, 1/3], $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] * 3.0 + N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log \left(\sqrt[3]{y}\right) \cdot x, 3, \left(\log t - z\right) - y\right)
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
add-cube-cbrt99.8%
log-prod99.8%
pow299.8%
Applied egg-rr99.8%
distribute-rgt-in99.8%
log-pow99.8%
Applied egg-rr99.8%
associate-*l*99.8%
*-un-lft-identity99.8%
distribute-rgt-out99.8%
metadata-eval99.8%
Applied egg-rr99.8%
fmm-def99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2.3e+123)
(* x (- (log y) (/ (- y (log t)) x)))
(if (<= x -2.05e+18)
(- t_1 z)
(if (<= x 4.6e+35) (- (log t) (+ y z)) (- t_1 y))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2.3e+123) {
tmp = x * (log(y) - ((y - log(t)) / x));
} else if (x <= -2.05e+18) {
tmp = t_1 - z;
} else if (x <= 4.6e+35) {
tmp = log(t) - (y + z);
} else {
tmp = t_1 - 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (x <= (-2.3d+123)) then
tmp = x * (log(y) - ((y - log(t)) / x))
else if (x <= (-2.05d+18)) then
tmp = t_1 - z
else if (x <= 4.6d+35) then
tmp = log(t) - (y + z)
else
tmp = t_1 - y
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 <= -2.3e+123) {
tmp = x * (Math.log(y) - ((y - Math.log(t)) / x));
} else if (x <= -2.05e+18) {
tmp = t_1 - z;
} else if (x <= 4.6e+35) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2.3e+123: tmp = x * (math.log(y) - ((y - math.log(t)) / x)) elif x <= -2.05e+18: tmp = t_1 - z elif x <= 4.6e+35: tmp = math.log(t) - (y + z) else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2.3e+123) tmp = Float64(x * Float64(log(y) - Float64(Float64(y - log(t)) / x))); elseif (x <= -2.05e+18) tmp = Float64(t_1 - z); elseif (x <= 4.6e+35) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(t_1 - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2.3e+123) tmp = x * (log(y) - ((y - log(t)) / x)); elseif (x <= -2.05e+18) tmp = t_1 - z; elseif (x <= 4.6e+35) tmp = log(t) - (y + z); else tmp = t_1 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.3e+123], N[(x * N[(N[Log[y], $MachinePrecision] - N[(N[(y - N[Log[t], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.05e+18], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[x, 4.6e+35], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+123}:\\
\;\;\;\;x \cdot \left(\log y - \frac{y - \log t}{x}\right)\\
\mathbf{elif}\;x \leq -2.05 \cdot 10^{+18}:\\
\;\;\;\;t\_1 - z\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+35}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - y\\
\end{array}
\end{array}
if x < -2.2999999999999999e123Initial program 99.6%
sub-neg99.6%
associate--l+99.6%
fma-define99.6%
Simplified99.6%
Taylor expanded in z around 0 93.0%
Taylor expanded in x around inf 93.1%
associate--l+93.1%
div-sub93.1%
Simplified93.1%
if -2.2999999999999999e123 < x < -2.05e18Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 86.1%
if -2.05e18 < x < 4.5999999999999996e35Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 98.8%
if 4.5999999999999996e35 < x Initial program 99.5%
associate-+l-99.5%
associate--l-99.5%
Simplified99.5%
Taylor expanded in y around inf 82.8%
Final simplification93.3%
(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.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= x -2.8e+123)
t_2
(if (<= x -3.5e+18)
(- t_1 z)
(if (<= x 1.26e+37) (- (log t) (+ y z)) t_2)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (x <= -2.8e+123) {
tmp = t_2;
} else if (x <= -3.5e+18) {
tmp = t_1 - z;
} else if (x <= 1.26e+37) {
tmp = log(t) - (y + z);
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (x <= (-2.8d+123)) then
tmp = t_2
else if (x <= (-3.5d+18)) then
tmp = t_1 - z
else if (x <= 1.26d+37) then
tmp = log(t) - (y + z)
else
tmp = t_2
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 t_2 = t_1 - y;
double tmp;
if (x <= -2.8e+123) {
tmp = t_2;
} else if (x <= -3.5e+18) {
tmp = t_1 - z;
} else if (x <= 1.26e+37) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if x <= -2.8e+123: tmp = t_2 elif x <= -3.5e+18: tmp = t_1 - z elif x <= 1.26e+37: tmp = math.log(t) - (y + z) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (x <= -2.8e+123) tmp = t_2; elseif (x <= -3.5e+18) tmp = Float64(t_1 - z); elseif (x <= 1.26e+37) tmp = Float64(log(t) - Float64(y + z)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (x <= -2.8e+123) tmp = t_2; elseif (x <= -3.5e+18) tmp = t_1 - z; elseif (x <= 1.26e+37) tmp = log(t) - (y + z); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[x, -2.8e+123], t$95$2, If[LessEqual[x, -3.5e+18], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[x, 1.26e+37], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+123}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{+18}:\\
\;\;\;\;t\_1 - z\\
\mathbf{elif}\;x \leq 1.26 \cdot 10^{+37}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.80000000000000011e123 or 1.26e37 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in y around inf 87.4%
if -2.80000000000000011e123 < x < -3.5e18Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 86.1%
if -3.5e18 < x < 1.26e37Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 98.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2.8e+18)
t_1
(if (<= x 3.6e-295)
(- (log t) y)
(if (<= x 1.2e+37) (- (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 <= -2.8e+18) {
tmp = t_1;
} else if (x <= 3.6e-295) {
tmp = log(t) - y;
} else if (x <= 1.2e+37) {
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 <= (-2.8d+18)) then
tmp = t_1
else if (x <= 3.6d-295) then
tmp = log(t) - y
else if (x <= 1.2d+37) 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 <= -2.8e+18) {
tmp = t_1;
} else if (x <= 3.6e-295) {
tmp = Math.log(t) - y;
} else if (x <= 1.2e+37) {
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 <= -2.8e+18: tmp = t_1 elif x <= 3.6e-295: tmp = math.log(t) - y elif x <= 1.2e+37: 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 <= -2.8e+18) tmp = t_1; elseif (x <= 3.6e-295) tmp = Float64(log(t) - y); elseif (x <= 1.2e+37) 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 <= -2.8e+18) tmp = t_1; elseif (x <= 3.6e-295) tmp = log(t) - y; elseif (x <= 1.2e+37) 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, -2.8e+18], t$95$1, If[LessEqual[x, 3.6e-295], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.2e+37], 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 -2.8 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{-295}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+37}:\\
\;\;\;\;\log t - z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.8e18 or 1.2e37 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 81.0%
Taylor expanded in x around inf 62.8%
if -2.8e18 < x < 3.6000000000000001e-295Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around inf 66.7%
mul-1-neg66.7%
Simplified66.7%
Taylor expanded in y around 0 66.7%
mul-1-neg66.7%
sub-neg66.7%
Simplified66.7%
if 3.6000000000000001e-295 < x < 1.2e37Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 72.0%
neg-mul-172.0%
Simplified72.0%
Taylor expanded in z around 0 72.0%
mul-1-neg72.0%
sub-neg72.0%
Simplified72.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.65e+48) (not (<= x 5.4e+37))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.65e+48) || !(x <= 5.4e+37)) {
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 <= (-1.65d+48)) .or. (.not. (x <= 5.4d+37))) 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 <= -1.65e+48) || !(x <= 5.4e+37)) {
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 <= -1.65e+48) or not (x <= 5.4e+37): 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 <= -1.65e+48) || !(x <= 5.4e+37)) 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 <= -1.65e+48) || ~((x <= 5.4e+37))) 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, -1.65e+48], N[Not[LessEqual[x, 5.4e+37]], $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 -1.65 \cdot 10^{+48} \lor \neg \left(x \leq 5.4 \cdot 10^{+37}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.65000000000000011e48 or 5.39999999999999973e37 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in y around inf 83.9%
if -1.65000000000000011e48 < x < 5.39999999999999973e37Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 98.2%
Final simplification91.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.5e+185) (not (<= x 3.8e+76))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.5e+185) || !(x <= 3.8e+76)) {
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 <= (-5.5d+185)) .or. (.not. (x <= 3.8d+76))) 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 <= -5.5e+185) || !(x <= 3.8e+76)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -5.5e+185) or not (x <= 3.8e+76): 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 <= -5.5e+185) || !(x <= 3.8e+76)) 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 <= -5.5e+185) || ~((x <= 3.8e+76))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -5.5e+185], N[Not[LessEqual[x, 3.8e+76]], $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 -5.5 \cdot 10^{+185} \lor \neg \left(x \leq 3.8 \cdot 10^{+76}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -5.4999999999999996e185 or 3.80000000000000024e76 < x Initial program 99.6%
associate-+l-99.6%
associate--l-99.6%
Simplified99.6%
Taylor expanded in z around inf 87.3%
Taylor expanded in x around inf 78.4%
if -5.4999999999999996e185 < x < 3.80000000000000024e76Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around 0 87.4%
Final simplification85.0%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.1e+18) (not (<= x 1.3e-13))) (* x (log y)) (- (log t) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e+18) || !(x <= 1.3e-13)) {
tmp = x * log(y);
} 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 ((x <= (-3.1d+18)) .or. (.not. (x <= 1.3d-13))) then
tmp = x * log(y)
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 ((x <= -3.1e+18) || !(x <= 1.3e-13)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.1e+18) or not (x <= 1.3e-13): tmp = x * math.log(y) else: tmp = math.log(t) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.1e+18) || !(x <= 1.3e-13)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.1e+18) || ~((x <= 1.3e-13))) tmp = x * log(y); else tmp = log(t) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.1e+18], N[Not[LessEqual[x, 1.3e-13]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+18} \lor \neg \left(x \leq 1.3 \cdot 10^{-13}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - y\\
\end{array}
\end{array}
if x < -3.1e18 or 1.3e-13 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 81.6%
Taylor expanded in x around inf 61.5%
if -3.1e18 < x < 1.3e-13Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around inf 60.8%
mul-1-neg60.8%
Simplified60.8%
Taylor expanded in y around 0 60.8%
mul-1-neg60.8%
sub-neg60.8%
Simplified60.8%
Final simplification61.1%
(FPCore (x y z t) :precision binary64 (if (<= y 2.4e-247) (- z) (if (<= y 6e+75) (* x (log y)) (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.4e-247) {
tmp = -z;
} else if (y <= 6e+75) {
tmp = x * log(y);
} 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 <= 2.4d-247) then
tmp = -z
else if (y <= 6d+75) then
tmp = x * log(y)
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 <= 2.4e-247) {
tmp = -z;
} else if (y <= 6e+75) {
tmp = x * Math.log(y);
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.4e-247: tmp = -z elif y <= 6e+75: tmp = x * math.log(y) else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.4e-247) tmp = Float64(-z); elseif (y <= 6e+75) tmp = Float64(x * log(y)); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.4e-247) tmp = -z; elseif (y <= 6e+75) tmp = x * log(y); else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.4e-247], (-z), If[LessEqual[y, 6e+75], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-y)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{-247}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 6 \cdot 10^{+75}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.40000000000000011e-247Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 80.0%
Taylor expanded in x around 0 50.0%
neg-mul-150.0%
Simplified50.0%
if 2.40000000000000011e-247 < y < 6e75Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 74.9%
Taylor expanded in x around inf 47.1%
if 6e75 < y Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 60.8%
mul-1-neg60.8%
Simplified60.8%
Taylor expanded in y around inf 60.8%
mul-1-neg60.8%
Simplified60.8%
(FPCore (x y z t) :precision binary64 (if (<= y 2.7e+53) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.7e+53) {
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 <= 2.7d+53) 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 <= 2.7e+53) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.7e+53: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.7e+53) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.7e+53) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.7e+53], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{+53}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.70000000000000019e53Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 77.5%
Taylor expanded in x around 0 36.0%
neg-mul-136.0%
Simplified36.0%
if 2.70000000000000019e53 < y Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 59.3%
mul-1-neg59.3%
Simplified59.3%
Taylor expanded in y around inf 59.3%
mul-1-neg59.3%
Simplified59.3%
(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.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 40.1%
mul-1-neg40.1%
Simplified40.1%
Taylor expanded in y around inf 28.6%
mul-1-neg28.6%
Simplified28.6%
(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.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 40.1%
mul-1-neg40.1%
Simplified40.1%
Taylor expanded in y around inf 28.6%
mul-1-neg28.6%
Simplified28.6%
neg-sub028.6%
sub-neg28.6%
add-sqr-sqrt0.0%
sqrt-unprod2.0%
sqr-neg2.0%
sqrt-unprod2.1%
add-sqr-sqrt2.1%
Applied egg-rr2.1%
+-lft-identity2.1%
Simplified2.1%
herbie shell --seed 2024180
(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)))