
(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 (log y) x (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
return fma(log(y), x, ((log(t) - z) - y));
}
function code(x, y, z, t) return fma(log(y), x, Float64(Float64(log(t) - z) - y)) end
code[x_, y_, z_, t_] := N[(N[Log[y], $MachinePrecision] * x + N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, x, \left(\log t - z\right) - y\right)
\end{array}
Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
*-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Final simplification99.8%
(FPCore (x y z t) :precision binary64 (if (<= x -1.55) (- (- (* (log y) x) y) z) (if (<= x 1.55) (- (log t) (+ y z)) (fma (log y) x (- (- y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.55) {
tmp = ((log(y) * x) - y) - z;
} else if (x <= 1.55) {
tmp = log(t) - (y + z);
} else {
tmp = fma(log(y), x, (-y - z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (x <= -1.55) tmp = Float64(Float64(Float64(log(y) * x) - y) - z); elseif (x <= 1.55) tmp = Float64(log(t) - Float64(y + z)); else tmp = fma(log(y), x, Float64(Float64(-y) - z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.55], N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 1.55], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[((-y) - z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.55:\\
\;\;\;\;\left(\log y \cdot x - y\right) - z\\
\mathbf{elif}\;x \leq 1.55:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \left(-y\right) - z\right)\\
\end{array}
\end{array}
if x < -1.55000000000000004Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
associate--l+99.6%
*-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around inf 98.1%
mul-1-neg98.1%
unsub-neg98.1%
mul-1-neg98.1%
log-rec99.6%
Simplified99.6%
if -1.55000000000000004 < x < 1.55000000000000004Initial program 100.0%
Taylor expanded in x around 0 99.2%
if 1.55000000000000004 < x Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
associate--l+99.6%
*-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.3%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (log y) x))) (if (<= y 1.9e-6) (- (+ (log t) t_1) z) (- (- t_1 y) z))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (y <= 1.9e-6) {
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 = log(y) * x
if (y <= 1.9d-6) 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 = Math.log(y) * x;
double tmp;
if (y <= 1.9e-6) {
tmp = (Math.log(t) + t_1) - z;
} else {
tmp = (t_1 - y) - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if y <= 1.9e-6: tmp = (math.log(t) + t_1) - z else: tmp = (t_1 - y) - z return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (y <= 1.9e-6) 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 = log(y) * x; tmp = 0.0; if (y <= 1.9e-6) 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[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, 1.9e-6], 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 := \log y \cdot x\\
\mathbf{if}\;y \leq 1.9 \cdot 10^{-6}:\\
\;\;\;\;\left(\log t + t_1\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(t_1 - y\right) - z\\
\end{array}
\end{array}
if y < 1.9e-6Initial program 99.8%
Taylor expanded in y around 0 99.5%
if 1.9e-6 < y Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
associate--l+99.9%
*-commutative99.9%
fma-def99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 99.5%
Taylor expanded in y around inf 99.5%
mul-1-neg99.5%
unsub-neg99.5%
mul-1-neg99.5%
log-rec99.5%
Simplified99.5%
Final simplification99.5%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* (log y) x) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((log(y) * x) - 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) + (((log(y) * x) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((Math.log(y) * x) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((math.log(y) * x) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(log(y) * x) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((log(y) * x) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(\log y \cdot x - y\right) - z\right)
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)) (t_2 (- (- y) z)))
(if (<= x -1.16e+218)
t_1
(if (<= x -2.4e+177)
t_2
(if (<= x -6e+87)
t_1
(if (<= x 4.7e-101)
t_2
(if (<= x 3.8e-74) (- (log t) y) (if (<= x 8.6e+133) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = -y - z;
double tmp;
if (x <= -1.16e+218) {
tmp = t_1;
} else if (x <= -2.4e+177) {
tmp = t_2;
} else if (x <= -6e+87) {
tmp = t_1;
} else if (x <= 4.7e-101) {
tmp = t_2;
} else if (x <= 3.8e-74) {
tmp = log(t) - y;
} else if (x <= 8.6e+133) {
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 = log(y) * x
t_2 = -y - z
if (x <= (-1.16d+218)) then
tmp = t_1
else if (x <= (-2.4d+177)) then
tmp = t_2
else if (x <= (-6d+87)) then
tmp = t_1
else if (x <= 4.7d-101) then
tmp = t_2
else if (x <= 3.8d-74) then
tmp = log(t) - y
else if (x <= 8.6d+133) 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 = Math.log(y) * x;
double t_2 = -y - z;
double tmp;
if (x <= -1.16e+218) {
tmp = t_1;
} else if (x <= -2.4e+177) {
tmp = t_2;
} else if (x <= -6e+87) {
tmp = t_1;
} else if (x <= 4.7e-101) {
tmp = t_2;
} else if (x <= 3.8e-74) {
tmp = Math.log(t) - y;
} else if (x <= 8.6e+133) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x t_2 = -y - z tmp = 0 if x <= -1.16e+218: tmp = t_1 elif x <= -2.4e+177: tmp = t_2 elif x <= -6e+87: tmp = t_1 elif x <= 4.7e-101: tmp = t_2 elif x <= 3.8e-74: tmp = math.log(t) - y elif x <= 8.6e+133: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -1.16e+218) tmp = t_1; elseif (x <= -2.4e+177) tmp = t_2; elseif (x <= -6e+87) tmp = t_1; elseif (x <= 4.7e-101) tmp = t_2; elseif (x <= 3.8e-74) tmp = Float64(log(t) - y); elseif (x <= 8.6e+133) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; t_2 = -y - z; tmp = 0.0; if (x <= -1.16e+218) tmp = t_1; elseif (x <= -2.4e+177) tmp = t_2; elseif (x <= -6e+87) tmp = t_1; elseif (x <= 4.7e-101) tmp = t_2; elseif (x <= 3.8e-74) tmp = log(t) - y; elseif (x <= 8.6e+133) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -1.16e+218], t$95$1, If[LessEqual[x, -2.4e+177], t$95$2, If[LessEqual[x, -6e+87], t$95$1, If[LessEqual[x, 4.7e-101], t$95$2, If[LessEqual[x, 3.8e-74], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 8.6e+133], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -1.16 \cdot 10^{+218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{+177}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -6 \cdot 10^{+87}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.7 \cdot 10^{-101}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-74}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 8.6 \cdot 10^{+133}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.15999999999999994e218 or -2.4e177 < x < -5.9999999999999998e87 or 8.59999999999999989e133 < x Initial program 99.5%
associate-+l-99.5%
sub-neg99.5%
associate--l+99.5%
*-commutative99.5%
fma-def99.5%
Applied egg-rr99.5%
Taylor expanded in x around inf 80.3%
if -1.15999999999999994e218 < x < -2.4e177 or -5.9999999999999998e87 < x < 4.6999999999999999e-101 or 3.7999999999999996e-74 < x < 8.59999999999999989e133Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
associate--l+99.9%
*-commutative99.9%
fma-def99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 86.9%
Taylor expanded in x around 0 79.1%
mul-1-neg79.1%
Simplified79.1%
if 4.6999999999999999e-101 < x < 3.7999999999999996e-74Initial program 100.0%
Taylor expanded in z around 0 81.4%
Taylor expanded in x around 0 81.4%
Final simplification79.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)) (t_2 (- (- y) z)))
(if (<= x -1.2e+218)
t_1
(if (<= x -2.4e+177)
t_2
(if (<= x -7.2e+88)
t_1
(if (<= x -2.8e-301)
t_2
(if (<= x 4.3e-81) (- (log t) z) (if (<= x 8.5e+137) t_2 t_1))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double t_2 = -y - z;
double tmp;
if (x <= -1.2e+218) {
tmp = t_1;
} else if (x <= -2.4e+177) {
tmp = t_2;
} else if (x <= -7.2e+88) {
tmp = t_1;
} else if (x <= -2.8e-301) {
tmp = t_2;
} else if (x <= 4.3e-81) {
tmp = log(t) - z;
} else if (x <= 8.5e+137) {
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 = log(y) * x
t_2 = -y - z
if (x <= (-1.2d+218)) then
tmp = t_1
else if (x <= (-2.4d+177)) then
tmp = t_2
else if (x <= (-7.2d+88)) then
tmp = t_1
else if (x <= (-2.8d-301)) then
tmp = t_2
else if (x <= 4.3d-81) then
tmp = log(t) - z
else if (x <= 8.5d+137) 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 = Math.log(y) * x;
double t_2 = -y - z;
double tmp;
if (x <= -1.2e+218) {
tmp = t_1;
} else if (x <= -2.4e+177) {
tmp = t_2;
} else if (x <= -7.2e+88) {
tmp = t_1;
} else if (x <= -2.8e-301) {
tmp = t_2;
} else if (x <= 4.3e-81) {
tmp = Math.log(t) - z;
} else if (x <= 8.5e+137) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x t_2 = -y - z tmp = 0 if x <= -1.2e+218: tmp = t_1 elif x <= -2.4e+177: tmp = t_2 elif x <= -7.2e+88: tmp = t_1 elif x <= -2.8e-301: tmp = t_2 elif x <= 4.3e-81: tmp = math.log(t) - z elif x <= 8.5e+137: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(-y) - z) tmp = 0.0 if (x <= -1.2e+218) tmp = t_1; elseif (x <= -2.4e+177) tmp = t_2; elseif (x <= -7.2e+88) tmp = t_1; elseif (x <= -2.8e-301) tmp = t_2; elseif (x <= 4.3e-81) tmp = Float64(log(t) - z); elseif (x <= 8.5e+137) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(y) * x; t_2 = -y - z; tmp = 0.0; if (x <= -1.2e+218) tmp = t_1; elseif (x <= -2.4e+177) tmp = t_2; elseif (x <= -7.2e+88) tmp = t_1; elseif (x <= -2.8e-301) tmp = t_2; elseif (x <= 4.3e-81) tmp = log(t) - z; elseif (x <= 8.5e+137) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[((-y) - z), $MachinePrecision]}, If[LessEqual[x, -1.2e+218], t$95$1, If[LessEqual[x, -2.4e+177], t$95$2, If[LessEqual[x, -7.2e+88], t$95$1, If[LessEqual[x, -2.8e-301], t$95$2, If[LessEqual[x, 4.3e-81], N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision], If[LessEqual[x, 8.5e+137], t$95$2, t$95$1]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := \left(-y\right) - z\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+218}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.4 \cdot 10^{+177}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -7.2 \cdot 10^{+88}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -2.8 \cdot 10^{-301}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-81}:\\
\;\;\;\;\log t - z\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{+137}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.1999999999999999e218 or -2.4e177 < x < -7.2000000000000004e88 or 8.50000000000000028e137 < x Initial program 99.5%
associate-+l-99.5%
sub-neg99.5%
associate--l+99.5%
*-commutative99.5%
fma-def99.5%
Applied egg-rr99.5%
Taylor expanded in x around inf 80.3%
if -1.1999999999999999e218 < x < -2.4e177 or -7.2000000000000004e88 < x < -2.8000000000000001e-301 or 4.3000000000000003e-81 < x < 8.50000000000000028e137Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
associate--l+99.9%
*-commutative99.9%
fma-def99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 88.6%
Taylor expanded in x around 0 79.4%
mul-1-neg79.4%
Simplified79.4%
if -2.8000000000000001e-301 < x < 4.3000000000000003e-81Initial program 100.0%
associate-+l-100.0%
sub-neg100.0%
associate--l+100.0%
*-commutative100.0%
fma-def100.0%
Applied egg-rr100.0%
fma-udef100.0%
*-commutative100.0%
add-cube-cbrt100.0%
unpow2100.0%
associate-*r*100.0%
fma-udef100.0%
add-sqr-sqrt38.8%
pow238.8%
Applied egg-rr38.9%
Taylor expanded in x around 0 89.0%
Taylor expanded in y around 0 89.0%
Final simplification81.0%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.2e+218)
(not
(or (<= x -1.8e+175) (and (not (<= x -9.6e+88)) (<= x 5.5e+138)))))
(* (log y) x)
(- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.2e+218) || !((x <= -1.8e+175) || (!(x <= -9.6e+88) && (x <= 5.5e+138)))) {
tmp = log(y) * x;
} 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.2d+218)) .or. (.not. (x <= (-1.8d+175)) .or. (.not. (x <= (-9.6d+88))) .and. (x <= 5.5d+138))) then
tmp = log(y) * x
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.2e+218) || !((x <= -1.8e+175) || (!(x <= -9.6e+88) && (x <= 5.5e+138)))) {
tmp = Math.log(y) * x;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.2e+218) or not ((x <= -1.8e+175) or (not (x <= -9.6e+88) and (x <= 5.5e+138))): tmp = math.log(y) * x else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.2e+218) || !((x <= -1.8e+175) || (!(x <= -9.6e+88) && (x <= 5.5e+138)))) tmp = Float64(log(y) * x); 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.2e+218) || ~(((x <= -1.8e+175) || (~((x <= -9.6e+88)) && (x <= 5.5e+138))))) tmp = log(y) * x; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.2e+218], N[Not[Or[LessEqual[x, -1.8e+175], And[N[Not[LessEqual[x, -9.6e+88]], $MachinePrecision], LessEqual[x, 5.5e+138]]]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+218} \lor \neg \left(x \leq -1.8 \cdot 10^{+175} \lor \neg \left(x \leq -9.6 \cdot 10^{+88}\right) \land x \leq 5.5 \cdot 10^{+138}\right):\\
\;\;\;\;\log y \cdot x\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.1999999999999999e218 or -1.80000000000000017e175 < x < -9.5999999999999996e88 or 5.4999999999999999e138 < x Initial program 99.5%
associate-+l-99.5%
sub-neg99.5%
associate--l+99.5%
*-commutative99.5%
fma-def99.5%
Applied egg-rr99.5%
Taylor expanded in x around inf 80.3%
if -1.1999999999999999e218 < x < -1.80000000000000017e175 or -9.5999999999999996e88 < x < 5.4999999999999999e138Initial program 99.9%
Taylor expanded in x around 0 92.1%
Final simplification89.1%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.16e+218)
(and (not (<= x -2.4e+177))
(or (<= x -7.4e+87) (not (<= x 6.3e+128)))))
(* (log y) x)
(- (- y) z)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.16e+218) || (!(x <= -2.4e+177) && ((x <= -7.4e+87) || !(x <= 6.3e+128)))) {
tmp = log(y) * x;
} 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) :: tmp
if ((x <= (-1.16d+218)) .or. (.not. (x <= (-2.4d+177))) .and. (x <= (-7.4d+87)) .or. (.not. (x <= 6.3d+128))) then
tmp = log(y) * x
else
tmp = -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.16e+218) || (!(x <= -2.4e+177) && ((x <= -7.4e+87) || !(x <= 6.3e+128)))) {
tmp = Math.log(y) * x;
} else {
tmp = -y - z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.16e+218) or (not (x <= -2.4e+177) and ((x <= -7.4e+87) or not (x <= 6.3e+128))): tmp = math.log(y) * x else: tmp = -y - z return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.16e+218) || (!(x <= -2.4e+177) && ((x <= -7.4e+87) || !(x <= 6.3e+128)))) tmp = Float64(log(y) * x); else tmp = Float64(Float64(-y) - z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.16e+218) || (~((x <= -2.4e+177)) && ((x <= -7.4e+87) || ~((x <= 6.3e+128))))) tmp = log(y) * x; else tmp = -y - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.16e+218], And[N[Not[LessEqual[x, -2.4e+177]], $MachinePrecision], Or[LessEqual[x, -7.4e+87], N[Not[LessEqual[x, 6.3e+128]], $MachinePrecision]]]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[((-y) - z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.16 \cdot 10^{+218} \lor \neg \left(x \leq -2.4 \cdot 10^{+177}\right) \land \left(x \leq -7.4 \cdot 10^{+87} \lor \neg \left(x \leq 6.3 \cdot 10^{+128}\right)\right):\\
\;\;\;\;\log y \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(-y\right) - z\\
\end{array}
\end{array}
if x < -1.15999999999999994e218 or -2.4e177 < x < -7.40000000000000005e87 or 6.2999999999999999e128 < x Initial program 99.5%
associate-+l-99.5%
sub-neg99.5%
associate--l+99.5%
*-commutative99.5%
fma-def99.5%
Applied egg-rr99.5%
Taylor expanded in x around inf 80.3%
if -1.15999999999999994e218 < x < -2.4e177 or -7.40000000000000005e87 < x < 6.2999999999999999e128Initial program 99.9%
associate-+l-99.9%
sub-neg99.9%
associate--l+99.9%
*-commutative99.9%
fma-def99.9%
Applied egg-rr99.9%
Taylor expanded in z around inf 84.5%
Taylor expanded in x around 0 77.0%
mul-1-neg77.0%
Simplified77.0%
Final simplification77.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.12) (not (<= x 1.05))) (- (- (* (log y) x) y) z) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.12) || !(x <= 1.05)) {
tmp = ((log(y) * x) - 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.12d0)) .or. (.not. (x <= 1.05d0))) then
tmp = ((log(y) * x) - 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.12) || !(x <= 1.05)) {
tmp = ((Math.log(y) * x) - y) - z;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.12) or not (x <= 1.05): tmp = ((math.log(y) * x) - y) - z else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.12) || !(x <= 1.05)) tmp = Float64(Float64(Float64(log(y) * x) - 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.12) || ~((x <= 1.05))) tmp = ((log(y) * x) - y) - z; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.12], N[Not[LessEqual[x, 1.05]], $MachinePrecision]], N[(N[(N[(N[Log[y], $MachinePrecision] * x), $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.12 \lor \neg \left(x \leq 1.05\right):\\
\;\;\;\;\left(\log y \cdot x - y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.1200000000000001 or 1.05000000000000004 < x Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
associate--l+99.6%
*-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.5%
Taylor expanded in y around inf 98.7%
mul-1-neg98.7%
unsub-neg98.7%
mul-1-neg98.7%
log-rec99.5%
Simplified99.5%
if -1.1200000000000001 < x < 1.05000000000000004Initial program 100.0%
Taylor expanded in x around 0 99.2%
Final simplification99.3%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.1e+68) (not (<= x 2.5e+128))) (- (* (log y) x) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.1e+68) || !(x <= 2.5e+128)) {
tmp = (log(y) * x) - 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.1d+68)) .or. (.not. (x <= 2.5d+128))) then
tmp = (log(y) * x) - 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.1e+68) || !(x <= 2.5e+128)) {
tmp = (Math.log(y) * x) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.1e+68) or not (x <= 2.5e+128): tmp = (math.log(y) * x) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.1e+68) || !(x <= 2.5e+128)) tmp = Float64(Float64(log(y) * x) - 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.1e+68) || ~((x <= 2.5e+128))) tmp = (log(y) * x) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.1e+68], N[Not[LessEqual[x, 2.5e+128]], $MachinePrecision]], N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{+68} \lor \neg \left(x \leq 2.5 \cdot 10^{+128}\right):\\
\;\;\;\;\log y \cdot x - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -2.10000000000000001e68 or 2.5e128 < x Initial program 99.5%
associate-+l-99.5%
sub-neg99.5%
associate--l+99.5%
*-commutative99.5%
fma-def99.5%
Applied egg-rr99.5%
Taylor expanded in z around inf 99.5%
Taylor expanded in z around 0 85.7%
if -2.10000000000000001e68 < x < 2.5e128Initial program 99.9%
Taylor expanded in x around 0 93.5%
Final simplification91.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (log y) x)))
(if (<= x -6.2e+48)
(- t_1 z)
(if (<= x 4.6e+127) (- (log t) (+ y z)) (- t_1 y)))))
double code(double x, double y, double z, double t) {
double t_1 = log(y) * x;
double tmp;
if (x <= -6.2e+48) {
tmp = t_1 - z;
} else if (x <= 4.6e+127) {
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 = log(y) * x
if (x <= (-6.2d+48)) then
tmp = t_1 - z
else if (x <= 4.6d+127) 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 = Math.log(y) * x;
double tmp;
if (x <= -6.2e+48) {
tmp = t_1 - z;
} else if (x <= 4.6e+127) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(y) * x tmp = 0 if x <= -6.2e+48: tmp = t_1 - z elif x <= 4.6e+127: tmp = math.log(t) - (y + z) else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -6.2e+48) tmp = Float64(t_1 - z); elseif (x <= 4.6e+127) 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 = log(y) * x; tmp = 0.0; if (x <= -6.2e+48) tmp = t_1 - z; elseif (x <= 4.6e+127) 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[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -6.2e+48], N[(t$95$1 - z), $MachinePrecision], If[LessEqual[x, 4.6e+127], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+48}:\\
\;\;\;\;t_1 - z\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+127}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 - y\\
\end{array}
\end{array}
if x < -6.20000000000000011e48Initial program 99.6%
associate-+l-99.6%
sub-neg99.6%
associate--l+99.6%
*-commutative99.6%
fma-def99.6%
Applied egg-rr99.6%
Taylor expanded in z around inf 99.6%
Taylor expanded in y around 0 87.1%
if -6.20000000000000011e48 < x < 4.6000000000000003e127Initial program 100.0%
Taylor expanded in x around 0 94.2%
if 4.6000000000000003e127 < x Initial program 99.4%
associate-+l-99.4%
sub-neg99.4%
associate--l+99.4%
*-commutative99.4%
fma-def99.4%
Applied egg-rr99.4%
Taylor expanded in z around inf 99.4%
Taylor expanded in z around 0 98.8%
Final simplification93.3%
(FPCore (x y z t) :precision binary64 (if (<= y 2.6e+152) (- y z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.6e+152) {
tmp = y - 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.6d+152) then
tmp = y - 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.6e+152) {
tmp = y - z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.6e+152: tmp = y - z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.6e+152) tmp = Float64(y - z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.6e+152) tmp = y - z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.6e+152], N[(y - z), $MachinePrecision], (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.6 \cdot 10^{+152}:\\
\;\;\;\;y - z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.6000000000000001e152Initial program 99.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
*-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
fma-udef99.8%
*-commutative99.8%
add-cube-cbrt99.4%
unpow299.4%
associate-*r*99.4%
fma-udef99.4%
add-sqr-sqrt48.7%
pow248.7%
Applied egg-rr48.5%
Taylor expanded in x around 0 59.1%
Taylor expanded in y around inf 44.6%
if 2.6000000000000001e152 < y Initial program 100.0%
Taylor expanded in y around inf 82.2%
neg-mul-182.2%
Simplified82.2%
Final simplification54.1%
(FPCore (x y z t) :precision binary64 (if (<= y 2.9e+152) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.9e+152) {
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.9d+152) 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.9e+152) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.9e+152: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.9e+152) 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.9e+152) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.9e+152], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.9 \cdot 10^{+152}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.8999999999999998e152Initial program 99.8%
Taylor expanded in z around inf 44.6%
mul-1-neg44.6%
Simplified44.6%
if 2.8999999999999998e152 < y Initial program 100.0%
Taylor expanded in y around inf 82.2%
neg-mul-182.2%
Simplified82.2%
Final simplification54.1%
(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.8%
associate-+l-99.8%
sub-neg99.8%
associate--l+99.8%
*-commutative99.8%
fma-def99.8%
Applied egg-rr99.8%
Taylor expanded in z around inf 88.4%
Taylor expanded in x around 0 62.5%
mul-1-neg62.5%
Simplified62.5%
Final simplification62.5%
(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%
Taylor expanded in y around inf 28.0%
neg-mul-128.0%
Simplified28.0%
Final simplification28.0%
herbie shell --seed 2023187
(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)))