
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- (- (* x (log y)) y) z) (log t)))
double code(double x, double y, double z, double t) {
return (((x * log(y)) - y) - z) + log(t);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (((x * log(y)) - y) - z) + log(t)
end function
public static double code(double x, double y, double z, double t) {
return (((x * Math.log(y)) - y) - z) + Math.log(t);
}
def code(x, y, z, t): return (((x * math.log(y)) - y) - z) + math.log(t)
function code(x, y, z, t) return Float64(Float64(Float64(Float64(x * log(y)) - y) - z) + log(t)) end
function tmp = code(x, y, z, t) tmp = (((x * log(y)) - y) - z) + log(t); end
code[x_, y_, z_, t_] := N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot \log y - y\right) - z\right) + \log t
\end{array}
(FPCore (x y z t) :precision binary64 (+ (fma x (log y) (- (- 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-define99.9%
Simplified99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- t_1 y)))
(if (<= t_2 -6.16e+153)
t_2
(if (<= t_2 1e-16) (- (log t) (+ z y)) (- 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 <= -6.16e+153) {
tmp = t_2;
} else if (t_2 <= 1e-16) {
tmp = log(t) - (z + y);
} 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 <= (-6.16d+153)) then
tmp = t_2
else if (t_2 <= 1d-16) then
tmp = log(t) - (z + y)
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 <= -6.16e+153) {
tmp = t_2;
} else if (t_2 <= 1e-16) {
tmp = Math.log(t) - (z + y);
} 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 <= -6.16e+153: tmp = t_2 elif t_2 <= 1e-16: tmp = math.log(t) - (z + y) 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 <= -6.16e+153) tmp = t_2; elseif (t_2 <= 1e-16) tmp = Float64(log(t) - Float64(z + y)); 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 <= -6.16e+153) tmp = t_2; elseif (t_2 <= 1e-16) tmp = log(t) - (z + y); 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, -6.16e+153], t$95$2, If[LessEqual[t$95$2, 1e-16], N[(N[Log[t], $MachinePrecision] - N[(z + y), $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 -6.16 \cdot 10^{+153}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 10^{-16}:\\
\;\;\;\;\log t - \left(z + y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -6.15999999999999975e153Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in y around inf 87.5%
if -6.15999999999999975e153 < (-.f64 (*.f64 x (log.f64 y)) y) < 9.9999999999999998e-17Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 90.0%
if 9.9999999999999998e-17 < (-.f64 (*.f64 x (log.f64 y)) y) Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 99.4%
Final simplification91.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (log y)))) (if (<= y 4.2e+69) (+ t_1 (- (log t) z)) (- t_1 y))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (y <= 4.2e+69) {
tmp = t_1 + (log(t) - 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 = x * log(y)
if (y <= 4.2d+69) then
tmp = t_1 + (log(t) - 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 = x * Math.log(y);
double tmp;
if (y <= 4.2e+69) {
tmp = t_1 + (Math.log(t) - z);
} else {
tmp = t_1 - y;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if y <= 4.2e+69: tmp = t_1 + (math.log(t) - z) else: tmp = t_1 - y return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (y <= 4.2e+69) tmp = Float64(t_1 + Float64(log(t) - z)); else tmp = Float64(t_1 - y); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (y <= 4.2e+69) tmp = t_1 + (log(t) - z); else tmp = t_1 - y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 4.2e+69], N[(t$95$1 + N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;y \leq 4.2 \cdot 10^{+69}:\\
\;\;\;\;t\_1 + \left(\log t - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - y\\
\end{array}
\end{array}
if y < 4.2000000000000003e69Initial program 99.8%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around 0 96.1%
if 4.2000000000000003e69 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 82.8%
Final simplification91.0%
(FPCore (x y z t) :precision binary64 (+ (* x (log y)) (- (- (log t) z) y)))
double code(double x, double y, double z, double t) {
return (x * log(y)) + ((log(t) - 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 = (x * log(y)) + ((log(t) - z) - y)
end function
public static double code(double x, double y, double z, double t) {
return (x * Math.log(y)) + ((Math.log(t) - z) - y);
}
def code(x, y, z, t): return (x * math.log(y)) + ((math.log(t) - z) - y)
function code(x, y, z, t) return Float64(Float64(x * log(y)) + Float64(Float64(log(t) - z) - y)) end
function tmp = code(x, y, z, t) tmp = (x * log(y)) + ((log(t) - z) - y); end
code[x_, y_, z_, t_] := N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Log[t], $MachinePrecision] - z), $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \log y + \left(\left(\log t - z\right) - y\right)
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (+ (log t) (- (- (* x (log y)) y) z)))
double code(double x, double y, double z, double t) {
return log(t) + (((x * log(y)) - y) - z);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = log(t) + (((x * log(y)) - y) - z)
end function
public static double code(double x, double y, double z, double t) {
return Math.log(t) + (((x * Math.log(y)) - y) - z);
}
def code(x, y, z, t): return math.log(t) + (((x * math.log(y)) - y) - z)
function code(x, y, z, t) return Float64(log(t) + Float64(Float64(Float64(x * log(y)) - y) - z)) end
function tmp = code(x, y, z, t) tmp = log(t) + (((x * log(y)) - y) - z); end
code[x_, y_, z_, t_] := N[(N[Log[t], $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\log t + \left(\left(x \cdot \log y - y\right) - z\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= z -1.5e+104)
(- z)
(if (<= z -4.8e-90)
(- y)
(if (<= z 1.26e-197)
t_1
(if (<= z 4.5e-77) (- y) (if (<= z 1.4e+101) t_1 (- z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (z <= -1.5e+104) {
tmp = -z;
} else if (z <= -4.8e-90) {
tmp = -y;
} else if (z <= 1.26e-197) {
tmp = t_1;
} else if (z <= 4.5e-77) {
tmp = -y;
} else if (z <= 1.4e+101) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x * log(y)
if (z <= (-1.5d+104)) then
tmp = -z
else if (z <= (-4.8d-90)) then
tmp = -y
else if (z <= 1.26d-197) then
tmp = t_1
else if (z <= 4.5d-77) then
tmp = -y
else if (z <= 1.4d+101) 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 = x * Math.log(y);
double tmp;
if (z <= -1.5e+104) {
tmp = -z;
} else if (z <= -4.8e-90) {
tmp = -y;
} else if (z <= 1.26e-197) {
tmp = t_1;
} else if (z <= 4.5e-77) {
tmp = -y;
} else if (z <= 1.4e+101) {
tmp = t_1;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if z <= -1.5e+104: tmp = -z elif z <= -4.8e-90: tmp = -y elif z <= 1.26e-197: tmp = t_1 elif z <= 4.5e-77: tmp = -y elif z <= 1.4e+101: tmp = t_1 else: tmp = -z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (z <= -1.5e+104) tmp = Float64(-z); elseif (z <= -4.8e-90) tmp = Float64(-y); elseif (z <= 1.26e-197) tmp = t_1; elseif (z <= 4.5e-77) tmp = Float64(-y); elseif (z <= 1.4e+101) tmp = t_1; else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (z <= -1.5e+104) tmp = -z; elseif (z <= -4.8e-90) tmp = -y; elseif (z <= 1.26e-197) tmp = t_1; elseif (z <= 4.5e-77) tmp = -y; elseif (z <= 1.4e+101) tmp = t_1; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.5e+104], (-z), If[LessEqual[z, -4.8e-90], (-y), If[LessEqual[z, 1.26e-197], t$95$1, If[LessEqual[z, 4.5e-77], (-y), If[LessEqual[z, 1.4e+101], t$95$1, (-z)]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+104}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-90}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{-197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-77}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -1.49999999999999984e104 or 1.39999999999999991e101 < z Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 86.1%
Taylor expanded in x around 0 71.5%
neg-mul-171.5%
Simplified71.5%
if -1.49999999999999984e104 < z < -4.8000000000000003e-90 or 1.26000000000000003e-197 < z < 4.5000000000000001e-77Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around inf 77.6%
mul-1-neg77.6%
Simplified77.6%
Taylor expanded in y around inf 57.2%
mul-1-neg57.2%
Simplified57.2%
if -4.8000000000000003e-90 < z < 1.26000000000000003e-197 or 4.5000000000000001e-77 < z < 1.39999999999999991e101Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 52.6%
Taylor expanded in x around inf 50.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) z)))
(if (<= x -2e+19)
t_1
(if (<= x -6.6e-216)
t_2
(if (<= x 4.2e-172) (- (log t) y) (if (<= x 5e+134) t_2 t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = log(t) - z;
double tmp;
if (x <= -2e+19) {
tmp = t_1;
} else if (x <= -6.6e-216) {
tmp = t_2;
} else if (x <= 4.2e-172) {
tmp = log(t) - y;
} else if (x <= 5e+134) {
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 = log(t) - z
if (x <= (-2d+19)) then
tmp = t_1
else if (x <= (-6.6d-216)) then
tmp = t_2
else if (x <= 4.2d-172) then
tmp = log(t) - y
else if (x <= 5d+134) 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 = Math.log(t) - z;
double tmp;
if (x <= -2e+19) {
tmp = t_1;
} else if (x <= -6.6e-216) {
tmp = t_2;
} else if (x <= 4.2e-172) {
tmp = Math.log(t) - y;
} else if (x <= 5e+134) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = math.log(t) - z tmp = 0 if x <= -2e+19: tmp = t_1 elif x <= -6.6e-216: tmp = t_2 elif x <= 4.2e-172: tmp = math.log(t) - y elif x <= 5e+134: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(log(t) - z) tmp = 0.0 if (x <= -2e+19) tmp = t_1; elseif (x <= -6.6e-216) tmp = t_2; elseif (x <= 4.2e-172) tmp = Float64(log(t) - y); elseif (x <= 5e+134) 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 = log(t) - z; tmp = 0.0; if (x <= -2e+19) tmp = t_1; elseif (x <= -6.6e-216) tmp = t_2; elseif (x <= 4.2e-172) tmp = log(t) - y; elseif (x <= 5e+134) 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[(N[Log[t], $MachinePrecision] - z), $MachinePrecision]}, If[LessEqual[x, -2e+19], t$95$1, If[LessEqual[x, -6.6e-216], t$95$2, If[LessEqual[x, 4.2e-172], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 5e+134], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - z\\
\mathbf{if}\;x \leq -2 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.6 \cdot 10^{-216}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-172}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+134}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2e19 or 4.99999999999999981e134 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 82.4%
Taylor expanded in x around inf 65.4%
if -2e19 < x < -6.59999999999999937e-216 or 4.1999999999999999e-172 < x < 4.99999999999999981e134Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 66.6%
neg-mul-166.6%
Simplified66.6%
Taylor expanded in z around 0 66.6%
mul-1-neg66.6%
sub-neg66.6%
Simplified66.6%
if -6.59999999999999937e-216 < x < 4.1999999999999999e-172Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around inf 79.6%
mul-1-neg79.6%
Simplified79.6%
Taylor expanded in y around 0 79.6%
mul-1-neg79.6%
sub-neg79.6%
Simplified79.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2.8e+17)
t_1
(if (<= x -3.6e-155)
(- z)
(if (<= x 1.1e-32) (- (log t) y) (if (<= x 1.65e+133) (- z) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -2.8e+17) {
tmp = t_1;
} else if (x <= -3.6e-155) {
tmp = -z;
} else if (x <= 1.1e-32) {
tmp = log(t) - y;
} else if (x <= 1.65e+133) {
tmp = -z;
} 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) :: tmp
t_1 = x * log(y)
if (x <= (-2.8d+17)) then
tmp = t_1
else if (x <= (-3.6d-155)) then
tmp = -z
else if (x <= 1.1d-32) then
tmp = log(t) - y
else if (x <= 1.65d+133) then
tmp = -z
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 tmp;
if (x <= -2.8e+17) {
tmp = t_1;
} else if (x <= -3.6e-155) {
tmp = -z;
} else if (x <= 1.1e-32) {
tmp = Math.log(t) - y;
} else if (x <= 1.65e+133) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -2.8e+17: tmp = t_1 elif x <= -3.6e-155: tmp = -z elif x <= 1.1e-32: tmp = math.log(t) - y elif x <= 1.65e+133: tmp = -z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2.8e+17) tmp = t_1; elseif (x <= -3.6e-155) tmp = Float64(-z); elseif (x <= 1.1e-32) tmp = Float64(log(t) - y); elseif (x <= 1.65e+133) tmp = Float64(-z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); tmp = 0.0; if (x <= -2.8e+17) tmp = t_1; elseif (x <= -3.6e-155) tmp = -z; elseif (x <= 1.1e-32) tmp = log(t) - y; elseif (x <= 1.65e+133) tmp = -z; 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]}, If[LessEqual[x, -2.8e+17], t$95$1, If[LessEqual[x, -3.6e-155], (-z), If[LessEqual[x, 1.1e-32], N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision], If[LessEqual[x, 1.65e+133], (-z), t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.8 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -3.6 \cdot 10^{-155}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-32}:\\
\;\;\;\;\log t - y\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+133}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.8e17 or 1.65e133 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 82.4%
Taylor expanded in x around inf 65.4%
if -2.8e17 < x < -3.59999999999999989e-155 or 1.1e-32 < x < 1.65e133Initial program 99.9%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 72.4%
Taylor expanded in x around 0 60.2%
neg-mul-160.2%
Simplified60.2%
if -3.59999999999999989e-155 < x < 1.1e-32Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in y around inf 69.9%
mul-1-neg69.9%
Simplified69.9%
Taylor expanded in y around 0 69.9%
mul-1-neg69.9%
sub-neg69.9%
Simplified69.9%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.9e+104)
(- z)
(if (<= z 1.2e-305)
(- y)
(if (<= z 8.2e-196) (log t) (if (<= z 1.75e+124) (- y) (- z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e+104) {
tmp = -z;
} else if (z <= 1.2e-305) {
tmp = -y;
} else if (z <= 8.2e-196) {
tmp = log(t);
} else if (z <= 1.75e+124) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-2.9d+104)) then
tmp = -z
else if (z <= 1.2d-305) then
tmp = -y
else if (z <= 8.2d-196) then
tmp = log(t)
else if (z <= 1.75d+124) then
tmp = -y
else
tmp = -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.9e+104) {
tmp = -z;
} else if (z <= 1.2e-305) {
tmp = -y;
} else if (z <= 8.2e-196) {
tmp = Math.log(t);
} else if (z <= 1.75e+124) {
tmp = -y;
} else {
tmp = -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.9e+104: tmp = -z elif z <= 1.2e-305: tmp = -y elif z <= 8.2e-196: tmp = math.log(t) elif z <= 1.75e+124: tmp = -y else: tmp = -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.9e+104) tmp = Float64(-z); elseif (z <= 1.2e-305) tmp = Float64(-y); elseif (z <= 8.2e-196) tmp = log(t); elseif (z <= 1.75e+124) tmp = Float64(-y); else tmp = Float64(-z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.9e+104) tmp = -z; elseif (z <= 1.2e-305) tmp = -y; elseif (z <= 8.2e-196) tmp = log(t); elseif (z <= 1.75e+124) tmp = -y; else tmp = -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.9e+104], (-z), If[LessEqual[z, 1.2e-305], (-y), If[LessEqual[z, 8.2e-196], N[Log[t], $MachinePrecision], If[LessEqual[z, 1.75e+124], (-y), (-z)]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+104}:\\
\;\;\;\;-z\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-305}:\\
\;\;\;\;-y\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-196}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+124}:\\
\;\;\;\;-y\\
\mathbf{else}:\\
\;\;\;\;-z\\
\end{array}
\end{array}
if z < -2.8999999999999998e104 or 1.7500000000000001e124 < z Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 89.1%
Taylor expanded in x around 0 74.6%
neg-mul-174.6%
Simplified74.6%
if -2.8999999999999998e104 < z < 1.2000000000000001e-305 or 8.20000000000000043e-196 < z < 1.7500000000000001e124Initial program 99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 55.0%
mul-1-neg55.0%
Simplified55.0%
Taylor expanded in y around inf 40.8%
mul-1-neg40.8%
Simplified40.8%
if 1.2000000000000001e-305 < z < 8.20000000000000043e-196Initial program 99.8%
sub-neg99.8%
associate--l+99.8%
fma-define99.8%
Simplified99.8%
Taylor expanded in y around inf 51.8%
mul-1-neg51.8%
Simplified51.8%
Taylor expanded in y around 0 44.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.05e+101) (not (<= x 8.5e+132))) (- (* x (log y)) y) (- (log t) (+ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.05e+101) || !(x <= 8.5e+132)) {
tmp = (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.05d+101)) .or. (.not. (x <= 8.5d+132))) then
tmp = (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.05e+101) || !(x <= 8.5e+132)) {
tmp = (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.05e+101) or not (x <= 8.5e+132): tmp = (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.05e+101) || !(x <= 8.5e+132)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - Float64(z + y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.05e+101) || ~((x <= 8.5e+132))) tmp = (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.05e+101], N[Not[LessEqual[x, 8.5e+132]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(z + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+101} \lor \neg \left(x \leq 8.5 \cdot 10^{+132}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(z + y\right)\\
\end{array}
\end{array}
if x < -2.05e101 or 8.49999999999999969e132 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 86.9%
if -2.05e101 < x < 8.49999999999999969e132Initial program 100.0%
sub-neg100.0%
associate--l+100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 90.8%
Final simplification89.5%
(FPCore (x y z t) :precision binary64 (if (or (<= x -6.8e+168) (not (<= x 4.9e+138))) (* x (log y)) (- (log t) (+ z y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -6.8e+168) || !(x <= 4.9e+138)) {
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 <= (-6.8d+168)) .or. (.not. (x <= 4.9d+138))) 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 <= -6.8e+168) || !(x <= 4.9e+138)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (z + y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -6.8e+168) or not (x <= 4.9e+138): 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 <= -6.8e+168) || !(x <= 4.9e+138)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - Float64(z + y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -6.8e+168) || ~((x <= 4.9e+138))) tmp = x * log(y); else tmp = log(t) - (z + y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -6.8e+168], N[Not[LessEqual[x, 4.9e+138]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(z + y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{+168} \lor \neg \left(x \leq 4.9 \cdot 10^{+138}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(z + y\right)\\
\end{array}
\end{array}
if x < -6.80000000000000005e168 or 4.89999999999999983e138 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 87.8%
Taylor expanded in x around inf 78.3%
if -6.80000000000000005e168 < x < 4.89999999999999983e138Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 86.5%
Final simplification84.4%
(FPCore (x y z t) :precision binary64 (if (<= y 2.3e+70) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.3e+70) {
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.3d+70) 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.3e+70) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.3e+70: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.3e+70) 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.3e+70) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.3e+70], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.3 \cdot 10^{+70}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 2.29999999999999994e70Initial program 99.8%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 76.1%
Taylor expanded in x around 0 41.5%
neg-mul-141.5%
Simplified41.5%
if 2.29999999999999994e70 < y Initial program 99.9%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 61.8%
mul-1-neg61.8%
Simplified61.8%
Taylor expanded in y around inf 61.8%
mul-1-neg61.8%
Simplified61.8%
(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%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 38.7%
mul-1-neg38.7%
Simplified38.7%
Taylor expanded in y around inf 27.2%
mul-1-neg27.2%
Simplified27.2%
(FPCore (x y z t) :precision binary64 y)
double code(double x, double y, double z, double t) {
return y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = y
end function
public static double code(double x, double y, double z, double t) {
return y;
}
def code(x, y, z, t): return y
function code(x, y, z, t) return 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%
sub-neg99.9%
associate--l+99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in y around inf 38.7%
mul-1-neg38.7%
Simplified38.7%
Taylor expanded in y around inf 27.2%
mul-1-neg27.2%
Simplified27.2%
neg-sub027.2%
sub-neg27.2%
add-sqr-sqrt0.0%
sqrt-unprod2.3%
sqr-neg2.3%
sqrt-unprod2.3%
add-sqr-sqrt2.3%
Applied egg-rr2.3%
+-lft-identity2.3%
Simplified2.3%
herbie shell --seed 2024165
(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)))