
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (fma y i (fma (+ b -0.5) (log c) (+ (fma x (log y) z) (+ t a)))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, fma((b + -0.5), log(c), (fma(x, log(y), z) + (t + a))));
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(fma(x, log(y), z) + Float64(t + a)))) end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
associate-+l+99.8%
fma-def99.8%
Simplified99.8%
Final simplification99.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (+ (fma x (log y) z) (+ t a)) (+ (* (+ b -0.5) (log c)) (* y i))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (fma(x, log(y), z) + (t + a)) + (((b + -0.5) * log(c)) + (y * i));
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(fma(x, log(y), z) + Float64(t + a)) + Float64(Float64(Float64(b + -0.5) * log(c)) + Float64(y * i))) end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right)
\end{array}
Initial program 99.8%
associate-+l+99.8%
associate-+l+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Final simplification99.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* (log (/ 1.0 c)) (- 0.5 b)))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (log((1.0 / c)) * (0.5 - b)));
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + ((a + (t + (z + (x * log(y))))) + (log((1.0d0 / c)) * (0.5d0 - b)))
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * Math.log(y))))) + (Math.log((1.0 / c)) * (0.5 - b)));
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (math.log((1.0 / c)) * (0.5 - b)))
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(Float64(1.0 / c)) * Float64(0.5 - b)))) end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (log((1.0 / c)) * (0.5 - b)));
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[N[(1.0 / c), $MachinePrecision]], $MachinePrecision] * N[(0.5 - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log \left(\frac{1}{c}\right) \cdot \left(0.5 - b\right)\right)
\end{array}
Initial program 99.8%
Taylor expanded in c around inf 99.8%
Final simplification99.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -6e+129) (not (<= x 4.5e+91))) (+ (* y i) (+ (* x (log y)) (+ t (+ z (* b (log c)))))) (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ z t))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -6e+129) || !(x <= 4.5e+91)) {
tmp = (y * i) + ((x * log(y)) + (t + (z + (b * log(c)))));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-6d+129)) .or. (.not. (x <= 4.5d+91))) then
tmp = (y * i) + ((x * log(y)) + (t + (z + (b * log(c)))))
else
tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (a + (z + t)))
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -6e+129) || !(x <= 4.5e+91)) {
tmp = (y * i) + ((x * Math.log(y)) + (t + (z + (b * Math.log(c)))));
} else {
tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + (z + t)));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -6e+129) or not (x <= 4.5e+91): tmp = (y * i) + ((x * math.log(y)) + (t + (z + (b * math.log(c))))) else: tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (a + (z + t))) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -6e+129) || !(x <= 4.5e+91)) tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + Float64(t + Float64(z + Float64(b * log(c)))))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(z + t)))); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((x <= -6e+129) || ~((x <= 4.5e+91)))
tmp = (y * i) + ((x * log(y)) + (t + (z + (b * log(c)))));
else
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -6e+129], N[Not[LessEqual[x, 4.5e+91]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(t + N[(z + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+129} \lor \neg \left(x \leq 4.5 \cdot 10^{+91}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + \left(t + \left(z + b \cdot \log c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)\\
\end{array}
\end{array}
if x < -6.0000000000000006e129 or 4.5e91 < x Initial program 99.7%
Taylor expanded in b around inf 99.7%
Taylor expanded in a around 0 91.7%
if -6.0000000000000006e129 < x < 4.5e91Initial program 99.9%
Taylor expanded in x around 0 98.8%
Final simplification96.6%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5)))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5)));
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0)))
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5)));
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5)))
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5)))) end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5)));
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)
\end{array}
Initial program 99.8%
Final simplification99.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* b (log c)))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)));
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)))
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * Math.log(y))))) + (b * Math.log(c)));
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (b * math.log(c)))
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(b * log(c)))) end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)));
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + b \cdot \log c\right)
\end{array}
Initial program 99.8%
Taylor expanded in b around inf 98.3%
Final simplification98.3%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (+ z t))))
(if (<= x -1.65e+152)
(+ (* y i) (+ (* x (log y)) t_1))
(if (<= x 5e+60)
(+ (* y i) (+ (* (log c) (- b 0.5)) t_1))
(+ (* y i) (fma (log y) x t_1))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (z + t);
double tmp;
if (x <= -1.65e+152) {
tmp = (y * i) + ((x * log(y)) + t_1);
} else if (x <= 5e+60) {
tmp = (y * i) + ((log(c) * (b - 0.5)) + t_1);
} else {
tmp = (y * i) + fma(log(y), x, t_1);
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(z + t)) tmp = 0.0 if (x <= -1.65e+152) tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + t_1)); elseif (x <= 5e+60) tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + t_1)); else tmp = Float64(Float64(y * i) + fma(log(y), x, t_1)); end return tmp end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.65e+152], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5e+60], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := a + \left(z + t\right)\\
\mathbf{if}\;x \leq -1.65 \cdot 10^{+152}:\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + t_1\right)\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+60}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \mathsf{fma}\left(\log y, x, t_1\right)\\
\end{array}
\end{array}
if x < -1.6500000000000001e152Initial program 99.7%
Taylor expanded in b around inf 99.7%
Taylor expanded in b around 0 86.8%
if -1.6500000000000001e152 < x < 4.99999999999999975e60Initial program 99.9%
Taylor expanded in x around 0 98.3%
if 4.99999999999999975e60 < x Initial program 99.8%
Taylor expanded in b around inf 99.8%
Taylor expanded in b around 0 87.8%
fma-def87.8%
Simplified87.8%
Final simplification94.9%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (+ z t))))
(if (or (<= x -3.8e+156) (not (<= x 9e+60)))
(+ (* y i) (+ (* x (log y)) t_1))
(+ (* y i) (+ (* (log c) (- b 0.5)) t_1)))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (z + t);
double tmp;
if ((x <= -3.8e+156) || !(x <= 9e+60)) {
tmp = (y * i) + ((x * log(y)) + t_1);
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + t_1);
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = a + (z + t)
if ((x <= (-3.8d+156)) .or. (.not. (x <= 9d+60))) then
tmp = (y * i) + ((x * log(y)) + t_1)
else
tmp = (y * i) + ((log(c) * (b - 0.5d0)) + t_1)
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (z + t);
double tmp;
if ((x <= -3.8e+156) || !(x <= 9e+60)) {
tmp = (y * i) + ((x * Math.log(y)) + t_1);
} else {
tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + t_1);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = a + (z + t) tmp = 0 if (x <= -3.8e+156) or not (x <= 9e+60): tmp = (y * i) + ((x * math.log(y)) + t_1) else: tmp = (y * i) + ((math.log(c) * (b - 0.5)) + t_1) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(z + t)) tmp = 0.0 if ((x <= -3.8e+156) || !(x <= 9e+60)) tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + t_1)); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + t_1)); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = a + (z + t);
tmp = 0.0;
if ((x <= -3.8e+156) || ~((x <= 9e+60)))
tmp = (y * i) + ((x * log(y)) + t_1);
else
tmp = (y * i) + ((log(c) * (b - 0.5)) + t_1);
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -3.8e+156], N[Not[LessEqual[x, 9e+60]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := a + \left(z + t\right)\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+156} \lor \neg \left(x \leq 9 \cdot 10^{+60}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + t_1\right)\\
\end{array}
\end{array}
if x < -3.80000000000000024e156 or 9.00000000000000026e60 < x Initial program 99.7%
Taylor expanded in b around inf 99.7%
Taylor expanded in b around 0 87.4%
if -3.80000000000000024e156 < x < 9.00000000000000026e60Initial program 99.9%
Taylor expanded in x around 0 98.3%
Final simplification94.9%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (* x (log y)))))
(if (<= z -2.35e+142)
(+ z (* y i))
(if (<= z -3.6e+34)
t_1
(if (<= z -1.6e-183)
(+ (* y i) (* b (log c)))
(if (<= z -1.85e-214)
t_1
(if (<= z -4.2e-262)
(+ z (* (log c) (- b 0.5)))
(+ a (* y i)))))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + (x * log(y));
double tmp;
if (z <= -2.35e+142) {
tmp = z + (y * i);
} else if (z <= -3.6e+34) {
tmp = t_1;
} else if (z <= -1.6e-183) {
tmp = (y * i) + (b * log(c));
} else if (z <= -1.85e-214) {
tmp = t_1;
} else if (z <= -4.2e-262) {
tmp = z + (log(c) * (b - 0.5));
} else {
tmp = a + (y * i);
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (y * i) + (x * log(y))
if (z <= (-2.35d+142)) then
tmp = z + (y * i)
else if (z <= (-3.6d+34)) then
tmp = t_1
else if (z <= (-1.6d-183)) then
tmp = (y * i) + (b * log(c))
else if (z <= (-1.85d-214)) then
tmp = t_1
else if (z <= (-4.2d-262)) then
tmp = z + (log(c) * (b - 0.5d0))
else
tmp = a + (y * i)
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + (x * Math.log(y));
double tmp;
if (z <= -2.35e+142) {
tmp = z + (y * i);
} else if (z <= -3.6e+34) {
tmp = t_1;
} else if (z <= -1.6e-183) {
tmp = (y * i) + (b * Math.log(c));
} else if (z <= -1.85e-214) {
tmp = t_1;
} else if (z <= -4.2e-262) {
tmp = z + (Math.log(c) * (b - 0.5));
} else {
tmp = a + (y * i);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = (y * i) + (x * math.log(y)) tmp = 0 if z <= -2.35e+142: tmp = z + (y * i) elif z <= -3.6e+34: tmp = t_1 elif z <= -1.6e-183: tmp = (y * i) + (b * math.log(c)) elif z <= -1.85e-214: tmp = t_1 elif z <= -4.2e-262: tmp = z + (math.log(c) * (b - 0.5)) else: tmp = a + (y * i) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(x * log(y))) tmp = 0.0 if (z <= -2.35e+142) tmp = Float64(z + Float64(y * i)); elseif (z <= -3.6e+34) tmp = t_1; elseif (z <= -1.6e-183) tmp = Float64(Float64(y * i) + Float64(b * log(c))); elseif (z <= -1.85e-214) tmp = t_1; elseif (z <= -4.2e-262) tmp = Float64(z + Float64(log(c) * Float64(b - 0.5))); else tmp = Float64(a + Float64(y * i)); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (y * i) + (x * log(y));
tmp = 0.0;
if (z <= -2.35e+142)
tmp = z + (y * i);
elseif (z <= -3.6e+34)
tmp = t_1;
elseif (z <= -1.6e-183)
tmp = (y * i) + (b * log(c));
elseif (z <= -1.85e-214)
tmp = t_1;
elseif (z <= -4.2e-262)
tmp = z + (log(c) * (b - 0.5));
else
tmp = a + (y * i);
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e+142], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.6e+34], t$95$1, If[LessEqual[z, -1.6e-183], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.85e-214], t$95$1, If[LessEqual[z, -4.2e-262], N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot i + x \cdot \log y\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{+142}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{+34}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{-183}:\\
\;\;\;\;y \cdot i + b \cdot \log c\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-214}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-262}:\\
\;\;\;\;z + \log c \cdot \left(b - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -2.35e142Initial program 99.9%
Taylor expanded in z around inf 66.7%
if -2.35e142 < z < -3.6e34 or -1.6000000000000001e-183 < z < -1.8500000000000001e-214Initial program 99.7%
Taylor expanded in c around inf 99.7%
Taylor expanded in x around inf 39.7%
if -3.6e34 < z < -1.6000000000000001e-183Initial program 99.8%
Taylor expanded in x around 0 86.5%
Taylor expanded in b around inf 52.5%
if -1.8500000000000001e-214 < z < -4.1999999999999999e-262Initial program 99.6%
Taylor expanded in x around 0 72.0%
Taylor expanded in a around 0 57.7%
fma-def57.7%
sub-neg57.7%
metadata-eval57.7%
+-commutative57.7%
Simplified57.7%
Taylor expanded in y around 0 44.5%
Taylor expanded in t around 0 30.3%
if -4.1999999999999999e-262 < z Initial program 99.8%
Taylor expanded in a around inf 41.8%
Final simplification47.5%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (+ (* x (log y)) (+ z t)))))
(if (<= a 7e-155)
t_1
(if (<= a 2.25e-127)
(+ z (* (log c) (- b 0.5)))
(if (<= a 1.5e+192) t_1 (+ a (* y i)))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + ((x * log(y)) + (z + t));
double tmp;
if (a <= 7e-155) {
tmp = t_1;
} else if (a <= 2.25e-127) {
tmp = z + (log(c) * (b - 0.5));
} else if (a <= 1.5e+192) {
tmp = t_1;
} else {
tmp = a + (y * i);
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (y * i) + ((x * log(y)) + (z + t))
if (a <= 7d-155) then
tmp = t_1
else if (a <= 2.25d-127) then
tmp = z + (log(c) * (b - 0.5d0))
else if (a <= 1.5d+192) then
tmp = t_1
else
tmp = a + (y * i)
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + ((x * Math.log(y)) + (z + t));
double tmp;
if (a <= 7e-155) {
tmp = t_1;
} else if (a <= 2.25e-127) {
tmp = z + (Math.log(c) * (b - 0.5));
} else if (a <= 1.5e+192) {
tmp = t_1;
} else {
tmp = a + (y * i);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = (y * i) + ((x * math.log(y)) + (z + t)) tmp = 0 if a <= 7e-155: tmp = t_1 elif a <= 2.25e-127: tmp = z + (math.log(c) * (b - 0.5)) elif a <= 1.5e+192: tmp = t_1 else: tmp = a + (y * i) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + Float64(z + t))) tmp = 0.0 if (a <= 7e-155) tmp = t_1; elseif (a <= 2.25e-127) tmp = Float64(z + Float64(log(c) * Float64(b - 0.5))); elseif (a <= 1.5e+192) tmp = t_1; else tmp = Float64(a + Float64(y * i)); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (y * i) + ((x * log(y)) + (z + t));
tmp = 0.0;
if (a <= 7e-155)
tmp = t_1;
elseif (a <= 2.25e-127)
tmp = z + (log(c) * (b - 0.5));
elseif (a <= 1.5e+192)
tmp = t_1;
else
tmp = a + (y * i);
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 7e-155], t$95$1, If[LessEqual[a, 2.25e-127], N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.5e+192], t$95$1, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot i + \left(x \cdot \log y + \left(z + t\right)\right)\\
\mathbf{if}\;a \leq 7 \cdot 10^{-155}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.25 \cdot 10^{-127}:\\
\;\;\;\;z + \log c \cdot \left(b - 0.5\right)\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+192}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if a < 7.00000000000000031e-155 or 2.25e-127 < a < 1.5e192Initial program 99.8%
Taylor expanded in b around inf 98.4%
Taylor expanded in a around 0 88.4%
Taylor expanded in b around 0 70.6%
if 7.00000000000000031e-155 < a < 2.25e-127Initial program 99.7%
Taylor expanded in x around 0 99.7%
Taylor expanded in a around 0 99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
+-commutative99.7%
Simplified99.7%
Taylor expanded in y around 0 89.1%
Taylor expanded in t around 0 83.1%
if 1.5e192 < a Initial program 99.9%
Taylor expanded in a around inf 80.0%
Final simplification71.7%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -2.8e+153) (not (<= x 4.9e+91))) (+ (* y i) (+ (* x (log y)) (+ z t))) (+ (* y i) (+ a (+ z (* (log c) (- b 0.5)))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -2.8e+153) || !(x <= 4.9e+91)) {
tmp = (y * i) + ((x * log(y)) + (z + t));
} else {
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-2.8d+153)) .or. (.not. (x <= 4.9d+91))) then
tmp = (y * i) + ((x * log(y)) + (z + t))
else
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5d0))))
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -2.8e+153) || !(x <= 4.9e+91)) {
tmp = (y * i) + ((x * Math.log(y)) + (z + t));
} else {
tmp = (y * i) + (a + (z + (Math.log(c) * (b - 0.5))));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -2.8e+153) or not (x <= 4.9e+91): tmp = (y * i) + ((x * math.log(y)) + (z + t)) else: tmp = (y * i) + (a + (z + (math.log(c) * (b - 0.5)))) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -2.8e+153) || !(x <= 4.9e+91)) tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + Float64(z + t))); else tmp = Float64(Float64(y * i) + Float64(a + Float64(z + Float64(log(c) * Float64(b - 0.5))))); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((x <= -2.8e+153) || ~((x <= 4.9e+91)))
tmp = (y * i) + ((x * log(y)) + (z + t));
else
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -2.8e+153], N[Not[LessEqual[x, 4.9e+91]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+153} \lor \neg \left(x \leq 4.9 \cdot 10^{+91}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + \left(z + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\
\end{array}
\end{array}
if x < -2.79999999999999985e153 or 4.9000000000000003e91 < x Initial program 99.7%
Taylor expanded in b around inf 99.7%
Taylor expanded in a around 0 91.2%
Taylor expanded in b around 0 79.2%
if -2.79999999999999985e153 < x < 4.9000000000000003e91Initial program 99.9%
Taylor expanded in x around 0 98.3%
Taylor expanded in t around 0 81.3%
Final simplification80.7%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -9.5e+153) (not (<= x 9e+60))) (+ (* y i) (+ (* x (log y)) (+ a (+ z t)))) (+ (* y i) (+ a (+ z (* (log c) (- b 0.5)))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -9.5e+153) || !(x <= 9e+60)) {
tmp = (y * i) + ((x * log(y)) + (a + (z + t)));
} else {
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-9.5d+153)) .or. (.not. (x <= 9d+60))) then
tmp = (y * i) + ((x * log(y)) + (a + (z + t)))
else
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5d0))))
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -9.5e+153) || !(x <= 9e+60)) {
tmp = (y * i) + ((x * Math.log(y)) + (a + (z + t)));
} else {
tmp = (y * i) + (a + (z + (Math.log(c) * (b - 0.5))));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -9.5e+153) or not (x <= 9e+60): tmp = (y * i) + ((x * math.log(y)) + (a + (z + t))) else: tmp = (y * i) + (a + (z + (math.log(c) * (b - 0.5)))) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -9.5e+153) || !(x <= 9e+60)) tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + Float64(a + Float64(z + t)))); else tmp = Float64(Float64(y * i) + Float64(a + Float64(z + Float64(log(c) * Float64(b - 0.5))))); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((x <= -9.5e+153) || ~((x <= 9e+60)))
tmp = (y * i) + ((x * log(y)) + (a + (z + t)));
else
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -9.5e+153], N[Not[LessEqual[x, 9e+60]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+153} \lor \neg \left(x \leq 9 \cdot 10^{+60}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(z + t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\
\end{array}
\end{array}
if x < -9.4999999999999995e153 or 9.00000000000000026e60 < x Initial program 99.7%
Taylor expanded in b around inf 99.7%
Taylor expanded in b around 0 87.4%
if -9.4999999999999995e153 < x < 9.00000000000000026e60Initial program 99.9%
Taylor expanded in x around 0 98.3%
Taylor expanded in t around 0 81.3%
Final simplification83.2%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.05e+142) (+ z (* y i)) (if (<= z -5.4e-108) (+ (* y i) (* b (log c))) (+ a (* y i)))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.05e+142) {
tmp = z + (y * i);
} else if (z <= -5.4e-108) {
tmp = (y * i) + (b * log(c));
} else {
tmp = a + (y * i);
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-1.05d+142)) then
tmp = z + (y * i)
else if (z <= (-5.4d-108)) then
tmp = (y * i) + (b * log(c))
else
tmp = a + (y * i)
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.05e+142) {
tmp = z + (y * i);
} else if (z <= -5.4e-108) {
tmp = (y * i) + (b * Math.log(c));
} else {
tmp = a + (y * i);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -1.05e+142: tmp = z + (y * i) elif z <= -5.4e-108: tmp = (y * i) + (b * math.log(c)) else: tmp = a + (y * i) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -1.05e+142) tmp = Float64(z + Float64(y * i)); elseif (z <= -5.4e-108) tmp = Float64(Float64(y * i) + Float64(b * log(c))); else tmp = Float64(a + Float64(y * i)); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (z <= -1.05e+142)
tmp = z + (y * i);
elseif (z <= -5.4e-108)
tmp = (y * i) + (b * log(c));
else
tmp = a + (y * i);
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.05e+142], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.4e-108], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+142}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{elif}\;z \leq -5.4 \cdot 10^{-108}:\\
\;\;\;\;y \cdot i + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -1.05e142Initial program 99.9%
Taylor expanded in z around inf 66.7%
if -1.05e142 < z < -5.4000000000000001e-108Initial program 99.7%
Taylor expanded in x around 0 88.2%
Taylor expanded in b around inf 51.8%
if -5.4000000000000001e-108 < z Initial program 99.8%
Taylor expanded in a around inf 41.4%
Final simplification47.9%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= z -1.9e+166)
z
(if (<= z -7.2e+26)
(* y i)
(if (<= z -8.2e-37)
a
(if (<= z 8.2e-264) (* y i) (if (<= z 7e-7) a (* y i)))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.9e+166) {
tmp = z;
} else if (z <= -7.2e+26) {
tmp = y * i;
} else if (z <= -8.2e-37) {
tmp = a;
} else if (z <= 8.2e-264) {
tmp = y * i;
} else if (z <= 7e-7) {
tmp = a;
} else {
tmp = y * i;
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-1.9d+166)) then
tmp = z
else if (z <= (-7.2d+26)) then
tmp = y * i
else if (z <= (-8.2d-37)) then
tmp = a
else if (z <= 8.2d-264) then
tmp = y * i
else if (z <= 7d-7) then
tmp = a
else
tmp = y * i
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.9e+166) {
tmp = z;
} else if (z <= -7.2e+26) {
tmp = y * i;
} else if (z <= -8.2e-37) {
tmp = a;
} else if (z <= 8.2e-264) {
tmp = y * i;
} else if (z <= 7e-7) {
tmp = a;
} else {
tmp = y * i;
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -1.9e+166: tmp = z elif z <= -7.2e+26: tmp = y * i elif z <= -8.2e-37: tmp = a elif z <= 8.2e-264: tmp = y * i elif z <= 7e-7: tmp = a else: tmp = y * i return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -1.9e+166) tmp = z; elseif (z <= -7.2e+26) tmp = Float64(y * i); elseif (z <= -8.2e-37) tmp = a; elseif (z <= 8.2e-264) tmp = Float64(y * i); elseif (z <= 7e-7) tmp = a; else tmp = Float64(y * i); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (z <= -1.9e+166)
tmp = z;
elseif (z <= -7.2e+26)
tmp = y * i;
elseif (z <= -8.2e-37)
tmp = a;
elseif (z <= 8.2e-264)
tmp = y * i;
elseif (z <= 7e-7)
tmp = a;
else
tmp = y * i;
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.9e+166], z, If[LessEqual[z, -7.2e+26], N[(y * i), $MachinePrecision], If[LessEqual[z, -8.2e-37], a, If[LessEqual[z, 8.2e-264], N[(y * i), $MachinePrecision], If[LessEqual[z, 7e-7], a, N[(y * i), $MachinePrecision]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+166}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{+26}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq -8.2 \cdot 10^{-37}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-264}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-7}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if z < -1.90000000000000003e166Initial program 99.9%
Taylor expanded in z around inf 72.9%
Taylor expanded in z around inf 62.0%
if -1.90000000000000003e166 < z < -7.20000000000000048e26 or -8.1999999999999996e-37 < z < 8.20000000000000045e-264 or 6.99999999999999968e-7 < z Initial program 99.8%
associate-+l+99.8%
associate-+l+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 24.1%
*-commutative24.1%
Simplified24.1%
if -7.20000000000000048e26 < z < -8.1999999999999996e-37 or 8.20000000000000045e-264 < z < 6.99999999999999968e-7Initial program 99.8%
Taylor expanded in a around inf 47.8%
Taylor expanded in a around inf 16.3%
Final simplification27.5%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.2e+166) z (+ a (* y i))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.2e+166) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-2.2d+166)) then
tmp = z
else
tmp = a + (y * i)
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.2e+166) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.2e+166: tmp = z else: tmp = a + (y * i) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.2e+166) tmp = z; else tmp = Float64(a + Float64(y * i)); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (z <= -2.2e+166)
tmp = z;
else
tmp = a + (y * i);
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.2e+166], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+166}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -2.1999999999999999e166Initial program 99.9%
Taylor expanded in z around inf 72.9%
Taylor expanded in z around inf 62.0%
if -2.1999999999999999e166 < z Initial program 99.8%
Taylor expanded in a around inf 40.8%
Final simplification43.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.5e+74) (+ z (* y i)) (+ a (* y i))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.5e+74) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-1.5d+74)) then
tmp = z + (y * i)
else
tmp = a + (y * i)
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.5e+74) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -1.5e+74: tmp = z + (y * i) else: tmp = a + (y * i) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -1.5e+74) tmp = Float64(z + Float64(y * i)); else tmp = Float64(a + Float64(y * i)); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (z <= -1.5e+74)
tmp = z + (y * i);
else
tmp = a + (y * i);
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.5e+74], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+74}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -1.5e74Initial program 99.9%
Taylor expanded in z around inf 58.1%
if -1.5e74 < z Initial program 99.8%
Taylor expanded in a around inf 41.5%
Final simplification45.0%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.45e+74) z a))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.45e+74) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-1.45d+74)) then
tmp = z
else
tmp = a
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.45e+74) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -1.45e+74: tmp = z else: tmp = a return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -1.45e+74) tmp = z; else tmp = a; end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (z <= -1.45e+74)
tmp = z;
else
tmp = a;
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.45e+74], z, a]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{+74}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -1.4500000000000001e74Initial program 99.9%
Taylor expanded in z around inf 58.1%
Taylor expanded in z around inf 45.8%
if -1.4500000000000001e74 < z Initial program 99.8%
Taylor expanded in a around inf 41.5%
Taylor expanded in a around inf 15.9%
Final simplification22.1%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 a)
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return a
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return a end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = a;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
a
\end{array}
Initial program 99.8%
Taylor expanded in a around inf 37.6%
Taylor expanded in a around inf 14.7%
Final simplification14.7%
herbie shell --seed 2023196
(FPCore (x y z t a b c i)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
:precision binary64
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))