
(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 14 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.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-+r+99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y))) (t_2 (- (- t_1 y) z))) (if (or (<= t_2 -2000000.0) (not (<= t_2 1e+17))) t_2 (+ (log t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = (t_1 - y) - z;
double tmp;
if ((t_2 <= -2000000.0) || !(t_2 <= 1e+17)) {
tmp = t_2;
} else {
tmp = log(t) + 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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = (t_1 - y) - z
if ((t_2 <= (-2000000.0d0)) .or. (.not. (t_2 <= 1d+17))) then
tmp = t_2
else
tmp = log(t) + 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 t_2 = (t_1 - y) - z;
double tmp;
if ((t_2 <= -2000000.0) || !(t_2 <= 1e+17)) {
tmp = t_2;
} else {
tmp = Math.log(t) + t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = (t_1 - y) - z tmp = 0 if (t_2 <= -2000000.0) or not (t_2 <= 1e+17): tmp = t_2 else: tmp = math.log(t) + t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(t_1 - y) - z) tmp = 0.0 if ((t_2 <= -2000000.0) || !(t_2 <= 1e+17)) tmp = t_2; else tmp = Float64(log(t) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = (t_1 - y) - z; tmp = 0.0; if ((t_2 <= -2000000.0) || ~((t_2 <= 1e+17))) tmp = t_2; else tmp = log(t) + t_1; 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[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision]}, If[Or[LessEqual[t$95$2, -2000000.0], N[Not[LessEqual[t$95$2, 1e+17]], $MachinePrecision]], t$95$2, N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(t\_1 - y\right) - z\\
\mathbf{if}\;t\_2 \leq -2000000 \lor \neg \left(t\_2 \leq 10^{+17}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\log t + t\_1\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -2e6 or 1e17 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.1%
if -2e6 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 1e17Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-+r+99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 99.8%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (or (<= z -50000.0) (not (<= z 8.8e-18)))
(- (- t_1 y) z)
(- (+ (log t) t_1) y))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if ((z <= -50000.0) || !(z <= 8.8e-18)) {
tmp = (t_1 - y) - z;
} else {
tmp = (log(t) + 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 ((z <= (-50000.0d0)) .or. (.not. (z <= 8.8d-18))) then
tmp = (t_1 - y) - z
else
tmp = (log(t) + 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 ((z <= -50000.0) || !(z <= 8.8e-18)) {
tmp = (t_1 - y) - z;
} else {
tmp = (Math.log(t) + t_1) - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if (z <= -50000.0) or not (z <= 8.8e-18): tmp = (t_1 - y) - z else: tmp = (math.log(t) + t_1) - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if ((z <= -50000.0) || !(z <= 8.8e-18)) tmp = Float64(Float64(t_1 - y) - z); else tmp = Float64(Float64(log(t) + t_1) - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if ((z <= -50000.0) || ~((z <= 8.8e-18))) tmp = (t_1 - y) - z; else tmp = (log(t) + 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[Or[LessEqual[z, -50000.0], N[Not[LessEqual[z, 8.8e-18]], $MachinePrecision]], N[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;z \leq -50000 \lor \neg \left(z \leq 8.8 \cdot 10^{-18}\right):\\
\;\;\;\;\left(t\_1 - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t + t\_1\right) - y\\
\end{array}
\end{array}
if z < -5e4 or 8.7999999999999994e-18 < z Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.7%
if -5e4 < z < 8.7999999999999994e-18Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around 0 99.8%
Final simplification99.7%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 0.0085) (- (+ (log t) t_1) z) (- (- t_1 y) z))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 0.0085) {
tmp = (log(t) + t_1) - z;
} else {
tmp = (t_1 - 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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 0.0085d0) then
tmp = (log(t) + t_1) - z
else
tmp = (t_1 - y) - z
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 <= 0.0085) {
tmp = (Math.log(t) + t_1) - z;
} else {
tmp = (t_1 - y) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 0.0085: tmp = (math.log(t) + t_1) - z else: tmp = (t_1 - y) - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 0.0085) tmp = Float64(Float64(log(t) + t_1) - z); else tmp = Float64(Float64(t_1 - y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 0.0085) tmp = (log(t) + t_1) - z; else tmp = (t_1 - y) - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 0.0085], N[(N[(N[Log[t], $MachinePrecision] + t$95$1), $MachinePrecision] - z), $MachinePrecision], N[(N[(t$95$1 - y), $MachinePrecision] - z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 0.0085:\\
\;\;\;\;\left(\log t + t\_1\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - y\right) - z\\
\end{array}
\end{array}
if y < 0.0085000000000000006Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around 0 99.8%
if 0.0085000000000000006 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 98.8%
Final simplification99.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 (- (log t) y)))
(if (<= z -1.65e+93)
(- z)
(if (<= z -1.9e-171)
t_1
(if (<= z -6.8e-216)
(* x (log y))
(if (<= z 19000000000000.0) t_1 (- z)))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double tmp;
if (z <= -1.65e+93) {
tmp = -z;
} else if (z <= -1.9e-171) {
tmp = t_1;
} else if (z <= -6.8e-216) {
tmp = x * log(y);
} else if (z <= 19000000000000.0) {
tmp = t_1;
} else {
tmp = -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) :: t_1
real(8) :: tmp
t_1 = log(t) - y
if (z <= (-1.65d+93)) then
tmp = -z
else if (z <= (-1.9d-171)) then
tmp = t_1
else if (z <= (-6.8d-216)) then
tmp = x * log(y)
else if (z <= 19000000000000.0d0) then
tmp = t_1
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = Math.log(t) - y;
double tmp;
if (z <= -1.65e+93) {
tmp = -z;
} else if (z <= -1.9e-171) {
tmp = t_1;
} else if (z <= -6.8e-216) {
tmp = x * Math.log(y);
} else if (z <= 19000000000000.0) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - y tmp = 0 if z <= -1.65e+93: tmp = -z elif z <= -1.9e-171: tmp = t_1 elif z <= -6.8e-216: tmp = x * math.log(y) elif z <= 19000000000000.0: tmp = t_1 else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - y) tmp = 0.0 if (z <= -1.65e+93) tmp = Float64(-z); elseif (z <= -1.9e-171) tmp = t_1; elseif (z <= -6.8e-216) tmp = Float64(x * log(y)); elseif (z <= 19000000000000.0) tmp = t_1; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - y; tmp = 0.0; if (z <= -1.65e+93) tmp = -z; elseif (z <= -1.9e-171) tmp = t_1; elseif (z <= -6.8e-216) tmp = x * log(y); elseif (z <= 19000000000000.0) tmp = t_1; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[z, -1.65e+93], (-z), If[LessEqual[z, -1.9e-171], t$95$1, If[LessEqual[z, -6.8e-216], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 19000000000000.0], t$95$1, (-z)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+93}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-216}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;z \leq 19000000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.65000000000000004e93 or 1.9e13 < z Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 69.2%
neg-mul-169.2%
Simplified69.2%
if -1.65000000000000004e93 < z < -1.90000000000000011e-171 or -6.7999999999999995e-216 < z < 1.9e13Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-+r+99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 97.1%
Taylor expanded in x around 0 61.4%
if -1.90000000000000011e-171 < z < -6.7999999999999995e-216Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around inf 78.2%
Final simplification65.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.5) (not (<= x 0.000435))) (- (- (* x (log y)) y) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.5) || !(x <= 0.000435)) {
tmp = ((x * log(y)) - 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 <= (-1.5d0)) .or. (.not. (x <= 0.000435d0))) then
tmp = ((x * log(y)) - 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 <= -1.5) || !(x <= 0.000435)) {
tmp = ((x * Math.log(y)) - y) - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.5) or not (x <= 0.000435): tmp = ((x * math.log(y)) - y) - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.5) || !(x <= 0.000435)) tmp = Float64(Float64(Float64(x * log(y)) - 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 <= -1.5) || ~((x <= 0.000435))) tmp = ((x * log(y)) - y) - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.5], N[Not[LessEqual[x, 0.000435]], $MachinePrecision]], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \lor \neg \left(x \leq 0.000435\right):\\
\;\;\;\;\left(x \cdot \log y - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.5 or 4.35000000000000003e-4 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.1%
if -1.5 < x < 4.35000000000000003e-4Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 99.0%
Final simplification99.1%
(FPCore (x y z t)
:precision binary64
(if (<= z -1.55e+91)
(- z)
(if (<= z -7e-197)
(- y)
(if (<= z -1.45e-267) (log t) (if (<= z 13000000000000.0) (- y) (- z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+91) {
tmp = -z;
} else if (z <= -7e-197) {
tmp = -y;
} else if (z <= -1.45e-267) {
tmp = log(t);
} else if (z <= 13000000000000.0) {
tmp = -y;
} else {
tmp = -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 (z <= (-1.55d+91)) then
tmp = -z
else if (z <= (-7d-197)) then
tmp = -y
else if (z <= (-1.45d-267)) then
tmp = log(t)
else if (z <= 13000000000000.0d0) then
tmp = -y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.55e+91) {
tmp = -z;
} else if (z <= -7e-197) {
tmp = -y;
} else if (z <= -1.45e-267) {
tmp = Math.log(t);
} else if (z <= 13000000000000.0) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.55e+91: tmp = -z elif z <= -7e-197: tmp = -y elif z <= -1.45e-267: tmp = math.log(t) elif z <= 13000000000000.0: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.55e+91) tmp = Float64(-z); elseif (z <= -7e-197) tmp = Float64(-y); elseif (z <= -1.45e-267) tmp = log(t); elseif (z <= 13000000000000.0) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.55e+91) tmp = -z; elseif (z <= -7e-197) tmp = -y; elseif (z <= -1.45e-267) tmp = log(t); elseif (z <= 13000000000000.0) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.55e+91], (-z), If[LessEqual[z, -7e-197], (-y), If[LessEqual[z, -1.45e-267], N[Log[t], $MachinePrecision], If[LessEqual[z, 13000000000000.0], (-y), (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+91}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-197}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{-267}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;z \leq 13000000000000:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.54999999999999999e91 or 1.3e13 < z Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 69.2%
neg-mul-169.2%
Simplified69.2%
if -1.54999999999999999e91 < z < -6.9999999999999996e-197 or -1.45000000000000011e-267 < z < 1.3e13Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around inf 44.3%
neg-mul-144.3%
Simplified44.3%
if -6.9999999999999996e-197 < z < -1.45000000000000011e-267Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.9%
sub-neg99.9%
distribute-neg-in99.9%
sub-neg99.9%
associate-+r+99.9%
+-commutative99.9%
distribute-neg-in99.9%
remove-double-neg99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in z around 0 99.9%
Taylor expanded in y around 0 84.0%
+-commutative84.0%
*-commutative84.0%
fma-undefine84.0%
Simplified84.0%
Taylor expanded in x around 0 34.0%
Final simplification53.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -5.8e+139) (not (<= x 1.5e+125))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -5.8e+139) || !(x <= 1.5e+125)) {
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.8d+139)) .or. (.not. (x <= 1.5d+125))) 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.8e+139) || !(x <= 1.5e+125)) {
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.8e+139) or not (x <= 1.5e+125): 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.8e+139) || !(x <= 1.5e+125)) 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.8e+139) || ~((x <= 1.5e+125))) 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.8e+139], N[Not[LessEqual[x, 1.5e+125]], $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.8 \cdot 10^{+139} \lor \neg \left(x \leq 1.5 \cdot 10^{+125}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -5.7999999999999998e139 or 1.50000000000000008e125 < x Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in x around inf 77.1%
if -5.7999999999999998e139 < x < 1.50000000000000008e125Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in x around 0 91.0%
Final simplification87.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -5.4e+75)
(- z)
(if (<= z -3.1e-267)
(* x (log y))
(if (<= z 15000000000000.0) (- y) (- z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.4e+75) {
tmp = -z;
} else if (z <= -3.1e-267) {
tmp = x * log(y);
} else if (z <= 15000000000000.0) {
tmp = -y;
} else {
tmp = -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 (z <= (-5.4d+75)) then
tmp = -z
else if (z <= (-3.1d-267)) then
tmp = x * log(y)
else if (z <= 15000000000000.0d0) then
tmp = -y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.4e+75) {
tmp = -z;
} else if (z <= -3.1e-267) {
tmp = x * Math.log(y);
} else if (z <= 15000000000000.0) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.4e+75: tmp = -z elif z <= -3.1e-267: tmp = x * math.log(y) elif z <= 15000000000000.0: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.4e+75) tmp = Float64(-z); elseif (z <= -3.1e-267) tmp = Float64(x * log(y)); elseif (z <= 15000000000000.0) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.4e+75) tmp = -z; elseif (z <= -3.1e-267) tmp = x * log(y); elseif (z <= 15000000000000.0) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.4e+75], (-z), If[LessEqual[z, -3.1e-267], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 15000000000000.0], (-y), (-z)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+75}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-267}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;z \leq 15000000000000:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -5.39999999999999996e75 or 1.5e13 < z Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 67.9%
neg-mul-167.9%
Simplified67.9%
if -5.39999999999999996e75 < z < -3.1000000000000001e-267Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in x around inf 46.3%
if -3.1000000000000001e-267 < z < 1.5e13Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 47.3%
neg-mul-147.3%
Simplified47.3%
Final simplification56.2%
(FPCore (x y z t) :precision binary64 (if (<= y 1.2e-18) (- (log t) z) (if (<= y 1.85e+94) (* x (log y)) (- y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.2e-18) {
tmp = log(t) - z;
} else if (y <= 1.85e+94) {
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 <= 1.2d-18) then
tmp = log(t) - z
else if (y <= 1.85d+94) 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 <= 1.2e-18) {
tmp = Math.log(t) - z;
} else if (y <= 1.85e+94) {
tmp = x * Math.log(y);
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.2e-18: tmp = math.log(t) - z elif y <= 1.85e+94: tmp = x * math.log(y) else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.2e-18) tmp = Float64(log(t) - z); elseif (y <= 1.85e+94) 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 <= 1.2e-18) tmp = log(t) - z; elseif (y <= 1.85e+94) tmp = x * log(y); else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.2e-18], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 1.85e+94], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], (-y)]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.2 \cdot 10^{-18}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;y \leq 1.85 \cdot 10^{+94}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.19999999999999997e-18Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around 0 99.8%
Taylor expanded in x around 0 67.7%
if 1.19999999999999997e-18 < y < 1.8500000000000001e94Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in x around inf 49.9%
if 1.8500000000000001e94 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around inf 65.5%
neg-mul-165.5%
Simplified65.5%
Final simplification63.7%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.5e+92) (not (<= z 5500000000000.0))) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.5e+92) || !(z <= 5500000000000.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 ((z <= (-6.5d+92)) .or. (.not. (z <= 5500000000000.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 ((z <= -6.5e+92) || !(z <= 5500000000000.0)) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.5e+92) or not (z <= 5500000000000.0): tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.5e+92) || !(z <= 5500000000000.0)) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6.5e+92) || ~((z <= 5500000000000.0))) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.5e+92], N[Not[LessEqual[z, 5500000000000.0]], $MachinePrecision]], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+92} \lor \neg \left(z \leq 5500000000000\right):\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if z < -6.49999999999999999e92 or 5.5e12 < z Initial program 99.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in z around inf 69.2%
neg-mul-169.2%
Simplified69.2%
if -6.49999999999999999e92 < z < 5.5e12Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in y around inf 39.6%
neg-mul-139.6%
Simplified39.6%
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.8%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 29.4%
neg-mul-129.4%
Simplified29.4%
Final simplification29.4%
(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%
associate-+l-99.8%
Simplified99.8%
Taylor expanded in y around inf 29.4%
neg-mul-129.4%
Simplified29.4%
neg-sub029.4%
sub-neg29.4%
add-sqr-sqrt0.0%
sqrt-unprod2.3%
sqr-neg2.3%
sqrt-unprod2.3%
add-sqr-sqrt2.3%
Applied egg-rr2.3%
+-lft-identity2.3%
Simplified2.3%
Final simplification2.3%
herbie shell --seed 2024052
(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)))