
(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 15 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) (- (- y) z)) (log t)))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (-y - z)) + log(t);
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(Float64(-y) - z)) + log(t)) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[((-y) - z), $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \left(-y\right) - z\right) + \log t
\end{array}
Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-def99.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 -2e+19) (not (<= t_2 200000000.0))) 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 <= -2e+19) || !(t_2 <= 200000000.0)) {
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 <= (-2d+19)) .or. (.not. (t_2 <= 200000000.0d0))) 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 <= -2e+19) || !(t_2 <= 200000000.0)) {
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 <= -2e+19) or not (t_2 <= 200000000.0): 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 <= -2e+19) || !(t_2 <= 200000000.0)) 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 <= -2e+19) || ~((t_2 <= 200000000.0))) 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, -2e+19], N[Not[LessEqual[t$95$2, 200000000.0]], $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 -2 \cdot 10^{+19} \lor \neg \left(t\_2 \leq 200000000\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\log t + t\_1\\
\end{array}
\end{array}
if (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < -2e19 or 2e8 < (-.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.9%
if -2e19 < (-.f64 (-.f64 (*.f64 x (log.f64 y)) y) z) < 2e8Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in x around inf 94.2%
Final simplification99.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* x (log y)) y)))
(if (or (<= t_1 -500000.0) (not (<= t_1 2e-18)))
(- t_1 z)
(- (log t) (+ y z)))))
double code(double x, double y, double z, double t) {
double t_1 = (x * log(y)) - y;
double tmp;
if ((t_1 <= -500000.0) || !(t_1 <= 2e-18)) {
tmp = t_1 - 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) :: t_1
real(8) :: tmp
t_1 = (x * log(y)) - y
if ((t_1 <= (-500000.0d0)) .or. (.not. (t_1 <= 2d-18))) then
tmp = t_1 - 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 t_1 = (x * Math.log(y)) - y;
double tmp;
if ((t_1 <= -500000.0) || !(t_1 <= 2e-18)) {
tmp = t_1 - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): t_1 = (x * math.log(y)) - y tmp = 0 if (t_1 <= -500000.0) or not (t_1 <= 2e-18): tmp = t_1 - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x * log(y)) - y) tmp = 0.0 if ((t_1 <= -500000.0) || !(t_1 <= 2e-18)) tmp = Float64(t_1 - z); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x * log(y)) - y; tmp = 0.0; if ((t_1 <= -500000.0) || ~((t_1 <= 2e-18))) tmp = t_1 - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -500000.0], N[Not[LessEqual[t$95$1, 2e-18]], $MachinePrecision]], N[(t$95$1 - z), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y - y\\
\mathbf{if}\;t\_1 \leq -500000 \lor \neg \left(t\_1 \leq 2 \cdot 10^{-18}\right):\\
\;\;\;\;t\_1 - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5e5 or 2.0000000000000001e-18 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 98.6%
if -5e5 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.0000000000000001e-18Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Final simplification98.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -4e+251)
t_2
(if (<= t_2 2e-18) (- (log t) (+ y z)) (- t_1 z)))))
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 (t_2 <= -4e+251) {
tmp = t_2;
} else if (t_2 <= 2e-18) {
tmp = log(t) - (y + z);
} else {
tmp = t_1 - 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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-4d+251)) then
tmp = t_2
else if (t_2 <= 2d-18) then
tmp = log(t) - (y + z)
else
tmp = t_1 - 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 t_2 = t_1 - y;
double tmp;
if (t_2 <= -4e+251) {
tmp = t_2;
} else if (t_2 <= 2e-18) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -4e+251: tmp = t_2 elif t_2 <= 2e-18: tmp = math.log(t) - (y + z) else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -4e+251) tmp = t_2; elseif (t_2 <= 2e-18) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(t_1 - z); 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 (t_2 <= -4e+251) tmp = t_2; elseif (t_2 <= 2e-18) tmp = log(t) - (y + z); else tmp = t_1 - z; 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[t$95$2, -4e+251], t$95$2, If[LessEqual[t$95$2, 2e-18], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+251}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-18}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -4.0000000000000002e251Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in z around 0 97.7%
if -4.0000000000000002e251 < (-.f64 (*.f64 x (log.f64 y)) y) < 2.0000000000000001e-18Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 87.1%
if 2.0000000000000001e-18 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 97.3%
Taylor expanded in y around 0 97.2%
Final simplification90.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))) (t_2 (- (- y) z)))
(if (<= x -1.02e+133)
t_1
(if (<= x -6.6e-106)
t_2
(if (<= x -6.8e-153)
(log t)
(if (<= x 3e-218)
t_2
(if (<= x 1e-191) (log t) (if (<= x 2.05e+165) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = -y - z;
double tmp;
if (x <= -1.02e+133) {
tmp = t_1;
} else if (x <= -6.6e-106) {
tmp = t_2;
} else if (x <= -6.8e-153) {
tmp = log(t);
} else if (x <= 3e-218) {
tmp = t_2;
} else if (x <= 1e-191) {
tmp = log(t);
} else if (x <= 2.05e+165) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = -y - z
if (x <= (-1.02d+133)) then
tmp = t_1
else if (x <= (-6.6d-106)) then
tmp = t_2
else if (x <= (-6.8d-153)) then
tmp = log(t)
else if (x <= 3d-218) then
tmp = t_2
else if (x <= 1d-191) then
tmp = log(t)
else if (x <= 2.05d+165) then
tmp = t_2
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 t_2 = -y - z;
double tmp;
if (x <= -1.02e+133) {
tmp = t_1;
} else if (x <= -6.6e-106) {
tmp = t_2;
} else if (x <= -6.8e-153) {
tmp = Math.log(t);
} else if (x <= 3e-218) {
tmp = t_2;
} else if (x <= 1e-191) {
tmp = Math.log(t);
} else if (x <= 2.05e+165) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = -y - z tmp = 0 if x <= -1.02e+133: tmp = t_1 elif x <= -6.6e-106: tmp = t_2 elif x <= -6.8e-153: tmp = math.log(t) elif x <= 3e-218: tmp = t_2 elif x <= 1e-191: tmp = math.log(t) elif x <= 2.05e+165: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -1.02e+133) tmp = t_1; elseif (x <= -6.6e-106) tmp = t_2; elseif (x <= -6.8e-153) tmp = log(t); elseif (x <= 3e-218) tmp = t_2; elseif (x <= 1e-191) tmp = log(t); elseif (x <= 2.05e+165) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = -y - z; tmp = 0.0; if (x <= -1.02e+133) tmp = t_1; elseif (x <= -6.6e-106) tmp = t_2; elseif (x <= -6.8e-153) tmp = log(t); elseif (x <= 3e-218) tmp = t_2; elseif (x <= 1e-191) tmp = log(t); elseif (x <= 2.05e+165) tmp = t_2; 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]}, Block[{t$95$2 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -1.02e+133], t$95$1, If[LessEqual[x, -6.6e-106], t$95$2, If[LessEqual[x, -6.8e-153], N[Log[t], $MachinePrecision], If[LessEqual[x, 3e-218], t$95$2, If[LessEqual[x, 1e-191], N[Log[t], $MachinePrecision], If[LessEqual[x, 2.05e+165], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -1.02 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-106}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-153}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;x \leq 3 \cdot 10^{-218}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 10^{-191}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+165}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.02e133 or 2.0500000000000001e165 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 75.5%
if -1.02e133 < x < -6.60000000000000031e-106 or -6.7999999999999997e-153 < x < 2.9999999999999998e-218 or 1e-191 < x < 2.0500000000000001e165Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 86.3%
Taylor expanded in x around 0 73.8%
mul-1-neg73.8%
distribute-neg-in73.8%
sub-neg73.8%
Simplified73.8%
if -6.60000000000000031e-106 < x < -6.7999999999999997e-153 or 2.9999999999999998e-218 < x < 1e-191Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-def100.0%
Simplified100.0%
Taylor expanded in y around inf 84.7%
mul-1-neg84.7%
Simplified84.7%
Taylor expanded in y around 0 78.5%
Final simplification74.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) y)) (t_2 (- (- y) z)) (t_3 (* x (log y))))
(if (<= z -1.55e+31)
t_2
(if (<= z -4.8e-69)
t_3
(if (<= z -3.2e-231)
t_1
(if (<= z -2.6e-269)
t_3
(if (<= z 1e-15) t_1 (if (<= z 0.0035) t_3 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double t_2 = -y - z;
double t_3 = x * log(y);
double tmp;
if (z <= -1.55e+31) {
tmp = t_2;
} else if (z <= -4.8e-69) {
tmp = t_3;
} else if (z <= -3.2e-231) {
tmp = t_1;
} else if (z <= -2.6e-269) {
tmp = t_3;
} else if (z <= 1e-15) {
tmp = t_1;
} else if (z <= 0.0035) {
tmp = t_3;
} 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) :: t_3
real(8) :: tmp
t_1 = log(t) - y
t_2 = -y - z
t_3 = x * log(y)
if (z <= (-1.55d+31)) then
tmp = t_2
else if (z <= (-4.8d-69)) then
tmp = t_3
else if (z <= (-3.2d-231)) then
tmp = t_1
else if (z <= (-2.6d-269)) then
tmp = t_3
else if (z <= 1d-15) then
tmp = t_1
else if (z <= 0.0035d0) then
tmp = t_3
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 = Math.log(t) - y;
double t_2 = -y - z;
double t_3 = x * Math.log(y);
double tmp;
if (z <= -1.55e+31) {
tmp = t_2;
} else if (z <= -4.8e-69) {
tmp = t_3;
} else if (z <= -3.2e-231) {
tmp = t_1;
} else if (z <= -2.6e-269) {
tmp = t_3;
} else if (z <= 1e-15) {
tmp = t_1;
} else if (z <= 0.0035) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - y t_2 = -y - z t_3 = x * math.log(y) tmp = 0 if z <= -1.55e+31: tmp = t_2 elif z <= -4.8e-69: tmp = t_3 elif z <= -3.2e-231: tmp = t_1 elif z <= -2.6e-269: tmp = t_3 elif z <= 1e-15: tmp = t_1 elif z <= 0.0035: tmp = t_3 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - y) t_2 = Float64(Float64(-y) - z) t_3 = Float64(x * log(y)) tmp = 0.0 if (z <= -1.55e+31) tmp = t_2; elseif (z <= -4.8e-69) tmp = t_3; elseif (z <= -3.2e-231) tmp = t_1; elseif (z <= -2.6e-269) tmp = t_3; elseif (z <= 1e-15) tmp = t_1; elseif (z <= 0.0035) tmp = t_3; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - y; t_2 = -y - z; t_3 = x * log(y); tmp = 0.0; if (z <= -1.55e+31) tmp = t_2; elseif (z <= -4.8e-69) tmp = t_3; elseif (z <= -3.2e-231) tmp = t_1; elseif (z <= -2.6e-269) tmp = t_3; elseif (z <= 1e-15) tmp = t_1; elseif (z <= 0.0035) tmp = t_3; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, Block[{t$95$2 = N[((-y) - z), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.55e+31], t$95$2, If[LessEqual[z, -4.8e-69], t$95$3, If[LessEqual[z, -3.2e-231], t$95$1, If[LessEqual[z, -2.6e-269], t$95$3, If[LessEqual[z, 1e-15], t$95$1, If[LessEqual[z, 0.0035], t$95$3, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
t_2 := \left(-y\right) - z\\
t_3 := x \cdot \log y\\
\mathbf{if}\;z \leq -1.55 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-69}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-231}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2.6 \cdot 10^{-269}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;z \leq 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.0035:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.5500000000000001e31 or 0.00350000000000000007 < z Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in x around 0 85.8%
mul-1-neg85.8%
distribute-neg-in85.8%
sub-neg85.8%
Simplified85.8%
if -1.5500000000000001e31 < z < -4.8000000000000002e-69 or -3.20000000000000008e-231 < z < -2.6e-269 or 1.0000000000000001e-15 < z < 0.00350000000000000007Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 84.4%
Taylor expanded in x around inf 68.1%
if -4.8000000000000002e-69 < z < -3.20000000000000008e-231 or -2.6e-269 < z < 1.0000000000000001e-15Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in y around inf 72.7%
mul-1-neg72.7%
Simplified72.7%
Taylor expanded in y around 0 72.7%
mul-1-neg72.7%
sub-neg72.7%
Simplified72.7%
Final simplification78.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= y 1.4e-278)
t_1
(if (<= y 1.02e-22)
(- (log t) z)
(if (<= y 410000000.0) t_1 (- (- y) z))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 1.4e-278) {
tmp = t_1;
} else if (y <= 1.02e-22) {
tmp = log(t) - z;
} else if (y <= 410000000.0) {
tmp = t_1;
} else {
tmp = -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 <= 1.4d-278) then
tmp = t_1
else if (y <= 1.02d-22) then
tmp = log(t) - z
else if (y <= 410000000.0d0) then
tmp = t_1
else
tmp = -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 <= 1.4e-278) {
tmp = t_1;
} else if (y <= 1.02e-22) {
tmp = Math.log(t) - z;
} else if (y <= 410000000.0) {
tmp = t_1;
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 1.4e-278: tmp = t_1 elif y <= 1.02e-22: tmp = math.log(t) - z elif y <= 410000000.0: tmp = t_1 else: tmp = -y - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 1.4e-278) tmp = t_1; elseif (y <= 1.02e-22) tmp = Float64(log(t) - z); elseif (y <= 410000000.0) tmp = t_1; else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 1.4e-278) tmp = t_1; elseif (y <= 1.02e-22) tmp = log(t) - z; elseif (y <= 410000000.0) tmp = t_1; else tmp = -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, 1.4e-278], t$95$1, If[LessEqual[y, 1.02e-22], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[y, 410000000.0], t$95$1, N[((-y) - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 1.4 \cdot 10^{-278}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.02 \cdot 10^{-22}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;y \leq 410000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if y < 1.40000000000000004e-278 or 1.02000000000000002e-22 < y < 4.1e8Initial program 99.6%
associate-+l-99.6%
Simplified99.6%
Taylor expanded in z around inf 88.9%
Taylor expanded in x around inf 79.9%
if 1.40000000000000004e-278 < y < 1.02000000000000002e-22Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in x around 0 68.6%
Taylor expanded in y around 0 68.6%
if 4.1e8 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in x around 0 81.4%
mul-1-neg81.4%
distribute-neg-in81.4%
sub-neg81.4%
Simplified81.4%
Final simplification75.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.4e+133) (not (<= x 1.9e+165))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.4e+133) || !(x <= 1.9e+165)) {
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 <= (-1.4d+133)) .or. (.not. (x <= 1.9d+165))) 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 <= -1.4e+133) || !(x <= 1.9e+165)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.4e+133) or not (x <= 1.9e+165): 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 <= -1.4e+133) || !(x <= 1.9e+165)) 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 <= -1.4e+133) || ~((x <= 1.9e+165))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.4e+133], N[Not[LessEqual[x, 1.9e+165]], $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 -1.4 \cdot 10^{+133} \lor \neg \left(x \leq 1.9 \cdot 10^{+165}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.40000000000000008e133 or 1.89999999999999995e165 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in x around inf 75.5%
if -1.40000000000000008e133 < x < 1.89999999999999995e165Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in x around 0 87.3%
Final simplification84.4%
(FPCore (x y z t) :precision binary64 (if (or (<= x -4.5e+105) (not (<= x 3e+80))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -4.5e+105) || !(x <= 3e+80)) {
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 <= (-4.5d+105)) .or. (.not. (x <= 3d+80))) 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 <= -4.5e+105) || !(x <= 3e+80)) {
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 <= -4.5e+105) or not (x <= 3e+80): 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 <= -4.5e+105) || !(x <= 3e+80)) 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 <= -4.5e+105) || ~((x <= 3e+80))) 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, -4.5e+105], N[Not[LessEqual[x, 3e+80]], $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 -4.5 \cdot 10^{+105} \lor \neg \left(x \leq 3 \cdot 10^{+80}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -4.5000000000000001e105 or 2.99999999999999987e80 < x Initial program 99.7%
associate-+l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.7%
Taylor expanded in z around 0 80.1%
if -4.5000000000000001e105 < x < 2.99999999999999987e80Initial program 100.0%
associate-+l-100.0%
Simplified100.0%
Taylor expanded in x around 0 92.4%
Final simplification87.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z 7e-280) (not (<= z 2.8e-124))) (- (- y) z) (log t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= 7e-280) || !(z <= 2.8e-124)) {
tmp = -y - z;
} else {
tmp = log(t);
}
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 <= 7d-280) .or. (.not. (z <= 2.8d-124))) then
tmp = -y - z
else
tmp = log(t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= 7e-280) || !(z <= 2.8e-124)) {
tmp = -y - z;
} else {
tmp = Math.log(t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= 7e-280) or not (z <= 2.8e-124): tmp = -y - z else: tmp = math.log(t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= 7e-280) || !(z <= 2.8e-124)) tmp = Float64(Float64(-y) - z); else tmp = log(t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= 7e-280) || ~((z <= 2.8e-124))) tmp = -y - z; else tmp = log(t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, 7e-280], N[Not[LessEqual[z, 2.8e-124]], $MachinePrecision]], N[((-y) - z), $MachinePrecision], N[Log[t], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 7 \cdot 10^{-280} \lor \neg \left(z \leq 2.8 \cdot 10^{-124}\right):\\
\;\;\;\;\left(-y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t\\
\end{array}
\end{array}
if z < 7.0000000000000002e-280 or 2.79999999999999998e-124 < z Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 89.1%
Taylor expanded in x around 0 63.6%
mul-1-neg63.6%
distribute-neg-in63.6%
sub-neg63.6%
Simplified63.6%
if 7.0000000000000002e-280 < z < 2.79999999999999998e-124Initial program 99.8%
sub-neg99.8%
associate--l+99.8%
fma-def99.8%
Simplified99.8%
Taylor expanded in y around inf 64.0%
mul-1-neg64.0%
Simplified64.0%
Taylor expanded in y around 0 42.0%
Final simplification61.1%
(FPCore (x y z t) :precision binary64 (if (<= y 2.2e+79) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e+79) {
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.2d+79) 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.2e+79) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.2e+79: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.2e+79) 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.2e+79) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.2e+79], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{+79}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.1999999999999999e79Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 76.5%
Taylor expanded in z around inf 36.3%
neg-mul-136.3%
Simplified36.3%
if 2.1999999999999999e79 < y Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 99.9%
Taylor expanded in y around inf 69.4%
mul-1-neg69.4%
Simplified69.4%
Final simplification49.2%
(FPCore (x y z t) :precision binary64 (- (- y) z))
double code(double x, double y, double z, double t) {
return -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 = -y - z
end function
public static double code(double x, double y, double z, double t) {
return -y - z;
}
def code(x, y, z, t): return -y - z
function code(x, y, z, t) return Float64(Float64(-y) - z) end
function tmp = code(x, y, z, t) tmp = -y - z; end
code[x_, y_, z_, t_] := N[((-y) - z), $MachinePrecision]
\begin{array}{l}
\\
\left(-y\right) - z
\end{array}
Initial program 99.9%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 85.7%
Taylor expanded in x around 0 59.1%
mul-1-neg59.1%
distribute-neg-in59.1%
sub-neg59.1%
Simplified59.1%
Final simplification59.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%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 85.7%
Taylor expanded in y around inf 31.3%
mul-1-neg31.3%
Simplified31.3%
Final simplification31.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 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%
associate-+l-99.9%
Simplified99.9%
Taylor expanded in z around inf 85.7%
associate--l-85.7%
sub-neg85.7%
distribute-neg-in85.7%
add-sqr-sqrt0.0%
sqrt-unprod49.6%
sqr-neg49.6%
sqrt-unprod55.1%
add-sqr-sqrt55.1%
sub-neg55.1%
flip-+19.7%
unpow219.7%
unpow219.7%
add-sqr-sqrt11.0%
pow211.0%
Applied egg-rr30.1%
unpow230.1%
add-sqr-sqrt55.1%
fma-udef55.1%
add-sqr-sqrt21.1%
associate-*r*21.1%
fma-def21.1%
Applied egg-rr21.1%
Taylor expanded in y around inf 2.2%
Final simplification2.2%
herbie shell --seed 2024036
(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)))