
(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 17 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)
(-
(+ (* t (- (* (* y z) (* x 18.0)) (* a 4.0))) (* b c))
(+ (* x (* i 4.0)) (* j (* k 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 = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (b * c)) - ((x * (i * 4.0)) + (j * (k * 27.0)));
} 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 tmp;
if ((((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0))) <= Double.POSITIVE_INFINITY) {
tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (b * c)) - ((x * (i * 4.0)) + (j * (k * 27.0)));
} 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): tmp = 0 if (((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0))) <= math.inf: tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (b * c)) - ((x * (i * 4.0)) + (j * (k * 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(Float64(Float64(t * Float64(Float64(Float64(y * z) * Float64(x * 18.0)) - Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * Float64(i * 4.0)) + Float64(j * Float64(k * 27.0)))); 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)
tmp = 0.0;
if ((((((t * (z * (y * (x * 18.0)))) - (t * (a * 4.0))) + (b * c)) - (i * (x * 4.0))) - (k * (j * 27.0))) <= Inf)
tmp = ((t * (((y * z) * (x * 18.0)) - (a * 4.0))) + (b * c)) - ((x * (i * 4.0)) + (j * (k * 27.0)));
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_] := 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[(N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * 18.0), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision] + N[(j * N[(k * 27.0), $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:\\
\;\;\;\;\left(t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot 18\right) - a \cdot 4\right) + b \cdot c\right) - \left(x \cdot \left(i \cdot 4\right) + j \cdot \left(k \cdot 27\right)\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 94.1%
sub-neg94.1%
associate-+l-94.1%
sub-neg94.1%
sub-neg94.1%
distribute-rgt-out--94.1%
associate-*l*95.7%
distribute-lft-neg-in95.7%
cancel-sign-sub95.7%
associate-*l*95.7%
associate-*l*95.8%
Simplified95.8%
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--16.7%
associate-*l*25.0%
distribute-lft-neg-in25.0%
cancel-sign-sub25.0%
associate-*l*25.0%
associate-*l*25.0%
Simplified25.0%
Taylor expanded in x around inf 75.0%
Final simplification93.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 (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 85.3%
sub-neg85.3%
+-commutative85.3%
associate-*l*85.3%
distribute-rgt-neg-in85.3%
fma-def85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
metadata-eval85.7%
sub-neg85.7%
+-commutative85.7%
associate-*l*85.7%
distribute-rgt-neg-in85.7%
Simplified93.4%
Final simplification93.4%
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 (- (* -18.0 (* y (* x (- z)))) (* a 4.0)))))
(if (<= t -5.2e+79)
t_1
(if (<= t 124000000000.0)
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* 18.0 (* y (* t z))) (* i -4.0)))))
(if (<= t 2e+168)
(- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))
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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0));
double tmp;
if (t <= -5.2e+79) {
tmp = t_1;
} else if (t <= 124000000000.0) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0))));
} else if (t <= 2e+168) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} 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 = t * (((-18.0d0) * (y * (x * -z))) - (a * 4.0d0))
if (t <= (-5.2d+79)) then
tmp = t_1
else if (t <= 124000000000.0d0) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((18.0d0 * (y * (t * z))) + (i * (-4.0d0)))))
else if (t <= 2d+168) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0));
double tmp;
if (t <= -5.2e+79) {
tmp = t_1;
} else if (t <= 124000000000.0) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0))));
} else if (t <= 2e+168) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} 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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0)) tmp = 0 if t <= -5.2e+79: tmp = t_1 elif t <= 124000000000.0: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0)))) elif t <= 2e+168: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) 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(t * Float64(Float64(-18.0 * Float64(y * Float64(x * Float64(-z)))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -5.2e+79) tmp = t_1; elseif (t <= 124000000000.0) 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))))); elseif (t <= 2e+168) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); 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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0));
tmp = 0.0;
if (t <= -5.2e+79)
tmp = t_1;
elseif (t <= 124000000000.0)
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((18.0 * (y * (t * z))) + (i * -4.0))));
elseif (t <= 2e+168)
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
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[(t * N[(N[(-18.0 * N[(y * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.2e+79], t$95$1, If[LessEqual[t, 124000000000.0], 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], If[LessEqual[t, 2e+168], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-18 \cdot \left(y \cdot \left(x \cdot \left(-z\right)\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -5.2 \cdot 10^{+79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 124000000000:\\
\;\;\;\;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{elif}\;t \leq 2 \cdot 10^{+168}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.20000000000000029e79 or 1.9999999999999999e168 < t Initial program 86.5%
Simplified89.1%
Taylor expanded in t around -inf 80.0%
if -5.20000000000000029e79 < t < 1.24e11Initial program 84.3%
Simplified93.1%
Taylor expanded in a around 0 93.1%
if 1.24e11 < t < 1.9999999999999999e168Initial program 86.9%
sub-neg86.9%
associate-+l-86.9%
sub-neg86.9%
sub-neg86.9%
distribute-rgt-out--86.9%
associate-*l*80.8%
distribute-lft-neg-in80.8%
cancel-sign-sub80.8%
associate-*l*80.8%
associate-*l*80.8%
Simplified80.8%
Taylor expanded in x around 0 77.9%
Final simplification87.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
(let* ((t_1 (- (* b c) (* 4.0 (* x i)))))
(if (<= k -1.5e-27)
(* -27.0 (* j k))
(if (<= k 2.3e-72)
t_1
(if (<= k 3.4e+27)
(* 18.0 (* (* x z) (* t y)))
(if (<= k 3.8e+50)
t_1
(if (<= k 9.6e+63)
(* k (* j -27.0))
(if (<= k 8.2e+145) t_1 (* 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 t_1 = (b * c) - (4.0 * (x * i));
double tmp;
if (k <= -1.5e-27) {
tmp = -27.0 * (j * k);
} else if (k <= 2.3e-72) {
tmp = t_1;
} else if (k <= 3.4e+27) {
tmp = 18.0 * ((x * z) * (t * y));
} else if (k <= 3.8e+50) {
tmp = t_1;
} else if (k <= 9.6e+63) {
tmp = k * (j * -27.0);
} else if (k <= 8.2e+145) {
tmp = t_1;
} else {
tmp = 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) :: t_1
real(8) :: tmp
t_1 = (b * c) - (4.0d0 * (x * i))
if (k <= (-1.5d-27)) then
tmp = (-27.0d0) * (j * k)
else if (k <= 2.3d-72) then
tmp = t_1
else if (k <= 3.4d+27) then
tmp = 18.0d0 * ((x * z) * (t * y))
else if (k <= 3.8d+50) then
tmp = t_1
else if (k <= 9.6d+63) then
tmp = k * (j * (-27.0d0))
else if (k <= 8.2d+145) then
tmp = t_1
else
tmp = 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 t_1 = (b * c) - (4.0 * (x * i));
double tmp;
if (k <= -1.5e-27) {
tmp = -27.0 * (j * k);
} else if (k <= 2.3e-72) {
tmp = t_1;
} else if (k <= 3.4e+27) {
tmp = 18.0 * ((x * z) * (t * y));
} else if (k <= 3.8e+50) {
tmp = t_1;
} else if (k <= 9.6e+63) {
tmp = k * (j * -27.0);
} else if (k <= 8.2e+145) {
tmp = t_1;
} else {
tmp = j * (k * -27.0);
}
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)) tmp = 0 if k <= -1.5e-27: tmp = -27.0 * (j * k) elif k <= 2.3e-72: tmp = t_1 elif k <= 3.4e+27: tmp = 18.0 * ((x * z) * (t * y)) elif k <= 3.8e+50: tmp = t_1 elif k <= 9.6e+63: tmp = k * (j * -27.0) elif k <= 8.2e+145: tmp = t_1 else: tmp = j * (k * -27.0) 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))) tmp = 0.0 if (k <= -1.5e-27) tmp = Float64(-27.0 * Float64(j * k)); elseif (k <= 2.3e-72) tmp = t_1; elseif (k <= 3.4e+27) tmp = Float64(18.0 * Float64(Float64(x * z) * Float64(t * y))); elseif (k <= 3.8e+50) tmp = t_1; elseif (k <= 9.6e+63) tmp = Float64(k * Float64(j * -27.0)); elseif (k <= 8.2e+145) tmp = t_1; else tmp = 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)
t_1 = (b * c) - (4.0 * (x * i));
tmp = 0.0;
if (k <= -1.5e-27)
tmp = -27.0 * (j * k);
elseif (k <= 2.3e-72)
tmp = t_1;
elseif (k <= 3.4e+27)
tmp = 18.0 * ((x * z) * (t * y));
elseif (k <= 3.8e+50)
tmp = t_1;
elseif (k <= 9.6e+63)
tmp = k * (j * -27.0);
elseif (k <= 8.2e+145)
tmp = t_1;
else
tmp = 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_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -1.5e-27], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.3e-72], t$95$1, If[LessEqual[k, 3.4e+27], N[(18.0 * N[(N[(x * z), $MachinePrecision] * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 3.8e+50], t$95$1, If[LessEqual[k, 9.6e+63], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 8.2e+145], t$95$1, N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;k \leq -1.5 \cdot 10^{-27}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;k \leq 2.3 \cdot 10^{-72}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 3.4 \cdot 10^{+27}:\\
\;\;\;\;18 \cdot \left(\left(x \cdot z\right) \cdot \left(t \cdot y\right)\right)\\
\mathbf{elif}\;k \leq 3.8 \cdot 10^{+50}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 9.6 \cdot 10^{+63}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;k \leq 8.2 \cdot 10^{+145}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if k < -1.5000000000000001e-27Initial program 90.1%
sub-neg90.1%
+-commutative90.1%
associate-*l*90.2%
distribute-rgt-neg-in90.2%
fma-def91.8%
*-commutative91.8%
distribute-rgt-neg-in91.8%
metadata-eval91.8%
sub-neg91.8%
+-commutative91.8%
associate-*l*91.8%
distribute-rgt-neg-in91.8%
Simplified95.0%
Taylor expanded in j around inf 44.7%
if -1.5000000000000001e-27 < k < 2.29999999999999995e-72 or 3.4e27 < k < 3.79999999999999987e50 or 9.6e63 < k < 8.2000000000000003e145Initial program 83.7%
Taylor expanded in t around 0 55.9%
Taylor expanded in j around 0 50.3%
if 2.29999999999999995e-72 < k < 3.4e27Initial program 86.5%
Simplified94.0%
Taylor expanded in a around 0 80.8%
Taylor expanded in k around 0 55.0%
Taylor expanded in y around inf 52.5%
*-commutative52.5%
associate-*r*53.1%
*-commutative53.1%
Simplified53.1%
if 3.79999999999999987e50 < k < 9.6e63Initial program 100.0%
sub-neg100.0%
+-commutative100.0%
associate-*l*99.6%
distribute-rgt-neg-in99.6%
fma-def99.6%
*-commutative99.6%
distribute-rgt-neg-in99.6%
metadata-eval99.6%
sub-neg99.6%
+-commutative99.6%
associate-*l*99.6%
distribute-rgt-neg-in99.6%
Simplified99.6%
Taylor expanded in j around inf 99.2%
*-commutative99.2%
associate-*r*100.0%
*-commutative100.0%
Simplified100.0%
if 8.2000000000000003e145 < k Initial program 81.1%
sub-neg81.1%
+-commutative81.1%
associate-*l*81.1%
distribute-rgt-neg-in81.1%
fma-def81.1%
*-commutative81.1%
distribute-rgt-neg-in81.1%
metadata-eval81.1%
sub-neg81.1%
+-commutative81.1%
associate-*l*81.1%
distribute-rgt-neg-in81.1%
Simplified96.6%
Taylor expanded in j around inf 56.5%
associate-*r*59.4%
*-commutative59.4%
*-commutative59.4%
*-commutative59.4%
Simplified59.4%
Final simplification51.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
(let* ((t_1 (* x (- (* 18.0 (* y (* t z))) (* i 4.0)))))
(if (<= x -2.7e+57)
t_1
(if (<= x -4.1e-243)
(- (* b c) (* k (* j 27.0)))
(if (<= x -2.1e-302)
(* t (* a (- 4.0)))
(if (<= x 2e-57) (- (* b c) (* 27.0 (* j k))) 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 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double tmp;
if (x <= -2.7e+57) {
tmp = t_1;
} else if (x <= -4.1e-243) {
tmp = (b * c) - (k * (j * 27.0));
} else if (x <= -2.1e-302) {
tmp = t * (a * -4.0);
} else if (x <= 2e-57) {
tmp = (b * c) - (27.0 * (j * k));
} 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 = x * ((18.0d0 * (y * (t * z))) - (i * 4.0d0))
if (x <= (-2.7d+57)) then
tmp = t_1
else if (x <= (-4.1d-243)) then
tmp = (b * c) - (k * (j * 27.0d0))
else if (x <= (-2.1d-302)) then
tmp = t * (a * -4.0d0)
else if (x <= 2d-57) then
tmp = (b * c) - (27.0d0 * (j * k))
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 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
double tmp;
if (x <= -2.7e+57) {
tmp = t_1;
} else if (x <= -4.1e-243) {
tmp = (b * c) - (k * (j * 27.0));
} else if (x <= -2.1e-302) {
tmp = t * (a * -4.0);
} else if (x <= 2e-57) {
tmp = (b * c) - (27.0 * (j * k));
} 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 = x * ((18.0 * (y * (t * z))) - (i * 4.0)) tmp = 0 if x <= -2.7e+57: tmp = t_1 elif x <= -4.1e-243: tmp = (b * c) - (k * (j * 27.0)) elif x <= -2.1e-302: tmp = t * (a * -4.0) elif x <= 2e-57: tmp = (b * c) - (27.0 * (j * k)) 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(x * Float64(Float64(18.0 * Float64(y * Float64(t * z))) - Float64(i * 4.0))) tmp = 0.0 if (x <= -2.7e+57) tmp = t_1; elseif (x <= -4.1e-243) tmp = Float64(Float64(b * c) - Float64(k * Float64(j * 27.0))); elseif (x <= -2.1e-302) tmp = Float64(t * Float64(a * Float64(-4.0))); elseif (x <= 2e-57) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); 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 = x * ((18.0 * (y * (t * z))) - (i * 4.0));
tmp = 0.0;
if (x <= -2.7e+57)
tmp = t_1;
elseif (x <= -4.1e-243)
tmp = (b * c) - (k * (j * 27.0));
elseif (x <= -2.1e-302)
tmp = t * (a * -4.0);
elseif (x <= 2e-57)
tmp = (b * c) - (27.0 * (j * k));
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[(x * N[(N[(18.0 * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.7e+57], t$95$1, If[LessEqual[x, -4.1e-243], N[(N[(b * c), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, -2.1e-302], N[(t * N[(a * (-4.0)), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e-57], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(y \cdot \left(t \cdot z\right)\right) - i \cdot 4\right)\\
\mathbf{if}\;x \leq -2.7 \cdot 10^{+57}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-243}:\\
\;\;\;\;b \cdot c - k \cdot \left(j \cdot 27\right)\\
\mathbf{elif}\;x \leq -2.1 \cdot 10^{-302}:\\
\;\;\;\;t \cdot \left(a \cdot \left(-4\right)\right)\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-57}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -2.6999999999999998e57 or 1.99999999999999991e-57 < x Initial program 73.7%
sub-neg73.7%
associate-+l-73.7%
sub-neg73.7%
sub-neg73.7%
distribute-rgt-out--76.1%
associate-*l*85.5%
distribute-lft-neg-in85.5%
cancel-sign-sub85.5%
associate-*l*85.5%
associate-*l*85.5%
Simplified85.5%
Taylor expanded in x around inf 70.3%
if -2.6999999999999998e57 < x < -4.09999999999999981e-243Initial program 94.3%
Taylor expanded in t around 0 63.1%
Taylor expanded in i around 0 56.6%
expm1-log1p-u35.0%
expm1-udef34.7%
*-commutative34.7%
Applied egg-rr34.7%
expm1-def35.0%
expm1-log1p56.6%
associate-*l*56.6%
Simplified56.6%
if -4.09999999999999981e-243 < x < -2.10000000000000013e-302Initial program 99.9%
Simplified78.5%
Taylor expanded in t around -inf 72.8%
Taylor expanded in y around 0 72.8%
*-commutative72.8%
Simplified72.8%
if -2.10000000000000013e-302 < x < 1.99999999999999991e-57Initial program 97.7%
Taylor expanded in t around 0 75.5%
Taylor expanded in i around 0 71.4%
Final simplification66.9%
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 (- (* -18.0 (* y (* x (- z)))) (* a 4.0)))))
(if (<= t -5.6e+81)
t_1
(if (<= t 380000000.0)
(- (- (* b c) (* 4.0 (* x i))) (* k (* j 27.0)))
(if (<= t 1.95e+168)
(- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))
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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0));
double tmp;
if (t <= -5.6e+81) {
tmp = t_1;
} else if (t <= 380000000.0) {
tmp = ((b * c) - (4.0 * (x * i))) - (k * (j * 27.0));
} else if (t <= 1.95e+168) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} 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 = t * (((-18.0d0) * (y * (x * -z))) - (a * 4.0d0))
if (t <= (-5.6d+81)) then
tmp = t_1
else if (t <= 380000000.0d0) then
tmp = ((b * c) - (4.0d0 * (x * i))) - (k * (j * 27.0d0))
else if (t <= 1.95d+168) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0));
double tmp;
if (t <= -5.6e+81) {
tmp = t_1;
} else if (t <= 380000000.0) {
tmp = ((b * c) - (4.0 * (x * i))) - (k * (j * 27.0));
} else if (t <= 1.95e+168) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} 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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0)) tmp = 0 if t <= -5.6e+81: tmp = t_1 elif t <= 380000000.0: tmp = ((b * c) - (4.0 * (x * i))) - (k * (j * 27.0)) elif t <= 1.95e+168: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) 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(t * Float64(Float64(-18.0 * Float64(y * Float64(x * Float64(-z)))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -5.6e+81) tmp = t_1; elseif (t <= 380000000.0) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))) - Float64(k * Float64(j * 27.0))); elseif (t <= 1.95e+168) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); 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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0));
tmp = 0.0;
if (t <= -5.6e+81)
tmp = t_1;
elseif (t <= 380000000.0)
tmp = ((b * c) - (4.0 * (x * i))) - (k * (j * 27.0));
elseif (t <= 1.95e+168)
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
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[(t * N[(N[(-18.0 * N[(y * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+81], t$95$1, If[LessEqual[t, 380000000.0], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+168], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-18 \cdot \left(y \cdot \left(x \cdot \left(-z\right)\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+81}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 380000000:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+168}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.5999999999999999e81 or 1.95e168 < t Initial program 87.5%
Simplified89.0%
Taylor expanded in t around -inf 81.0%
if -5.5999999999999999e81 < t < 3.8e8Initial program 83.6%
Taylor expanded in t around 0 82.7%
if 3.8e8 < t < 1.95e168Initial program 87.4%
sub-neg87.4%
associate-+l-87.4%
sub-neg87.4%
sub-neg87.4%
distribute-rgt-out--87.4%
associate-*l*81.3%
distribute-lft-neg-in81.3%
cancel-sign-sub81.3%
associate-*l*81.3%
associate-*l*81.3%
Simplified81.3%
Taylor expanded in x around 0 75.7%
Final simplification81.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 (- (* 27.0 (* j (- k))) (* 4.0 (* x i))))
(t_2 (- (* b c) (* 27.0 (* j k)))))
(if (<= b -3.2e+190)
t_2
(if (<= b -4.6e+105)
t_1
(if (<= b -1.35e+39) (* t (* a (- 4.0))) (if (<= b 8000.0) t_1 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 = (27.0 * (j * -k)) - (4.0 * (x * i));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (b <= -3.2e+190) {
tmp = t_2;
} else if (b <= -4.6e+105) {
tmp = t_1;
} else if (b <= -1.35e+39) {
tmp = t * (a * -4.0);
} else if (b <= 8000.0) {
tmp = t_1;
} 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 = (27.0d0 * (j * -k)) - (4.0d0 * (x * i))
t_2 = (b * c) - (27.0d0 * (j * k))
if (b <= (-3.2d+190)) then
tmp = t_2
else if (b <= (-4.6d+105)) then
tmp = t_1
else if (b <= (-1.35d+39)) then
tmp = t * (a * -4.0d0)
else if (b <= 8000.0d0) then
tmp = t_1
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 = (27.0 * (j * -k)) - (4.0 * (x * i));
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (b <= -3.2e+190) {
tmp = t_2;
} else if (b <= -4.6e+105) {
tmp = t_1;
} else if (b <= -1.35e+39) {
tmp = t * (a * -4.0);
} else if (b <= 8000.0) {
tmp = t_1;
} 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 = (27.0 * (j * -k)) - (4.0 * (x * i)) t_2 = (b * c) - (27.0 * (j * k)) tmp = 0 if b <= -3.2e+190: tmp = t_2 elif b <= -4.6e+105: tmp = t_1 elif b <= -1.35e+39: tmp = t * (a * -4.0) elif b <= 8000.0: tmp = t_1 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(27.0 * Float64(j * Float64(-k))) - Float64(4.0 * Float64(x * i))) t_2 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (b <= -3.2e+190) tmp = t_2; elseif (b <= -4.6e+105) tmp = t_1; elseif (b <= -1.35e+39) tmp = Float64(t * Float64(a * Float64(-4.0))); elseif (b <= 8000.0) tmp = t_1; 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 = (27.0 * (j * -k)) - (4.0 * (x * i));
t_2 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if (b <= -3.2e+190)
tmp = t_2;
elseif (b <= -4.6e+105)
tmp = t_1;
elseif (b <= -1.35e+39)
tmp = t * (a * -4.0);
elseif (b <= 8000.0)
tmp = t_1;
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[(27.0 * N[(j * (-k)), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.2e+190], t$95$2, If[LessEqual[b, -4.6e+105], t$95$1, If[LessEqual[b, -1.35e+39], N[(t * N[(a * (-4.0)), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot \left(-k\right)\right) - 4 \cdot \left(x \cdot i\right)\\
t_2 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;b \leq -3.2 \cdot 10^{+190}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \leq -4.6 \cdot 10^{+105}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.35 \cdot 10^{+39}:\\
\;\;\;\;t \cdot \left(a \cdot \left(-4\right)\right)\\
\mathbf{elif}\;b \leq 8000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if b < -3.2000000000000001e190 or 8e3 < b Initial program 85.2%
Taylor expanded in t around 0 69.9%
Taylor expanded in i around 0 59.3%
if -3.2000000000000001e190 < b < -4.5999999999999996e105 or -1.35000000000000002e39 < b < 8e3Initial program 85.1%
Taylor expanded in t around 0 58.3%
Taylor expanded in c around 0 53.6%
if -4.5999999999999996e105 < b < -1.35000000000000002e39Initial program 87.2%
Simplified83.1%
Taylor expanded in t around -inf 55.4%
Taylor expanded in y around 0 38.7%
*-commutative38.7%
Simplified38.7%
Final simplification54.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 (* t (- (* -18.0 (* y (* x (- z)))) (* a 4.0)))))
(if (<= t -3.3e-49)
t_1
(if (<= t 9.6e-266)
(- (* b c) (* 27.0 (* j k)))
(if (<= t 110000000.0) (- (* 27.0 (* j (- k))) (* 4.0 (* 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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0));
double tmp;
if (t <= -3.3e-49) {
tmp = t_1;
} else if (t <= 9.6e-266) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 110000000.0) {
tmp = (27.0 * (j * -k)) - (4.0 * (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 = t * (((-18.0d0) * (y * (x * -z))) - (a * 4.0d0))
if (t <= (-3.3d-49)) then
tmp = t_1
else if (t <= 9.6d-266) then
tmp = (b * c) - (27.0d0 * (j * k))
else if (t <= 110000000.0d0) then
tmp = (27.0d0 * (j * -k)) - (4.0d0 * (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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0));
double tmp;
if (t <= -3.3e-49) {
tmp = t_1;
} else if (t <= 9.6e-266) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 110000000.0) {
tmp = (27.0 * (j * -k)) - (4.0 * (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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0)) tmp = 0 if t <= -3.3e-49: tmp = t_1 elif t <= 9.6e-266: tmp = (b * c) - (27.0 * (j * k)) elif t <= 110000000.0: tmp = (27.0 * (j * -k)) - (4.0 * (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(t * Float64(Float64(-18.0 * Float64(y * Float64(x * Float64(-z)))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -3.3e-49) tmp = t_1; elseif (t <= 9.6e-266) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); elseif (t <= 110000000.0) tmp = Float64(Float64(27.0 * Float64(j * Float64(-k))) - Float64(4.0 * 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 = t * ((-18.0 * (y * (x * -z))) - (a * 4.0));
tmp = 0.0;
if (t <= -3.3e-49)
tmp = t_1;
elseif (t <= 9.6e-266)
tmp = (b * c) - (27.0 * (j * k));
elseif (t <= 110000000.0)
tmp = (27.0 * (j * -k)) - (4.0 * (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[(t * N[(N[(-18.0 * N[(y * N[(x * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.3e-49], t$95$1, If[LessEqual[t, 9.6e-266], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 110000000.0], N[(N[(27.0 * N[(j * (-k)), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(-18 \cdot \left(y \cdot \left(x \cdot \left(-z\right)\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -3.3 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{-266}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 110000000:\\
\;\;\;\;27 \cdot \left(j \cdot \left(-k\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -3.3e-49 or 1.1e8 < t Initial program 87.4%
Simplified90.7%
Taylor expanded in t around -inf 71.0%
if -3.3e-49 < t < 9.5999999999999999e-266Initial program 86.7%
Taylor expanded in t around 0 89.4%
Taylor expanded in i around 0 72.2%
if 9.5999999999999999e-266 < t < 1.1e8Initial program 79.6%
Taylor expanded in t around 0 80.9%
Taylor expanded in c around 0 63.5%
Final simplification69.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 (or (<= x -1.32e+153) (not (<= x 2.85e-42))) (* 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.32e+153) || !(x <= 2.85e-42)) {
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.32d+153)) .or. (.not. (x <= 2.85d-42))) 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.32e+153) || !(x <= 2.85e-42)) {
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.32e+153) or not (x <= 2.85e-42): 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.32e+153) || !(x <= 2.85e-42)) 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.32e+153) || ~((x <= 2.85e-42)))
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.32e+153], N[Not[LessEqual[x, 2.85e-42]], $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.32 \cdot 10^{+153} \lor \neg \left(x \leq 2.85 \cdot 10^{-42}\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.3200000000000001e153 or 2.85e-42 < x Initial program 71.5%
sub-neg71.5%
associate-+l-71.5%
sub-neg71.5%
sub-neg71.5%
distribute-rgt-out--74.5%
associate-*l*85.2%
distribute-lft-neg-in85.2%
cancel-sign-sub85.2%
associate-*l*85.2%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in x around inf 75.1%
if -1.3200000000000001e153 < x < 2.85e-42Initial program 94.1%
sub-neg94.1%
associate-+l-94.1%
sub-neg94.1%
sub-neg94.1%
distribute-rgt-out--94.8%
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 x around 0 80.7%
Final simplification78.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) (* 27.0 (* j k)))))
(if (<= k -2.2e-49)
t_1
(if (<= k 2.3e-72)
(- (* b c) (* 4.0 (* x i)))
(if (<= k 5.8e+27) (* t (* z (* x (* y (- -18.0))))) 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 = (b * c) - (27.0 * (j * k));
double tmp;
if (k <= -2.2e-49) {
tmp = t_1;
} else if (k <= 2.3e-72) {
tmp = (b * c) - (4.0 * (x * i));
} else if (k <= 5.8e+27) {
tmp = t * (z * (x * (y * -(-18.0))));
} 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 = (b * c) - (27.0d0 * (j * k))
if (k <= (-2.2d-49)) then
tmp = t_1
else if (k <= 2.3d-72) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (k <= 5.8d+27) then
tmp = t * (z * (x * (y * -(-18.0d0))))
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 = (b * c) - (27.0 * (j * k));
double tmp;
if (k <= -2.2e-49) {
tmp = t_1;
} else if (k <= 2.3e-72) {
tmp = (b * c) - (4.0 * (x * i));
} else if (k <= 5.8e+27) {
tmp = t * (z * (x * (y * -(-18.0))));
} 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 = (b * c) - (27.0 * (j * k)) tmp = 0 if k <= -2.2e-49: tmp = t_1 elif k <= 2.3e-72: tmp = (b * c) - (4.0 * (x * i)) elif k <= 5.8e+27: tmp = t * (z * (x * (y * -(-18.0)))) 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(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (k <= -2.2e-49) tmp = t_1; elseif (k <= 2.3e-72) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (k <= 5.8e+27) tmp = Float64(t * Float64(z * Float64(x * Float64(y * Float64(-(-18.0)))))); 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 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if (k <= -2.2e-49)
tmp = t_1;
elseif (k <= 2.3e-72)
tmp = (b * c) - (4.0 * (x * i));
elseif (k <= 5.8e+27)
tmp = t * (z * (x * (y * -(-18.0))));
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[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -2.2e-49], t$95$1, If[LessEqual[k, 2.3e-72], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 5.8e+27], N[(t * N[(z * N[(x * N[(y * (--18.0)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;k \leq -2.2 \cdot 10^{-49}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 2.3 \cdot 10^{-72}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;k \leq 5.8 \cdot 10^{+27}:\\
\;\;\;\;t \cdot \left(z \cdot \left(x \cdot \left(y \cdot \left(--18\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if k < -2.1999999999999999e-49 or 5.8000000000000002e27 < k Initial program 86.7%
Taylor expanded in t around 0 70.2%
Taylor expanded in i around 0 57.2%
if -2.1999999999999999e-49 < k < 2.29999999999999995e-72Initial program 83.4%
Taylor expanded in t around 0 53.1%
Taylor expanded in j around 0 51.7%
if 2.29999999999999995e-72 < k < 5.8000000000000002e27Initial program 87.3%
Simplified94.4%
Taylor expanded in t around -inf 61.8%
Taylor expanded in y around inf 49.7%
associate-*r*49.7%
*-commutative49.7%
*-commutative49.7%
Simplified49.7%
Taylor expanded in z around 0 49.7%
associate-*r*49.7%
*-commutative49.7%
*-commutative49.7%
associate-*l*43.6%
Simplified43.6%
Final simplification54.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 (- (* b c) (* 27.0 (* j k)))))
(if (<= k -9.5e-62)
t_1
(if (<= k 6.2e-74)
(- (* b c) (* 4.0 (* x i)))
(if (<= k 5.5e+27) (* 18.0 (* (* x z) (* t y))) 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 = (b * c) - (27.0 * (j * k));
double tmp;
if (k <= -9.5e-62) {
tmp = t_1;
} else if (k <= 6.2e-74) {
tmp = (b * c) - (4.0 * (x * i));
} else if (k <= 5.5e+27) {
tmp = 18.0 * ((x * z) * (t * y));
} 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 = (b * c) - (27.0d0 * (j * k))
if (k <= (-9.5d-62)) then
tmp = t_1
else if (k <= 6.2d-74) then
tmp = (b * c) - (4.0d0 * (x * i))
else if (k <= 5.5d+27) then
tmp = 18.0d0 * ((x * z) * (t * y))
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 = (b * c) - (27.0 * (j * k));
double tmp;
if (k <= -9.5e-62) {
tmp = t_1;
} else if (k <= 6.2e-74) {
tmp = (b * c) - (4.0 * (x * i));
} else if (k <= 5.5e+27) {
tmp = 18.0 * ((x * z) * (t * y));
} 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 = (b * c) - (27.0 * (j * k)) tmp = 0 if k <= -9.5e-62: tmp = t_1 elif k <= 6.2e-74: tmp = (b * c) - (4.0 * (x * i)) elif k <= 5.5e+27: tmp = 18.0 * ((x * z) * (t * y)) 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(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (k <= -9.5e-62) tmp = t_1; elseif (k <= 6.2e-74) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(x * i))); elseif (k <= 5.5e+27) tmp = Float64(18.0 * Float64(Float64(x * z) * Float64(t * y))); 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 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if (k <= -9.5e-62)
tmp = t_1;
elseif (k <= 6.2e-74)
tmp = (b * c) - (4.0 * (x * i));
elseif (k <= 5.5e+27)
tmp = 18.0 * ((x * z) * (t * y));
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[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -9.5e-62], t$95$1, If[LessEqual[k, 6.2e-74], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 5.5e+27], N[(18.0 * N[(N[(x * z), $MachinePrecision] * N[(t * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;k \leq -9.5 \cdot 10^{-62}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 6.2 \cdot 10^{-74}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;k \leq 5.5 \cdot 10^{+27}:\\
\;\;\;\;18 \cdot \left(\left(x \cdot z\right) \cdot \left(t \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if k < -9.49999999999999951e-62 or 5.49999999999999966e27 < k Initial program 87.1%
Taylor expanded in t around 0 69.2%
Taylor expanded in i around 0 56.0%
if -9.49999999999999951e-62 < k < 6.2000000000000003e-74Initial program 82.6%
Taylor expanded in t around 0 53.6%
Taylor expanded in j around 0 52.2%
if 6.2000000000000003e-74 < k < 5.49999999999999966e27Initial program 87.3%
Simplified94.4%
Taylor expanded in a around 0 82.0%
Taylor expanded in k around 0 57.8%
Taylor expanded in y around inf 49.6%
*-commutative49.6%
associate-*r*50.2%
*-commutative50.2%
Simplified50.2%
Final simplification54.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 (* a (- 4.0)))))
(if (<= t -5.6e+203)
t_1
(if (<= t -4.8e-53)
(* 18.0 (* y (* t (* x z))))
(if (<= t -1.15e-307)
(* j (* k -27.0))
(if (<= t 160000000.0) (* -4.0 (* 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 = t * (a * -4.0);
double tmp;
if (t <= -5.6e+203) {
tmp = t_1;
} else if (t <= -4.8e-53) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= -1.15e-307) {
tmp = j * (k * -27.0);
} else if (t <= 160000000.0) {
tmp = -4.0 * (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 = t * (a * -4.0d0)
if (t <= (-5.6d+203)) then
tmp = t_1
else if (t <= (-4.8d-53)) then
tmp = 18.0d0 * (y * (t * (x * z)))
else if (t <= (-1.15d-307)) then
tmp = j * (k * (-27.0d0))
else if (t <= 160000000.0d0) then
tmp = (-4.0d0) * (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 = t * (a * -4.0);
double tmp;
if (t <= -5.6e+203) {
tmp = t_1;
} else if (t <= -4.8e-53) {
tmp = 18.0 * (y * (t * (x * z)));
} else if (t <= -1.15e-307) {
tmp = j * (k * -27.0);
} else if (t <= 160000000.0) {
tmp = -4.0 * (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 = t * (a * -4.0) tmp = 0 if t <= -5.6e+203: tmp = t_1 elif t <= -4.8e-53: tmp = 18.0 * (y * (t * (x * z))) elif t <= -1.15e-307: tmp = j * (k * -27.0) elif t <= 160000000.0: tmp = -4.0 * (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(t * Float64(a * Float64(-4.0))) tmp = 0.0 if (t <= -5.6e+203) tmp = t_1; elseif (t <= -4.8e-53) tmp = Float64(18.0 * Float64(y * Float64(t * Float64(x * z)))); elseif (t <= -1.15e-307) tmp = Float64(j * Float64(k * -27.0)); elseif (t <= 160000000.0) tmp = Float64(-4.0 * 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 = t * (a * -4.0);
tmp = 0.0;
if (t <= -5.6e+203)
tmp = t_1;
elseif (t <= -4.8e-53)
tmp = 18.0 * (y * (t * (x * z)));
elseif (t <= -1.15e-307)
tmp = j * (k * -27.0);
elseif (t <= 160000000.0)
tmp = -4.0 * (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[(t * N[(a * (-4.0)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -5.6e+203], t$95$1, If[LessEqual[t, -4.8e-53], N[(18.0 * N[(y * N[(t * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.15e-307], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 160000000.0], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot \left(-4\right)\right)\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{+203}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -4.8 \cdot 10^{-53}:\\
\;\;\;\;18 \cdot \left(y \cdot \left(t \cdot \left(x \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-307}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;t \leq 160000000:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -5.5999999999999998e203 or 1.6e8 < t Initial program 85.3%
Simplified88.7%
Taylor expanded in t around -inf 73.6%
Taylor expanded in y around 0 50.8%
*-commutative50.8%
Simplified50.8%
if -5.5999999999999998e203 < t < -4.80000000000000015e-53Initial program 92.3%
Simplified95.2%
Taylor expanded in a around 0 75.9%
Taylor expanded in k around 0 63.9%
Taylor expanded in y around inf 41.3%
if -4.80000000000000015e-53 < t < -1.1499999999999999e-307Initial program 87.0%
sub-neg87.0%
+-commutative87.0%
associate-*l*87.0%
distribute-rgt-neg-in87.0%
fma-def87.0%
*-commutative87.0%
distribute-rgt-neg-in87.0%
metadata-eval87.0%
sub-neg87.0%
+-commutative87.0%
associate-*l*87.0%
distribute-rgt-neg-in87.0%
Simplified94.4%
Taylor expanded in j around inf 47.4%
associate-*r*47.4%
*-commutative47.4%
*-commutative47.4%
*-commutative47.4%
Simplified47.4%
if -1.1499999999999999e-307 < t < 1.6e8Initial program 80.3%
Simplified90.7%
Taylor expanded in a around 0 90.6%
Taylor expanded in k around 0 68.2%
Taylor expanded in i around inf 39.3%
*-commutative39.3%
Simplified39.3%
Final simplification45.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 (* t (* a (- 4.0)))))
(if (<= t -6.6e+33)
t_1
(if (<= t -1.3e-307)
(* j (* k -27.0))
(if (<= t 115000000.0) (* -4.0 (* 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 = t * (a * -4.0);
double tmp;
if (t <= -6.6e+33) {
tmp = t_1;
} else if (t <= -1.3e-307) {
tmp = j * (k * -27.0);
} else if (t <= 115000000.0) {
tmp = -4.0 * (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 = t * (a * -4.0d0)
if (t <= (-6.6d+33)) then
tmp = t_1
else if (t <= (-1.3d-307)) then
tmp = j * (k * (-27.0d0))
else if (t <= 115000000.0d0) then
tmp = (-4.0d0) * (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 = t * (a * -4.0);
double tmp;
if (t <= -6.6e+33) {
tmp = t_1;
} else if (t <= -1.3e-307) {
tmp = j * (k * -27.0);
} else if (t <= 115000000.0) {
tmp = -4.0 * (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 = t * (a * -4.0) tmp = 0 if t <= -6.6e+33: tmp = t_1 elif t <= -1.3e-307: tmp = j * (k * -27.0) elif t <= 115000000.0: tmp = -4.0 * (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(t * Float64(a * Float64(-4.0))) tmp = 0.0 if (t <= -6.6e+33) tmp = t_1; elseif (t <= -1.3e-307) tmp = Float64(j * Float64(k * -27.0)); elseif (t <= 115000000.0) tmp = Float64(-4.0 * 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 = t * (a * -4.0);
tmp = 0.0;
if (t <= -6.6e+33)
tmp = t_1;
elseif (t <= -1.3e-307)
tmp = j * (k * -27.0);
elseif (t <= 115000000.0)
tmp = -4.0 * (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[(t * N[(a * (-4.0)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.6e+33], t$95$1, If[LessEqual[t, -1.3e-307], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 115000000.0], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot \left(-4\right)\right)\\
\mathbf{if}\;t \leq -6.6 \cdot 10^{+33}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.3 \cdot 10^{-307}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;t \leq 115000000:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -6.59999999999999953e33 or 1.15e8 < t Initial program 87.5%
Simplified90.1%
Taylor expanded in t around -inf 71.7%
Taylor expanded in y around 0 46.8%
*-commutative46.8%
Simplified46.8%
if -6.59999999999999953e33 < t < -1.29999999999999998e-307Initial program 87.1%
sub-neg87.1%
+-commutative87.1%
associate-*l*87.1%
distribute-rgt-neg-in87.1%
fma-def87.1%
*-commutative87.1%
distribute-rgt-neg-in87.1%
metadata-eval87.1%
sub-neg87.1%
+-commutative87.1%
associate-*l*87.1%
distribute-rgt-neg-in87.1%
Simplified95.0%
Taylor expanded in j around inf 43.0%
associate-*r*43.0%
*-commutative43.0%
*-commutative43.0%
*-commutative43.0%
Simplified43.0%
if -1.29999999999999998e-307 < t < 1.15e8Initial program 80.3%
Simplified90.7%
Taylor expanded in a around 0 90.6%
Taylor expanded in k around 0 68.2%
Taylor expanded in i around inf 39.3%
*-commutative39.3%
Simplified39.3%
Final simplification43.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
(let* ((t_1 (* -4.0 (* x i))))
(if (<= x -5.3e+85)
t_1
(if (<= x -9.2e-197) (* b c) (if (<= x 5e-21) (* j (* k -27.0)) 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 = -4.0 * (x * i);
double tmp;
if (x <= -5.3e+85) {
tmp = t_1;
} else if (x <= -9.2e-197) {
tmp = b * c;
} else if (x <= 5e-21) {
tmp = j * (k * -27.0);
} 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 = (-4.0d0) * (x * i)
if (x <= (-5.3d+85)) then
tmp = t_1
else if (x <= (-9.2d-197)) then
tmp = b * c
else if (x <= 5d-21) then
tmp = j * (k * (-27.0d0))
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 = -4.0 * (x * i);
double tmp;
if (x <= -5.3e+85) {
tmp = t_1;
} else if (x <= -9.2e-197) {
tmp = b * c;
} else if (x <= 5e-21) {
tmp = j * (k * -27.0);
} 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 = -4.0 * (x * i) tmp = 0 if x <= -5.3e+85: tmp = t_1 elif x <= -9.2e-197: tmp = b * c elif x <= 5e-21: tmp = j * (k * -27.0) 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(-4.0 * Float64(x * i)) tmp = 0.0 if (x <= -5.3e+85) tmp = t_1; elseif (x <= -9.2e-197) tmp = Float64(b * c); elseif (x <= 5e-21) tmp = Float64(j * Float64(k * -27.0)); 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 = -4.0 * (x * i);
tmp = 0.0;
if (x <= -5.3e+85)
tmp = t_1;
elseif (x <= -9.2e-197)
tmp = b * c;
elseif (x <= 5e-21)
tmp = j * (k * -27.0);
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[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5.3e+85], t$95$1, If[LessEqual[x, -9.2e-197], N[(b * c), $MachinePrecision], If[LessEqual[x, 5e-21], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;x \leq -5.3 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq -9.2 \cdot 10^{-197}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;x \leq 5 \cdot 10^{-21}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -5.2999999999999999e85 or 4.99999999999999973e-21 < x Initial program 72.6%
Simplified93.5%
Taylor expanded in a around 0 88.1%
Taylor expanded in k around 0 77.8%
Taylor expanded in i around inf 42.4%
*-commutative42.4%
Simplified42.4%
if -5.2999999999999999e85 < x < -9.2000000000000002e-197Initial program 91.4%
Simplified92.9%
Taylor expanded in a around 0 72.1%
Taylor expanded in c around inf 30.8%
if -9.2000000000000002e-197 < x < 4.99999999999999973e-21Initial program 97.4%
sub-neg97.4%
+-commutative97.4%
associate-*l*97.4%
distribute-rgt-neg-in97.4%
fma-def97.4%
*-commutative97.4%
distribute-rgt-neg-in97.4%
metadata-eval97.4%
sub-neg97.4%
+-commutative97.4%
associate-*l*97.4%
distribute-rgt-neg-in97.4%
Simplified91.3%
Taylor expanded in j around inf 43.0%
associate-*r*43.0%
*-commutative43.0%
*-commutative43.0%
*-commutative43.0%
Simplified43.0%
Final simplification39.4%
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 (<= k -9.5e-28) (not (<= k 3.3e-19))) (* -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 ((k <= -9.5e-28) || !(k <= 3.3e-19)) {
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 ((k <= (-9.5d-28)) .or. (.not. (k <= 3.3d-19))) 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 ((k <= -9.5e-28) || !(k <= 3.3e-19)) {
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 (k <= -9.5e-28) or not (k <= 3.3e-19): 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 ((k <= -9.5e-28) || !(k <= 3.3e-19)) 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 ((k <= -9.5e-28) || ~((k <= 3.3e-19)))
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[Or[LessEqual[k, -9.5e-28], N[Not[LessEqual[k, 3.3e-19]], $MachinePrecision]], 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}\;k \leq -9.5 \cdot 10^{-28} \lor \neg \left(k \leq 3.3 \cdot 10^{-19}\right):\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if k < -9.50000000000000001e-28 or 3.2999999999999998e-19 < k Initial program 86.8%
sub-neg86.8%
+-commutative86.8%
associate-*l*86.8%
distribute-rgt-neg-in86.8%
fma-def87.5%
*-commutative87.5%
distribute-rgt-neg-in87.5%
metadata-eval87.5%
sub-neg87.5%
+-commutative87.5%
associate-*l*87.5%
distribute-rgt-neg-in87.5%
Simplified94.7%
Taylor expanded in j around inf 42.7%
if -9.50000000000000001e-28 < k < 3.2999999999999998e-19Initial program 83.6%
Simplified91.2%
Taylor expanded in a around 0 74.6%
Taylor expanded in c around inf 24.2%
Final simplification33.9%
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 (<= k -1.5e-27) (* -27.0 (* j k)) (if (<= k 2.3e-18) (* b c) (* 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 (k <= -1.5e-27) {
tmp = -27.0 * (j * k);
} else if (k <= 2.3e-18) {
tmp = b * c;
} else {
tmp = 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 (k <= (-1.5d-27)) then
tmp = (-27.0d0) * (j * k)
else if (k <= 2.3d-18) then
tmp = b * c
else
tmp = 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 (k <= -1.5e-27) {
tmp = -27.0 * (j * k);
} else if (k <= 2.3e-18) {
tmp = b * c;
} else {
tmp = 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 k <= -1.5e-27: tmp = -27.0 * (j * k) elif k <= 2.3e-18: tmp = b * c else: tmp = 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 (k <= -1.5e-27) tmp = Float64(-27.0 * Float64(j * k)); elseif (k <= 2.3e-18) tmp = Float64(b * c); else tmp = 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 (k <= -1.5e-27)
tmp = -27.0 * (j * k);
elseif (k <= 2.3e-18)
tmp = b * c;
else
tmp = 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[k, -1.5e-27], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.3e-18], N[(b * c), $MachinePrecision], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq -1.5 \cdot 10^{-27}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;k \leq 2.3 \cdot 10^{-18}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\end{array}
\end{array}
if k < -1.5000000000000001e-27Initial program 90.1%
sub-neg90.1%
+-commutative90.1%
associate-*l*90.2%
distribute-rgt-neg-in90.2%
fma-def91.8%
*-commutative91.8%
distribute-rgt-neg-in91.8%
metadata-eval91.8%
sub-neg91.8%
+-commutative91.8%
associate-*l*91.8%
distribute-rgt-neg-in91.8%
Simplified95.0%
Taylor expanded in j around inf 44.7%
if -1.5000000000000001e-27 < k < 2.3000000000000001e-18Initial program 83.8%
Simplified91.2%
Taylor expanded in a around 0 74.8%
Taylor expanded in c around inf 24.8%
if 2.3000000000000001e-18 < k Initial program 83.9%
sub-neg83.9%
+-commutative83.9%
associate-*l*83.8%
distribute-rgt-neg-in83.8%
fma-def83.9%
*-commutative83.9%
distribute-rgt-neg-in83.9%
metadata-eval83.9%
sub-neg83.9%
+-commutative83.9%
associate-*l*83.9%
distribute-rgt-neg-in83.9%
Simplified94.4%
Taylor expanded in j around inf 41.6%
associate-*r*42.9%
*-commutative42.9%
*-commutative42.9%
*-commutative42.9%
Simplified42.9%
Final simplification34.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 (* 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 85.3%
Simplified91.5%
Taylor expanded in a around 0 77.5%
Taylor expanded in c around inf 19.9%
Final simplification19.9%
(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 2023195
(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)))