
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(-
(+ (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))) (* b c))
(* i (* x 4.0)))
(* k (* j 27.0)))
INFINITY)
(+
(fma t (fma (* x 18.0) (* y z) (* -4.0 a)) (fma b c (* i (* x -4.0))))
(* k (* j -27.0)))
(* x (- (* 18.0 (* y (* t z))) (* i 4.0)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0))) <= ((double) INFINITY)) {
tmp = fma(t, fma((x * 18.0), (y * z), (-4.0 * a)), fma(b, c, (i * (x * -4.0)))) + (k * (j * -27.0));
} else {
tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0));
}
return tmp;
}
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) <= Inf) tmp = Float64(fma(t, fma(Float64(x * 18.0), Float64(y * z), Float64(-4.0 * a)), fma(b, c, Float64(i * Float64(x * -4.0)))) + Float64(k * Float64(j * -27.0))); else tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0))); end return tmp end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(t * N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + N[(b * c + N[(i * N[(x * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(x \cdot 18, y \cdot z, -4 \cdot a\right), \mathsf{fma}\left(b, c, i \cdot \left(x \cdot -4\right)\right)\right) + k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 95.1%
sub-neg95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
Simplified95.1%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
sub-neg0.0%
associate-+l-0.0%
sub-neg0.0%
sub-neg0.0%
distribute-rgt-out--14.3%
associate-*l*19.0%
distribute-lft-neg-in19.0%
cancel-sign-sub19.0%
associate-*l*19.0%
associate-*l*19.0%
Simplified19.0%
Taylor expanded in x around inf 71.5%
Final simplification93.1%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (fma j (* k -27.0) (fma x (* i -4.0) (fma t (fma x (* 18.0 (* y z)) (* -4.0 a)) (* b c)))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return fma(j, (k * -27.0), fma(x, (i * -4.0), fma(t, fma(x, (18.0 * (y * z)), (-4.0 * a)), (b * c))));
}
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return fma(j, Float64(k * -27.0), fma(x, Float64(i * -4.0), fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(-4.0 * a)), Float64(b * c)))) end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(j * N[(k * -27.0), $MachinePrecision] + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), -4 \cdot a\right), b \cdot c\right)\right)\right)
\end{array}
Initial program 87.3%
sub-neg87.3%
+-commutative87.3%
associate-*l*87.3%
distribute-rgt-neg-in87.3%
fma-def89.6%
*-commutative89.6%
distribute-rgt-neg-in89.6%
metadata-eval89.6%
sub-neg89.6%
+-commutative89.6%
associate-*l*89.6%
distribute-rgt-neg-in89.6%
Simplified93.1%
Final simplification93.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(-
(+ (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))) (* b c))
(* i (* x 4.0)))
(* k (* j 27.0)))
INFINITY)
(+
(* k (* j -27.0))
(fma t (fma (* x 18.0) (* y z) (* -4.0 a)) (+ (* i (* x -4.0)) (* b c))))
(* x (- (* 18.0 (* y (* t z))) (* i 4.0)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0))) <= ((double) INFINITY)) {
tmp = (k * (j * -27.0)) + fma(t, fma((x * 18.0), (y * z), (-4.0 * a)), ((i * (x * -4.0)) + (b * c)));
} else {
tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0));
}
return tmp;
}
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) <= Inf) tmp = Float64(Float64(k * Float64(j * -27.0)) + fma(t, fma(Float64(x * 18.0), Float64(y * z), Float64(-4.0 * a)), Float64(Float64(i * Float64(x * -4.0)) + Float64(b * c)))); else tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0))); end return tmp end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(N[(N[(N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(t * N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision] + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] + N[(N[(i * N[(x * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;k \cdot \left(j \cdot -27\right) + \mathsf{fma}\left(t, \mathsf{fma}\left(x \cdot 18, y \cdot z, -4 \cdot a\right), i \cdot \left(x \cdot -4\right) + b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 95.1%
sub-neg95.1%
*-commutative95.1%
distribute-rgt-neg-in95.1%
Simplified95.1%
fma-udef95.1%
Applied egg-rr95.1%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
sub-neg0.0%
associate-+l-0.0%
sub-neg0.0%
sub-neg0.0%
distribute-rgt-out--14.3%
associate-*l*19.0%
distribute-lft-neg-in19.0%
cancel-sign-sub19.0%
associate-*l*19.0%
associate-*l*19.0%
Simplified19.0%
Taylor expanded in x around inf 71.5%
Final simplification93.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (- (* t (* z (* y (* x 18.0)))) (* t (* a 4.0))) (* b c))
(* i (* x 4.0)))
(* k (* j 27.0)))))
(if (<= t_1 INFINITY) t_1 (* x (- (* 18.0 (* y (* t z))) (* i 4.0))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0));
}
return tmp;
}
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0)) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = ((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0));
tmp = 0.0;
if (t_1 <= Inf)
tmp = t_1;
else
tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 95.1%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
sub-neg0.0%
associate-+l-0.0%
sub-neg0.0%
sub-neg0.0%
distribute-rgt-out--14.3%
associate-*l*19.0%
distribute-lft-neg-in19.0%
cancel-sign-sub19.0%
associate-*l*19.0%
associate-*l*19.0%
Simplified19.0%
Taylor expanded in x around inf 71.5%
Final simplification93.2%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= i -7.2e+131)
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* 18.0 (* y (* t z))) (* i -4.0)))))
(-
(+ (* b c) (* t (- (* (* y z) (* x 18.0)) (* a 4.0))))
(+ (* x (* i 4.0)) (* j (* k 27.0))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (i <= -7.2e+131) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0))));
} else {
tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (k * 27.0)));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (i <= (-7.2d+131)) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((18.0d0 * (y * (t * z))) + (i * (-4.0d0)))))
else
tmp = ((b * c) + (t * (((y * z) * (x * 18.0d0)) - (a * 4.0d0)))) - ((x * (i * 4.0d0)) + (j * (k * 27.0d0)))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (i <= -7.2e+131) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0))));
} else {
tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (k * 27.0)));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if i <= -7.2e+131: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0)))) else: tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (k * 27.0))) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (i <= -7.2e+131) tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) + Float64(i * -4.0))))); else tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(y * z) * Float64(x * 18.0)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(i * 4.0)) + Float64(j * Float64(k * 27.0)))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (i <= -7.2e+131)
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0))));
else
tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (a * 4.0)))) - ((x * (i * 4.0)) + (j * (k * 27.0)));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[i, -7.2e+131], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * 18.0), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -7.2 \cdot 10^{+131}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) + i \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot 18\right) - a \cdot 4\right)\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(k \cdot 27\right)\right)\\
\end{array}
\end{array}
if i < -7.20000000000000063e131Initial program 69.1%
sub-neg69.1%
+-commutative69.1%
sub-neg69.1%
associate-+l+69.1%
associate-+r+69.1%
associate--l+69.1%
+-commutative69.1%
sub-neg69.1%
Simplified81.6%
Taylor expanded in a around 0 90.4%
if -7.20000000000000063e131 < i Initial program 89.9%
sub-neg89.9%
associate-+l-89.9%
sub-neg89.9%
sub-neg89.9%
distribute-rgt-out--91.2%
associate-*l*91.2%
distribute-lft-neg-in91.2%
cancel-sign-sub91.2%
associate-*l*91.2%
associate-*l*91.2%
Simplified91.2%
Final simplification91.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* t a)))
(t_2 (* x (- (* 18.0 (* y (* t z))) (* i 4.0))))
(t_3 (* k (* j -27.0)))
(t_4 (+ t_3 (* b c)))
(t_5 (* -4.0 (* x i)))
(t_6 (+ (* b c) t_1)))
(if (<= x -1.05e+70)
t_2
(if (<= x -1.6e-96)
t_4
(if (<= x -1.05e-124)
(+ (* 18.0 (* y (* t (* x z)))) t_5)
(if (<= x -2.1e-182)
(- t_1 (* 27.0 (* j k)))
(if (<= x -1.06e-271)
t_6
(if (<= x 8.5e-279)
t_4
(if (<= x 1.3e-80)
t_6
(if (<= x 5.2e+33) (+ t_3 t_5) t_2))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (t * a);
double t_2 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double t_3 = k * (j * -27.0);
double t_4 = t_3 + (b * c);
double t_5 = -4.0 * (x * i);
double t_6 = (b * c) + t_1;
double tmp;
if (x <= -1.05e+70) {
tmp = t_2;
} else if (x <= -1.6e-96) {
tmp = t_4;
} else if (x <= -1.05e-124) {
tmp = (18.0 * (y * (t * (x * z)))) + t_5;
} else if (x <= -2.1e-182) {
tmp = t_1 - (27.0 * (j * k));
} else if (x <= -1.06e-271) {
tmp = t_6;
} else if (x <= 8.5e-279) {
tmp = t_4;
} else if (x <= 1.3e-80) {
tmp = t_6;
} else if (x <= 5.2e+33) {
tmp = t_3 + t_5;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = (-4.0d0) * (t * a)
t_2 = x * ((18.0d0 * (y * (t * z))) - (i * 4.0d0))
t_3 = k * (j * (-27.0d0))
t_4 = t_3 + (b * c)
t_5 = (-4.0d0) * (x * i)
t_6 = (b * c) + t_1
if (x <= (-1.05d+70)) then
tmp = t_2
else if (x <= (-1.6d-96)) then
tmp = t_4
else if (x <= (-1.05d-124)) then
tmp = (18.0d0 * (y * (t * (x * z)))) + t_5
else if (x <= (-2.1d-182)) then
tmp = t_1 - (27.0d0 * (j * k))
else if (x <= (-1.06d-271)) then
tmp = t_6
else if (x <= 8.5d-279) then
tmp = t_4
else if (x <= 1.3d-80) then
tmp = t_6
else if (x <= 5.2d+33) then
tmp = t_3 + t_5
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (t * a);
double t_2 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double t_3 = k * (j * -27.0);
double t_4 = t_3 + (b * c);
double t_5 = -4.0 * (x * i);
double t_6 = (b * c) + t_1;
double tmp;
if (x <= -1.05e+70) {
tmp = t_2;
} else if (x <= -1.6e-96) {
tmp = t_4;
} else if (x <= -1.05e-124) {
tmp = (18.0 * (y * (t * (x * z)))) + t_5;
} else if (x <= -2.1e-182) {
tmp = t_1 - (27.0 * (j * k));
} else if (x <= -1.06e-271) {
tmp = t_6;
} else if (x <= 8.5e-279) {
tmp = t_4;
} else if (x <= 1.3e-80) {
tmp = t_6;
} else if (x <= 5.2e+33) {
tmp = t_3 + t_5;
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (t * a) t_2 = x * ((18.0 * (y * (t * z))) - (i * 4.0)) t_3 = k * (j * -27.0) t_4 = t_3 + (b * c) t_5 = -4.0 * (x * i) t_6 = (b * c) + t_1 tmp = 0 if x <= -1.05e+70: tmp = t_2 elif x <= -1.6e-96: tmp = t_4 elif x <= -1.05e-124: tmp = (18.0 * (y * (t * (x * z)))) + t_5 elif x <= -2.1e-182: tmp = t_1 - (27.0 * (j * k)) elif x <= -1.06e-271: tmp = t_6 elif x <= 8.5e-279: tmp = t_4 elif x <= 1.3e-80: tmp = t_6 elif x <= 5.2e+33: tmp = t_3 + t_5 else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(t * a)) t_2 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0))) t_3 = Float64(k * Float64(j * -27.0)) t_4 = Float64(t_3 + Float64(b * c)) t_5 = Float64(-4.0 * Float64(x * i)) t_6 = Float64(Float64(b * c) + t_1) tmp = 0.0 if (x <= -1.05e+70) tmp = t_2; elseif (x <= -1.6e-96) tmp = t_4; elseif (x <= -1.05e-124) tmp = Float64(Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))) + t_5); elseif (x <= -2.1e-182) tmp = Float64(t_1 - Float64(27.0 * Float64(j * k))); elseif (x <= -1.06e-271) tmp = t_6; elseif (x <= 8.5e-279) tmp = t_4; elseif (x <= 1.3e-80) tmp = t_6; elseif (x <= 5.2e+33) tmp = Float64(t_3 + t_5); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * (t * a);
t_2 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
t_3 = k * (j * -27.0);
t_4 = t_3 + (b * c);
t_5 = -4.0 * (x * i);
t_6 = (b * c) + t_1;
tmp = 0.0;
if (x <= -1.05e+70)
tmp = t_2;
elseif (x <= -1.6e-96)
tmp = t_4;
elseif (x <= -1.05e-124)
tmp = (18.0 * (y * (t * (x * z)))) + t_5;
elseif (x <= -2.1e-182)
tmp = t_1 - (27.0 * (j * k));
elseif (x <= -1.06e-271)
tmp = t_6;
elseif (x <= 8.5e-279)
tmp = t_4;
elseif (x <= 1.3e-80)
tmp = t_6;
elseif (x <= 5.2e+33)
tmp = t_3 + t_5;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[x, -1.05e+70], t$95$2, If[LessEqual[x, -1.6e-96], t$95$4, If[LessEqual[x, -1.05e-124], N[(N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$5), $MachinePrecision], If[LessEqual[x, -2.1e-182], N[(t$95$1 - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -1.06e-271], t$95$6, If[LessEqual[x, 8.5e-279], t$95$4, If[LessEqual[x, 1.3e-80], t$95$6, If[LessEqual[x, 5.2e+33], N[(t$95$3 + t$95$5), $MachinePrecision], t$95$2]]]]]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
t_2 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\
t_3 := k \cdot \left(j \cdot -27\right)\\
t_4 := t_3 + b \cdot c\\
t_5 := -4 \cdot \left(x \cdot i\right)\\
t_6 := b \cdot c + t_1\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+70}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -1.6 \cdot 10^{-96}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-124}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right) + t_5\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-182}:\\
\;\;\;\;t_1 - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{-271}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x \leq 8.5 \cdot 10^{-279}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-80}:\\
\;\;\;\;t_6\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{+33}:\\
\;\;\;\;t_3 + t_5\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.05000000000000004e70 or 5.1999999999999995e33 < x Initial program 78.8%
sub-neg78.8%
associate-+l-78.8%
sub-neg78.8%
sub-neg78.8%
distribute-rgt-out--81.6%
associate-*l*85.1%
distribute-lft-neg-in85.1%
cancel-sign-sub85.1%
associate-*l*85.1%
associate-*l*85.1%
Simplified85.1%
Taylor expanded in x around inf 80.4%
if -1.05000000000000004e70 < x < -1.60000000000000006e-96 or -1.06e-271 < x < 8.5000000000000002e-279Initial program 91.4%
sub-neg91.4%
*-commutative91.4%
distribute-rgt-neg-in91.4%
Simplified91.6%
fma-udef91.5%
Applied egg-rr91.5%
Taylor expanded in b around inf 67.0%
if -1.60000000000000006e-96 < x < -1.05e-124Initial program 100.0%
sub-neg100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
distribute-rgt-out--100.0%
associate-*l*100.0%
distribute-lft-neg-in100.0%
cancel-sign-sub100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 81.2%
Taylor expanded in y around 0 100.0%
if -1.05e-124 < x < -2.1e-182Initial program 89.2%
sub-neg89.2%
associate-+l-89.2%
sub-neg89.2%
sub-neg89.2%
distribute-rgt-out--89.2%
associate-*l*78.1%
distribute-lft-neg-in78.1%
cancel-sign-sub78.1%
associate-*l*78.1%
associate-*l*78.1%
Simplified78.1%
Taylor expanded in x around 0 89.5%
Taylor expanded in c around 0 78.7%
if -2.1e-182 < x < -1.06e-271 or 8.5000000000000002e-279 < x < 1.3e-80Initial program 95.2%
sub-neg95.2%
associate-+l-95.2%
sub-neg95.2%
sub-neg95.2%
distribute-rgt-out--95.2%
associate-*l*93.8%
distribute-lft-neg-in93.8%
cancel-sign-sub93.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around 0 89.9%
Taylor expanded in i around inf 72.6%
*-commutative72.6%
*-commutative72.6%
associate-*l*72.6%
Simplified72.6%
Taylor expanded in x around 0 71.0%
if 1.3e-80 < x < 5.1999999999999995e33Initial program 92.9%
sub-neg92.9%
*-commutative92.9%
distribute-rgt-neg-in92.9%
Simplified92.8%
fma-udef92.8%
Applied egg-rr92.8%
Taylor expanded in i around inf 57.3%
Final simplification73.6%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k)))
(t_2 (- (* -4.0 (+ (* t a) (* x i))) t_1))
(t_3 (* x (- (* 18.0 (* y (* t z))) (* i 4.0))))
(t_4 (- (+ (* b c) (* 18.0 (* y (* t (* x z))))) (* 4.0 (* x i)))))
(if (<= x -2.2e+86)
t_3
(if (<= x 7.5e-55)
(- (+ (* b c) (* -4.0 (* t a))) t_1)
(if (<= x 0.155)
t_4
(if (<= x 5.9e+26)
t_2
(if (<= x 2.2e+117) t_4 (if (<= x 1e+189) t_2 t_3))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (-4.0 * ((t * a) + (x * i))) - t_1;
double t_3 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double t_4 = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i));
double tmp;
if (x <= -2.2e+86) {
tmp = t_3;
} else if (x <= 7.5e-55) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
} else if (x <= 0.155) {
tmp = t_4;
} else if (x <= 5.9e+26) {
tmp = t_2;
} else if (x <= 2.2e+117) {
tmp = t_4;
} else if (x <= 1e+189) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = ((-4.0d0) * ((t * a) + (x * i))) - t_1
t_3 = x * ((18.0d0 * (y * (t * z))) - (i * 4.0d0))
t_4 = ((b * c) + (18.0d0 * (y * (t * (x * z))))) - (4.0d0 * (x * i))
if (x <= (-2.2d+86)) then
tmp = t_3
else if (x <= 7.5d-55) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - t_1
else if (x <= 0.155d0) then
tmp = t_4
else if (x <= 5.9d+26) then
tmp = t_2
else if (x <= 2.2d+117) then
tmp = t_4
else if (x <= 1d+189) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (-4.0 * ((t * a) + (x * i))) - t_1;
double t_3 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double t_4 = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i));
double tmp;
if (x <= -2.2e+86) {
tmp = t_3;
} else if (x <= 7.5e-55) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
} else if (x <= 0.155) {
tmp = t_4;
} else if (x <= 5.9e+26) {
tmp = t_2;
} else if (x <= 2.2e+117) {
tmp = t_4;
} else if (x <= 1e+189) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = (-4.0 * ((t * a) + (x * i))) - t_1 t_3 = x * ((18.0 * (y * (t * z))) - (i * 4.0)) t_4 = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i)) tmp = 0 if x <= -2.2e+86: tmp = t_3 elif x <= 7.5e-55: tmp = ((b * c) + (-4.0 * (t * a))) - t_1 elif x <= 0.155: tmp = t_4 elif x <= 5.9e+26: tmp = t_2 elif x <= 2.2e+117: tmp = t_4 elif x <= 1e+189: tmp = t_2 else: tmp = t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) - t_1) t_3 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0))) t_4 = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(y * Float64(t * Float64(x * z))))) - Float64(4.0 * Float64(x * i))) tmp = 0.0 if (x <= -2.2e+86) tmp = t_3; elseif (x <= 7.5e-55) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - t_1); elseif (x <= 0.155) tmp = t_4; elseif (x <= 5.9e+26) tmp = t_2; elseif (x <= 2.2e+117) tmp = t_4; elseif (x <= 1e+189) tmp = t_2; else tmp = t_3; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = (-4.0 * ((t * a) + (x * i))) - t_1;
t_3 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
t_4 = ((b * c) + (18.0 * (y * (t * (x * z))))) - (4.0 * (x * i));
tmp = 0.0;
if (x <= -2.2e+86)
tmp = t_3;
elseif (x <= 7.5e-55)
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
elseif (x <= 0.155)
tmp = t_4;
elseif (x <= 5.9e+26)
tmp = t_2;
elseif (x <= 2.2e+117)
tmp = t_4;
elseif (x <= 1e+189)
tmp = t_2;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.2e+86], t$95$3, If[LessEqual[x, 7.5e-55], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 0.155], t$95$4, If[LessEqual[x, 5.9e+26], t$95$2, If[LessEqual[x, 2.2e+117], t$95$4, If[LessEqual[x, 1e+189], t$95$2, t$95$3]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := -4 \cdot \left(t \cdot a + x \cdot i\right) - t_1\\
t_3 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\
t_4 := \left(b \cdot c + 18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{+86}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{-55}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;x \leq 0.155:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq 5.9 \cdot 10^{+26}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+117}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq 10^{+189}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if x < -2.20000000000000003e86 or 1e189 < x Initial program 76.0%
sub-neg76.0%
associate-+l-76.0%
sub-neg76.0%
sub-neg76.0%
distribute-rgt-out--78.9%
associate-*l*83.0%
distribute-lft-neg-in83.0%
cancel-sign-sub83.0%
associate-*l*83.0%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in x around inf 84.1%
if -2.20000000000000003e86 < x < 7.50000000000000023e-55Initial program 94.0%
sub-neg94.0%
associate-+l-94.0%
sub-neg94.0%
sub-neg94.0%
distribute-rgt-out--94.0%
associate-*l*91.8%
distribute-lft-neg-in91.8%
cancel-sign-sub91.8%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in x around 0 81.4%
if 7.50000000000000023e-55 < x < 0.154999999999999999 or 5.9000000000000003e26 < x < 2.20000000000000014e117Initial program 85.7%
sub-neg85.7%
associate-+l-85.7%
sub-neg85.7%
sub-neg85.7%
distribute-rgt-out--88.6%
associate-*l*88.5%
distribute-lft-neg-in88.5%
cancel-sign-sub88.5%
associate-*l*88.5%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in j around 0 88.7%
Taylor expanded in a around 0 94.4%
if 0.154999999999999999 < x < 5.9000000000000003e26 or 2.20000000000000014e117 < x < 1e189Initial program 86.2%
sub-neg86.2%
associate-+l-86.2%
sub-neg86.2%
sub-neg86.2%
distribute-rgt-out--86.2%
associate-*l*90.5%
distribute-lft-neg-in90.5%
cancel-sign-sub90.5%
associate-*l*90.5%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in y around 0 83.3%
*-un-lft-identity83.3%
fma-def83.3%
*-commutative83.3%
associate-*r*83.2%
Applied egg-rr83.2%
*-lft-identity83.2%
fma-udef83.2%
*-commutative83.2%
associate-*l*83.2%
*-commutative83.2%
fma-def83.2%
*-commutative83.2%
associate-*r*83.3%
*-commutative83.3%
associate-*l*83.3%
Simplified83.3%
Taylor expanded in c around 0 88.0%
associate--r+88.0%
cancel-sign-sub-inv88.0%
metadata-eval88.0%
+-commutative88.0%
distribute-lft-out88.0%
Simplified88.0%
Final simplification84.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 4.0 (* x i))))
(t_2 (- (* -4.0 (+ (* t a) (* x i))) (* 27.0 (* j k))))
(t_3 (* t (- (* 18.0 (* y (* x z))) (* a 4.0)))))
(if (<= t -6.8e+17)
t_3
(if (<= t -2.65e-226)
t_2
(if (<= t 2.55e-177)
t_1
(if (<= t 6.5e-36)
t_2
(if (<= t 64000000.0) t_1 (if (<= t 8.2e+100) t_2 t_3))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (x * i));
double t_2 = (-4.0 * ((t * a) + (x * i))) - (27.0 * (j * k));
double t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -6.8e+17) {
tmp = t_3;
} else if (t <= -2.65e-226) {
tmp = t_2;
} else if (t <= 2.55e-177) {
tmp = t_1;
} else if (t <= 6.5e-36) {
tmp = t_2;
} else if (t <= 64000000.0) {
tmp = t_1;
} else if (t <= 8.2e+100) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * (x * i))
t_2 = ((-4.0d0) * ((t * a) + (x * i))) - (27.0d0 * (j * k))
t_3 = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
if (t <= (-6.8d+17)) then
tmp = t_3
else if (t <= (-2.65d-226)) then
tmp = t_2
else if (t <= 2.55d-177) then
tmp = t_1
else if (t <= 6.5d-36) then
tmp = t_2
else if (t <= 64000000.0d0) then
tmp = t_1
else if (t <= 8.2d+100) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (x * i));
double t_2 = (-4.0 * ((t * a) + (x * i))) - (27.0 * (j * k));
double t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -6.8e+17) {
tmp = t_3;
} else if (t <= -2.65e-226) {
tmp = t_2;
} else if (t <= 2.55e-177) {
tmp = t_1;
} else if (t <= 6.5e-36) {
tmp = t_2;
} else if (t <= 64000000.0) {
tmp = t_1;
} else if (t <= 8.2e+100) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (4.0 * (x * i)) t_2 = (-4.0 * ((t * a) + (x * i))) - (27.0 * (j * k)) t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0)) tmp = 0 if t <= -6.8e+17: tmp = t_3 elif t <= -2.65e-226: tmp = t_2 elif t <= 2.55e-177: tmp = t_1 elif t <= 6.5e-36: tmp = t_2 elif t <= 64000000.0: tmp = t_1 elif t <= 8.2e+100: tmp = t_2 else: tmp = t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) t_2 = Float64(Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) - Float64(27.0 * Float64(j * k))) t_3 = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -6.8e+17) tmp = t_3; elseif (t <= -2.65e-226) tmp = t_2; elseif (t <= 2.55e-177) tmp = t_1; elseif (t <= 6.5e-36) tmp = t_2; elseif (t <= 64000000.0) tmp = t_1; elseif (t <= 8.2e+100) tmp = t_2; else tmp = t_3; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (4.0 * (x * i));
t_2 = (-4.0 * ((t * a) + (x * i))) - (27.0 * (j * k));
t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -6.8e+17)
tmp = t_3;
elseif (t <= -2.65e-226)
tmp = t_2;
elseif (t <= 2.55e-177)
tmp = t_1;
elseif (t <= 6.5e-36)
tmp = t_2;
elseif (t <= 64000000.0)
tmp = t_1;
elseif (t <= 8.2e+100)
tmp = t_2;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.8e+17], t$95$3, If[LessEqual[t, -2.65e-226], t$95$2, If[LessEqual[t, 2.55e-177], t$95$1, If[LessEqual[t, 6.5e-36], t$95$2, If[LessEqual[t, 64000000.0], t$95$1, If[LessEqual[t, 8.2e+100], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
t_2 := -4 \cdot \left(t \cdot a + x \cdot i\right) - 27 \cdot \left(j \cdot k\right)\\
t_3 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{+17}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -2.65 \cdot 10^{-226}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.55 \cdot 10^{-177}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-36}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 64000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 8.2 \cdot 10^{+100}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -6.8e17 or 8.2000000000000006e100 < t Initial program 84.6%
sub-neg84.6%
associate-+l-84.6%
sub-neg84.6%
sub-neg84.6%
distribute-rgt-out--87.5%
associate-*l*89.4%
distribute-lft-neg-in89.4%
cancel-sign-sub89.4%
associate-*l*89.4%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in j around 0 83.0%
Taylor expanded in t around inf 70.9%
if -6.8e17 < t < -2.6500000000000002e-226 or 2.55000000000000004e-177 < t < 6.50000000000000012e-36 or 6.4e7 < t < 8.2000000000000006e100Initial program 88.1%
sub-neg88.1%
associate-+l-88.1%
sub-neg88.1%
sub-neg88.1%
distribute-rgt-out--88.1%
associate-*l*88.9%
distribute-lft-neg-in88.9%
cancel-sign-sub88.9%
associate-*l*88.9%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in y around 0 83.4%
*-un-lft-identity83.4%
fma-def83.4%
*-commutative83.4%
associate-*r*83.4%
Applied egg-rr83.4%
*-lft-identity83.4%
fma-udef83.4%
*-commutative83.4%
associate-*l*83.4%
*-commutative83.4%
fma-def84.4%
*-commutative84.4%
associate-*r*84.4%
*-commutative84.4%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in c around 0 72.9%
associate--r+72.9%
cancel-sign-sub-inv72.9%
metadata-eval72.9%
+-commutative72.9%
distribute-lft-out72.9%
Simplified72.9%
if -2.6500000000000002e-226 < t < 2.55000000000000004e-177 or 6.50000000000000012e-36 < t < 6.4e7Initial program 91.0%
sub-neg91.0%
associate-+l-91.0%
sub-neg91.0%
sub-neg91.0%
distribute-rgt-out--91.0%
associate-*l*87.5%
distribute-lft-neg-in87.5%
cancel-sign-sub87.5%
associate-*l*87.5%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in j around 0 70.6%
Taylor expanded in t around 0 68.3%
Final simplification71.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 27.0 (* j k)))
(t_2 (- (* b c) (+ (* 4.0 (* x i)) t_1)))
(t_3 (- (* -4.0 (+ (* t a) (* x i))) t_1))
(t_4 (* t (- (* 18.0 (* y (* x z))) (* a 4.0)))))
(if (<= t -2.4e+16)
t_4
(if (<= t -1.95e-56)
t_3
(if (<= t -1.92e-90)
(* x (* y (* 18.0 (* t z))))
(if (<= t -9e-135)
t_2
(if (<= t -1.35e-180) t_3 (if (<= t 1.4e+98) t_2 t_4))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - ((4.0 * (x * i)) + t_1);
double t_3 = (-4.0 * ((t * a) + (x * i))) - t_1;
double t_4 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -2.4e+16) {
tmp = t_4;
} else if (t <= -1.95e-56) {
tmp = t_3;
} else if (t <= -1.92e-90) {
tmp = x * (y * (18.0 * (t * z)));
} else if (t <= -9e-135) {
tmp = t_2;
} else if (t <= -1.35e-180) {
tmp = t_3;
} else if (t <= 1.4e+98) {
tmp = t_2;
} else {
tmp = t_4;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = 27.0d0 * (j * k)
t_2 = (b * c) - ((4.0d0 * (x * i)) + t_1)
t_3 = ((-4.0d0) * ((t * a) + (x * i))) - t_1
t_4 = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
if (t <= (-2.4d+16)) then
tmp = t_4
else if (t <= (-1.95d-56)) then
tmp = t_3
else if (t <= (-1.92d-90)) then
tmp = x * (y * (18.0d0 * (t * z)))
else if (t <= (-9d-135)) then
tmp = t_2
else if (t <= (-1.35d-180)) then
tmp = t_3
else if (t <= 1.4d+98) then
tmp = t_2
else
tmp = t_4
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 27.0 * (j * k);
double t_2 = (b * c) - ((4.0 * (x * i)) + t_1);
double t_3 = (-4.0 * ((t * a) + (x * i))) - t_1;
double t_4 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -2.4e+16) {
tmp = t_4;
} else if (t <= -1.95e-56) {
tmp = t_3;
} else if (t <= -1.92e-90) {
tmp = x * (y * (18.0 * (t * z)));
} else if (t <= -9e-135) {
tmp = t_2;
} else if (t <= -1.35e-180) {
tmp = t_3;
} else if (t <= 1.4e+98) {
tmp = t_2;
} else {
tmp = t_4;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) t_2 = (b * c) - ((4.0 * (x * i)) + t_1) t_3 = (-4.0 * ((t * a) + (x * i))) - t_1 t_4 = t * ((18.0 * (y * (x * z))) - (a * 4.0)) tmp = 0 if t <= -2.4e+16: tmp = t_4 elif t <= -1.95e-56: tmp = t_3 elif t <= -1.92e-90: tmp = x * (y * (18.0 * (t * z))) elif t <= -9e-135: tmp = t_2 elif t <= -1.35e-180: tmp = t_3 elif t <= 1.4e+98: tmp = t_2 else: tmp = t_4 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(27.0 * Float64(j * k)) t_2 = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + t_1)) t_3 = Float64(Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) - t_1) t_4 = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -2.4e+16) tmp = t_4; elseif (t <= -1.95e-56) tmp = t_3; elseif (t <= -1.92e-90) tmp = Float64(x * Float64(y * Float64(18.0 * Float64(t * z)))); elseif (t <= -9e-135) tmp = t_2; elseif (t <= -1.35e-180) tmp = t_3; elseif (t <= 1.4e+98) tmp = t_2; else tmp = t_4; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 27.0 * (j * k);
t_2 = (b * c) - ((4.0 * (x * i)) + t_1);
t_3 = (-4.0 * ((t * a) + (x * i))) - t_1;
t_4 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -2.4e+16)
tmp = t_4;
elseif (t <= -1.95e-56)
tmp = t_3;
elseif (t <= -1.92e-90)
tmp = x * (y * (18.0 * (t * z)));
elseif (t <= -9e-135)
tmp = t_2;
elseif (t <= -1.35e-180)
tmp = t_3;
elseif (t <= 1.4e+98)
tmp = t_2;
else
tmp = t_4;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e+16], t$95$4, If[LessEqual[t, -1.95e-56], t$95$3, If[LessEqual[t, -1.92e-90], N[(x * N[(y * N[(18.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -9e-135], t$95$2, If[LessEqual[t, -1.35e-180], t$95$3, If[LessEqual[t, 1.4e+98], t$95$2, t$95$4]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := b \cdot c - \left(4 \cdot \left(x \cdot i\right) + t_1\right)\\
t_3 := -4 \cdot \left(t \cdot a + x \cdot i\right) - t_1\\
t_4 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{+16}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;t \leq -1.95 \cdot 10^{-56}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -1.92 \cdot 10^{-90}:\\
\;\;\;\;x \cdot \left(y \cdot \left(18 \cdot \left(t \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-135}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.35 \cdot 10^{-180}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{+98}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_4\\
\end{array}
\end{array}
if t < -2.4e16 or 1.4e98 < t Initial program 84.6%
sub-neg84.6%
associate-+l-84.6%
sub-neg84.6%
sub-neg84.6%
distribute-rgt-out--87.5%
associate-*l*89.4%
distribute-lft-neg-in89.4%
cancel-sign-sub89.4%
associate-*l*89.4%
associate-*l*89.4%
Simplified89.4%
Taylor expanded in j around 0 83.0%
Taylor expanded in t around inf 70.9%
if -2.4e16 < t < -1.95e-56 or -8.99999999999999975e-135 < t < -1.35000000000000007e-180Initial program 96.0%
sub-neg96.0%
associate-+l-96.0%
sub-neg96.0%
sub-neg96.0%
distribute-rgt-out--96.0%
associate-*l*99.9%
distribute-lft-neg-in99.9%
cancel-sign-sub99.9%
associate-*l*99.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in y around 0 91.7%
*-un-lft-identity91.7%
fma-def91.7%
*-commutative91.7%
associate-*r*91.8%
Applied egg-rr91.8%
*-lft-identity91.8%
fma-udef91.8%
*-commutative91.8%
associate-*l*91.8%
*-commutative91.8%
fma-def91.8%
*-commutative91.8%
associate-*r*91.7%
*-commutative91.7%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in c around 0 91.7%
associate--r+91.7%
cancel-sign-sub-inv91.7%
metadata-eval91.7%
+-commutative91.7%
distribute-lft-out91.7%
Simplified91.7%
if -1.95e-56 < t < -1.92000000000000009e-90Initial program 63.3%
sub-neg63.3%
associate-+l-63.3%
sub-neg63.3%
sub-neg63.3%
distribute-rgt-out--63.3%
associate-*l*63.3%
distribute-lft-neg-in63.3%
cancel-sign-sub63.3%
associate-*l*63.3%
associate-*l*63.3%
Simplified63.3%
Taylor expanded in x around inf 79.4%
Taylor expanded in y around inf 79.6%
*-commutative79.6%
associate-*l*79.8%
*-commutative79.8%
Simplified79.8%
if -1.92000000000000009e-90 < t < -8.99999999999999975e-135 or -1.35000000000000007e-180 < t < 1.4e98Initial program 88.9%
sub-neg88.9%
associate-+l-88.9%
sub-neg88.9%
sub-neg88.9%
distribute-rgt-out--88.9%
associate-*l*87.3%
distribute-lft-neg-in87.3%
cancel-sign-sub87.3%
associate-*l*87.3%
associate-*l*87.3%
Simplified87.3%
Taylor expanded in t around 0 78.8%
Final simplification76.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (or (<= x -3.1e+70) (not (<= x 3e-55)))
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* 18.0 (* y (* t z))) (* i -4.0)))))
(- (+ (* b c) (* -4.0 (* t a))) (+ (* 4.0 (* x i)) (* 27.0 (* j k))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -3.1e+70) || !(x <= 3e-55)) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0))));
} else {
tmp = ((b * c) + (-4.0 * (t * a))) - ((4.0 * (x * i)) + (27.0 * (j * k)));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-3.1d+70)) .or. (.not. (x <= 3d-55))) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((18.0d0 * (y * (t * z))) + (i * (-4.0d0)))))
else
tmp = ((b * c) + ((-4.0d0) * (t * a))) - ((4.0d0 * (x * i)) + (27.0d0 * (j * k)))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -3.1e+70) || !(x <= 3e-55)) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0))));
} else {
tmp = ((b * c) + (-4.0 * (t * a))) - ((4.0 * (x * i)) + (27.0 * (j * k)));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -3.1e+70) or not (x <= 3e-55): tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0)))) else: tmp = ((b * c) + (-4.0 * (t * a))) - ((4.0 * (x * i)) + (27.0 * (j * k))) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -3.1e+70) || !(x <= 3e-55)) tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) + Float64(i * -4.0))))); else tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(j * k)))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -3.1e+70) || ~((x <= 3e-55)))
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0))));
else
tmp = ((b * c) + (-4.0 * (t * a))) - ((4.0 * (x * i)) + (27.0 * (j * k)));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -3.1e+70], N[Not[LessEqual[x, 3e-55]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+70} \lor \neg \left(x \leq 3 \cdot 10^{-55}\right):\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) + i \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(j \cdot k\right)\right)\\
\end{array}
\end{array}
if x < -3.1000000000000003e70 or 3.00000000000000016e-55 < x Initial program 81.2%
sub-neg81.2%
+-commutative81.2%
sub-neg81.2%
associate-+l+81.2%
associate-+r+81.2%
associate--l+81.2%
+-commutative81.2%
sub-neg81.2%
Simplified89.3%
Taylor expanded in a around 0 86.5%
if -3.1000000000000003e70 < x < 3.00000000000000016e-55Initial program 93.7%
sub-neg93.7%
associate-+l-93.7%
sub-neg93.7%
sub-neg93.7%
distribute-rgt-out--93.7%
associate-*l*91.4%
distribute-lft-neg-in91.4%
cancel-sign-sub91.4%
associate-*l*91.4%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in y around 0 88.1%
Final simplification87.3%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* b c) (* 4.0 (* x i))))
(t_2 (+ (* k (* j -27.0)) (* -4.0 (* x i))))
(t_3 (* t (- (* 18.0 (* y (* x z))) (* a 4.0)))))
(if (<= t -3.2e-91)
t_3
(if (<= t -1.28e-226)
t_2
(if (<= t 2.2e-178)
t_1
(if (<= t 6.5e-38)
t_2
(if (<= t 125000000.0) t_1 (if (<= t 2.15e+30) t_2 t_3))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (x * i));
double t_2 = (k * (j * -27.0)) + (-4.0 * (x * i));
double t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -3.2e-91) {
tmp = t_3;
} else if (t <= -1.28e-226) {
tmp = t_2;
} else if (t <= 2.2e-178) {
tmp = t_1;
} else if (t <= 6.5e-38) {
tmp = t_2;
} else if (t <= 125000000.0) {
tmp = t_1;
} else if (t <= 2.15e+30) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * (x * i))
t_2 = (k * (j * (-27.0d0))) + ((-4.0d0) * (x * i))
t_3 = t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0))
if (t <= (-3.2d-91)) then
tmp = t_3
else if (t <= (-1.28d-226)) then
tmp = t_2
else if (t <= 2.2d-178) then
tmp = t_1
else if (t <= 6.5d-38) then
tmp = t_2
else if (t <= 125000000.0d0) then
tmp = t_1
else if (t <= 2.15d+30) then
tmp = t_2
else
tmp = t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) - (4.0 * (x * i));
double t_2 = (k * (j * -27.0)) + (-4.0 * (x * i));
double t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
double tmp;
if (t <= -3.2e-91) {
tmp = t_3;
} else if (t <= -1.28e-226) {
tmp = t_2;
} else if (t <= 2.2e-178) {
tmp = t_1;
} else if (t <= 6.5e-38) {
tmp = t_2;
} else if (t <= 125000000.0) {
tmp = t_1;
} else if (t <= 2.15e+30) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) - (4.0 * (x * i)) t_2 = (k * (j * -27.0)) + (-4.0 * (x * i)) t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0)) tmp = 0 if t <= -3.2e-91: tmp = t_3 elif t <= -1.28e-226: tmp = t_2 elif t <= 2.2e-178: tmp = t_1 elif t <= 6.5e-38: tmp = t_2 elif t <= 125000000.0: tmp = t_1 elif t <= 2.15e+30: tmp = t_2 else: tmp = t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) t_2 = Float64(Float64(k * Float64(j * -27.0)) + Float64(-4.0 * Float64(x * i))) t_3 = Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -3.2e-91) tmp = t_3; elseif (t <= -1.28e-226) tmp = t_2; elseif (t <= 2.2e-178) tmp = t_1; elseif (t <= 6.5e-38) tmp = t_2; elseif (t <= 125000000.0) tmp = t_1; elseif (t <= 2.15e+30) tmp = t_2; else tmp = t_3; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) - (4.0 * (x * i));
t_2 = (k * (j * -27.0)) + (-4.0 * (x * i));
t_3 = t * ((18.0 * (y * (x * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -3.2e-91)
tmp = t_3;
elseif (t <= -1.28e-226)
tmp = t_2;
elseif (t <= 2.2e-178)
tmp = t_1;
elseif (t <= 6.5e-38)
tmp = t_2;
elseif (t <= 125000000.0)
tmp = t_1;
elseif (t <= 2.15e+30)
tmp = t_2;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.2e-91], t$95$3, If[LessEqual[t, -1.28e-226], t$95$2, If[LessEqual[t, 2.2e-178], t$95$1, If[LessEqual[t, 6.5e-38], t$95$2, If[LessEqual[t, 125000000.0], t$95$1, If[LessEqual[t, 2.15e+30], t$95$2, t$95$3]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
t_2 := k \cdot \left(j \cdot -27\right) + -4 \cdot \left(x \cdot i\right)\\
t_3 := t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -3.2 \cdot 10^{-91}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t \leq -1.28 \cdot 10^{-226}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-178}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{-38}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 125000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+30}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if t < -3.19999999999999996e-91 or 2.15e30 < t Initial program 85.8%
sub-neg85.8%
associate-+l-85.8%
sub-neg85.8%
sub-neg85.8%
distribute-rgt-out--87.9%
associate-*l*90.0%
distribute-lft-neg-in90.0%
cancel-sign-sub90.0%
associate-*l*90.0%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in j around 0 79.2%
Taylor expanded in t around inf 64.8%
if -3.19999999999999996e-91 < t < -1.28000000000000004e-226 or 2.2000000000000001e-178 < t < 6.49999999999999949e-38 or 1.25e8 < t < 2.15e30Initial program 87.4%
sub-neg87.4%
*-commutative87.4%
distribute-rgt-neg-in87.4%
Simplified88.8%
fma-udef87.2%
Applied egg-rr87.2%
Taylor expanded in i around inf 69.2%
if -1.28000000000000004e-226 < t < 2.2000000000000001e-178 or 6.49999999999999949e-38 < t < 1.25e8Initial program 91.0%
sub-neg91.0%
associate-+l-91.0%
sub-neg91.0%
sub-neg91.0%
distribute-rgt-out--91.0%
associate-*l*87.5%
distribute-lft-neg-in87.5%
cancel-sign-sub87.5%
associate-*l*87.5%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in j around 0 70.6%
Taylor expanded in t around 0 68.3%
Final simplification66.6%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* b c) (* -4.0 (* t a))))
(t_2 (* x (- (* 18.0 (* y (* t z))) (* i 4.0))))
(t_3 (* k (* j -27.0)))
(t_4 (+ t_3 (* b c))))
(if (<= x -3.5e+71)
t_2
(if (<= x -2.15e-182)
t_4
(if (<= x -1.95e-272)
t_1
(if (<= x 1.8e-278)
t_4
(if (<= x 1.16e-77)
t_1
(if (<= x 4.6e+33) (+ t_3 (* -4.0 (* x i))) t_2))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (-4.0 * (t * a));
double t_2 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double t_3 = k * (j * -27.0);
double t_4 = t_3 + (b * c);
double tmp;
if (x <= -3.5e+71) {
tmp = t_2;
} else if (x <= -2.15e-182) {
tmp = t_4;
} else if (x <= -1.95e-272) {
tmp = t_1;
} else if (x <= 1.8e-278) {
tmp = t_4;
} else if (x <= 1.16e-77) {
tmp = t_1;
} else if (x <= 4.6e+33) {
tmp = t_3 + (-4.0 * (x * i));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = (b * c) + ((-4.0d0) * (t * a))
t_2 = x * ((18.0d0 * (y * (t * z))) - (i * 4.0d0))
t_3 = k * (j * (-27.0d0))
t_4 = t_3 + (b * c)
if (x <= (-3.5d+71)) then
tmp = t_2
else if (x <= (-2.15d-182)) then
tmp = t_4
else if (x <= (-1.95d-272)) then
tmp = t_1
else if (x <= 1.8d-278) then
tmp = t_4
else if (x <= 1.16d-77) then
tmp = t_1
else if (x <= 4.6d+33) then
tmp = t_3 + ((-4.0d0) * (x * i))
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (-4.0 * (t * a));
double t_2 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double t_3 = k * (j * -27.0);
double t_4 = t_3 + (b * c);
double tmp;
if (x <= -3.5e+71) {
tmp = t_2;
} else if (x <= -2.15e-182) {
tmp = t_4;
} else if (x <= -1.95e-272) {
tmp = t_1;
} else if (x <= 1.8e-278) {
tmp = t_4;
} else if (x <= 1.16e-77) {
tmp = t_1;
} else if (x <= 4.6e+33) {
tmp = t_3 + (-4.0 * (x * i));
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (-4.0 * (t * a)) t_2 = x * ((18.0 * (y * (t * z))) - (i * 4.0)) t_3 = k * (j * -27.0) t_4 = t_3 + (b * c) tmp = 0 if x <= -3.5e+71: tmp = t_2 elif x <= -2.15e-182: tmp = t_4 elif x <= -1.95e-272: tmp = t_1 elif x <= 1.8e-278: tmp = t_4 elif x <= 1.16e-77: tmp = t_1 elif x <= 4.6e+33: tmp = t_3 + (-4.0 * (x * i)) else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) t_2 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0))) t_3 = Float64(k * Float64(j * -27.0)) t_4 = Float64(t_3 + Float64(b * c)) tmp = 0.0 if (x <= -3.5e+71) tmp = t_2; elseif (x <= -2.15e-182) tmp = t_4; elseif (x <= -1.95e-272) tmp = t_1; elseif (x <= 1.8e-278) tmp = t_4; elseif (x <= 1.16e-77) tmp = t_1; elseif (x <= 4.6e+33) tmp = Float64(t_3 + Float64(-4.0 * Float64(x * i))); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (-4.0 * (t * a));
t_2 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
t_3 = k * (j * -27.0);
t_4 = t_3 + (b * c);
tmp = 0.0;
if (x <= -3.5e+71)
tmp = t_2;
elseif (x <= -2.15e-182)
tmp = t_4;
elseif (x <= -1.95e-272)
tmp = t_1;
elseif (x <= 1.8e-278)
tmp = t_4;
elseif (x <= 1.16e-77)
tmp = t_1;
elseif (x <= 4.6e+33)
tmp = t_3 + (-4.0 * (x * i));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.5e+71], t$95$2, If[LessEqual[x, -2.15e-182], t$95$4, If[LessEqual[x, -1.95e-272], t$95$1, If[LessEqual[x, 1.8e-278], t$95$4, If[LessEqual[x, 1.16e-77], t$95$1, If[LessEqual[x, 4.6e+33], N[(t$95$3 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + -4 \cdot \left(t \cdot a\right)\\
t_2 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\
t_3 := k \cdot \left(j \cdot -27\right)\\
t_4 := t_3 + b \cdot c\\
\mathbf{if}\;x \leq -3.5 \cdot 10^{+71}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -2.15 \cdot 10^{-182}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq -1.95 \cdot 10^{-272}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-278}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{-77}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+33}:\\
\;\;\;\;t_3 + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -3.4999999999999999e71 or 4.60000000000000021e33 < x Initial program 78.8%
sub-neg78.8%
associate-+l-78.8%
sub-neg78.8%
sub-neg78.8%
distribute-rgt-out--81.6%
associate-*l*85.1%
distribute-lft-neg-in85.1%
cancel-sign-sub85.1%
associate-*l*85.1%
associate-*l*85.1%
Simplified85.1%
Taylor expanded in x around inf 80.4%
if -3.4999999999999999e71 < x < -2.15e-182 or -1.9499999999999999e-272 < x < 1.79999999999999998e-278Initial program 91.8%
sub-neg91.8%
*-commutative91.8%
distribute-rgt-neg-in91.8%
Simplified90.3%
fma-udef90.2%
Applied egg-rr90.2%
Taylor expanded in b around inf 61.7%
if -2.15e-182 < x < -1.9499999999999999e-272 or 1.79999999999999998e-278 < x < 1.16e-77Initial program 95.2%
sub-neg95.2%
associate-+l-95.2%
sub-neg95.2%
sub-neg95.2%
distribute-rgt-out--95.2%
associate-*l*93.8%
distribute-lft-neg-in93.8%
cancel-sign-sub93.8%
associate-*l*93.8%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around 0 89.9%
Taylor expanded in i around inf 72.6%
*-commutative72.6%
*-commutative72.6%
associate-*l*72.6%
Simplified72.6%
Taylor expanded in x around 0 71.0%
if 1.16e-77 < x < 4.60000000000000021e33Initial program 92.9%
sub-neg92.9%
*-commutative92.9%
distribute-rgt-neg-in92.9%
Simplified92.8%
fma-udef92.8%
Applied egg-rr92.8%
Taylor expanded in i around inf 57.3%
Final simplification71.3%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 4.0 (* x i)))
(t_2 (* 27.0 (* j k)))
(t_3 (* x (- (* 18.0 (* y (* t z))) (* i 4.0)))))
(if (<= x -5.7e+116)
t_3
(if (<= x 1.9e+41)
(- (+ (* b c) (* -4.0 (* t a))) (+ t_1 t_2))
(if (<= x 4.6e+116)
(- (+ (* b c) (* 18.0 (* (* t y) (* x z)))) t_1)
(if (<= x 1e+189) (- (* -4.0 (+ (* t a) (* x i))) t_2) t_3))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = 27.0 * (j * k);
double t_3 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double tmp;
if (x <= -5.7e+116) {
tmp = t_3;
} else if (x <= 1.9e+41) {
tmp = ((b * c) + (-4.0 * (t * a))) - (t_1 + t_2);
} else if (x <= 4.6e+116) {
tmp = ((b * c) + (18.0 * ((t * y) * (x * z)))) - t_1;
} else if (x <= 1e+189) {
tmp = (-4.0 * ((t * a) + (x * i))) - t_2;
} else {
tmp = t_3;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = 4.0d0 * (x * i)
t_2 = 27.0d0 * (j * k)
t_3 = x * ((18.0d0 * (y * (t * z))) - (i * 4.0d0))
if (x <= (-5.7d+116)) then
tmp = t_3
else if (x <= 1.9d+41) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (t_1 + t_2)
else if (x <= 4.6d+116) then
tmp = ((b * c) + (18.0d0 * ((t * y) * (x * z)))) - t_1
else if (x <= 1d+189) then
tmp = ((-4.0d0) * ((t * a) + (x * i))) - t_2
else
tmp = t_3
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = 27.0 * (j * k);
double t_3 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double tmp;
if (x <= -5.7e+116) {
tmp = t_3;
} else if (x <= 1.9e+41) {
tmp = ((b * c) + (-4.0 * (t * a))) - (t_1 + t_2);
} else if (x <= 4.6e+116) {
tmp = ((b * c) + (18.0 * ((t * y) * (x * z)))) - t_1;
} else if (x <= 1e+189) {
tmp = (-4.0 * ((t * a) + (x * i))) - t_2;
} else {
tmp = t_3;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 4.0 * (x * i) t_2 = 27.0 * (j * k) t_3 = x * ((18.0 * (y * (t * z))) - (i * 4.0)) tmp = 0 if x <= -5.7e+116: tmp = t_3 elif x <= 1.9e+41: tmp = ((b * c) + (-4.0 * (t * a))) - (t_1 + t_2) elif x <= 4.6e+116: tmp = ((b * c) + (18.0 * ((t * y) * (x * z)))) - t_1 elif x <= 1e+189: tmp = (-4.0 * ((t * a) + (x * i))) - t_2 else: tmp = t_3 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(4.0 * Float64(x * i)) t_2 = Float64(27.0 * Float64(j * k)) t_3 = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0))) tmp = 0.0 if (x <= -5.7e+116) tmp = t_3; elseif (x <= 1.9e+41) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(t_1 + t_2)); elseif (x <= 4.6e+116) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(Float64(t * y) * Float64(x * z)))) - t_1); elseif (x <= 1e+189) tmp = Float64(Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) - t_2); else tmp = t_3; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 4.0 * (x * i);
t_2 = 27.0 * (j * k);
t_3 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
tmp = 0.0;
if (x <= -5.7e+116)
tmp = t_3;
elseif (x <= 1.9e+41)
tmp = ((b * c) + (-4.0 * (t * a))) - (t_1 + t_2);
elseif (x <= 4.6e+116)
tmp = ((b * c) + (18.0 * ((t * y) * (x * z)))) - t_1;
elseif (x <= 1e+189)
tmp = (-4.0 * ((t * a) + (x * i))) - t_2;
else
tmp = t_3;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.7e+116], t$95$3, If[LessEqual[x, 1.9e+41], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.6e+116], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(N[(t * y), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 1e+189], N[(N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(x \cdot i\right)\\
t_2 := 27 \cdot \left(j \cdot k\right)\\
t_3 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\
\mathbf{if}\;x \leq -5.7 \cdot 10^{+116}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{+41}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - \left(t_1 + t_2\right)\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+116}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(\left(t \cdot y\right) \cdot \left(x \cdot z\right)\right)\right) - t_1\\
\mathbf{elif}\;x \leq 10^{+189}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right) - t_2\\
\mathbf{else}:\\
\;\;\;\;t_3\\
\end{array}
\end{array}
if x < -5.69999999999999983e116 or 1e189 < x Initial program 76.9%
sub-neg76.9%
associate-+l-76.9%
sub-neg76.9%
sub-neg76.9%
distribute-rgt-out--80.0%
associate-*l*82.9%
distribute-lft-neg-in82.9%
cancel-sign-sub82.9%
associate-*l*82.9%
associate-*l*82.9%
Simplified82.9%
Taylor expanded in x around inf 85.7%
if -5.69999999999999983e116 < x < 1.9000000000000001e41Initial program 92.7%
sub-neg92.7%
associate-+l-92.7%
sub-neg92.7%
sub-neg92.7%
distribute-rgt-out--92.7%
associate-*l*91.6%
distribute-lft-neg-in91.6%
cancel-sign-sub91.6%
associate-*l*91.6%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in y around 0 85.6%
if 1.9000000000000001e41 < x < 4.5999999999999999e116Initial program 81.3%
sub-neg81.3%
associate-+l-81.3%
sub-neg81.3%
sub-neg81.3%
distribute-rgt-out--87.5%
associate-*l*87.4%
distribute-lft-neg-in87.4%
cancel-sign-sub87.4%
associate-*l*87.4%
associate-*l*87.4%
Simplified87.4%
Taylor expanded in j around 0 93.8%
pow193.8%
*-commutative93.8%
Applied egg-rr93.8%
unpow193.8%
*-commutative93.8%
associate-*l*93.7%
*-commutative93.7%
Simplified93.7%
Taylor expanded in x around inf 100.0%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
if 4.5999999999999999e116 < x < 1e189Initial program 77.6%
sub-neg77.6%
associate-+l-77.6%
sub-neg77.6%
sub-neg77.6%
distribute-rgt-out--77.6%
associate-*l*84.6%
distribute-lft-neg-in84.6%
cancel-sign-sub84.6%
associate-*l*84.6%
associate-*l*84.5%
Simplified84.5%
Taylor expanded in y around 0 73.0%
*-un-lft-identity73.0%
fma-def73.0%
*-commutative73.0%
associate-*r*72.9%
Applied egg-rr72.9%
*-lft-identity72.9%
fma-udef72.9%
*-commutative72.9%
associate-*l*72.9%
*-commutative72.9%
fma-def72.9%
*-commutative72.9%
associate-*r*73.0%
*-commutative73.0%
associate-*l*73.0%
Simplified73.0%
Taylor expanded in c around 0 80.7%
associate--r+80.7%
cancel-sign-sub-inv80.7%
metadata-eval80.7%
+-commutative80.7%
distribute-lft-out80.7%
Simplified80.7%
Final simplification86.3%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* t a) (* x i))))
(t_2 (* k (* j -27.0)))
(t_3 (+ t_2 (* b c))))
(if (<= k -2.95e-27)
t_3
(if (<= k 8.5e-122)
(+ (* b c) (* -4.0 (* t a)))
(if (<= k 2.65e+70)
t_1
(if (<= k 8.5e+179)
t_3
(if (<= k 3.5e+195) t_1 (+ t_2 (* -4.0 (* x i))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double t_2 = k * (j * -27.0);
double t_3 = t_2 + (b * c);
double tmp;
if (k <= -2.95e-27) {
tmp = t_3;
} else if (k <= 8.5e-122) {
tmp = (b * c) + (-4.0 * (t * a));
} else if (k <= 2.65e+70) {
tmp = t_1;
} else if (k <= 8.5e+179) {
tmp = t_3;
} else if (k <= 3.5e+195) {
tmp = t_1;
} else {
tmp = t_2 + (-4.0 * (x * i));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (-4.0d0) * ((t * a) + (x * i))
t_2 = k * (j * (-27.0d0))
t_3 = t_2 + (b * c)
if (k <= (-2.95d-27)) then
tmp = t_3
else if (k <= 8.5d-122) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if (k <= 2.65d+70) then
tmp = t_1
else if (k <= 8.5d+179) then
tmp = t_3
else if (k <= 3.5d+195) then
tmp = t_1
else
tmp = t_2 + ((-4.0d0) * (x * i))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double t_2 = k * (j * -27.0);
double t_3 = t_2 + (b * c);
double tmp;
if (k <= -2.95e-27) {
tmp = t_3;
} else if (k <= 8.5e-122) {
tmp = (b * c) + (-4.0 * (t * a));
} else if (k <= 2.65e+70) {
tmp = t_1;
} else if (k <= 8.5e+179) {
tmp = t_3;
} else if (k <= 3.5e+195) {
tmp = t_1;
} else {
tmp = t_2 + (-4.0 * (x * i));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((t * a) + (x * i)) t_2 = k * (j * -27.0) t_3 = t_2 + (b * c) tmp = 0 if k <= -2.95e-27: tmp = t_3 elif k <= 8.5e-122: tmp = (b * c) + (-4.0 * (t * a)) elif k <= 2.65e+70: tmp = t_1 elif k <= 8.5e+179: tmp = t_3 elif k <= 3.5e+195: tmp = t_1 else: tmp = t_2 + (-4.0 * (x * i)) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) t_2 = Float64(k * Float64(j * -27.0)) t_3 = Float64(t_2 + Float64(b * c)) tmp = 0.0 if (k <= -2.95e-27) tmp = t_3; elseif (k <= 8.5e-122) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif (k <= 2.65e+70) tmp = t_1; elseif (k <= 8.5e+179) tmp = t_3; elseif (k <= 3.5e+195) tmp = t_1; else tmp = Float64(t_2 + Float64(-4.0 * Float64(x * i))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((t * a) + (x * i));
t_2 = k * (j * -27.0);
t_3 = t_2 + (b * c);
tmp = 0.0;
if (k <= -2.95e-27)
tmp = t_3;
elseif (k <= 8.5e-122)
tmp = (b * c) + (-4.0 * (t * a));
elseif (k <= 2.65e+70)
tmp = t_1;
elseif (k <= 8.5e+179)
tmp = t_3;
elseif (k <= 3.5e+195)
tmp = t_1;
else
tmp = t_2 + (-4.0 * (x * i));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -2.95e-27], t$95$3, If[LessEqual[k, 8.5e-122], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.65e+70], t$95$1, If[LessEqual[k, 8.5e+179], t$95$3, If[LessEqual[k, 3.5e+195], t$95$1, N[(t$95$2 + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
t_2 := k \cdot \left(j \cdot -27\right)\\
t_3 := t_2 + b \cdot c\\
\mathbf{if}\;k \leq -2.95 \cdot 10^{-27}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;k \leq 8.5 \cdot 10^{-122}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;k \leq 2.65 \cdot 10^{+70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 8.5 \cdot 10^{+179}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;k \leq 3.5 \cdot 10^{+195}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2 + -4 \cdot \left(x \cdot i\right)\\
\end{array}
\end{array}
if k < -2.9499999999999999e-27 or 2.65e70 < k < 8.49999999999999962e179Initial program 86.0%
sub-neg86.0%
*-commutative86.0%
distribute-rgt-neg-in86.0%
Simplified87.0%
fma-udef87.0%
Applied egg-rr87.0%
Taylor expanded in b around inf 55.0%
if -2.9499999999999999e-27 < k < 8.50000000000000003e-122Initial program 85.7%
sub-neg85.7%
associate-+l-85.7%
sub-neg85.7%
sub-neg85.7%
distribute-rgt-out--86.7%
associate-*l*86.6%
distribute-lft-neg-in86.6%
cancel-sign-sub86.6%
associate-*l*86.6%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in y around 0 69.7%
Taylor expanded in i around inf 67.9%
*-commutative67.9%
*-commutative67.9%
associate-*l*67.9%
Simplified67.9%
Taylor expanded in x around 0 51.1%
if 8.50000000000000003e-122 < k < 2.65e70 or 8.49999999999999962e179 < k < 3.5000000000000002e195Initial program 90.5%
sub-neg90.5%
associate-+l-90.5%
sub-neg90.5%
sub-neg90.5%
distribute-rgt-out--90.5%
associate-*l*92.8%
distribute-lft-neg-in92.8%
cancel-sign-sub92.8%
associate-*l*92.8%
associate-*l*92.9%
Simplified92.9%
Taylor expanded in y around 0 72.8%
Taylor expanded in i around inf 58.9%
*-commutative58.9%
*-commutative58.9%
associate-*l*58.9%
Simplified58.9%
Taylor expanded in c around 0 50.8%
cancel-sign-sub-inv50.8%
metadata-eval50.8%
+-commutative50.8%
distribute-lft-out50.8%
Simplified50.8%
if 3.5000000000000002e195 < k Initial program 94.9%
sub-neg94.9%
*-commutative94.9%
distribute-rgt-neg-in94.9%
Simplified99.9%
fma-udef99.9%
Applied egg-rr99.9%
Taylor expanded in i around inf 85.7%
Final simplification55.2%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* k (* j -27.0)) (* b c))))
(if (<= k -6.5e-27)
t_1
(if (<= k 2.6e-121)
(+ (* b c) (* -4.0 (* t a)))
(if (or (<= k 1.06e+71) (and (not (<= k 6e+177)) (<= k 1.35e+197)))
(* -4.0 (+ (* t a) (* x i)))
t_1)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * (j * -27.0)) + (b * c);
double tmp;
if (k <= -6.5e-27) {
tmp = t_1;
} else if (k <= 2.6e-121) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((k <= 1.06e+71) || (!(k <= 6e+177) && (k <= 1.35e+197))) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k * (j * (-27.0d0))) + (b * c)
if (k <= (-6.5d-27)) then
tmp = t_1
else if (k <= 2.6d-121) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if ((k <= 1.06d+71) .or. (.not. (k <= 6d+177)) .and. (k <= 1.35d+197)) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else
tmp = t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * (j * -27.0)) + (b * c);
double tmp;
if (k <= -6.5e-27) {
tmp = t_1;
} else if (k <= 2.6e-121) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((k <= 1.06e+71) || (!(k <= 6e+177) && (k <= 1.35e+197))) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (k * (j * -27.0)) + (b * c) tmp = 0 if k <= -6.5e-27: tmp = t_1 elif k <= 2.6e-121: tmp = (b * c) + (-4.0 * (t * a)) elif (k <= 1.06e+71) or (not (k <= 6e+177) and (k <= 1.35e+197)): tmp = -4.0 * ((t * a) + (x * i)) else: tmp = t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(k * Float64(j * -27.0)) + Float64(b * c)) tmp = 0.0 if (k <= -6.5e-27) tmp = t_1; elseif (k <= 2.6e-121) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif ((k <= 1.06e+71) || (!(k <= 6e+177) && (k <= 1.35e+197))) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); else tmp = t_1; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (k * (j * -27.0)) + (b * c);
tmp = 0.0;
if (k <= -6.5e-27)
tmp = t_1;
elseif (k <= 2.6e-121)
tmp = (b * c) + (-4.0 * (t * a));
elseif ((k <= 1.06e+71) || (~((k <= 6e+177)) && (k <= 1.35e+197)))
tmp = -4.0 * ((t * a) + (x * i));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -6.5e-27], t$95$1, If[LessEqual[k, 2.6e-121], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[k, 1.06e+71], And[N[Not[LessEqual[k, 6e+177]], $MachinePrecision], LessEqual[k, 1.35e+197]]], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot -27\right) + b \cdot c\\
\mathbf{if}\;k \leq -6.5 \cdot 10^{-27}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 2.6 \cdot 10^{-121}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;k \leq 1.06 \cdot 10^{+71} \lor \neg \left(k \leq 6 \cdot 10^{+177}\right) \land k \leq 1.35 \cdot 10^{+197}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if k < -6.50000000000000025e-27 or 1.06e71 < k < 6e177 or 1.35e197 < k Initial program 87.4%
sub-neg87.4%
*-commutative87.4%
distribute-rgt-neg-in87.4%
Simplified89.0%
fma-udef89.0%
Applied egg-rr89.0%
Taylor expanded in b around inf 60.5%
if -6.50000000000000025e-27 < k < 2.59999999999999986e-121Initial program 85.7%
sub-neg85.7%
associate-+l-85.7%
sub-neg85.7%
sub-neg85.7%
distribute-rgt-out--86.7%
associate-*l*86.6%
distribute-lft-neg-in86.6%
cancel-sign-sub86.6%
associate-*l*86.6%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in y around 0 69.7%
Taylor expanded in i around inf 67.9%
*-commutative67.9%
*-commutative67.9%
associate-*l*67.9%
Simplified67.9%
Taylor expanded in x around 0 51.1%
if 2.59999999999999986e-121 < k < 1.06e71 or 6e177 < k < 1.35e197Initial program 90.7%
sub-neg90.7%
associate-+l-90.7%
sub-neg90.7%
sub-neg90.7%
distribute-rgt-out--90.7%
associate-*l*93.0%
distribute-lft-neg-in93.0%
cancel-sign-sub93.0%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in y around 0 73.5%
Taylor expanded in i around inf 59.8%
*-commutative59.8%
*-commutative59.8%
associate-*l*59.8%
Simplified59.8%
Taylor expanded in c around 0 52.0%
cancel-sign-sub-inv52.0%
metadata-eval52.0%
+-commutative52.0%
distribute-lft-out52.0%
Simplified52.0%
Final simplification55.6%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* b c) (* -4.0 (* t a)))) (t_2 (* x (* (* t z) (* 18.0 y)))))
(if (<= x -1.7e+71)
t_2
(if (<= x -3.5e-278)
t_1
(if (<= x 1.6e-281)
(* k (* j -27.0))
(if (<= x 6.5e-84)
t_1
(if (<= x 3.3e+212) (* -4.0 (+ (* t a) (* x i))) t_2)))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (-4.0 * (t * a));
double t_2 = x * ((t * z) * (18.0 * y));
double tmp;
if (x <= -1.7e+71) {
tmp = t_2;
} else if (x <= -3.5e-278) {
tmp = t_1;
} else if (x <= 1.6e-281) {
tmp = k * (j * -27.0);
} else if (x <= 6.5e-84) {
tmp = t_1;
} else if (x <= 3.3e+212) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b * c) + ((-4.0d0) * (t * a))
t_2 = x * ((t * z) * (18.0d0 * y))
if (x <= (-1.7d+71)) then
tmp = t_2
else if (x <= (-3.5d-278)) then
tmp = t_1
else if (x <= 1.6d-281) then
tmp = k * (j * (-27.0d0))
else if (x <= 6.5d-84) then
tmp = t_1
else if (x <= 3.3d+212) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + (-4.0 * (t * a));
double t_2 = x * ((t * z) * (18.0 * y));
double tmp;
if (x <= -1.7e+71) {
tmp = t_2;
} else if (x <= -3.5e-278) {
tmp = t_1;
} else if (x <= 1.6e-281) {
tmp = k * (j * -27.0);
} else if (x <= 6.5e-84) {
tmp = t_1;
} else if (x <= 3.3e+212) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + (-4.0 * (t * a)) t_2 = x * ((t * z) * (18.0 * y)) tmp = 0 if x <= -1.7e+71: tmp = t_2 elif x <= -3.5e-278: tmp = t_1 elif x <= 1.6e-281: tmp = k * (j * -27.0) elif x <= 6.5e-84: tmp = t_1 elif x <= 3.3e+212: tmp = -4.0 * ((t * a) + (x * i)) else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) t_2 = Float64(x * Float64(Float64(t * z) * Float64(18.0 * y))) tmp = 0.0 if (x <= -1.7e+71) tmp = t_2; elseif (x <= -3.5e-278) tmp = t_1; elseif (x <= 1.6e-281) tmp = Float64(k * Float64(j * -27.0)); elseif (x <= 6.5e-84) tmp = t_1; elseif (x <= 3.3e+212) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + (-4.0 * (t * a));
t_2 = x * ((t * z) * (18.0 * y));
tmp = 0.0;
if (x <= -1.7e+71)
tmp = t_2;
elseif (x <= -3.5e-278)
tmp = t_1;
elseif (x <= 1.6e-281)
tmp = k * (j * -27.0);
elseif (x <= 6.5e-84)
tmp = t_1;
elseif (x <= 3.3e+212)
tmp = -4.0 * ((t * a) + (x * i));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(t * z), $MachinePrecision] * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.7e+71], t$95$2, If[LessEqual[x, -3.5e-278], t$95$1, If[LessEqual[x, 1.6e-281], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.5e-84], t$95$1, If[LessEqual[x, 3.3e+212], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + -4 \cdot \left(t \cdot a\right)\\
t_2 := x \cdot \left(\left(t \cdot z\right) \cdot \left(18 \cdot y\right)\right)\\
\mathbf{if}\;x \leq -1.7 \cdot 10^{+71}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-278}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-281}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;x \leq 6.5 \cdot 10^{-84}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+212}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if x < -1.6999999999999999e71 or 3.3e212 < x Initial program 76.4%
sub-neg76.4%
associate-+l-76.4%
sub-neg76.4%
sub-neg76.4%
distribute-rgt-out--79.2%
associate-*l*83.2%
distribute-lft-neg-in83.2%
cancel-sign-sub83.2%
associate-*l*83.2%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in x around inf 81.5%
Taylor expanded in y around inf 58.8%
associate-*r*58.8%
*-commutative58.8%
Simplified58.8%
if -1.6999999999999999e71 < x < -3.4999999999999997e-278 or 1.6e-281 < x < 6.50000000000000022e-84Initial program 93.6%
sub-neg93.6%
associate-+l-93.6%
sub-neg93.6%
sub-neg93.6%
distribute-rgt-out--93.6%
associate-*l*91.8%
distribute-lft-neg-in91.8%
cancel-sign-sub91.8%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around 0 87.0%
Taylor expanded in i around inf 63.8%
*-commutative63.8%
*-commutative63.8%
associate-*l*63.8%
Simplified63.8%
Taylor expanded in x around 0 58.3%
if -3.4999999999999997e-278 < x < 1.6e-281Initial program 92.6%
sub-neg92.6%
associate-+l-92.6%
sub-neg92.6%
sub-neg92.6%
distribute-rgt-out--92.6%
associate-*l*85.8%
distribute-lft-neg-in85.8%
cancel-sign-sub85.8%
associate-*l*85.8%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in y around 0 92.6%
*-un-lft-identity92.6%
fma-def92.6%
*-commutative92.6%
associate-*r*92.9%
Applied egg-rr92.9%
*-lft-identity92.9%
fma-udef92.9%
*-commutative92.9%
associate-*l*92.9%
*-commutative92.9%
fma-def92.9%
*-commutative92.9%
associate-*r*92.6%
*-commutative92.6%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in k around inf 65.2%
*-commutative65.2%
associate-*r*65.2%
Simplified65.2%
if 6.50000000000000022e-84 < x < 3.3e212Initial program 87.8%
sub-neg87.8%
associate-+l-87.8%
sub-neg87.8%
sub-neg87.8%
distribute-rgt-out--89.4%
associate-*l*90.7%
distribute-lft-neg-in90.7%
cancel-sign-sub90.7%
associate-*l*90.7%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in y around 0 71.2%
Taylor expanded in i around inf 56.7%
*-commutative56.7%
*-commutative56.7%
associate-*l*56.7%
Simplified56.7%
Taylor expanded in c around 0 46.2%
cancel-sign-sub-inv46.2%
metadata-eval46.2%
+-commutative46.2%
distribute-lft-out46.2%
Simplified46.2%
Final simplification55.8%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -1.85e+83) (not (<= x 3.5e+36))) (* x (- (* 18.0 (* y (* t z))) (* i 4.0))) (- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -1.85e+83) || !(x <= 3.5e+36)) {
tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0));
} else {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-1.85d+83)) .or. (.not. (x <= 3.5d+36))) then
tmp = x * ((18.0d0 * (y * (t * z))) - (i * 4.0d0))
else
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -1.85e+83) || !(x <= 3.5e+36)) {
tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0));
} else {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -1.85e+83) or not (x <= 3.5e+36): tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0)) else: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -1.85e+83) || !(x <= 3.5e+36)) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0))); else tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -1.85e+83) || ~((x <= 3.5e+36)))
tmp = x * ((18.0 * (y * (t * z))) - (i * 4.0));
else
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -1.85e+83], N[Not[LessEqual[x, 3.5e+36]], $MachinePrecision]], N[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{+83} \lor \neg \left(x \leq 3.5 \cdot 10^{+36}\right):\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if x < -1.8500000000000001e83 or 3.4999999999999998e36 < x Initial program 77.5%
sub-neg77.5%
associate-+l-77.5%
sub-neg77.5%
sub-neg77.5%
distribute-rgt-out--80.5%
associate-*l*84.2%
distribute-lft-neg-in84.2%
cancel-sign-sub84.2%
associate-*l*84.2%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in x around inf 82.2%
if -1.8500000000000001e83 < x < 3.4999999999999998e36Initial program 93.6%
sub-neg93.6%
associate-+l-93.6%
sub-neg93.6%
sub-neg93.6%
distribute-rgt-out--93.6%
associate-*l*91.8%
distribute-lft-neg-in91.8%
cancel-sign-sub91.8%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in x around 0 77.0%
Final simplification79.0%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= j -1.2e+193) (not (<= j 1.96e-29))) (* k (* j -27.0)) (* -4.0 (+ (* t a) (* x i)))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((j <= -1.2e+193) || !(j <= 1.96e-29)) {
tmp = k * (j * -27.0);
} else {
tmp = -4.0 * ((t * a) + (x * i));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((j <= (-1.2d+193)) .or. (.not. (j <= 1.96d-29))) then
tmp = k * (j * (-27.0d0))
else
tmp = (-4.0d0) * ((t * a) + (x * i))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((j <= -1.2e+193) || !(j <= 1.96e-29)) {
tmp = k * (j * -27.0);
} else {
tmp = -4.0 * ((t * a) + (x * i));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (j <= -1.2e+193) or not (j <= 1.96e-29): tmp = k * (j * -27.0) else: tmp = -4.0 * ((t * a) + (x * i)) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((j <= -1.2e+193) || !(j <= 1.96e-29)) tmp = Float64(k * Float64(j * -27.0)); else tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((j <= -1.2e+193) || ~((j <= 1.96e-29)))
tmp = k * (j * -27.0);
else
tmp = -4.0 * ((t * a) + (x * i));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[j, -1.2e+193], N[Not[LessEqual[j, 1.96e-29]], $MachinePrecision]], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.2 \cdot 10^{+193} \lor \neg \left(j \leq 1.96 \cdot 10^{-29}\right):\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\end{array}
\end{array}
if j < -1.2e193 or 1.95999999999999988e-29 < j Initial program 81.0%
sub-neg81.0%
associate-+l-81.0%
sub-neg81.0%
sub-neg81.0%
distribute-rgt-out--84.2%
associate-*l*84.3%
distribute-lft-neg-in84.3%
cancel-sign-sub84.3%
associate-*l*84.3%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in y around 0 74.6%
*-un-lft-identity74.6%
fma-def74.6%
*-commutative74.6%
associate-*r*74.6%
Applied egg-rr74.6%
*-lft-identity74.6%
fma-udef74.6%
*-commutative74.6%
associate-*l*74.6%
*-commutative74.6%
fma-def75.7%
*-commutative75.7%
associate-*r*75.6%
*-commutative75.6%
associate-*l*75.7%
Simplified75.7%
Taylor expanded in k around inf 40.1%
*-commutative40.1%
associate-*r*40.2%
Simplified40.2%
if -1.2e193 < j < 1.95999999999999988e-29Initial program 90.9%
sub-neg90.9%
associate-+l-90.9%
sub-neg90.9%
sub-neg90.9%
distribute-rgt-out--90.9%
associate-*l*91.4%
distribute-lft-neg-in91.4%
cancel-sign-sub91.4%
associate-*l*91.4%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in y around 0 72.5%
Taylor expanded in i around inf 59.3%
*-commutative59.3%
*-commutative59.3%
associate-*l*59.3%
Simplified59.3%
Taylor expanded in c around 0 39.7%
cancel-sign-sub-inv39.7%
metadata-eval39.7%
+-commutative39.7%
distribute-lft-out39.7%
Simplified39.7%
Final simplification39.8%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= z -28000.0) (not (<= z 3.65e+227))) (* x (* 18.0 (* y (* t z)))) (* -4.0 (+ (* t a) (* x i)))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((z <= -28000.0) || !(z <= 3.65e+227)) {
tmp = x * (18.0 * (y * (t * z)));
} else {
tmp = -4.0 * ((t * a) + (x * i));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((z <= (-28000.0d0)) .or. (.not. (z <= 3.65d+227))) then
tmp = x * (18.0d0 * (y * (t * z)))
else
tmp = (-4.0d0) * ((t * a) + (x * i))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((z <= -28000.0) || !(z <= 3.65e+227)) {
tmp = x * (18.0 * (y * (t * z)));
} else {
tmp = -4.0 * ((t * a) + (x * i));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (z <= -28000.0) or not (z <= 3.65e+227): tmp = x * (18.0 * (y * (t * z))) else: tmp = -4.0 * ((t * a) + (x * i)) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((z <= -28000.0) || !(z <= 3.65e+227)) tmp = Float64(x * Float64(18.0 * Float64(y * Float64(t * z)))); else tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((z <= -28000.0) || ~((z <= 3.65e+227)))
tmp = x * (18.0 * (y * (t * z)));
else
tmp = -4.0 * ((t * a) + (x * i));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[z, -28000.0], N[Not[LessEqual[z, 3.65e+227]], $MachinePrecision]], N[(x * N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -28000 \lor \neg \left(z \leq 3.65 \cdot 10^{+227}\right):\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\end{array}
\end{array}
if z < -28000 or 3.65000000000000013e227 < z Initial program 78.5%
sub-neg78.5%
associate-+l-78.5%
sub-neg78.5%
sub-neg78.5%
distribute-rgt-out--80.9%
associate-*l*79.8%
distribute-lft-neg-in79.8%
cancel-sign-sub79.8%
associate-*l*79.8%
associate-*l*79.8%
Simplified79.8%
Taylor expanded in x around inf 62.2%
Taylor expanded in y around inf 51.4%
if -28000 < z < 3.65000000000000013e227Initial program 91.4%
sub-neg91.4%
associate-+l-91.4%
sub-neg91.4%
sub-neg91.4%
distribute-rgt-out--92.0%
associate-*l*93.0%
distribute-lft-neg-in93.0%
cancel-sign-sub93.0%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in y around 0 83.2%
Taylor expanded in i around inf 59.4%
*-commutative59.4%
*-commutative59.4%
associate-*l*59.4%
Simplified59.4%
Taylor expanded in c around 0 39.8%
cancel-sign-sub-inv39.8%
metadata-eval39.8%
+-commutative39.8%
distribute-lft-out39.8%
Simplified39.8%
Final simplification43.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= z -13500000000.0)
(* x (* y (* 18.0 (* t z))))
(if (<= z 3.65e+227)
(* -4.0 (+ (* t a) (* x i)))
(* x (* 18.0 (* y (* t z)))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -13500000000.0) {
tmp = x * (y * (18.0 * (t * z)));
} else if (z <= 3.65e+227) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = x * (18.0 * (y * (t * z)));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (z <= (-13500000000.0d0)) then
tmp = x * (y * (18.0d0 * (t * z)))
else if (z <= 3.65d+227) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else
tmp = x * (18.0d0 * (y * (t * z)))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (z <= -13500000000.0) {
tmp = x * (y * (18.0 * (t * z)));
} else if (z <= 3.65e+227) {
tmp = -4.0 * ((t * a) + (x * i));
} else {
tmp = x * (18.0 * (y * (t * z)));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if z <= -13500000000.0: tmp = x * (y * (18.0 * (t * z))) elif z <= 3.65e+227: tmp = -4.0 * ((t * a) + (x * i)) else: tmp = x * (18.0 * (y * (t * z))) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (z <= -13500000000.0) tmp = Float64(x * Float64(y * Float64(18.0 * Float64(t * z)))); elseif (z <= 3.65e+227) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); else tmp = Float64(x * Float64(18.0 * Float64(y * Float64(t * z)))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (z <= -13500000000.0)
tmp = x * (y * (18.0 * (t * z)));
elseif (z <= 3.65e+227)
tmp = -4.0 * ((t * a) + (x * i));
else
tmp = x * (18.0 * (y * (t * z)));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[z, -13500000000.0], N[(x * N[(y * N[(18.0 * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.65e+227], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -13500000000:\\
\;\;\;\;x \cdot \left(y \cdot \left(18 \cdot \left(t \cdot z\right)\right)\right)\\
\mathbf{elif}\;z \leq 3.65 \cdot 10^{+227}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if z < -1.35e10Initial program 77.7%
sub-neg77.7%
associate-+l-77.7%
sub-neg77.7%
sub-neg77.7%
distribute-rgt-out--80.7%
associate-*l*79.3%
distribute-lft-neg-in79.3%
cancel-sign-sub79.3%
associate-*l*79.3%
associate-*l*79.3%
Simplified79.3%
Taylor expanded in x around inf 59.1%
Taylor expanded in y around inf 45.6%
*-commutative45.6%
associate-*l*45.6%
*-commutative45.6%
Simplified45.6%
if -1.35e10 < z < 3.65000000000000013e227Initial program 91.4%
sub-neg91.4%
associate-+l-91.4%
sub-neg91.4%
sub-neg91.4%
distribute-rgt-out--92.0%
associate-*l*93.0%
distribute-lft-neg-in93.0%
cancel-sign-sub93.0%
associate-*l*93.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in y around 0 83.2%
Taylor expanded in i around inf 59.4%
*-commutative59.4%
*-commutative59.4%
associate-*l*59.4%
Simplified59.4%
Taylor expanded in c around 0 39.8%
cancel-sign-sub-inv39.8%
metadata-eval39.8%
+-commutative39.8%
distribute-lft-out39.8%
Simplified39.8%
if 3.65000000000000013e227 < z Initial program 81.9%
sub-neg81.9%
associate-+l-81.9%
sub-neg81.9%
sub-neg81.9%
distribute-rgt-out--81.9%
associate-*l*81.9%
distribute-lft-neg-in81.9%
cancel-sign-sub81.9%
associate-*l*81.9%
associate-*l*81.9%
Simplified81.9%
Taylor expanded in x around inf 75.1%
Taylor expanded in y around inf 75.1%
Final simplification43.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= b -1.65e+90)
(* b c)
(if (<= b -1.35e-230)
(* -27.0 (* j k))
(if (<= b 6.5e-51) (* -4.0 (* x i)) (* b c)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -1.65e+90) {
tmp = b * c;
} else if (b <= -1.35e-230) {
tmp = -27.0 * (j * k);
} else if (b <= 6.5e-51) {
tmp = -4.0 * (x * i);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (b <= (-1.65d+90)) then
tmp = b * c
else if (b <= (-1.35d-230)) then
tmp = (-27.0d0) * (j * k)
else if (b <= 6.5d-51) then
tmp = (-4.0d0) * (x * i)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -1.65e+90) {
tmp = b * c;
} else if (b <= -1.35e-230) {
tmp = -27.0 * (j * k);
} else if (b <= 6.5e-51) {
tmp = -4.0 * (x * i);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -1.65e+90: tmp = b * c elif b <= -1.35e-230: tmp = -27.0 * (j * k) elif b <= 6.5e-51: tmp = -4.0 * (x * i) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -1.65e+90) tmp = Float64(b * c); elseif (b <= -1.35e-230) tmp = Float64(-27.0 * Float64(j * k)); elseif (b <= 6.5e-51) tmp = Float64(-4.0 * Float64(x * i)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (b <= -1.65e+90)
tmp = b * c;
elseif (b <= -1.35e-230)
tmp = -27.0 * (j * k);
elseif (b <= 6.5e-51)
tmp = -4.0 * (x * i);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[b, -1.65e+90], N[(b * c), $MachinePrecision], If[LessEqual[b, -1.35e-230], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.5e-51], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.65 \cdot 10^{+90}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -1.35 \cdot 10^{-230}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{-51}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -1.65000000000000004e90 or 6.5000000000000003e-51 < b Initial program 84.0%
sub-neg84.0%
associate-+l-84.0%
sub-neg84.0%
sub-neg84.0%
distribute-rgt-out--86.6%
associate-*l*84.9%
distribute-lft-neg-in84.9%
cancel-sign-sub84.9%
associate-*l*84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in y around 0 68.0%
*-un-lft-identity68.0%
fma-def68.0%
*-commutative68.0%
associate-*r*68.0%
Applied egg-rr68.0%
*-lft-identity68.0%
fma-udef68.0%
*-commutative68.0%
associate-*l*68.0%
*-commutative68.0%
fma-def68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
associate-*l*68.9%
Simplified68.9%
Taylor expanded in c around inf 38.4%
if -1.65000000000000004e90 < b < -1.35000000000000006e-230Initial program 91.4%
sub-neg91.4%
+-commutative91.4%
associate-*l*91.4%
distribute-rgt-neg-in91.4%
fma-def93.9%
*-commutative93.9%
distribute-rgt-neg-in93.9%
metadata-eval93.9%
sub-neg93.9%
+-commutative93.9%
associate-*l*93.9%
distribute-rgt-neg-in93.9%
Simplified97.4%
Taylor expanded in j around inf 36.1%
if -1.35000000000000006e-230 < b < 6.5000000000000003e-51Initial program 88.2%
sub-neg88.2%
+-commutative88.2%
associate-*l*88.2%
distribute-rgt-neg-in88.2%
fma-def90.0%
*-commutative90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
sub-neg90.0%
+-commutative90.0%
associate-*l*90.0%
distribute-rgt-neg-in90.0%
Simplified93.3%
Taylor expanded in i around inf 33.0%
Final simplification36.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= b -1.7e+90)
(* b c)
(if (<= b -3.5e-230)
(* k (* j -27.0))
(if (<= b 5.3e-51) (* -4.0 (* x i)) (* b c)))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -1.7e+90) {
tmp = b * c;
} else if (b <= -3.5e-230) {
tmp = k * (j * -27.0);
} else if (b <= 5.3e-51) {
tmp = -4.0 * (x * i);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (b <= (-1.7d+90)) then
tmp = b * c
else if (b <= (-3.5d-230)) then
tmp = k * (j * (-27.0d0))
else if (b <= 5.3d-51) then
tmp = (-4.0d0) * (x * i)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -1.7e+90) {
tmp = b * c;
} else if (b <= -3.5e-230) {
tmp = k * (j * -27.0);
} else if (b <= 5.3e-51) {
tmp = -4.0 * (x * i);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -1.7e+90: tmp = b * c elif b <= -3.5e-230: tmp = k * (j * -27.0) elif b <= 5.3e-51: tmp = -4.0 * (x * i) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -1.7e+90) tmp = Float64(b * c); elseif (b <= -3.5e-230) tmp = Float64(k * Float64(j * -27.0)); elseif (b <= 5.3e-51) tmp = Float64(-4.0 * Float64(x * i)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (b <= -1.7e+90)
tmp = b * c;
elseif (b <= -3.5e-230)
tmp = k * (j * -27.0);
elseif (b <= 5.3e-51)
tmp = -4.0 * (x * i);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[b, -1.7e+90], N[(b * c), $MachinePrecision], If[LessEqual[b, -3.5e-230], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.3e-51], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7 \cdot 10^{+90}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -3.5 \cdot 10^{-230}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;b \leq 5.3 \cdot 10^{-51}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -1.70000000000000009e90 or 5.29999999999999974e-51 < b Initial program 84.0%
sub-neg84.0%
associate-+l-84.0%
sub-neg84.0%
sub-neg84.0%
distribute-rgt-out--86.6%
associate-*l*84.9%
distribute-lft-neg-in84.9%
cancel-sign-sub84.9%
associate-*l*84.9%
associate-*l*84.9%
Simplified84.9%
Taylor expanded in y around 0 68.0%
*-un-lft-identity68.0%
fma-def68.0%
*-commutative68.0%
associate-*r*68.0%
Applied egg-rr68.0%
*-lft-identity68.0%
fma-udef68.0%
*-commutative68.0%
associate-*l*68.0%
*-commutative68.0%
fma-def68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
associate-*l*68.9%
Simplified68.9%
Taylor expanded in c around inf 38.4%
if -1.70000000000000009e90 < b < -3.49999999999999988e-230Initial program 91.4%
sub-neg91.4%
associate-+l-91.4%
sub-neg91.4%
sub-neg91.4%
distribute-rgt-out--91.4%
associate-*l*93.8%
distribute-lft-neg-in93.8%
cancel-sign-sub93.8%
associate-*l*93.8%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in y around 0 78.1%
*-un-lft-identity78.1%
fma-def78.1%
*-commutative78.1%
associate-*r*78.1%
Applied egg-rr78.1%
*-lft-identity78.1%
fma-udef78.1%
*-commutative78.1%
associate-*l*78.1%
*-commutative78.1%
fma-def78.1%
*-commutative78.1%
associate-*r*78.1%
*-commutative78.1%
associate-*l*78.2%
Simplified78.2%
Taylor expanded in k around inf 36.1%
*-commutative36.1%
associate-*r*36.2%
Simplified36.2%
if -3.49999999999999988e-230 < b < 5.29999999999999974e-51Initial program 88.2%
sub-neg88.2%
+-commutative88.2%
associate-*l*88.2%
distribute-rgt-neg-in88.2%
fma-def90.0%
*-commutative90.0%
distribute-rgt-neg-in90.0%
metadata-eval90.0%
sub-neg90.0%
+-commutative90.0%
associate-*l*90.0%
distribute-rgt-neg-in90.0%
Simplified93.3%
Taylor expanded in i around inf 33.0%
Final simplification36.5%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= b -5e+86) (* b c) (if (<= b 22500.0) (* -27.0 (* j k)) (* b c))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -5e+86) {
tmp = b * c;
} else if (b <= 22500.0) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (b <= (-5d+86)) then
tmp = b * c
else if (b <= 22500.0d0) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -5e+86) {
tmp = b * c;
} else if (b <= 22500.0) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -5e+86: tmp = b * c elif b <= 22500.0: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -5e+86) tmp = Float64(b * c); elseif (b <= 22500.0) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (b <= -5e+86)
tmp = b * c;
elseif (b <= 22500.0)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[b, -5e+86], N[(b * c), $MachinePrecision], If[LessEqual[b, 22500.0], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+86}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq 22500:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -4.9999999999999998e86 or 22500 < b Initial program 84.0%
sub-neg84.0%
associate-+l-84.0%
sub-neg84.0%
sub-neg84.0%
distribute-rgt-out--86.9%
associate-*l*85.0%
distribute-lft-neg-in85.0%
cancel-sign-sub85.0%
associate-*l*85.0%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in y around 0 67.9%
*-un-lft-identity67.9%
fma-def67.9%
*-commutative67.9%
associate-*r*67.9%
Applied egg-rr67.9%
*-lft-identity67.9%
fma-udef67.9%
*-commutative67.9%
associate-*l*67.9%
*-commutative67.9%
fma-def68.9%
*-commutative68.9%
associate-*r*68.9%
*-commutative68.9%
associate-*l*68.9%
Simplified68.9%
Taylor expanded in c around inf 41.5%
if -4.9999999999999998e86 < b < 22500Initial program 89.6%
sub-neg89.6%
+-commutative89.6%
associate-*l*89.6%
distribute-rgt-neg-in89.6%
fma-def91.6%
*-commutative91.6%
distribute-rgt-neg-in91.6%
metadata-eval91.6%
sub-neg91.6%
+-commutative91.6%
associate-*l*91.6%
distribute-rgt-neg-in91.6%
Simplified95.5%
Taylor expanded in j around inf 29.8%
Final simplification34.7%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
code = b * c
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 87.3%
sub-neg87.3%
associate-+l-87.3%
sub-neg87.3%
sub-neg87.3%
distribute-rgt-out--88.5%
associate-*l*88.8%
distribute-lft-neg-in88.8%
cancel-sign-sub88.8%
associate-*l*88.8%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in y around 0 73.3%
*-un-lft-identity73.3%
fma-def73.3%
*-commutative73.3%
associate-*r*73.3%
Applied egg-rr73.3%
*-lft-identity73.3%
fma-udef73.3%
*-commutative73.3%
associate-*l*73.3%
*-commutative73.3%
fma-def73.7%
*-commutative73.7%
associate-*r*73.7%
*-commutative73.7%
associate-*l*73.7%
Simplified73.7%
Taylor expanded in c around inf 21.7%
Final simplification21.7%
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (+ (* a t) (* i x)) 4.0))
(t_2
(-
(- (* (* 18.0 t) (* (* x y) z)) t_1)
(- (* (* k j) 27.0) (* c b)))))
(if (< t -1.6210815397541398e-69)
t_2
(if (< t 165.68027943805222)
(+ (- (* (* 18.0 y) (* x (* z t))) t_1) (- (* c b) (* 27.0 (* k j))))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
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), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((a * t) + (i * x)) * 4.0d0
t_2 = (((18.0d0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0d0) - (c * b))
if (t < (-1.6210815397541398d-69)) then
tmp = t_2
else if (t < 165.68027943805222d0) then
tmp = (((18.0d0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0d0 * (k * j)))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((a * t) + (i * x)) * 4.0;
double t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b));
double tmp;
if (t < -1.6210815397541398e-69) {
tmp = t_2;
} else if (t < 165.68027943805222) {
tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((a * t) + (i * x)) * 4.0 t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)) tmp = 0 if t < -1.6210815397541398e-69: tmp = t_2 elif t < 165.68027943805222: tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(a * t) + Float64(i * x)) * 4.0) t_2 = Float64(Float64(Float64(Float64(18.0 * t) * Float64(Float64(x * y) * z)) - t_1) - Float64(Float64(Float64(k * j) * 27.0) - Float64(c * b))) tmp = 0.0 if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = Float64(Float64(Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))) - t_1) + Float64(Float64(c * b) - Float64(27.0 * Float64(k * j)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k) t_1 = ((a * t) + (i * x)) * 4.0; t_2 = (((18.0 * t) * ((x * y) * z)) - t_1) - (((k * j) * 27.0) - (c * b)); tmp = 0.0; if (t < -1.6210815397541398e-69) tmp = t_2; elseif (t < 165.68027943805222) tmp = (((18.0 * y) * (x * (z * t))) - t_1) + ((c * b) - (27.0 * (k * j))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(a * t), $MachinePrecision] + N[(i * x), $MachinePrecision]), $MachinePrecision] * 4.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(N[(x * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -1.6210815397541398e-69], t$95$2, If[Less[t, 165.68027943805222], N[(N[(N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot t + i \cdot x\right) \cdot 4\\
t_2 := \left(\left(18 \cdot t\right) \cdot \left(\left(x \cdot y\right) \cdot z\right) - t_1\right) - \left(\left(k \cdot j\right) \cdot 27 - c \cdot b\right)\\
\mathbf{if}\;t < -1.6210815397541398 \cdot 10^{-69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t < 165.68027943805222:\\
\;\;\;\;\left(\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right) - t_1\right) + \left(c \cdot b - 27 \cdot \left(k \cdot j\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023181
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:herbie-target
(if (< t -1.6210815397541398e-69) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b))) (if (< t 165.68027943805222) (+ (- (* (* 18.0 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4.0)) (- (* c b) (* 27.0 (* k j)))) (- (- (* (* 18.0 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4.0)) (- (* (* k j) 27.0) (* c b)))))
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))