
(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 16 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.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
Simplified99.8%
Final simplification99.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
(let* ((t_1 (* x (log y))) (t_2 (* (log c) (- b 0.5))))
(if (<= x -9.5e+114)
(+ (* y i) (+ a (+ t_1 t_2)))
(if (<= x 2.55e+118)
(+ (* y i) (+ t_2 (+ a (+ z t))))
(+ (* y i) (+ t (+ z (+ t_1 (* 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 t_1 = x * log(y);
double t_2 = log(c) * (b - 0.5);
double tmp;
if (x <= -9.5e+114) {
tmp = (y * i) + (a + (t_1 + t_2));
} else if (x <= 2.55e+118) {
tmp = (y * i) + (t_2 + (a + (z + t)));
} else {
tmp = (y * i) + (t + (z + (t_1 + (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = log(c) * (b - 0.5d0)
if (x <= (-9.5d+114)) then
tmp = (y * i) + (a + (t_1 + t_2))
else if (x <= 2.55d+118) then
tmp = (y * i) + (t_2 + (a + (z + t)))
else
tmp = (y * i) + (t + (z + (t_1 + (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 t_1 = x * Math.log(y);
double t_2 = Math.log(c) * (b - 0.5);
double tmp;
if (x <= -9.5e+114) {
tmp = (y * i) + (a + (t_1 + t_2));
} else if (x <= 2.55e+118) {
tmp = (y * i) + (t_2 + (a + (z + t)));
} else {
tmp = (y * i) + (t + (z + (t_1 + (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): t_1 = x * math.log(y) t_2 = math.log(c) * (b - 0.5) tmp = 0 if x <= -9.5e+114: tmp = (y * i) + (a + (t_1 + t_2)) elif x <= 2.55e+118: tmp = (y * i) + (t_2 + (a + (z + t))) else: tmp = (y * i) + (t + (z + (t_1 + (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) t_1 = Float64(x * log(y)) t_2 = Float64(log(c) * Float64(b - 0.5)) tmp = 0.0 if (x <= -9.5e+114) tmp = Float64(Float64(y * i) + Float64(a + Float64(t_1 + t_2))); elseif (x <= 2.55e+118) tmp = Float64(Float64(y * i) + Float64(t_2 + Float64(a + Float64(z + t)))); else tmp = Float64(Float64(y * i) + Float64(t + Float64(z + Float64(t_1 + 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)
t_1 = x * log(y);
t_2 = log(c) * (b - 0.5);
tmp = 0.0;
if (x <= -9.5e+114)
tmp = (y * i) + (a + (t_1 + t_2));
elseif (x <= 2.55e+118)
tmp = (y * i) + (t_2 + (a + (z + t)));
else
tmp = (y * i) + (t + (z + (t_1 + (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_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9.5e+114], N[(N[(y * i), $MachinePrecision] + N[(a + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.55e+118], N[(N[(y * i), $MachinePrecision] + N[(t$95$2 + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t + N[(z + N[(t$95$1 + N[(b * N[Log[c], $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])\\
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+114}:\\
\;\;\;\;y \cdot i + \left(a + \left(t_1 + t_2\right)\right)\\
\mathbf{elif}\;x \leq 2.55 \cdot 10^{+118}:\\
\;\;\;\;y \cdot i + \left(t_2 + \left(a + \left(z + t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t + \left(z + \left(t_1 + b \cdot \log c\right)\right)\right)\\
\end{array}
\end{array}
if x < -9.5000000000000001e114Initial program 99.7%
Taylor expanded in z around 0 97.1%
associate-+r+97.1%
+-commutative97.1%
sub-neg97.1%
metadata-eval97.1%
associate-+r+97.1%
+-commutative97.1%
fma-def97.1%
+-commutative97.1%
fma-def97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around 0 90.7%
if -9.5000000000000001e114 < x < 2.55000000000000001e118Initial program 99.9%
Taylor expanded in x around 0 99.9%
if 2.55000000000000001e118 < x Initial program 99.8%
Taylor expanded in b around inf 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in a around 0 88.9%
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
(let* ((t_1 (* x (log y))) (t_2 (* (log c) (- b 0.5))))
(if (<= x -7.6e+107)
(+ (* y i) (+ a (+ t_1 t_2)))
(if (<= x 3.1e+175)
(+ (* y i) (+ t_2 (+ a (+ z t))))
(+ (+ a (+ t (+ z t_1))) (* 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 t_1 = x * log(y);
double t_2 = log(c) * (b - 0.5);
double tmp;
if (x <= -7.6e+107) {
tmp = (y * i) + (a + (t_1 + t_2));
} else if (x <= 3.1e+175) {
tmp = (y * i) + (t_2 + (a + (z + t)));
} else {
tmp = (a + (t + (z + t_1))) + (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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x * log(y)
t_2 = log(c) * (b - 0.5d0)
if (x <= (-7.6d+107)) then
tmp = (y * i) + (a + (t_1 + t_2))
else if (x <= 3.1d+175) then
tmp = (y * i) + (t_2 + (a + (z + t)))
else
tmp = (a + (t + (z + t_1))) + (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 t_1 = x * Math.log(y);
double t_2 = Math.log(c) * (b - 0.5);
double tmp;
if (x <= -7.6e+107) {
tmp = (y * i) + (a + (t_1 + t_2));
} else if (x <= 3.1e+175) {
tmp = (y * i) + (t_2 + (a + (z + t)));
} else {
tmp = (a + (t + (z + t_1))) + (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): t_1 = x * math.log(y) t_2 = math.log(c) * (b - 0.5) tmp = 0 if x <= -7.6e+107: tmp = (y * i) + (a + (t_1 + t_2)) elif x <= 3.1e+175: tmp = (y * i) + (t_2 + (a + (z + t))) else: tmp = (a + (t + (z + t_1))) + (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) t_1 = Float64(x * log(y)) t_2 = Float64(log(c) * Float64(b - 0.5)) tmp = 0.0 if (x <= -7.6e+107) tmp = Float64(Float64(y * i) + Float64(a + Float64(t_1 + t_2))); elseif (x <= 3.1e+175) tmp = Float64(Float64(y * i) + Float64(t_2 + Float64(a + Float64(z + t)))); else tmp = Float64(Float64(a + Float64(t + Float64(z + t_1))) + 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)
t_1 = x * log(y);
t_2 = log(c) * (b - 0.5);
tmp = 0.0;
if (x <= -7.6e+107)
tmp = (y * i) + (a + (t_1 + t_2));
elseif (x <= 3.1e+175)
tmp = (y * i) + (t_2 + (a + (z + t)));
else
tmp = (a + (t + (z + t_1))) + (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_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.6e+107], N[(N[(y * i), $MachinePrecision] + N[(a + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.1e+175], N[(N[(y * i), $MachinePrecision] + N[(t$95$2 + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + N[(t + N[(z + t$95$1), $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])\\
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{+107}:\\
\;\;\;\;y \cdot i + \left(a + \left(t_1 + t_2\right)\right)\\
\mathbf{elif}\;x \leq 3.1 \cdot 10^{+175}:\\
\;\;\;\;y \cdot i + \left(t_2 + \left(a + \left(z + t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + \left(t + \left(z + t_1\right)\right)\right) + y \cdot i\\
\end{array}
\end{array}
if x < -7.5999999999999996e107Initial program 99.7%
Taylor expanded in z around 0 97.1%
associate-+r+97.1%
+-commutative97.1%
sub-neg97.1%
metadata-eval97.1%
associate-+r+97.1%
+-commutative97.1%
fma-def97.1%
+-commutative97.1%
fma-def97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around 0 90.7%
if -7.5999999999999996e107 < x < 3.09999999999999984e175Initial program 99.9%
Taylor expanded in x around 0 99.4%
if 3.09999999999999984e175 < x Initial program 99.8%
Taylor expanded in b around inf 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in b around 0 92.4%
Final simplification97.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 (+ (+ (+ 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.8%
Final simplification99.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 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* 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) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)));
}
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 + (t + (z + (x * log(y))))) + (b * log(c)))
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 + (t + (z + (x * Math.log(y))))) + (b * Math.log(c)));
}
[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 + (t + (z + (x * math.log(y))))) + (b * math.log(c)))
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(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(b * log(c)))) 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 + (t + (z + (x * log(y))))) + (b * log(c)));
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[(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}
[x, y, z, t, a, b, c, i] = \mathsf{sort}([x, y, z, t, a, b, c, i])\\
\\
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.7%
*-commutative98.7%
Simplified98.7%
Final simplification98.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
(let* ((t_1 (+ (* y i) (* (log c) (- b 0.5)))) (t_2 (+ z (* y i))))
(if (<= t -1.02e-65)
t_2
(if (<= t -3.1e-89)
t_1
(if (<= t -1.25e-211) t_2 (if (<= t 2.9e-156) t_1 (+ 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 t_1 = (y * i) + (log(c) * (b - 0.5));
double t_2 = z + (y * i);
double tmp;
if (t <= -1.02e-65) {
tmp = t_2;
} else if (t <= -3.1e-89) {
tmp = t_1;
} else if (t <= -1.25e-211) {
tmp = t_2;
} else if (t <= 2.9e-156) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * i) + (log(c) * (b - 0.5d0))
t_2 = z + (y * i)
if (t <= (-1.02d-65)) then
tmp = t_2
else if (t <= (-3.1d-89)) then
tmp = t_1
else if (t <= (-1.25d-211)) then
tmp = t_2
else if (t <= 2.9d-156) then
tmp = t_1
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 t_1 = (y * i) + (Math.log(c) * (b - 0.5));
double t_2 = z + (y * i);
double tmp;
if (t <= -1.02e-65) {
tmp = t_2;
} else if (t <= -3.1e-89) {
tmp = t_1;
} else if (t <= -1.25e-211) {
tmp = t_2;
} else if (t <= 2.9e-156) {
tmp = t_1;
} 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): t_1 = (y * i) + (math.log(c) * (b - 0.5)) t_2 = z + (y * i) tmp = 0 if t <= -1.02e-65: tmp = t_2 elif t <= -3.1e-89: tmp = t_1 elif t <= -1.25e-211: tmp = t_2 elif t <= 2.9e-156: tmp = t_1 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) t_1 = Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5))) t_2 = Float64(z + Float64(y * i)) tmp = 0.0 if (t <= -1.02e-65) tmp = t_2; elseif (t <= -3.1e-89) tmp = t_1; elseif (t <= -1.25e-211) tmp = t_2; elseif (t <= 2.9e-156) tmp = t_1; 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)
t_1 = (y * i) + (log(c) * (b - 0.5));
t_2 = z + (y * i);
tmp = 0.0;
if (t <= -1.02e-65)
tmp = t_2;
elseif (t <= -3.1e-89)
tmp = t_1;
elseif (t <= -1.25e-211)
tmp = t_2;
elseif (t <= 2.9e-156)
tmp = t_1;
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_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.02e-65], t$95$2, If[LessEqual[t, -3.1e-89], t$95$1, If[LessEqual[t, -1.25e-211], t$95$2, If[LessEqual[t, 2.9e-156], t$95$1, 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}
t_1 := y \cdot i + \log c \cdot \left(b - 0.5\right)\\
t_2 := z + y \cdot i\\
\mathbf{if}\;t \leq -1.02 \cdot 10^{-65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-89}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{-211}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-156}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if t < -1.02000000000000004e-65 or -3.09999999999999996e-89 < t < -1.2500000000000001e-211Initial program 99.8%
Taylor expanded in x around 0 81.0%
Taylor expanded in z around inf 34.2%
if -1.02000000000000004e-65 < t < -3.09999999999999996e-89 or -1.2500000000000001e-211 < t < 2.90000000000000021e-156Initial program 99.9%
Taylor expanded in x around 0 87.3%
Taylor expanded in t around 0 87.3%
Taylor expanded in a around 0 69.3%
Taylor expanded in z around 0 52.9%
if 2.90000000000000021e-156 < t Initial program 99.9%
Taylor expanded in a around inf 45.0%
Final simplification42.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 (if (or (<= (- b 0.5) -1e+119) (not (<= (- b 0.5) 1e+84))) (+ (* y i) (+ a (+ z (* b (log c))))) (+ (+ a (+ t (+ z (* x (log y))))) (* 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 - 0.5) <= -1e+119) || !((b - 0.5) <= 1e+84)) {
tmp = (y * i) + (a + (z + (b * log(c))));
} else {
tmp = (a + (t + (z + (x * log(y))))) + (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 - 0.5d0) <= (-1d+119)) .or. (.not. ((b - 0.5d0) <= 1d+84))) then
tmp = (y * i) + (a + (z + (b * log(c))))
else
tmp = (a + (t + (z + (x * log(y))))) + (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 - 0.5) <= -1e+119) || !((b - 0.5) <= 1e+84)) {
tmp = (y * i) + (a + (z + (b * Math.log(c))));
} else {
tmp = (a + (t + (z + (x * Math.log(y))))) + (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 - 0.5) <= -1e+119) or not ((b - 0.5) <= 1e+84): tmp = (y * i) + (a + (z + (b * math.log(c)))) else: tmp = (a + (t + (z + (x * math.log(y))))) + (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 ((Float64(b - 0.5) <= -1e+119) || !(Float64(b - 0.5) <= 1e+84)) tmp = Float64(Float64(y * i) + Float64(a + Float64(z + Float64(b * log(c))))); else tmp = Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + 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 - 0.5) <= -1e+119) || ~(((b - 0.5) <= 1e+84)))
tmp = (y * i) + (a + (z + (b * log(c))));
else
tmp = (a + (t + (z + (x * log(y))))) + (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[N[(b - 0.5), $MachinePrecision], -1e+119], N[Not[LessEqual[N[(b - 0.5), $MachinePrecision], 1e+84]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $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])\\
\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -1 \cdot 10^{+119} \lor \neg \left(b - 0.5 \leq 10^{+84}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(z + b \cdot \log c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + y \cdot i\\
\end{array}
\end{array}
if (-.f64 b 1/2) < -9.99999999999999944e118 or 1.00000000000000006e84 < (-.f64 b 1/2) Initial program 99.7%
Taylor expanded in x around 0 92.9%
Taylor expanded in t around 0 84.3%
Taylor expanded in b around inf 84.3%
if -9.99999999999999944e118 < (-.f64 b 1/2) < 1.00000000000000006e84Initial program 99.9%
Taylor expanded in b around inf 98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in b around 0 96.9%
Final simplification92.3%
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 -1.35e+110) (not (<= x 2.3e+175))) (+ (+ a (+ t (+ z (* x (log y))))) (* y i)) (+ (* 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 <= -1.35e+110) || !(x <= 2.3e+175)) {
tmp = (a + (t + (z + (x * log(y))))) + (y * i);
} 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 <= (-1.35d+110)) .or. (.not. (x <= 2.3d+175))) then
tmp = (a + (t + (z + (x * log(y))))) + (y * i)
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 <= -1.35e+110) || !(x <= 2.3e+175)) {
tmp = (a + (t + (z + (x * Math.log(y))))) + (y * i);
} 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 <= -1.35e+110) or not (x <= 2.3e+175): tmp = (a + (t + (z + (x * math.log(y))))) + (y * i) 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 <= -1.35e+110) || !(x <= 2.3e+175)) tmp = Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(y * i)); 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 <= -1.35e+110) || ~((x <= 2.3e+175)))
tmp = (a + (t + (z + (x * log(y))))) + (y * i);
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, -1.35e+110], N[Not[LessEqual[x, 2.3e+175]], $MachinePrecision]], N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $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 -1.35 \cdot 10^{+110} \lor \neg \left(x \leq 2.3 \cdot 10^{+175}\right):\\
\;\;\;\;\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + y \cdot i\\
\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 < -1.35000000000000005e110 or 2.3e175 < x Initial program 99.7%
Taylor expanded in b around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in b around 0 88.9%
if -1.35000000000000005e110 < x < 2.3e175Initial program 99.9%
Taylor expanded in x around 0 99.4%
Final simplification96.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 (<= x -8e+111) (not (<= x 1.8e+176))) (+ (+ a (+ t (+ z (* x (log y))))) (* y i)) (+ (* y i) (+ a (+ z (* (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 ((x <= -8e+111) || !(x <= 1.8e+176)) {
tmp = (a + (t + (z + (x * log(y))))) + (y * i);
} else {
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
}
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 <= (-8d+111)) .or. (.not. (x <= 1.8d+176))) then
tmp = (a + (t + (z + (x * log(y))))) + (y * i)
else
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5d0))))
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 <= -8e+111) || !(x <= 1.8e+176)) {
tmp = (a + (t + (z + (x * Math.log(y))))) + (y * i);
} else {
tmp = (y * i) + (a + (z + (Math.log(c) * (b - 0.5))));
}
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 <= -8e+111) or not (x <= 1.8e+176): tmp = (a + (t + (z + (x * math.log(y))))) + (y * i) else: tmp = (y * i) + (a + (z + (math.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 ((x <= -8e+111) || !(x <= 1.8e+176)) tmp = Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(a + Float64(z + Float64(log(c) * Float64(b - 0.5))))); 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 <= -8e+111) || ~((x <= 1.8e+176)))
tmp = (a + (t + (z + (x * log(y))))) + (y * i);
else
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
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, -8e+111], N[Not[LessEqual[x, 1.8e+176]], $MachinePrecision]], N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $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}
[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 -8 \cdot 10^{+111} \lor \neg \left(x \leq 1.8 \cdot 10^{+176}\right):\\
\;\;\;\;\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + y \cdot i\\
\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 < -7.99999999999999965e111 or 1.79999999999999996e176 < x Initial program 99.7%
Taylor expanded in b around inf 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in b around 0 88.9%
if -7.99999999999999965e111 < x < 1.79999999999999996e176Initial program 99.9%
Taylor expanded in x around 0 99.4%
Taylor expanded in t around 0 87.3%
Final simplification87.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 (<= x -2.6e+210) (not (<= x 4.2e+222))) (+ (* x (log y)) (* y i)) (+ (* y i) (+ a (+ z (* 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.6e+210) || !(x <= 4.2e+222)) {
tmp = (x * log(y)) + (y * i);
} else {
tmp = (y * i) + (a + (z + (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.6d+210)) .or. (.not. (x <= 4.2d+222))) then
tmp = (x * log(y)) + (y * i)
else
tmp = (y * i) + (a + (z + (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.6e+210) || !(x <= 4.2e+222)) {
tmp = (x * Math.log(y)) + (y * i);
} else {
tmp = (y * i) + (a + (z + (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.6e+210) or not (x <= 4.2e+222): tmp = (x * math.log(y)) + (y * i) else: tmp = (y * i) + (a + (z + (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.6e+210) || !(x <= 4.2e+222)) tmp = Float64(Float64(x * log(y)) + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(a + Float64(z + 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.6e+210) || ~((x <= 4.2e+222)))
tmp = (x * log(y)) + (y * i);
else
tmp = (y * i) + (a + (z + (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.6e+210], N[Not[LessEqual[x, 4.2e+222]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(b * N[Log[c], $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}\;x \leq -2.6 \cdot 10^{+210} \lor \neg \left(x \leq 4.2 \cdot 10^{+222}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(z + b \cdot \log c\right)\right)\\
\end{array}
\end{array}
if x < -2.5999999999999999e210 or 4.2000000000000002e222 < x Initial program 99.7%
Taylor expanded in z around 0 97.0%
associate-+r+97.0%
+-commutative97.0%
sub-neg97.0%
metadata-eval97.0%
associate-+r+97.0%
+-commutative97.0%
fma-def97.0%
+-commutative97.0%
fma-def97.0%
+-commutative97.0%
+-commutative97.0%
Simplified97.0%
Taylor expanded in x around inf 80.9%
if -2.5999999999999999e210 < x < 4.2000000000000002e222Initial program 99.9%
Taylor expanded in x around 0 95.1%
Taylor expanded in t around 0 83.3%
Taylor expanded in b around inf 82.0%
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 (if (<= t 2.8e-186) (+ (* y i) (+ z (* b (log c)))) (+ 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 (t <= 2.8e-186) {
tmp = (y * i) + (z + (b * log(c)));
} 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 (t <= 2.8d-186) then
tmp = (y * i) + (z + (b * log(c)))
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 (t <= 2.8e-186) {
tmp = (y * i) + (z + (b * Math.log(c)));
} 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 t <= 2.8e-186: tmp = (y * i) + (z + (b * math.log(c))) 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 (t <= 2.8e-186) tmp = Float64(Float64(y * i) + Float64(z + Float64(b * log(c)))); 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 (t <= 2.8e-186)
tmp = (y * i) + (z + (b * log(c)));
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[LessEqual[t, 2.8e-186], N[(N[(y * i), $MachinePrecision] + N[(z + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 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}\;t \leq 2.8 \cdot 10^{-186}:\\
\;\;\;\;y \cdot i + \left(z + b \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if t < 2.79999999999999983e-186Initial program 99.8%
Taylor expanded in x around 0 83.1%
Taylor expanded in t around 0 74.8%
Taylor expanded in a around 0 57.6%
Taylor expanded in b around inf 56.4%
if 2.79999999999999983e-186 < t Initial program 99.9%
Taylor expanded in a around inf 45.4%
Final simplification52.3%
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 -8e+196) (and (not (<= z -2.9e+140)) (<= z -9.2e+108))) 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 <= -8e+196) || (!(z <= -2.9e+140) && (z <= -9.2e+108))) {
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 <= (-8d+196)) .or. (.not. (z <= (-2.9d+140))) .and. (z <= (-9.2d+108))) 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 <= -8e+196) || (!(z <= -2.9e+140) && (z <= -9.2e+108))) {
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 <= -8e+196) or (not (z <= -2.9e+140) and (z <= -9.2e+108)): 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 <= -8e+196) || (!(z <= -2.9e+140) && (z <= -9.2e+108))) 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 <= -8e+196) || (~((z <= -2.9e+140)) && (z <= -9.2e+108)))
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, -8e+196], And[N[Not[LessEqual[z, -2.9e+140]], $MachinePrecision], LessEqual[z, -9.2e+108]]], 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 -8 \cdot 10^{+196} \lor \neg \left(z \leq -2.9 \cdot 10^{+140}\right) \land z \leq -9.2 \cdot 10^{+108}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -7.9999999999999996e196 or -2.8999999999999999e140 < z < -9.1999999999999996e108Initial program 99.9%
Taylor expanded in x around 0 83.1%
Taylor expanded in z around inf 64.8%
Taylor expanded in z around inf 58.8%
if -7.9999999999999996e196 < z < -2.8999999999999999e140 or -9.1999999999999996e108 < z Initial program 99.8%
Taylor expanded in a around inf 45.2%
Final simplification47.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 (<= z -5e+103) z (if (<= z -2.4e-276) (* 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 (z <= -5e+103) {
tmp = z;
} else if (z <= -2.4e-276) {
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 (z <= (-5d+103)) then
tmp = z
else if (z <= (-2.4d-276)) 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 (z <= -5e+103) {
tmp = z;
} else if (z <= -2.4e-276) {
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 z <= -5e+103: tmp = z elif z <= -2.4e-276: 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 (z <= -5e+103) tmp = z; elseif (z <= -2.4e-276) 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 (z <= -5e+103)
tmp = z;
elseif (z <= -2.4e-276)
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[z, -5e+103], z, If[LessEqual[z, -2.4e-276], 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}\;z \leq -5 \cdot 10^{+103}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-276}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -5e103Initial program 99.9%
Taylor expanded in x around 0 82.4%
Taylor expanded in z around inf 57.1%
Taylor expanded in z around inf 48.1%
if -5e103 < z < -2.39999999999999983e-276Initial program 99.8%
Taylor expanded in a around inf 42.2%
Taylor expanded in a around 0 29.3%
if -2.39999999999999983e-276 < z Initial program 99.9%
Taylor expanded in a around inf 49.0%
Taylor expanded in a around inf 24.0%
Final simplification29.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 (<= t 1.8e-301) (+ z (* y i)) (+ 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 (t <= 1.8e-301) {
tmp = z + (y * i);
} 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 (t <= 1.8d-301) then
tmp = z + (y * i)
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 (t <= 1.8e-301) {
tmp = z + (y * i);
} 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 t <= 1.8e-301: tmp = z + (y * i) 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 (t <= 1.8e-301) tmp = Float64(z + Float64(y * i)); 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 (t <= 1.8e-301)
tmp = z + (y * i);
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[LessEqual[t, 1.8e-301], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], 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}\;t \leq 1.8 \cdot 10^{-301}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if t < 1.80000000000000004e-301Initial program 99.8%
Taylor expanded in x around 0 82.6%
Taylor expanded in z around inf 34.8%
if 1.80000000000000004e-301 < t Initial program 99.9%
Taylor expanded in a around inf 44.3%
Final simplification39.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 (if (<= a 6.2e+110) 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 <= 6.2e+110) {
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 <= 6.2d+110) 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 <= 6.2e+110) {
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 <= 6.2e+110: 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 <= 6.2e+110) 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 <= 6.2e+110)
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, 6.2e+110], 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 6.2 \cdot 10^{+110}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < 6.20000000000000035e110Initial program 99.8%
Taylor expanded in x around 0 84.3%
Taylor expanded in z around inf 42.0%
Taylor expanded in z around inf 18.0%
if 6.20000000000000035e110 < a Initial program 100.0%
Taylor expanded in a around inf 64.7%
Taylor expanded in a around inf 46.6%
Final simplification22.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 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.8%
Taylor expanded in a around inf 41.3%
Taylor expanded in a around inf 18.3%
Final simplification18.3%
herbie shell --seed 2024020
(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)))