
(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 13 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%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r-99.8%
associate--l-99.8%
fma-def99.9%
associate--l-99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (- (fma x (log y) (- (log t) z)) y))
double code(double x, double y, double z, double t) {
return fma(x, log(y), (log(t) - z)) - y;
}
function code(x, y, z, t) return Float64(fma(x, log(y), Float64(log(t) - z)) - y) end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(x, \log y, \log t - z\right) - y
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
+-commutative99.8%
associate--r+99.8%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.8e+24) (not (<= x 64000.0))) (- (+ (log t) (* x (log y))) y) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e+24) || !(x <= 64000.0)) {
tmp = (log(t) + (x * log(y))) - y;
} else {
tmp = (log(t) - z) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.8d+24)) .or. (.not. (x <= 64000.0d0))) then
tmp = (log(t) + (x * log(y))) - y
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.8e+24) || !(x <= 64000.0)) {
tmp = (Math.log(t) + (x * Math.log(y))) - y;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.8e+24) or not (x <= 64000.0): tmp = (math.log(t) + (x * math.log(y))) - y else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.8e+24) || !(x <= 64000.0)) tmp = Float64(Float64(log(t) + Float64(x * log(y))) - y); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.8e+24) || ~((x <= 64000.0))) tmp = (log(t) + (x * log(y))) - y; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.8e+24], N[Not[LessEqual[x, 64000.0]], $MachinePrecision]], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+24} \lor \neg \left(x \leq 64000\right):\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -2.8000000000000002e24 or 64000 < x Initial program 99.7%
Taylor expanded in z around 0 82.5%
if -2.8000000000000002e24 < x < 64000Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
+-commutative100.0%
associate--r+100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 99.3%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (- (- (- (log t) (* x (log (/ 1.0 y)))) z) y))
double code(double x, double y, double z, double t) {
return ((log(t) - (x * log((1.0 / y)))) - z) - 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 = ((log(t) - (x * log((1.0d0 / y)))) - z) - y
end function
public static double code(double x, double y, double z, double t) {
return ((Math.log(t) - (x * Math.log((1.0 / y)))) - z) - y;
}
def code(x, y, z, t): return ((math.log(t) - (x * math.log((1.0 / y)))) - z) - y
function code(x, y, z, t) return Float64(Float64(Float64(log(t) - Float64(x * log(Float64(1.0 / y)))) - z) - y) end
function tmp = code(x, y, z, t) tmp = ((log(t) - (x * log((1.0 / y)))) - z) - y; end
code[x_, y_, z_, t_] := N[(N[(N[(N[Log[t], $MachinePrecision] - N[(x * N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\log t - x \cdot \log \left(\frac{1}{y}\right)\right) - z\right) - y
\end{array}
Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
+-commutative99.8%
associate--r+99.8%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in y around inf 99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (<= y 1.28e+98) (- (+ (log t) (* x (log y))) z) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.28e+98) {
tmp = (log(t) + (x * log(y))) - z;
} else {
tmp = (log(t) - z) - 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.28d+98) then
tmp = (log(t) + (x * log(y))) - z
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1.28e+98) {
tmp = (Math.log(t) + (x * Math.log(y))) - z;
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1.28e+98: tmp = (math.log(t) + (x * math.log(y))) - z else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1.28e+98) tmp = Float64(Float64(log(t) + Float64(x * log(y))) - z); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1.28e+98) tmp = (log(t) + (x * log(y))) - z; else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1.28e+98], N[(N[(N[Log[t], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.28 \cdot 10^{+98}:\\
\;\;\;\;\left(\log t + x \cdot \log y\right) - z\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if y < 1.28000000000000006e98Initial program 99.8%
Taylor expanded in y around 0 95.5%
if 1.28000000000000006e98 < y Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
+-commutative100.0%
associate--r+100.0%
fma-neg100.0%
neg-sub0100.0%
associate-+l-100.0%
neg-sub0100.0%
+-commutative100.0%
unsub-neg100.0%
Simplified100.0%
Taylor expanded in x around 0 91.0%
Final simplification94.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)) (t_2 (* x (log y))))
(if (<= z -2e+150)
(- z)
(if (<= z -3.5e+40)
t_2
(if (<= z -1.9e+26)
(- z)
(if (<= z -1.36e-70)
t_1
(if (<= z -2.85e-103)
t_2
(if (<= z -1.2e-148)
t_1
(if (<= z -2.35e-225) t_2 (if (<= z 5.3e+20) t_1 (- z)))))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - y;
double t_2 = x * log(y);
double tmp;
if (z <= -2e+150) {
tmp = -z;
} else if (z <= -3.5e+40) {
tmp = t_2;
} else if (z <= -1.9e+26) {
tmp = -z;
} else if (z <= -1.36e-70) {
tmp = t_1;
} else if (z <= -2.85e-103) {
tmp = t_2;
} else if (z <= -1.2e-148) {
tmp = t_1;
} else if (z <= -2.35e-225) {
tmp = t_2;
} else if (z <= 5.3e+20) {
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) :: t_2
real(8) :: tmp
t_1 = log(t) - y
t_2 = x * log(y)
if (z <= (-2d+150)) then
tmp = -z
else if (z <= (-3.5d+40)) then
tmp = t_2
else if (z <= (-1.9d+26)) then
tmp = -z
else if (z <= (-1.36d-70)) then
tmp = t_1
else if (z <= (-2.85d-103)) then
tmp = t_2
else if (z <= (-1.2d-148)) then
tmp = t_1
else if (z <= (-2.35d-225)) then
tmp = t_2
else if (z <= 5.3d+20) 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 t_2 = x * Math.log(y);
double tmp;
if (z <= -2e+150) {
tmp = -z;
} else if (z <= -3.5e+40) {
tmp = t_2;
} else if (z <= -1.9e+26) {
tmp = -z;
} else if (z <= -1.36e-70) {
tmp = t_1;
} else if (z <= -2.85e-103) {
tmp = t_2;
} else if (z <= -1.2e-148) {
tmp = t_1;
} else if (z <= -2.35e-225) {
tmp = t_2;
} else if (z <= 5.3e+20) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - y t_2 = x * math.log(y) tmp = 0 if z <= -2e+150: tmp = -z elif z <= -3.5e+40: tmp = t_2 elif z <= -1.9e+26: tmp = -z elif z <= -1.36e-70: tmp = t_1 elif z <= -2.85e-103: tmp = t_2 elif z <= -1.2e-148: tmp = t_1 elif z <= -2.35e-225: tmp = t_2 elif z <= 5.3e+20: tmp = t_1 else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - y) t_2 = Float64(x * log(y)) tmp = 0.0 if (z <= -2e+150) tmp = Float64(-z); elseif (z <= -3.5e+40) tmp = t_2; elseif (z <= -1.9e+26) tmp = Float64(-z); elseif (z <= -1.36e-70) tmp = t_1; elseif (z <= -2.85e-103) tmp = t_2; elseif (z <= -1.2e-148) tmp = t_1; elseif (z <= -2.35e-225) tmp = t_2; elseif (z <= 5.3e+20) tmp = t_1; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - y; t_2 = x * log(y); tmp = 0.0; if (z <= -2e+150) tmp = -z; elseif (z <= -3.5e+40) tmp = t_2; elseif (z <= -1.9e+26) tmp = -z; elseif (z <= -1.36e-70) tmp = t_1; elseif (z <= -2.85e-103) tmp = t_2; elseif (z <= -1.2e-148) tmp = t_1; elseif (z <= -2.35e-225) tmp = t_2; elseif (z <= 5.3e+20) 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]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2e+150], (-z), If[LessEqual[z, -3.5e+40], t$95$2, If[LessEqual[z, -1.9e+26], (-z), If[LessEqual[z, -1.36e-70], t$95$1, If[LessEqual[z, -2.85e-103], t$95$2, If[LessEqual[z, -1.2e-148], t$95$1, If[LessEqual[z, -2.35e-225], t$95$2, If[LessEqual[z, 5.3e+20], t$95$1, (-z)]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - y\\
t_2 := x \cdot \log y\\
\mathbf{if}\;z \leq -2 \cdot 10^{+150}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{+40}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{+26}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -1.36 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.85 \cdot 10^{-103}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-148}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -2.35 \cdot 10^{-225}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 5.3 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.99999999999999996e150 or -3.4999999999999999e40 < z < -1.9000000000000001e26 or 5.3e20 < z Initial program 100.0%
Taylor expanded in z around inf 68.1%
neg-mul-168.1%
Simplified68.1%
if -1.99999999999999996e150 < z < -3.4999999999999999e40 or -1.36000000000000001e-70 < z < -2.8499999999999998e-103 or -1.2000000000000001e-148 < z < -2.35000000000000007e-225Initial program 99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r-99.7%
associate--l-99.7%
fma-def99.7%
associate--l-99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 63.6%
if -1.9000000000000001e26 < z < -1.36000000000000001e-70 or -2.8499999999999998e-103 < z < -1.2000000000000001e-148 or -2.35000000000000007e-225 < z < 5.3e20Initial program 99.8%
Taylor expanded in z around 0 99.1%
Taylor expanded in x around 0 66.5%
Final simplification66.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (log t) z)) (t_2 (* x (log y))) (t_3 (- (log t) y)))
(if (<= x -4.8e+196)
t_2
(if (<= x -1.5e+93)
t_3
(if (<= x -1.2e+24)
t_2
(if (<= x -5e-232)
t_1
(if (<= x 1.35e-299) t_3 (if (<= x 4e+45) t_1 t_2))))))))
double code(double x, double y, double z, double t) {
double t_1 = log(t) - z;
double t_2 = x * log(y);
double t_3 = log(t) - y;
double tmp;
if (x <= -4.8e+196) {
tmp = t_2;
} else if (x <= -1.5e+93) {
tmp = t_3;
} else if (x <= -1.2e+24) {
tmp = t_2;
} else if (x <= -5e-232) {
tmp = t_1;
} else if (x <= 1.35e-299) {
tmp = t_3;
} else if (x <= 4e+45) {
tmp = t_1;
} 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) - z
t_2 = x * log(y)
t_3 = log(t) - y
if (x <= (-4.8d+196)) then
tmp = t_2
else if (x <= (-1.5d+93)) then
tmp = t_3
else if (x <= (-1.2d+24)) then
tmp = t_2
else if (x <= (-5d-232)) then
tmp = t_1
else if (x <= 1.35d-299) then
tmp = t_3
else if (x <= 4d+45) then
tmp = t_1
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) - z;
double t_2 = x * Math.log(y);
double t_3 = Math.log(t) - y;
double tmp;
if (x <= -4.8e+196) {
tmp = t_2;
} else if (x <= -1.5e+93) {
tmp = t_3;
} else if (x <= -1.2e+24) {
tmp = t_2;
} else if (x <= -5e-232) {
tmp = t_1;
} else if (x <= 1.35e-299) {
tmp = t_3;
} else if (x <= 4e+45) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = math.log(t) - z t_2 = x * math.log(y) t_3 = math.log(t) - y tmp = 0 if x <= -4.8e+196: tmp = t_2 elif x <= -1.5e+93: tmp = t_3 elif x <= -1.2e+24: tmp = t_2 elif x <= -5e-232: tmp = t_1 elif x <= 1.35e-299: tmp = t_3 elif x <= 4e+45: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(log(t) - z) t_2 = Float64(x * log(y)) t_3 = Float64(log(t) - y) tmp = 0.0 if (x <= -4.8e+196) tmp = t_2; elseif (x <= -1.5e+93) tmp = t_3; elseif (x <= -1.2e+24) tmp = t_2; elseif (x <= -5e-232) tmp = t_1; elseif (x <= 1.35e-299) tmp = t_3; elseif (x <= 4e+45) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = log(t) - z; t_2 = x * log(y); t_3 = log(t) - y; tmp = 0.0; if (x <= -4.8e+196) tmp = t_2; elseif (x <= -1.5e+93) tmp = t_3; elseif (x <= -1.2e+24) tmp = t_2; elseif (x <= -5e-232) tmp = t_1; elseif (x <= 1.35e-299) tmp = t_3; elseif (x <= 4e+45) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -4.8e+196], t$95$2, If[LessEqual[x, -1.5e+93], t$95$3, If[LessEqual[x, -1.2e+24], t$95$2, If[LessEqual[x, -5e-232], t$95$1, If[LessEqual[x, 1.35e-299], t$95$3, If[LessEqual[x, 4e+45], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log t - z\\
t_2 := x \cdot \log y\\
t_3 := \log t - y\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+196}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{+93}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{+24}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -5 \cdot 10^{-232}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-299}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+45}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -4.8000000000000001e196 or -1.49999999999999989e93 < x < -1.2e24 or 3.9999999999999997e45 < x Initial program 99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r-99.7%
associate--l-99.7%
fma-def99.7%
associate--l-99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 72.5%
if -4.8000000000000001e196 < x < -1.49999999999999989e93 or -4.9999999999999999e-232 < x < 1.35000000000000001e-299Initial program 99.8%
Taylor expanded in z around 0 86.7%
Taylor expanded in x around 0 67.7%
if -1.2e24 < x < -4.9999999999999999e-232 or 1.35000000000000001e-299 < x < 3.9999999999999997e45Initial program 100.0%
Taylor expanded in y around 0 73.7%
+-commutative73.7%
fma-def73.7%
Simplified73.7%
fma-udef73.7%
Applied egg-rr73.7%
Taylor expanded in x around 0 70.0%
Final simplification70.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (- (log t) z) y)))
(if (<= x -1.05e+228)
t_1
(if (<= x -8e+84)
t_2
(if (<= x -3.2e+58)
t_1
(if (<= x 1.05e+46) t_2 (* (log (/ 1.0 y)) (- x))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = (log(t) - z) - y;
double tmp;
if (x <= -1.05e+228) {
tmp = t_1;
} else if (x <= -8e+84) {
tmp = t_2;
} else if (x <= -3.2e+58) {
tmp = t_1;
} else if (x <= 1.05e+46) {
tmp = t_2;
} else {
tmp = log((1.0 / y)) * -x;
}
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 = (log(t) - z) - y
if (x <= (-1.05d+228)) then
tmp = t_1
else if (x <= (-8d+84)) then
tmp = t_2
else if (x <= (-3.2d+58)) then
tmp = t_1
else if (x <= 1.05d+46) then
tmp = t_2
else
tmp = log((1.0d0 / y)) * -x
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 = (Math.log(t) - z) - y;
double tmp;
if (x <= -1.05e+228) {
tmp = t_1;
} else if (x <= -8e+84) {
tmp = t_2;
} else if (x <= -3.2e+58) {
tmp = t_1;
} else if (x <= 1.05e+46) {
tmp = t_2;
} else {
tmp = Math.log((1.0 / y)) * -x;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = (math.log(t) - z) - y tmp = 0 if x <= -1.05e+228: tmp = t_1 elif x <= -8e+84: tmp = t_2 elif x <= -3.2e+58: tmp = t_1 elif x <= 1.05e+46: tmp = t_2 else: tmp = math.log((1.0 / y)) * -x return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(Float64(log(t) - z) - y) tmp = 0.0 if (x <= -1.05e+228) tmp = t_1; elseif (x <= -8e+84) tmp = t_2; elseif (x <= -3.2e+58) tmp = t_1; elseif (x <= 1.05e+46) tmp = t_2; else tmp = Float64(log(Float64(1.0 / y)) * Float64(-x)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = (log(t) - z) - y; tmp = 0.0; if (x <= -1.05e+228) tmp = t_1; elseif (x <= -8e+84) tmp = t_2; elseif (x <= -3.2e+58) tmp = t_1; elseif (x <= 1.05e+46) tmp = t_2; else tmp = log((1.0 / y)) * -x; 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[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -1.05e+228], t$95$1, If[LessEqual[x, -8e+84], t$95$2, If[LessEqual[x, -3.2e+58], t$95$1, If[LessEqual[x, 1.05e+46], t$95$2, N[(N[Log[N[(1.0 / y), $MachinePrecision]], $MachinePrecision] * (-x)), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \left(\log t - z\right) - y\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+228}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -8 \cdot 10^{+84}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{+58}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+46}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\log \left(\frac{1}{y}\right) \cdot \left(-x\right)\\
\end{array}
\end{array}
if x < -1.04999999999999997e228 or -8.00000000000000046e84 < x < -3.20000000000000015e58Initial program 99.6%
Taylor expanded in x around 0 99.6%
+-commutative99.6%
+-commutative99.6%
associate-+r-99.6%
associate--l-99.6%
fma-def99.7%
associate--l-99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 86.9%
if -1.04999999999999997e228 < x < -8.00000000000000046e84 or -3.20000000000000015e58 < x < 1.05e46Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 90.9%
if 1.05e46 < x Initial program 99.7%
Taylor expanded in z around 0 82.1%
Taylor expanded in y around inf 82.1%
Taylor expanded in x around inf 72.1%
Final simplification86.1%
(FPCore (x y z t)
:precision binary64
(if (or (<= x -1.05e+228)
(and (not (<= x -2.7e+90)) (or (<= x -3.2e+58) (not (<= x 8.2e+45)))))
(* x (log y))
(- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.05e+228) || (!(x <= -2.7e+90) && ((x <= -3.2e+58) || !(x <= 8.2e+45)))) {
tmp = x * log(y);
} else {
tmp = (log(t) - z) - y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.05d+228)) .or. (.not. (x <= (-2.7d+90))) .and. (x <= (-3.2d+58)) .or. (.not. (x <= 8.2d+45))) then
tmp = x * log(y)
else
tmp = (log(t) - z) - y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.05e+228) || (!(x <= -2.7e+90) && ((x <= -3.2e+58) || !(x <= 8.2e+45)))) {
tmp = x * Math.log(y);
} else {
tmp = (Math.log(t) - z) - y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.05e+228) or (not (x <= -2.7e+90) and ((x <= -3.2e+58) or not (x <= 8.2e+45))): tmp = x * math.log(y) else: tmp = (math.log(t) - z) - y return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.05e+228) || (!(x <= -2.7e+90) && ((x <= -3.2e+58) || !(x <= 8.2e+45)))) tmp = Float64(x * log(y)); else tmp = Float64(Float64(log(t) - z) - y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.05e+228) || (~((x <= -2.7e+90)) && ((x <= -3.2e+58) || ~((x <= 8.2e+45))))) tmp = x * log(y); else tmp = (log(t) - z) - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.05e+228], And[N[Not[LessEqual[x, -2.7e+90]], $MachinePrecision], Or[LessEqual[x, -3.2e+58], N[Not[LessEqual[x, 8.2e+45]], $MachinePrecision]]]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+228} \lor \neg \left(x \leq -2.7 \cdot 10^{+90}\right) \land \left(x \leq -3.2 \cdot 10^{+58} \lor \neg \left(x \leq 8.2 \cdot 10^{+45}\right)\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\left(\log t - z\right) - y\\
\end{array}
\end{array}
if x < -1.04999999999999997e228 or -2.7e90 < x < -3.20000000000000015e58 or 8.20000000000000025e45 < x Initial program 99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r-99.7%
associate--l-99.7%
fma-def99.7%
associate--l-99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in x around inf 76.9%
if -1.04999999999999997e228 < x < -2.7e90 or -3.20000000000000015e58 < x < 8.20000000000000025e45Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
+-commutative99.9%
associate--r+99.9%
fma-neg99.9%
neg-sub099.9%
associate-+l-99.9%
neg-sub099.9%
+-commutative99.9%
unsub-neg99.9%
Simplified99.9%
Taylor expanded in x around 0 90.9%
Final simplification86.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= y 1.8e-71)
t_1
(if (<= y 8.2e-45)
(- z)
(if (<= y 3.05e-31) t_1 (if (<= y 3.75e+99) (- z) (- y)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 1.8e-71) {
tmp = t_1;
} else if (y <= 8.2e-45) {
tmp = -z;
} else if (y <= 3.05e-31) {
tmp = t_1;
} else if (y <= 3.75e+99) {
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) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (y <= 1.8d-71) then
tmp = t_1
else if (y <= 8.2d-45) then
tmp = -z
else if (y <= 3.05d-31) then
tmp = t_1
else if (y <= 3.75d+99) 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 t_1 = x * Math.log(y);
double tmp;
if (y <= 1.8e-71) {
tmp = t_1;
} else if (y <= 8.2e-45) {
tmp = -z;
} else if (y <= 3.05e-31) {
tmp = t_1;
} else if (y <= 3.75e+99) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 1.8e-71: tmp = t_1 elif y <= 8.2e-45: tmp = -z elif y <= 3.05e-31: tmp = t_1 elif y <= 3.75e+99: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 1.8e-71) tmp = t_1; elseif (y <= 8.2e-45) tmp = Float64(-z); elseif (y <= 3.05e-31) tmp = t_1; elseif (y <= 3.75e+99) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 1.8e-71) tmp = t_1; elseif (y <= 8.2e-45) tmp = -z; elseif (y <= 3.05e-31) tmp = t_1; elseif (y <= 3.75e+99) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 1.8e-71], t$95$1, If[LessEqual[y, 8.2e-45], (-z), If[LessEqual[y, 3.05e-31], t$95$1, If[LessEqual[y, 3.75e+99], (-z), (-y)]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 1.8 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-45}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 3.05 \cdot 10^{-31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3.75 \cdot 10^{+99}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 1.8e-71 or 8.1999999999999998e-45 < y < 3.0499999999999999e-31Initial program 99.7%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
+-commutative99.7%
associate-+r-99.7%
associate--l-99.7%
fma-def99.8%
associate--l-99.8%
+-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 49.3%
if 1.8e-71 < y < 8.1999999999999998e-45 or 3.0499999999999999e-31 < y < 3.74999999999999982e99Initial program 99.9%
Taylor expanded in z around inf 55.0%
neg-mul-155.0%
Simplified55.0%
if 3.74999999999999982e99 < y Initial program 100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r-100.0%
associate--l-100.0%
fma-def100.0%
associate--l-100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 75.4%
neg-mul-175.4%
Simplified75.4%
Final simplification58.0%
(FPCore (x y z t) :precision binary64 (if (<= y 1e+99) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 1e+99) {
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 <= 1d+99) 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 <= 1e+99) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 1e+99: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 1e+99) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 1e+99) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 1e+99], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 10^{+99}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 9.9999999999999997e98Initial program 99.8%
Taylor expanded in z around inf 38.1%
neg-mul-138.1%
Simplified38.1%
if 9.9999999999999997e98 < y Initial program 100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
+-commutative100.0%
associate-+r-100.0%
associate--l-100.0%
fma-def100.0%
associate--l-100.0%
+-commutative100.0%
Simplified100.0%
Taylor expanded in y around inf 75.4%
neg-mul-175.4%
Simplified75.4%
Final simplification48.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 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 x around 0 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r-99.8%
associate--l-99.8%
fma-def99.9%
associate--l-99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 25.7%
neg-mul-125.7%
Simplified25.7%
Final simplification25.7%
herbie shell --seed 2023277
(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)))