
(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 17 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: x, y, z, t, a, b, c, and i 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) (+ z (fma x (log y) (+ t a))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
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), (z + fma(x, log(y), (t + a)))));
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(z + fma(x, log(y), Float64(t + a))))) end
NOTE: x, y, z, t, a, b, c, and i 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[(z + N[(x * N[Log[y], $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, z + \mathsf{fma}\left(x, \log y, t + a\right)\right)\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Final simplification99.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5))) (* y i)))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
}
NOTE: x, y, z, t, a, b, c, and i 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 + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0))) + (y * i)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((a + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5))) + (y * i);
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): return ((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5))) + (y * i)
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(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] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i
\end{array}
Initial program 99.9%
Final simplification99.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= z -3.5e+80) (+ (* y i) (+ (+ t a) (fma x (log y) z))) (+ (* y i) (+ a (+ (* x (log y)) (* (log c) (- b 0.5)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3.5e+80) {
tmp = (y * i) + ((t + a) + fma(x, log(y), z));
} else {
tmp = (y * i) + (a + ((x * log(y)) + (log(c) * (b - 0.5))));
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -3.5e+80) tmp = Float64(Float64(y * i) + Float64(Float64(t + a) + fma(x, log(y), z))); else tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(x * log(y)) + Float64(log(c) * Float64(b - 0.5))))); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -3.5e+80], N[(N[(y * i), $MachinePrecision] + N[(N[(t + a), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+80}:\\
\;\;\;\;y \cdot i + \left(\left(t + a\right) + \mathsf{fma}\left(x, \log y, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(x \cdot \log y + \log c \cdot \left(b - 0.5\right)\right)\right)\\
\end{array}
\end{array}
if z < -3.49999999999999994e80Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 90.7%
*-commutative90.7%
Simplified90.7%
if -3.49999999999999994e80 < z Initial program 99.9%
Taylor expanded in t around 0 86.5%
Taylor expanded in z around 0 80.3%
Final simplification81.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ a (+ z (+ (* x (log y)) (* (log c) (- b 0.5)))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (a + (z + ((x * log(y)) + (log(c) * (b - 0.5)))));
}
NOTE: x, y, z, t, a, b, c, and i 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 + (z + ((x * log(y)) + (log(c) * (b - 0.5d0)))))
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (a + (z + ((x * Math.log(y)) + (Math.log(c) * (b - 0.5)))));
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): return (y * i) + (a + (z + ((x * math.log(y)) + (math.log(c) * (b - 0.5)))))
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(a + Float64(z + Float64(Float64(x * log(y)) + Float64(log(c) * Float64(b - 0.5)))))) end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (y * i) + (a + (z + ((x * log(y)) + (log(c) * (b - 0.5)))));
end
NOTE: x, y, z, t, a, b, c, and i 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[(a + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
y \cdot i + \left(a + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - 0.5\right)\right)\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in t around 0 86.0%
Final simplification86.0%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1460.0) (not (<= x 9.8e+35))) (+ (* y i) (+ (+ t a) (fma x (log y) z))) (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ z t))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1460.0) || !(x <= 9.8e+35)) {
tmp = (y * i) + ((t + a) + fma(x, log(y), z));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
}
return tmp;
}
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1460.0) || !(x <= 9.8e+35)) tmp = Float64(Float64(y * i) + Float64(Float64(t + a) + fma(x, log(y), z))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(z + t)))); end return tmp end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1460.0], N[Not[LessEqual[x, 9.8e+35]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(t + a), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision] + z), $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}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1460 \lor \neg \left(x \leq 9.8 \cdot 10^{+35}\right):\\
\;\;\;\;y \cdot i + \left(\left(t + a\right) + \mathsf{fma}\left(x, \log y, z\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 < -1460 or 9.8000000000000005e35 < x 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 93.6%
*-commutative93.6%
Simplified93.6%
if -1460 < x < 9.8000000000000005e35Initial program 99.9%
Taylor expanded in x around 0 99.1%
Final simplification96.5%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -4.5e+103) (not (<= x 2.35e+191))) (+ (* y i) (+ a (* x (log y)))) (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ z t))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -4.5e+103) || !(x <= 2.35e+191)) {
tmp = (y * i) + (a + (x * log(y)));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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 <= (-4.5d+103)) .or. (.not. (x <= 2.35d+191))) then
tmp = (y * i) + (a + (x * log(y)))
else
tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (a + (z + t)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -4.5e+103) || !(x <= 2.35e+191)) {
tmp = (y * i) + (a + (x * Math.log(y)));
} else {
tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + (z + t)));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -4.5e+103) or not (x <= 2.35e+191): tmp = (y * i) + (a + (x * math.log(y))) else: tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (a + (z + t))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -4.5e+103) || !(x <= 2.35e+191)) tmp = Float64(Float64(y * i) + Float64(a + Float64(x * log(y)))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(z + t)))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((x <= -4.5e+103) || ~((x <= 2.35e+191)))
tmp = (y * i) + (a + (x * log(y)));
else
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -4.5e+103], N[Not[LessEqual[x, 2.35e+191]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(a + N[(x * N[Log[y], $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}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+103} \lor \neg \left(x \leq 2.35 \cdot 10^{+191}\right):\\
\;\;\;\;y \cdot i + \left(a + x \cdot \log y\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 < -4.50000000000000001e103 or 2.35000000000000005e191 < x Initial program 99.8%
Taylor expanded in t around 0 94.1%
Taylor expanded in x around inf 81.8%
if -4.50000000000000001e103 < x < 2.35000000000000005e191Initial program 99.9%
Taylor expanded in x around 0 93.3%
Final simplification90.4%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (+ t a) (+ z (* y i)))) (t_2 (+ (* y i) (+ a (* x (log y))))))
(if (<= x -3.3e+103)
t_2
(if (<= x -2.15e-111)
t_1
(if (<= x 7.6e-34)
(+ a (+ (* b (log c)) (+ z t)))
(if (<= x 9e+126) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (t + a) + (z + (y * i));
double t_2 = (y * i) + (a + (x * log(y)));
double tmp;
if (x <= -3.3e+103) {
tmp = t_2;
} else if (x <= -2.15e-111) {
tmp = t_1;
} else if (x <= 7.6e-34) {
tmp = a + ((b * log(c)) + (z + t));
} else if (x <= 9e+126) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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) :: t_2
real(8) :: tmp
t_1 = (t + a) + (z + (y * i))
t_2 = (y * i) + (a + (x * log(y)))
if (x <= (-3.3d+103)) then
tmp = t_2
else if (x <= (-2.15d-111)) then
tmp = t_1
else if (x <= 7.6d-34) then
tmp = a + ((b * log(c)) + (z + t))
else if (x <= 9d+126) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (t + a) + (z + (y * i));
double t_2 = (y * i) + (a + (x * Math.log(y)));
double tmp;
if (x <= -3.3e+103) {
tmp = t_2;
} else if (x <= -2.15e-111) {
tmp = t_1;
} else if (x <= 7.6e-34) {
tmp = a + ((b * Math.log(c)) + (z + t));
} else if (x <= 9e+126) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (t + a) + (z + (y * i)) t_2 = (y * i) + (a + (x * math.log(y))) tmp = 0 if x <= -3.3e+103: tmp = t_2 elif x <= -2.15e-111: tmp = t_1 elif x <= 7.6e-34: tmp = a + ((b * math.log(c)) + (z + t)) elif x <= 9e+126: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(t + a) + Float64(z + Float64(y * i))) t_2 = Float64(Float64(y * i) + Float64(a + Float64(x * log(y)))) tmp = 0.0 if (x <= -3.3e+103) tmp = t_2; elseif (x <= -2.15e-111) tmp = t_1; elseif (x <= 7.6e-34) tmp = Float64(a + Float64(Float64(b * log(c)) + Float64(z + t))); elseif (x <= 9e+126) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (t + a) + (z + (y * i));
t_2 = (y * i) + (a + (x * log(y)));
tmp = 0.0;
if (x <= -3.3e+103)
tmp = t_2;
elseif (x <= -2.15e-111)
tmp = t_1;
elseif (x <= 7.6e-34)
tmp = a + ((b * log(c)) + (z + t));
elseif (x <= 9e+126)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i 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[(t + a), $MachinePrecision] + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.3e+103], t$95$2, If[LessEqual[x, -2.15e-111], t$95$1, If[LessEqual[x, 7.6e-34], N[(a + N[(N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e+126], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(t + a\right) + \left(z + y \cdot i\right)\\
t_2 := y \cdot i + \left(a + x \cdot \log y\right)\\
\mathbf{if}\;x \leq -3.3 \cdot 10^{+103}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{-111}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-34}:\\
\;\;\;\;a + \left(b \cdot \log c + \left(z + t\right)\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+126}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.30000000000000009e103 or 8.99999999999999947e126 < x Initial program 99.8%
Taylor expanded in t around 0 92.6%
Taylor expanded in x around inf 79.7%
if -3.30000000000000009e103 < x < -2.1499999999999999e-111 or 7.6000000000000002e-34 < x < 8.99999999999999947e126Initial program 99.9%
Taylor expanded in x around 0 89.1%
Taylor expanded in b around inf 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in b around 0 79.7%
associate-+r+79.7%
*-commutative79.7%
Simplified79.7%
if -2.1499999999999999e-111 < x < 7.6000000000000002e-34Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in b around inf 97.9%
*-commutative97.9%
Simplified97.9%
Taylor expanded in y around 0 80.4%
associate-+r+80.4%
Simplified80.4%
Final simplification80.0%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (+ t a) (+ z (* y i)))) (t_2 (+ (* y i) (+ a (* x (log y))))))
(if (<= x -4.5e+103)
t_2
(if (<= x -7e-112)
t_1
(if (<= x 2.1e-34)
(+ a (+ t (+ z (* (log c) (- b 0.5)))))
(if (<= x 2.2e+128) t_1 t_2))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (t + a) + (z + (y * i));
double t_2 = (y * i) + (a + (x * log(y)));
double tmp;
if (x <= -4.5e+103) {
tmp = t_2;
} else if (x <= -7e-112) {
tmp = t_1;
} else if (x <= 2.1e-34) {
tmp = a + (t + (z + (log(c) * (b - 0.5))));
} else if (x <= 2.2e+128) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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) :: t_2
real(8) :: tmp
t_1 = (t + a) + (z + (y * i))
t_2 = (y * i) + (a + (x * log(y)))
if (x <= (-4.5d+103)) then
tmp = t_2
else if (x <= (-7d-112)) then
tmp = t_1
else if (x <= 2.1d-34) then
tmp = a + (t + (z + (log(c) * (b - 0.5d0))))
else if (x <= 2.2d+128) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (t + a) + (z + (y * i));
double t_2 = (y * i) + (a + (x * Math.log(y)));
double tmp;
if (x <= -4.5e+103) {
tmp = t_2;
} else if (x <= -7e-112) {
tmp = t_1;
} else if (x <= 2.1e-34) {
tmp = a + (t + (z + (Math.log(c) * (b - 0.5))));
} else if (x <= 2.2e+128) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): t_1 = (t + a) + (z + (y * i)) t_2 = (y * i) + (a + (x * math.log(y))) tmp = 0 if x <= -4.5e+103: tmp = t_2 elif x <= -7e-112: tmp = t_1 elif x <= 2.1e-34: tmp = a + (t + (z + (math.log(c) * (b - 0.5)))) elif x <= 2.2e+128: tmp = t_1 else: tmp = t_2 return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(t + a) + Float64(z + Float64(y * i))) t_2 = Float64(Float64(y * i) + Float64(a + Float64(x * log(y)))) tmp = 0.0 if (x <= -4.5e+103) tmp = t_2; elseif (x <= -7e-112) tmp = t_1; elseif (x <= 2.1e-34) tmp = Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5))))); elseif (x <= 2.2e+128) tmp = t_1; else tmp = t_2; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (t + a) + (z + (y * i));
t_2 = (y * i) + (a + (x * log(y)));
tmp = 0.0;
if (x <= -4.5e+103)
tmp = t_2;
elseif (x <= -7e-112)
tmp = t_1;
elseif (x <= 2.1e-34)
tmp = a + (t + (z + (log(c) * (b - 0.5))));
elseif (x <= 2.2e+128)
tmp = t_1;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i 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[(t + a), $MachinePrecision] + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.5e+103], t$95$2, If[LessEqual[x, -7e-112], t$95$1, If[LessEqual[x, 2.1e-34], N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e+128], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
t_1 := \left(t + a\right) + \left(z + y \cdot i\right)\\
t_2 := y \cdot i + \left(a + x \cdot \log y\right)\\
\mathbf{if}\;x \leq -4.5 \cdot 10^{+103}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -7 \cdot 10^{-112}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 2.1 \cdot 10^{-34}:\\
\;\;\;\;a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+128}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -4.50000000000000001e103 or 2.20000000000000017e128 < x Initial program 99.8%
Taylor expanded in t around 0 92.6%
Taylor expanded in x around inf 79.7%
if -4.50000000000000001e103 < x < -6.99999999999999988e-112 or 2.1000000000000001e-34 < x < 2.20000000000000017e128Initial program 99.9%
Taylor expanded in x around 0 89.1%
Taylor expanded in b around inf 88.2%
*-commutative88.2%
Simplified88.2%
Taylor expanded in b around 0 79.7%
associate-+r+79.7%
*-commutative79.7%
Simplified79.7%
if -6.99999999999999988e-112 < x < 2.1000000000000001e-34Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in y around 0 82.5%
Final simplification80.7%
NOTE: x, y, z, t, a, b, c, and i 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.5e+103) (not (<= x 1.12e+177))) (+ (* y i) (+ a (* x (log y)))) (+ (* y i) (+ (+ a (+ z t)) (* b (log c))))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -2.5e+103) || !(x <= 1.12e+177)) {
tmp = (y * i) + (a + (x * log(y)));
} else {
tmp = (y * i) + ((a + (z + t)) + (b * log(c)));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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.5d+103)) .or. (.not. (x <= 1.12d+177))) then
tmp = (y * i) + (a + (x * log(y)))
else
tmp = (y * i) + ((a + (z + t)) + (b * log(c)))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
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.5e+103) || !(x <= 1.12e+177)) {
tmp = (y * i) + (a + (x * Math.log(y)));
} else {
tmp = (y * i) + ((a + (z + t)) + (b * Math.log(c)));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -2.5e+103) or not (x <= 1.12e+177): tmp = (y * i) + (a + (x * math.log(y))) else: tmp = (y * i) + ((a + (z + t)) + (b * math.log(c))) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -2.5e+103) || !(x <= 1.12e+177)) tmp = Float64(Float64(y * i) + Float64(a + Float64(x * log(y)))); else tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(z + t)) + Float64(b * log(c)))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((x <= -2.5e+103) || ~((x <= 1.12e+177)))
tmp = (y * i) + (a + (x * log(y)));
else
tmp = (y * i) + ((a + (z + t)) + (b * log(c)));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -2.5e+103], N[Not[LessEqual[x, 1.12e+177]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+103} \lor \neg \left(x \leq 1.12 \cdot 10^{+177}\right):\\
\;\;\;\;y \cdot i + \left(a + x \cdot \log y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(a + \left(z + t\right)\right) + b \cdot \log c\right)\\
\end{array}
\end{array}
if x < -2.5e103 or 1.1200000000000001e177 < x Initial program 99.8%
Taylor expanded in t around 0 94.1%
Taylor expanded in x around inf 81.8%
if -2.5e103 < x < 1.1200000000000001e177Initial program 99.9%
Taylor expanded in x around 0 93.3%
Taylor expanded in b around inf 91.9%
*-commutative91.9%
Simplified91.9%
Final simplification89.4%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -1.36e+191) (not (<= b 9.2e+83))) (+ a (+ (* b (log c)) (+ z t))) (+ (+ t a) (+ z (* y i)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -1.36e+191) || !(b <= 9.2e+83)) {
tmp = a + ((b * log(c)) + (z + t));
} else {
tmp = (t + a) + (z + (y * i));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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 ((b <= (-1.36d+191)) .or. (.not. (b <= 9.2d+83))) then
tmp = a + ((b * log(c)) + (z + t))
else
tmp = (t + a) + (z + (y * i))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -1.36e+191) || !(b <= 9.2e+83)) {
tmp = a + ((b * Math.log(c)) + (z + t));
} else {
tmp = (t + a) + (z + (y * i));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (b <= -1.36e+191) or not (b <= 9.2e+83): tmp = a + ((b * math.log(c)) + (z + t)) else: tmp = (t + a) + (z + (y * i)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -1.36e+191) || !(b <= 9.2e+83)) tmp = Float64(a + Float64(Float64(b * log(c)) + Float64(z + t))); else tmp = Float64(Float64(t + a) + Float64(z + Float64(y * i))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((b <= -1.36e+191) || ~((b <= 9.2e+83)))
tmp = a + ((b * log(c)) + (z + t));
else
tmp = (t + a) + (z + (y * i));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -1.36e+191], N[Not[LessEqual[b, 9.2e+83]], $MachinePrecision]], N[(a + N[(N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.36 \cdot 10^{+191} \lor \neg \left(b \leq 9.2 \cdot 10^{+83}\right):\\
\;\;\;\;a + \left(b \cdot \log c + \left(z + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + \left(z + y \cdot i\right)\\
\end{array}
\end{array}
if b < -1.36e191 or 9.1999999999999998e83 < b Initial program 99.8%
Taylor expanded in x around 0 90.0%
Taylor expanded in b around inf 90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in y around 0 78.2%
associate-+r+78.2%
Simplified78.2%
if -1.36e191 < b < 9.1999999999999998e83Initial program 99.9%
Taylor expanded in x around 0 78.9%
Taylor expanded in b around inf 77.5%
*-commutative77.5%
Simplified77.5%
Taylor expanded in b around 0 74.9%
associate-+r+74.9%
*-commutative74.9%
Simplified74.9%
Final simplification75.8%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -9.5e+191) (not (<= b 3e+218))) (+ a (+ t (* b (log c)))) (+ (+ t a) (+ z (* y i)))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -9.5e+191) || !(b <= 3e+218)) {
tmp = a + (t + (b * log(c)));
} else {
tmp = (t + a) + (z + (y * i));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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 ((b <= (-9.5d+191)) .or. (.not. (b <= 3d+218))) then
tmp = a + (t + (b * log(c)))
else
tmp = (t + a) + (z + (y * i))
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -9.5e+191) || !(b <= 3e+218)) {
tmp = a + (t + (b * Math.log(c)));
} else {
tmp = (t + a) + (z + (y * i));
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (b <= -9.5e+191) or not (b <= 3e+218): tmp = a + (t + (b * math.log(c))) else: tmp = (t + a) + (z + (y * i)) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -9.5e+191) || !(b <= 3e+218)) tmp = Float64(a + Float64(t + Float64(b * log(c)))); else tmp = Float64(Float64(t + a) + Float64(z + Float64(y * i))); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((b <= -9.5e+191) || ~((b <= 3e+218)))
tmp = a + (t + (b * log(c)));
else
tmp = (t + a) + (z + (y * i));
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -9.5e+191], N[Not[LessEqual[b, 3e+218]], $MachinePrecision]], N[(a + N[(t + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.5 \cdot 10^{+191} \lor \neg \left(b \leq 3 \cdot 10^{+218}\right):\\
\;\;\;\;a + \left(t + b \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + \left(z + y \cdot i\right)\\
\end{array}
\end{array}
if b < -9.4999999999999998e191 or 3.0000000000000001e218 < b Initial program 99.7%
Taylor expanded in x around 0 98.3%
Taylor expanded in y around 0 88.9%
Taylor expanded in b around inf 86.1%
*-commutative86.1%
Simplified86.1%
if -9.4999999999999998e191 < b < 3.0000000000000001e218Initial program 99.9%
Taylor expanded in x around 0 79.0%
Taylor expanded in b around inf 77.8%
*-commutative77.8%
Simplified77.8%
Taylor expanded in b around 0 71.3%
associate-+r+71.3%
*-commutative71.3%
Simplified71.3%
Final simplification73.7%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= a 1.1e-247)
z
(if (<= a 2.7e-155)
(* y i)
(if (<= a 1.3e+29) z (if (<= a 6.5e+159) (* y i) a)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 1.1e-247) {
tmp = z;
} else if (a <= 2.7e-155) {
tmp = y * i;
} else if (a <= 1.3e+29) {
tmp = z;
} else if (a <= 6.5e+159) {
tmp = y * i;
} else {
tmp = a;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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 (a <= 1.1d-247) then
tmp = z
else if (a <= 2.7d-155) then
tmp = y * i
else if (a <= 1.3d+29) then
tmp = z
else if (a <= 6.5d+159) then
tmp = y * i
else
tmp = a
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 1.1e-247) {
tmp = z;
} else if (a <= 2.7e-155) {
tmp = y * i;
} else if (a <= 1.3e+29) {
tmp = z;
} else if (a <= 6.5e+159) {
tmp = y * i;
} else {
tmp = a;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 1.1e-247: tmp = z elif a <= 2.7e-155: tmp = y * i elif a <= 1.3e+29: tmp = z elif a <= 6.5e+159: tmp = y * i else: tmp = a return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 1.1e-247) tmp = z; elseif (a <= 2.7e-155) tmp = Float64(y * i); elseif (a <= 1.3e+29) tmp = z; elseif (a <= 6.5e+159) tmp = Float64(y * i); else tmp = a; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (a <= 1.1e-247)
tmp = z;
elseif (a <= 2.7e-155)
tmp = y * i;
elseif (a <= 1.3e+29)
tmp = z;
elseif (a <= 6.5e+159)
tmp = y * i;
else
tmp = a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.1e-247], z, If[LessEqual[a, 2.7e-155], N[(y * i), $MachinePrecision], If[LessEqual[a, 1.3e+29], z, If[LessEqual[a, 6.5e+159], N[(y * i), $MachinePrecision], a]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.1 \cdot 10^{-247}:\\
\;\;\;\;z\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{-155}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{+29}:\\
\;\;\;\;z\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{+159}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < 1.09999999999999996e-247 or 2.69999999999999981e-155 < a < 1.3e29Initial program 99.9%
Taylor expanded in x around 0 80.5%
Taylor expanded in z around inf 10.6%
if 1.09999999999999996e-247 < a < 2.69999999999999981e-155 or 1.3e29 < a < 6.5000000000000001e159Initial program 99.9%
Taylor expanded in a around inf 30.7%
Taylor expanded in a around 0 28.5%
if 6.5000000000000001e159 < a Initial program 100.0%
Taylor expanded in a around inf 73.3%
Taylor expanded in a around inf 54.4%
Final simplification20.0%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= z -1.5e+205) (and (not (<= z -4.6e+169)) (<= z -1e+155))) z (+ a (* y i))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z <= -1.5e+205) || (!(z <= -4.6e+169) && (z <= -1e+155))) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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+205)) .or. (.not. (z <= (-4.6d+169))) .and. (z <= (-1d+155))) then
tmp = z
else
tmp = a + (y * i)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
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+205) || (!(z <= -4.6e+169) && (z <= -1e+155))) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (z <= -1.5e+205) or (not (z <= -4.6e+169) and (z <= -1e+155)): tmp = z else: tmp = a + (y * i) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((z <= -1.5e+205) || (!(z <= -4.6e+169) && (z <= -1e+155))) tmp = z; else tmp = Float64(a + Float64(y * i)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((z <= -1.5e+205) || (~((z <= -4.6e+169)) && (z <= -1e+155)))
tmp = z;
else
tmp = a + (y * i);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[z, -1.5e+205], And[N[Not[LessEqual[z, -4.6e+169]], $MachinePrecision], LessEqual[z, -1e+155]]], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.5 \cdot 10^{+205} \lor \neg \left(z \leq -4.6 \cdot 10^{+169}\right) \land z \leq -1 \cdot 10^{+155}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -1.5e205 or -4.5999999999999999e169 < z < -1.00000000000000001e155Initial program 99.9%
Taylor expanded in x around 0 95.4%
Taylor expanded in z around inf 60.6%
if -1.5e205 < z < -4.5999999999999999e169 or -1.00000000000000001e155 < z Initial program 99.9%
Taylor expanded in a around inf 42.4%
Final simplification44.0%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -7.2e+93) (not (<= i 2.3e+57))) (+ a (* y i)) (+ a (+ z t))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -7.2e+93) || !(i <= 2.3e+57)) {
tmp = a + (y * i);
} else {
tmp = a + (z + t);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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 ((i <= (-7.2d+93)) .or. (.not. (i <= 2.3d+57))) then
tmp = a + (y * i)
else
tmp = a + (z + t)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -7.2e+93) || !(i <= 2.3e+57)) {
tmp = a + (y * i);
} else {
tmp = a + (z + t);
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (i <= -7.2e+93) or not (i <= 2.3e+57): tmp = a + (y * i) else: tmp = a + (z + t) return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -7.2e+93) || !(i <= 2.3e+57)) tmp = Float64(a + Float64(y * i)); else tmp = Float64(a + Float64(z + t)); end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((i <= -7.2e+93) || ~((i <= 2.3e+57)))
tmp = a + (y * i);
else
tmp = a + (z + t);
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -7.2e+93], N[Not[LessEqual[i, 2.3e+57]], $MachinePrecision]], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -7.2 \cdot 10^{+93} \lor \neg \left(i \leq 2.3 \cdot 10^{+57}\right):\\
\;\;\;\;a + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + \left(z + t\right)\\
\end{array}
\end{array}
if i < -7.1999999999999998e93 or 2.2999999999999999e57 < i Initial program 100.0%
Taylor expanded in a around inf 60.1%
if -7.1999999999999998e93 < i < 2.2999999999999999e57Initial program 99.8%
Taylor expanded in x around 0 77.2%
Taylor expanded in y around 0 72.7%
Taylor expanded in z around inf 49.8%
Final simplification54.1%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (+ t a) (+ z (* y i))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + a) + (z + (y * i));
}
NOTE: x, y, z, t, a, b, c, and i 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 = (t + a) + (z + (y * i))
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + a) + (z + (y * i));
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): return (t + a) + (z + (y * i))
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(t + a) + Float64(z + Float64(y * i))) end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (t + a) + (z + (y * i));
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t + a), $MachinePrecision] + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\left(t + a\right) + \left(z + y \cdot i\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 82.1%
Taylor expanded in b around inf 81.1%
*-commutative81.1%
Simplified81.1%
Taylor expanded in b around 0 64.6%
associate-+r+64.6%
*-commutative64.6%
Simplified64.6%
Final simplification64.6%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= a 1.15e+116) z a))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 1.15e+116) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, and i 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 (a <= 1.15d+116) then
tmp = z
else
tmp = a
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 1.15e+116) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 1.15e+116: tmp = z else: tmp = a return tmp
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 1.15e+116) tmp = z; else tmp = a; end return tmp end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (a <= 1.15e+116)
tmp = z;
else
tmp = a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.15e+116], z, a]
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.15 \cdot 10^{+116}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < 1.14999999999999997e116Initial program 99.9%
Taylor expanded in x around 0 80.7%
Taylor expanded in z around inf 13.3%
if 1.14999999999999997e116 < a Initial program 99.9%
Taylor expanded in a around inf 60.8%
Taylor expanded in a around inf 44.4%
Final simplification18.9%
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 a)
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
NOTE: x, y, z, t, a, b, c, and i 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 x < y && y < z && z < t && t < a && a < b && b < c && c < i;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
[x, y, z, t, a, b, c, i] = sort([x, y, z, t, a, b, c, i]) def code(x, y, z, t, a, b, c, i): return a
x, y, z, t, a, b, c, i = sort([x, y, z, t, a, b, c, i]) function code(x, y, z, t, a, b, c, i) return a end
x, y, z, t, a, b, c, i = num2cell(sort([x, y, z, t, a, b, c, i])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = a;
end
NOTE: x, y, z, t, a, b, c, and i should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
a
\end{array}
Initial program 99.9%
Taylor expanded in a around inf 40.5%
Taylor expanded in a around inf 16.9%
Final simplification16.9%
herbie shell --seed 2023322
(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)))