
(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 (+ (* 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 (let* ((t_1 (* x (log y))) (t_2 (- t_1 y))) (if (<= t_2 -5e+90) t_2 (if (<= t_2 5e-8) (- (log t) (+ y z)) (- t_1 z)))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5e+90) {
tmp = t_2;
} else if (t_2 <= 5e-8) {
tmp = log(t) - (y + z);
} else {
tmp = t_1 - z;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = t_1 - y
if (t_2 <= (-5d+90)) then
tmp = t_2
else if (t_2 <= 5d-8) then
tmp = log(t) - (y + z)
else
tmp = t_1 - z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x * Math.log(y);
double t_2 = t_1 - y;
double tmp;
if (t_2 <= -5e+90) {
tmp = t_2;
} else if (t_2 <= 5e-8) {
tmp = Math.log(t) - (y + z);
} else {
tmp = t_1 - z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = t_1 - y tmp = 0 if t_2 <= -5e+90: tmp = t_2 elif t_2 <= 5e-8: tmp = math.log(t) - (y + z) else: tmp = t_1 - z return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(t_1 - y) tmp = 0.0 if (t_2 <= -5e+90) tmp = t_2; elseif (t_2 <= 5e-8) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(t_1 - z); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * log(y); t_2 = t_1 - y; tmp = 0.0; if (t_2 <= -5e+90) tmp = t_2; elseif (t_2 <= 5e-8) tmp = log(t) - (y + z); else tmp = t_1 - z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 - y), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+90], t$95$2, If[LessEqual[t$95$2, 5e-8], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - z), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := t\_1 - y\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-8}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 - z\\
\end{array}
\end{array}
if (-.f64 (*.f64 x (log.f64 y)) y) < -5.0000000000000004e90Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 89.3%
if -5.0000000000000004e90 < (-.f64 (*.f64 x (log.f64 y)) y) < 4.9999999999999998e-8Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 96.2%
if 4.9999999999999998e-8 < (-.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 97.7%
Final simplification93.5%
(FPCore (x y z t) :precision binary64 (if (or (<= z -6.8e+65) (not (<= z 1.42e+109))) (- (log t) (+ y z)) (+ (* x (log y)) (- (log t) y))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.8e+65) || !(z <= 1.42e+109)) {
tmp = log(t) - (y + z);
} else {
tmp = (x * log(y)) + (log(t) - y);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((z <= (-6.8d+65)) .or. (.not. (z <= 1.42d+109))) then
tmp = log(t) - (y + z)
else
tmp = (x * log(y)) + (log(t) - y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -6.8e+65) || !(z <= 1.42e+109)) {
tmp = Math.log(t) - (y + z);
} else {
tmp = (x * Math.log(y)) + (Math.log(t) - y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -6.8e+65) or not (z <= 1.42e+109): tmp = math.log(t) - (y + z) else: tmp = (x * math.log(y)) + (math.log(t) - y) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -6.8e+65) || !(z <= 1.42e+109)) tmp = Float64(log(t) - Float64(y + z)); else tmp = Float64(Float64(x * log(y)) + Float64(log(t) - y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -6.8e+65) || ~((z <= 1.42e+109))) tmp = log(t) - (y + z); else tmp = (x * log(y)) + (log(t) - y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -6.8e+65], N[Not[LessEqual[z, 1.42e+109]], $MachinePrecision]], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.8 \cdot 10^{+65} \lor \neg \left(z \leq 1.42 \cdot 10^{+109}\right):\\
\;\;\;\;\log t - \left(y + z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y + \left(\log t - y\right)\\
\end{array}
\end{array}
if z < -6.7999999999999999e65 or 1.4200000000000001e109 < z Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 86.1%
if -6.7999999999999999e65 < z < 1.4200000000000001e109Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around 0 98.0%
Final simplification93.7%
(FPCore (x y z t) :precision binary64 (if (<= y 340.0) (- (+ (* x (log y)) (log t)) z) (* y (+ (* (log y) (/ x y)) (- -1.0 (/ z y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 340.0) {
tmp = ((x * log(y)) + log(t)) - z;
} else {
tmp = y * ((log(y) * (x / y)) + (-1.0 - (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 <= 340.0d0) then
tmp = ((x * log(y)) + log(t)) - z
else
tmp = y * ((log(y) * (x / y)) + ((-1.0d0) - (z / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 340.0) {
tmp = ((x * Math.log(y)) + Math.log(t)) - z;
} else {
tmp = y * ((Math.log(y) * (x / y)) + (-1.0 - (z / y)));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 340.0: tmp = ((x * math.log(y)) + math.log(t)) - z else: tmp = y * ((math.log(y) * (x / y)) + (-1.0 - (z / y))) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 340.0) tmp = Float64(Float64(Float64(x * log(y)) + log(t)) - z); else tmp = Float64(y * Float64(Float64(log(y) * Float64(x / y)) + Float64(-1.0 - Float64(z / y)))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 340.0) tmp = ((x * log(y)) + log(t)) - z; else tmp = y * ((log(y) * (x / y)) + (-1.0 - (z / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 340.0], N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Log[t], $MachinePrecision]), $MachinePrecision] - z), $MachinePrecision], N[(y * N[(N[(N[Log[y], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision] + N[(-1.0 - N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 340:\\
\;\;\;\;\left(x \cdot \log y + \log t\right) - z\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\log y \cdot \frac{x}{y} + \left(-1 - \frac{z}{y}\right)\right)\\
\end{array}
\end{array}
if y < 340Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around 0 99.1%
if 340 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 99.8%
Simplified99.8%
Taylor expanded in z around inf 98.7%
neg-mul-198.7%
distribute-neg-frac98.7%
Simplified98.7%
Final simplification98.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 (<= x -225000000.0)
t_1
(if (<= x -1.6e-102)
(- y)
(if (<= x -1.85e-283)
(- z)
(if (<= x 3.5e-94) (- y) (if (<= x 4.6e+73) (- z) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double tmp;
if (x <= -225000000.0) {
tmp = t_1;
} else if (x <= -1.6e-102) {
tmp = -y;
} else if (x <= -1.85e-283) {
tmp = -z;
} else if (x <= 3.5e-94) {
tmp = -y;
} else if (x <= 4.6e+73) {
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 <= (-225000000.0d0)) then
tmp = t_1
else if (x <= (-1.6d-102)) then
tmp = -y
else if (x <= (-1.85d-283)) then
tmp = -z
else if (x <= 3.5d-94) then
tmp = -y
else if (x <= 4.6d+73) 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 <= -225000000.0) {
tmp = t_1;
} else if (x <= -1.6e-102) {
tmp = -y;
} else if (x <= -1.85e-283) {
tmp = -z;
} else if (x <= 3.5e-94) {
tmp = -y;
} else if (x <= 4.6e+73) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) tmp = 0 if x <= -225000000.0: tmp = t_1 elif x <= -1.6e-102: tmp = -y elif x <= -1.85e-283: tmp = -z elif x <= 3.5e-94: tmp = -y elif x <= 4.6e+73: 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 <= -225000000.0) tmp = t_1; elseif (x <= -1.6e-102) tmp = Float64(-y); elseif (x <= -1.85e-283) tmp = Float64(-z); elseif (x <= 3.5e-94) tmp = Float64(-y); elseif (x <= 4.6e+73) 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 <= -225000000.0) tmp = t_1; elseif (x <= -1.6e-102) tmp = -y; elseif (x <= -1.85e-283) tmp = -z; elseif (x <= 3.5e-94) tmp = -y; elseif (x <= 4.6e+73) 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, -225000000.0], t$95$1, If[LessEqual[x, -1.6e-102], (-y), If[LessEqual[x, -1.85e-283], (-z), If[LessEqual[x, 3.5e-94], (-y), If[LessEqual[x, 4.6e+73], (-z), t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -225000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-102}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq -1.85 \cdot 10^{-283}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{-94}:\\
\;\;\;\;-y\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+73}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.25e8 or 4.6e73 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 70.7%
associate--l+70.7%
associate-/l*70.7%
Simplified70.7%
Taylor expanded in x around inf 68.9%
if -2.25e8 < x < -1.59999999999999993e-102 or -1.85e-283 < x < 3.49999999999999998e-94Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in y around inf 54.5%
mul-1-neg54.5%
Simplified54.5%
if -1.59999999999999993e-102 < x < -1.85e-283 or 3.49999999999999998e-94 < x < 4.6e73Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 50.6%
mul-1-neg50.6%
Simplified50.6%
Final simplification59.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* x (log y))) (t_2 (- (log t) y)))
(if (<= x -480000000.0)
t_1
(if (<= x -1.1e-203)
t_2
(if (<= x -2e-280)
(- z)
(if (<= x 0.065) t_2 (if (<= x 2e+68) (- z) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = x * log(y);
double t_2 = log(t) - y;
double tmp;
if (x <= -480000000.0) {
tmp = t_1;
} else if (x <= -1.1e-203) {
tmp = t_2;
} else if (x <= -2e-280) {
tmp = -z;
} else if (x <= 0.065) {
tmp = t_2;
} else if (x <= 2e+68) {
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) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = log(t) - y
if (x <= (-480000000.0d0)) then
tmp = t_1
else if (x <= (-1.1d-203)) then
tmp = t_2
else if (x <= (-2d-280)) then
tmp = -z
else if (x <= 0.065d0) then
tmp = t_2
else if (x <= 2d+68) 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 t_2 = Math.log(t) - y;
double tmp;
if (x <= -480000000.0) {
tmp = t_1;
} else if (x <= -1.1e-203) {
tmp = t_2;
} else if (x <= -2e-280) {
tmp = -z;
} else if (x <= 0.065) {
tmp = t_2;
} else if (x <= 2e+68) {
tmp = -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * math.log(y) t_2 = math.log(t) - y tmp = 0 if x <= -480000000.0: tmp = t_1 elif x <= -1.1e-203: tmp = t_2 elif x <= -2e-280: tmp = -z elif x <= 0.065: tmp = t_2 elif x <= 2e+68: tmp = -z else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * log(y)) t_2 = Float64(log(t) - y) tmp = 0.0 if (x <= -480000000.0) tmp = t_1; elseif (x <= -1.1e-203) tmp = t_2; elseif (x <= -2e-280) tmp = Float64(-z); elseif (x <= 0.065) tmp = t_2; elseif (x <= 2e+68) tmp = Float64(-z); 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) - y; tmp = 0.0; if (x <= -480000000.0) tmp = t_1; elseif (x <= -1.1e-203) tmp = t_2; elseif (x <= -2e-280) tmp = -z; elseif (x <= 0.065) tmp = t_2; elseif (x <= 2e+68) 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]}, Block[{t$95$2 = N[(N[Log[t], $MachinePrecision] - y), $MachinePrecision]}, If[LessEqual[x, -480000000.0], t$95$1, If[LessEqual[x, -1.1e-203], t$95$2, If[LessEqual[x, -2e-280], (-z), If[LessEqual[x, 0.065], t$95$2, If[LessEqual[x, 2e+68], (-z), t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log t - y\\
\mathbf{if}\;x \leq -480000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.1 \cdot 10^{-203}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -2 \cdot 10^{-280}:\\
\;\;\;\;-z\\
\mathbf{elif}\;x \leq 0.065:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+68}:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.8e8 or 1.99999999999999991e68 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 70.7%
associate--l+70.7%
associate-/l*70.7%
Simplified70.7%
Taylor expanded in x around inf 68.9%
if -4.8e8 < x < -1.1e-203 or -1.9999999999999999e-280 < x < 0.065000000000000002Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 99.5%
Taylor expanded in z around 0 73.9%
if -1.1e-203 < x < -1.9999999999999999e-280 or 0.065000000000000002 < x < 1.99999999999999991e68Initial program 99.9%
associate-+l-99.9%
associate--l-100.0%
Simplified100.0%
Taylor expanded in z around inf 64.1%
mul-1-neg64.1%
Simplified64.1%
Final simplification70.8%
(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 -240000000.0)
t_2
(if (<= x -6.5e-102)
t_3
(if (<= x -7e-282)
t_1
(if (<= x 1.6e-97) t_3 (if (<= x 2.7e+64) 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 <= -240000000.0) {
tmp = t_2;
} else if (x <= -6.5e-102) {
tmp = t_3;
} else if (x <= -7e-282) {
tmp = t_1;
} else if (x <= 1.6e-97) {
tmp = t_3;
} else if (x <= 2.7e+64) {
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 <= (-240000000.0d0)) then
tmp = t_2
else if (x <= (-6.5d-102)) then
tmp = t_3
else if (x <= (-7d-282)) then
tmp = t_1
else if (x <= 1.6d-97) then
tmp = t_3
else if (x <= 2.7d+64) 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 <= -240000000.0) {
tmp = t_2;
} else if (x <= -6.5e-102) {
tmp = t_3;
} else if (x <= -7e-282) {
tmp = t_1;
} else if (x <= 1.6e-97) {
tmp = t_3;
} else if (x <= 2.7e+64) {
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 <= -240000000.0: tmp = t_2 elif x <= -6.5e-102: tmp = t_3 elif x <= -7e-282: tmp = t_1 elif x <= 1.6e-97: tmp = t_3 elif x <= 2.7e+64: 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 <= -240000000.0) tmp = t_2; elseif (x <= -6.5e-102) tmp = t_3; elseif (x <= -7e-282) tmp = t_1; elseif (x <= 1.6e-97) tmp = t_3; elseif (x <= 2.7e+64) 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 <= -240000000.0) tmp = t_2; elseif (x <= -6.5e-102) tmp = t_3; elseif (x <= -7e-282) tmp = t_1; elseif (x <= 1.6e-97) tmp = t_3; elseif (x <= 2.7e+64) 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, -240000000.0], t$95$2, If[LessEqual[x, -6.5e-102], t$95$3, If[LessEqual[x, -7e-282], t$95$1, If[LessEqual[x, 1.6e-97], t$95$3, If[LessEqual[x, 2.7e+64], 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 -240000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-102}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-282}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-97}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -2.4e8 or 2.7e64 < x Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 70.7%
associate--l+70.7%
associate-/l*70.7%
Simplified70.7%
Taylor expanded in x around inf 68.9%
if -2.4e8 < x < -6.5000000000000003e-102 or -7.00000000000000013e-282 < x < 1.5999999999999999e-97Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 99.6%
Taylor expanded in z around 0 80.7%
if -6.5000000000000003e-102 < x < -7.00000000000000013e-282 or 1.5999999999999999e-97 < x < 2.7e64Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 94.9%
Taylor expanded in y around 0 69.8%
Final simplification72.8%
(FPCore (x y z t) :precision binary64 (if (or (<= x -2.2e+90) (not (<= x 1.55e+88))) (* x (log y)) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.2e+90) || !(x <= 1.55e+88)) {
tmp = x * log(y);
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-2.2d+90)) .or. (.not. (x <= 1.55d+88))) then
tmp = x * log(y)
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -2.2e+90) || !(x <= 1.55e+88)) {
tmp = x * Math.log(y);
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -2.2e+90) or not (x <= 1.55e+88): tmp = x * math.log(y) else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -2.2e+90) || !(x <= 1.55e+88)) tmp = Float64(x * log(y)); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -2.2e+90) || ~((x <= 1.55e+88))) tmp = x * log(y); else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -2.2e+90], N[Not[LessEqual[x, 1.55e+88]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+90} \lor \neg \left(x \leq 1.55 \cdot 10^{+88}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -2.1999999999999999e90 or 1.5500000000000001e88 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in z around inf 66.5%
associate--l+66.5%
associate-/l*66.4%
Simplified66.4%
Taylor expanded in x around inf 74.2%
if -2.1999999999999999e90 < x < 1.5500000000000001e88Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 93.7%
Final simplification86.6%
(FPCore (x y z t) :precision binary64 (if (or (<= x -1.85e+84) (not (<= x 7.6e+67))) (- (* x (log y)) y) (- (log t) (+ y z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.85e+84) || !(x <= 7.6e+67)) {
tmp = (x * log(y)) - y;
} else {
tmp = log(t) - (y + z);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((x <= (-1.85d+84)) .or. (.not. (x <= 7.6d+67))) then
tmp = (x * log(y)) - y
else
tmp = log(t) - (y + z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -1.85e+84) || !(x <= 7.6e+67)) {
tmp = (x * Math.log(y)) - y;
} else {
tmp = Math.log(t) - (y + z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -1.85e+84) or not (x <= 7.6e+67): tmp = (x * math.log(y)) - y else: tmp = math.log(t) - (y + z) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -1.85e+84) || !(x <= 7.6e+67)) tmp = Float64(Float64(x * log(y)) - y); else tmp = Float64(log(t) - Float64(y + z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -1.85e+84) || ~((x <= 7.6e+67))) tmp = (x * log(y)) - y; else tmp = log(t) - (y + z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -1.85e+84], N[Not[LessEqual[x, 7.6e+67]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] - y), $MachinePrecision], N[(N[Log[t], $MachinePrecision] - N[(y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+84} \lor \neg \left(x \leq 7.6 \cdot 10^{+67}\right):\\
\;\;\;\;x \cdot \log y - y\\
\mathbf{else}:\\
\;\;\;\;\log t - \left(y + z\right)\\
\end{array}
\end{array}
if x < -1.85e84 or 7.60000000000000041e67 < x Initial program 99.7%
associate-+l-99.7%
associate--l-99.7%
Simplified99.7%
Taylor expanded in y around inf 86.8%
if -1.85e84 < x < 7.60000000000000041e67Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 94.7%
Final simplification91.7%
(FPCore (x y z t) :precision binary64 (if (<= y 5.2e-277) (- z) (if (<= y 1.32e-188) (log t) (if (<= y 2600000000000.0) (- z) (- y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.2e-277) {
tmp = -z;
} else if (y <= 1.32e-188) {
tmp = log(t);
} else if (y <= 2600000000000.0) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 5.2d-277) then
tmp = -z
else if (y <= 1.32d-188) then
tmp = log(t)
else if (y <= 2600000000000.0d0) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 5.2e-277) {
tmp = -z;
} else if (y <= 1.32e-188) {
tmp = Math.log(t);
} else if (y <= 2600000000000.0) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 5.2e-277: tmp = -z elif y <= 1.32e-188: tmp = math.log(t) elif y <= 2600000000000.0: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 5.2e-277) tmp = Float64(-z); elseif (y <= 1.32e-188) tmp = log(t); elseif (y <= 2600000000000.0) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 5.2e-277) tmp = -z; elseif (y <= 1.32e-188) tmp = log(t); elseif (y <= 2600000000000.0) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 5.2e-277], (-z), If[LessEqual[y, 1.32e-188], N[Log[t], $MachinePrecision], If[LessEqual[y, 2600000000000.0], (-z), (-y)]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{-277}:\\
\;\;\;\;-z\\
\mathbf{elif}\;y \leq 1.32 \cdot 10^{-188}:\\
\;\;\;\;\log t\\
\mathbf{elif}\;y \leq 2600000000000:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 5.2e-277 or 1.32e-188 < y < 2.6e12Initial program 99.8%
associate-+l-99.8%
associate--l-99.8%
Simplified99.8%
Taylor expanded in z around inf 40.2%
mul-1-neg40.2%
Simplified40.2%
if 5.2e-277 < y < 1.32e-188Initial program 100.0%
associate-+l-100.0%
associate--l-100.0%
Simplified100.0%
Taylor expanded in x around 0 62.9%
Taylor expanded in z around 0 43.0%
Taylor expanded in y around 0 43.0%
if 2.6e12 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 65.6%
mul-1-neg65.6%
Simplified65.6%
Final simplification51.7%
(FPCore (x y z t) :precision binary64 (if (<= y 36000000000000.0) (- z) (- y)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 36000000000000.0) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (y <= 36000000000000.0d0) then
tmp = -z
else
tmp = -y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 36000000000000.0) {
tmp = -z;
} else {
tmp = -y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 36000000000000.0: tmp = -z else: tmp = -y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 36000000000000.0) tmp = Float64(-z); else tmp = Float64(-y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 36000000000000.0) tmp = -z; else tmp = -y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 36000000000000.0], (-z), (-y)]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 36000000000000:\\
\;\;\;\;-z\\
\mathbf{else}:\\
\;\;\;\;-y\\
\end{array}
\end{array}
if y < 3.6e13Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in z around inf 35.5%
mul-1-neg35.5%
Simplified35.5%
if 3.6e13 < y Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 65.6%
mul-1-neg65.6%
Simplified65.6%
Final simplification48.6%
(FPCore (x y z t) :precision binary64 (- y))
double code(double x, double y, double z, double t) {
return -y;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = -y
end function
public static double code(double x, double y, double z, double t) {
return -y;
}
def code(x, y, z, t): return -y
function code(x, y, z, t) return Float64(-y) end
function tmp = code(x, y, z, t) tmp = -y; end
code[x_, y_, z_, t_] := (-y)
\begin{array}{l}
\\
-y
\end{array}
Initial program 99.9%
associate-+l-99.9%
associate--l-99.9%
Simplified99.9%
Taylor expanded in y around inf 30.1%
mul-1-neg30.1%
Simplified30.1%
Final simplification30.1%
herbie shell --seed 2024095
(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)))