
(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 10 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 x (log y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - (y + z)));
}
function code(x, y, z, t) return fma(x, log(y), Float64(log(t) - Float64(y + z))) end
code[x_, y_, z_, t_] := N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - \left(y + z\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
+-commutative99.9%
+-commutative99.9%
associate--r-99.9%
fma-neg99.9%
+-commutative99.9%
associate-+r-99.9%
associate-+r-99.9%
+-commutative99.9%
sub-neg99.9%
log-rec99.9%
distribute-neg-in99.9%
+-commutative99.9%
log-rec99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.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 (if (<= x -1.02e+38) (fma x (log y) (- y)) (if (<= x 2.8e+67) (- (log t) (+ y z)) (- (* x (log y)) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.02e+38) {
tmp = fma(x, log(y), -y);
} else if (x <= 2.8e+67) {
tmp = log(t) - (y + z);
} else {
tmp = (x * log(y)) - y;
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -1.02e+38) tmp = fma(x, log(y), Float64(-y)); elseif (x <= 2.8e+67) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(Float64(x * log(y)) - y); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.02e+38], N[(x * N[Log[y], $MachinePrecision] + (-y)), $MachinePrecision], If[LessEqual[x, 2.8e+67], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.02 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, -y\right)\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+67}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y - y\\
\end{array}
\end{array}
if x < -1.02000000000000006e38Initial program 99.8%
Taylor expanded in x around 0 99.8%
associate--l+99.8%
+-commutative99.8%
+-commutative99.8%
associate--r-99.8%
fma-neg99.8%
+-commutative99.8%
associate-+r-99.8%
associate-+r-99.8%
+-commutative99.8%
sub-neg99.8%
log-rec99.8%
distribute-neg-in99.8%
+-commutative99.8%
log-rec99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 91.7%
mul-1-neg91.7%
Simplified91.7%
if -1.02000000000000006e38 < x < 2.7999999999999998e67Initial program 100.0%
Taylor expanded in x around 0 98.3%
if 2.7999999999999998e67 < x Initial program 99.8%
Taylor expanded in x around 0 99.8%
associate--l+99.8%
+-commutative99.8%
+-commutative99.8%
associate--r-99.8%
fma-neg99.8%
+-commutative99.8%
associate-+r-99.8%
associate-+r-99.8%
+-commutative99.8%
sub-neg99.8%
log-rec99.8%
distribute-neg-in99.8%
+-commutative99.8%
log-rec99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 92.8%
mul-1-neg92.8%
Simplified92.8%
Taylor expanded in x around 0 92.8%
+-commutative92.8%
mul-1-neg92.8%
sub-neg92.8%
Simplified92.8%
Final simplification95.6%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -3.8e+116)
(not (or (<= x 9.4e+69) (and (not (<= x 3.5e+118)) (<= x 3.6e+170)))))
(* x (log y))
(- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.8e+116) || !((x <= 9.4e+69) || (!(x <= 3.5e+118) && (x <= 3.6e+170)))) {
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 <= (-3.8d+116)) .or. (.not. (x <= 9.4d+69) .or. (.not. (x <= 3.5d+118)) .and. (x <= 3.6d+170))) 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 <= -3.8e+116) || !((x <= 9.4e+69) || (!(x <= 3.5e+118) && (x <= 3.6e+170)))) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.8e+116) or not ((x <= 9.4e+69) or (not (x <= 3.5e+118) and (x <= 3.6e+170))): 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 <= -3.8e+116) || !((x <= 9.4e+69) || (!(x <= 3.5e+118) && (x <= 3.6e+170)))) 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 <= -3.8e+116) || ~(((x <= 9.4e+69) || (~((x <= 3.5e+118)) && (x <= 3.6e+170))))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.8e+116], N[Not[Or[LessEqual[x, 9.4e+69], And[N[Not[LessEqual[x, 3.5e+118]], $MachinePrecision], LessEqual[x, 3.6e+170]]]], $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 -3.8 \cdot 10^{+116} \lor \neg \left(x \leq 9.4 \cdot 10^{+69} \lor \neg \left(x \leq 3.5 \cdot 10^{+118}\right) \land x \leq 3.6 \cdot 10^{+170}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -3.7999999999999999e116 or 9.39999999999999992e69 < x < 3.50000000000000016e118 or 3.6e170 < x Initial program 99.7%
Taylor expanded in x around 0 99.7%
associate--l+99.7%
+-commutative99.7%
+-commutative99.7%
associate--r-99.7%
fma-neg99.8%
+-commutative99.8%
associate-+r-99.8%
associate-+r-99.8%
+-commutative99.8%
sub-neg99.8%
log-rec99.8%
distribute-neg-in99.8%
+-commutative99.8%
log-rec99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 97.6%
mul-1-neg97.6%
Simplified97.6%
Taylor expanded in x around inf 80.2%
if -3.7999999999999999e116 < x < 9.39999999999999992e69 or 3.50000000000000016e118 < x < 3.6e170Initial program 100.0%
Taylor expanded in x around 0 92.3%
Final simplification88.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= y 1.05e-255)
(- z)
(if (<= y 5.6e-92)
t_1
(if (<= y 8e-39) (- z) (if (<= y 4.6e+19) t_1 (- y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 1.05e-255) {
tmp = -z;
} else if (y <= 5.6e-92) {
tmp = t_1;
} else if (y <= 8e-39) {
tmp = -z;
} else if (y <= 4.6e+19) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 1.05d-255) then
tmp = -z
else if (y <= 5.6d-92) then
tmp = t_1
else if (y <= 8d-39) then
tmp = -z
else if (y <= 4.6d+19) then
tmp = t_1
else
tmp = -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 (y <= 1.05e-255) {
tmp = -z;
} else if (y <= 5.6e-92) {
tmp = t_1;
} else if (y <= 8e-39) {
tmp = -z;
} else if (y <= 4.6e+19) {
tmp = t_1;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 1.05e-255: tmp = -z elif y <= 5.6e-92: tmp = t_1 elif y <= 8e-39: tmp = -z elif y <= 4.6e+19: tmp = t_1 else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 1.05e-255) tmp = Float64(-z); elseif (y <= 5.6e-92) tmp = t_1; elseif (y <= 8e-39) tmp = Float64(-z); elseif (y <= 4.6e+19) tmp = t_1; else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 1.05e-255) tmp = -z; elseif (y <= 5.6e-92) tmp = t_1; elseif (y <= 8e-39) tmp = -z; elseif (y <= 4.6e+19) tmp = t_1; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.05e-255], (-z), If[LessEqual[y, 5.6e-92], t$95$1, If[LessEqual[y, 8e-39], (-z), If[LessEqual[y, 4.6e+19], t$95$1, (-y)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 1.05 \cdot 10^{-255}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{-39}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+19}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.05e-255 or 5.6e-92 < y < 7.99999999999999943e-39Initial program 100.0%
Taylor expanded in z around inf 57.2%
neg-mul-157.2%
Simplified57.2%
if 1.05e-255 < y < 5.6e-92 or 7.99999999999999943e-39 < y < 4.6e19Initial program 99.8%
Taylor expanded in x around 0 99.8%
associate--l+99.8%
+-commutative99.8%
+-commutative99.8%
associate--r-99.8%
fma-neg99.8%
+-commutative99.8%
associate-+r-99.8%
associate-+r-99.8%
+-commutative99.8%
sub-neg99.8%
log-rec99.8%
distribute-neg-in99.8%
+-commutative99.8%
log-rec99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 50.3%
mul-1-neg50.3%
Simplified50.3%
Taylor expanded in x around inf 49.8%
if 4.6e19 < y Initial program 99.9%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
+-commutative99.9%
+-commutative99.9%
associate--r-99.9%
fma-neg100.0%
+-commutative100.0%
associate-+r-100.0%
associate-+r-100.0%
+-commutative100.0%
sub-neg100.0%
log-rec100.0%
distribute-neg-in100.0%
+-commutative100.0%
log-rec100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 87.3%
mul-1-neg87.3%
Simplified87.3%
Taylor expanded in x around 0 68.4%
mul-1-neg68.4%
Simplified68.4%
Final simplification60.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) z)))
(if (<= y 3.1e-214)
t_1
(if (<= y 8.4e-185) (* x (log y)) (if (<= y 8.5e+18) t_1 (- y))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double tmp;
if (y <= 3.1e-214) {
tmp = t_1;
} else if (y <= 8.4e-185) {
tmp = x * log(y);
} else if (y <= 8.5e+18) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = log(t) - z
if (y <= 3.1d-214) then
tmp = t_1
else if (y <= 8.4d-185) then
tmp = x * log(y)
else if (y <= 8.5d+18) then
tmp = t_1
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - z;
double tmp;
if (y <= 3.1e-214) {
tmp = t_1;
} else if (y <= 8.4e-185) {
tmp = x * Math.log(y);
} else if (y <= 8.5e+18) {
tmp = t_1;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z tmp = 0 if y <= 3.1e-214: tmp = t_1 elif y <= 8.4e-185: tmp = x * math.log(y) elif y <= 8.5e+18: tmp = t_1 else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - z) tmp = 0.0 if (y <= 3.1e-214) tmp = t_1; elseif (y <= 8.4e-185) tmp = Float64(x * log(y)); elseif (y <= 8.5e+18) tmp = t_1; else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - z; tmp = 0.0; if (y <= 3.1e-214) tmp = t_1; elseif (y <= 8.4e-185) tmp = x * log(y); elseif (y <= 8.5e+18) tmp = t_1; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[y, 3.1e-214], t$95$1, If[LessEqual[y, 8.4e-185], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.5e+18], t$95$1, (-y)]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
\mathbf{if}\;y \leq 3.1 \cdot 10^{-214}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.4 \cdot 10^{-185}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3.10000000000000004e-214 or 8.4000000000000001e-185 < y < 8.5e18Initial program 99.9%
Taylor expanded in y around 0 99.2%
remove-double-neg99.2%
log-rec99.2%
mul-1-neg99.2%
mul-1-neg99.2%
log-rec99.2%
remove-double-neg99.2%
log-pow56.9%
log-prod56.9%
Simplified56.9%
Taylor expanded in x around 0 64.5%
if 3.10000000000000004e-214 < y < 8.4000000000000001e-185Initial program 99.9%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
+-commutative99.9%
+-commutative99.9%
associate--r-99.9%
fma-neg99.9%
+-commutative99.9%
associate-+r-99.9%
associate-+r-99.9%
+-commutative99.9%
sub-neg99.9%
log-rec99.9%
distribute-neg-in99.9%
+-commutative99.9%
log-rec99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 72.4%
mul-1-neg72.4%
Simplified72.4%
Taylor expanded in x around inf 72.4%
if 8.5e18 < y Initial program 99.9%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
+-commutative99.9%
+-commutative99.9%
associate--r-99.9%
fma-neg100.0%
+-commutative100.0%
associate-+r-100.0%
associate-+r-100.0%
+-commutative100.0%
sub-neg100.0%
log-rec100.0%
distribute-neg-in100.0%
+-commutative100.0%
log-rec100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 87.4%
mul-1-neg87.4%
Simplified87.4%
Taylor expanded in x around 0 67.9%
mul-1-neg67.9%
Simplified67.9%
Final simplification66.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.05e+37) (not (<= x 8e+66))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.05e+37) || !(x <= 8e+66)) {
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.05d+37)) .or. (.not. (x <= 8d+66))) 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.05e+37) || !(x <= 8e+66)) {
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.05e+37) or not (x <= 8e+66): 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.05e+37) || !(x <= 8e+66)) 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.05e+37) || ~((x <= 8e+66))) 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.05e+37], N[Not[LessEqual[x, 8e+66]], $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.05 \cdot 10^{+37} \lor \neg \left(x \leq 8 \cdot 10^{+66}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -2.0499999999999999e37 or 7.99999999999999956e66 < x Initial program 99.8%
Taylor expanded in x around 0 99.8%
associate--l+99.8%
+-commutative99.8%
+-commutative99.8%
associate--r-99.8%
fma-neg99.8%
+-commutative99.8%
associate-+r-99.8%
associate-+r-99.8%
+-commutative99.8%
sub-neg99.8%
log-rec99.8%
distribute-neg-in99.8%
+-commutative99.8%
log-rec99.8%
remove-double-neg99.8%
+-commutative99.8%
sub-neg99.8%
Simplified99.8%
Taylor expanded in y around inf 92.2%
mul-1-neg92.2%
Simplified92.2%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
mul-1-neg92.1%
sub-neg92.1%
Simplified92.1%
if -2.0499999999999999e37 < x < 7.99999999999999956e66Initial program 100.0%
Taylor expanded in x around 0 98.3%
Final simplification95.6%
(FPCore (x y z t) :precision binary64 (if (<= y 1.7e+18) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.7e+18) {
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 <= 1.7d+18) 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 <= 1.7e+18) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.7e+18: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.7e+18) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.7e+18) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.7e+18], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{+18}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.7e18Initial program 99.9%
Taylor expanded in z around inf 36.4%
neg-mul-136.4%
Simplified36.4%
if 1.7e18 < y Initial program 99.9%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
+-commutative99.9%
+-commutative99.9%
associate--r-99.9%
fma-neg100.0%
+-commutative100.0%
associate-+r-100.0%
associate-+r-100.0%
+-commutative100.0%
sub-neg100.0%
log-rec100.0%
distribute-neg-in100.0%
+-commutative100.0%
log-rec100.0%
remove-double-neg100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Taylor expanded in y around inf 87.4%
mul-1-neg87.4%
Simplified87.4%
Taylor expanded in x around 0 67.9%
mul-1-neg67.9%
Simplified67.9%
Final simplification52.2%
(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%
Taylor expanded in x around 0 99.9%
associate--l+99.9%
+-commutative99.9%
+-commutative99.9%
associate--r-99.9%
fma-neg99.9%
+-commutative99.9%
associate-+r-99.9%
associate-+r-99.9%
+-commutative99.9%
sub-neg99.9%
log-rec99.9%
distribute-neg-in99.9%
+-commutative99.9%
log-rec99.9%
remove-double-neg99.9%
+-commutative99.9%
sub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 64.5%
mul-1-neg64.5%
Simplified64.5%
Taylor expanded in x around 0 35.4%
mul-1-neg35.4%
Simplified35.4%
Final simplification35.4%
(FPCore (x y z t) :precision binary64 z)
double code(double x, double y, double z, double t) {
return 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 = z
end function
public static double code(double x, double y, double z, double t) {
return z;
}
def code(x, y, z, t): return z
function code(x, y, z, t) return z end
function tmp = code(x, y, z, t) tmp = z; end
code[x_, y_, z_, t_] := z
\begin{array}{l}
\\
z
\end{array}
Initial program 99.9%
Taylor expanded in y around 0 66.2%
Taylor expanded in x around inf 53.9%
sub-neg53.9%
*-commutative53.9%
add-sqr-sqrt25.0%
associate-*r*25.0%
add-sqr-sqrt13.8%
sqrt-unprod16.9%
sqr-neg16.9%
sqrt-unprod6.9%
add-sqr-sqrt13.6%
fma-def13.6%
Applied egg-rr13.6%
Taylor expanded in x around 0 2.2%
Final simplification2.2%
herbie shell --seed 2023312
(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)))