
(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 29 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: y and z should be sorted in increasing order before calling this function.
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 (<= x -2.2e+116)
(* x (- (* i (- 4.0)) (* -18.0 (* (* t y) z))))
(if (<= x 5.5e+198)
(-
(fma t (fma x (* 18.0 (* y z)) (* a -4.0)) (* b c))
(fma x (* i 4.0) (* j (* 27.0 k))))
(-
(fma x (fma 18.0 (* t (* y z)) (* i -4.0)) (* b c))
(* k (* j 27.0))))))assert(y < 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 (x <= -2.2e+116) {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
} else if (x <= 5.5e+198) {
tmp = fma(t, fma(x, (18.0 * (y * z)), (a * -4.0)), (b * c)) - fma(x, (i * 4.0), (j * (27.0 * k)));
} else {
tmp = fma(x, fma(18.0, (t * (y * z)), (i * -4.0)), (b * c)) - (k * (j * 27.0));
}
return tmp;
}
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -2.2e+116) tmp = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(Float64(t * y) * z)))); elseif (x <= 5.5e+198) tmp = Float64(fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(a * -4.0)), Float64(b * c)) - fma(x, Float64(i * 4.0), Float64(j * Float64(27.0 * k)))); else tmp = Float64(fma(x, fma(18.0, Float64(t * Float64(y * z)), Float64(i * -4.0)), Float64(b * c)) - Float64(k * Float64(j * 27.0))); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function. 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[x, -2.2e+116], N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.5e+198], N[(N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(x * N[(i * 4.0), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.2 \cdot 10^{+116}:\\
\;\;\;\;x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(\left(t \cdot y\right) \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{+198}:\\
\;\;\;\;\mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), b \cdot c\right) - \mathsf{fma}\left(x, i \cdot 4, j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(18, t \cdot \left(y \cdot z\right), i \cdot -4\right), b \cdot c\right) - k \cdot \left(j \cdot 27\right)\\
\end{array}
\end{array}
if x < -2.2e116Initial program 68.0%
Simplified70.5%
Taylor expanded in x around inf 68.1%
*-commutative68.1%
associate-*l*77.9%
associate-*l*79.9%
Simplified79.9%
Taylor expanded in x around -inf 83.1%
mul-1-neg83.1%
cancel-sign-sub-inv83.1%
associate-*r*87.8%
metadata-eval87.8%
*-commutative87.8%
Simplified87.8%
if -2.2e116 < x < 5.5000000000000004e198Initial program 91.0%
associate--l-91.0%
associate-+l-91.0%
Simplified93.1%
if 5.5000000000000004e198 < x Initial program 71.0%
Taylor expanded in a around 0 78.2%
sub-neg78.2%
+-commutative78.2%
associate-+l+78.2%
associate-*r*78.2%
*-commutative78.2%
associate-*r*92.5%
associate-*r*92.5%
distribute-lft-neg-in92.5%
metadata-eval92.5%
associate-*r*92.5%
distribute-rgt-in99.9%
metadata-eval99.9%
cancel-sign-sub-inv99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Final simplification93.0%
NOTE: y and z should be sorted in increasing order before calling this function.
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 c) (- (* t (* z (* y (* x 18.0)))) (* t (* 4.0 a))))
(* i (* x 4.0)))
(* k (* j 27.0)))
INFINITY)
(-
(+ (* b c) (* t (- (* (* y z) (* x 18.0)) (* 4.0 a))))
(+ (* j (* 27.0 k)) (* x (* i 4.0))))
(* x (- (* i (- 4.0)) (* -18.0 (* (* t y) z))))))assert(y < 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 (((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (4.0 * a)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= ((double) INFINITY)) {
tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (4.0 * a)))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
} else {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
}
return tmp;
}
assert y < z;
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 * c) + ((t * (z * (y * (x * 18.0)))) - (t * (4.0 * a)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= Double.POSITIVE_INFINITY) {
tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (4.0 * a)))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
} else {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if ((((b * c) + ((t * (z * (y * (x * 18.0)))) - (t * (4.0 * a)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= math.inf: tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (4.0 * a)))) - ((j * (27.0 * k)) + (x * (i * 4.0))) else: tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z))) return tmp
y, z = sort([y, z]) 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(b * c) + Float64(Float64(t * Float64(z * Float64(y * Float64(x * 18.0)))) - Float64(t * Float64(4.0 * a)))) - Float64(i * Float64(x * 4.0))) - Float64(k * Float64(j * 27.0))) <= Inf) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(y * z) * Float64(x * 18.0)) - Float64(4.0 * a)))) - Float64(Float64(j * Float64(27.0 * k)) + Float64(x * Float64(i * 4.0)))); else tmp = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(Float64(t * y) * z)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 * c) + ((t * (z * (y * (x * 18.0)))) - (t * (4.0 * a)))) - (i * (x * 4.0))) - (k * (j * 27.0))) <= Inf)
tmp = ((b * c) + (t * (((y * z) * (x * 18.0)) - (4.0 * a)))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
else
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[(b * c), $MachinePrecision] + N[(N[(t * N[(z * N[(y * N[(x * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(t * N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * N[(x * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(y * z), $MachinePrecision] * N[(x * 18.0), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(b \cdot c + \left(t \cdot \left(z \cdot \left(y \cdot \left(x \cdot 18\right)\right)\right) - t \cdot \left(4 \cdot a\right)\right)\right) - i \cdot \left(x \cdot 4\right)\right) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(y \cdot z\right) \cdot \left(x \cdot 18\right) - 4 \cdot a\right)\right) - \left(j \cdot \left(27 \cdot k\right) + x \cdot \left(i \cdot 4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(\left(t \cdot y\right) \cdot z\right)\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 92.9%
Simplified92.9%
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%
Simplified14.3%
Taylor expanded in x around inf 28.6%
*-commutative28.6%
associate-*l*33.3%
associate-*l*33.3%
Simplified33.3%
Taylor expanded in x around -inf 62.1%
mul-1-neg62.1%
cancel-sign-sub-inv62.1%
associate-*r*71.6%
metadata-eval71.6%
*-commutative71.6%
Simplified71.6%
Final simplification91.1%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* t (* y z))) (* i 4.0))))
(t_2 (- (* b c) (* 4.0 (+ (* t a) (* x i)))))
(t_3 (* k (* j 27.0))))
(if (<= t_3 -1e+167)
(- (* t (* a -4.0)) t_3)
(if (<= t_3 -5e-196)
t_2
(if (<= t_3 1e-235)
t_1
(if (<= t_3 2e-72)
t_2
(if (<= t_3 4e+170)
t_1
(- (* b c) (+ (* 27.0 (* j k)) (* 4.0 (* x i)))))))))))assert(y < 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 t_1 = x * ((18.0 * (t * (y * z))) - (i * 4.0));
double t_2 = (b * c) - (4.0 * ((t * a) + (x * i)));
double t_3 = k * (j * 27.0);
double tmp;
if (t_3 <= -1e+167) {
tmp = (t * (a * -4.0)) - t_3;
} else if (t_3 <= -5e-196) {
tmp = t_2;
} else if (t_3 <= 1e-235) {
tmp = t_1;
} else if (t_3 <= 2e-72) {
tmp = t_2;
} else if (t_3 <= 4e+170) {
tmp = t_1;
} else {
tmp = (b * c) - ((27.0 * (j * k)) + (4.0 * (x * i)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = x * ((18.0d0 * (t * (y * z))) - (i * 4.0d0))
t_2 = (b * c) - (4.0d0 * ((t * a) + (x * i)))
t_3 = k * (j * 27.0d0)
if (t_3 <= (-1d+167)) then
tmp = (t * (a * (-4.0d0))) - t_3
else if (t_3 <= (-5d-196)) then
tmp = t_2
else if (t_3 <= 1d-235) then
tmp = t_1
else if (t_3 <= 2d-72) then
tmp = t_2
else if (t_3 <= 4d+170) then
tmp = t_1
else
tmp = (b * c) - ((27.0d0 * (j * k)) + (4.0d0 * (x * i)))
end if
code = tmp
end function
assert y < z;
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 * (t * (y * z))) - (i * 4.0));
double t_2 = (b * c) - (4.0 * ((t * a) + (x * i)));
double t_3 = k * (j * 27.0);
double tmp;
if (t_3 <= -1e+167) {
tmp = (t * (a * -4.0)) - t_3;
} else if (t_3 <= -5e-196) {
tmp = t_2;
} else if (t_3 <= 1e-235) {
tmp = t_1;
} else if (t_3 <= 2e-72) {
tmp = t_2;
} else if (t_3 <= 4e+170) {
tmp = t_1;
} else {
tmp = (b * c) - ((27.0 * (j * k)) + (4.0 * (x * i)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (t * (y * z))) - (i * 4.0)) t_2 = (b * c) - (4.0 * ((t * a) + (x * i))) t_3 = k * (j * 27.0) tmp = 0 if t_3 <= -1e+167: tmp = (t * (a * -4.0)) - t_3 elif t_3 <= -5e-196: tmp = t_2 elif t_3 <= 1e-235: tmp = t_1 elif t_3 <= 2e-72: tmp = t_2 elif t_3 <= 4e+170: tmp = t_1 else: tmp = (b * c) - ((27.0 * (j * k)) + (4.0 * (x * i))) return tmp
y, z = sort([y, z]) 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(t * Float64(y * z))) - Float64(i * 4.0))) t_2 = Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) t_3 = Float64(k * Float64(j * 27.0)) tmp = 0.0 if (t_3 <= -1e+167) tmp = Float64(Float64(t * Float64(a * -4.0)) - t_3); elseif (t_3 <= -5e-196) tmp = t_2; elseif (t_3 <= 1e-235) tmp = t_1; elseif (t_3 <= 2e-72) tmp = t_2; elseif (t_3 <= 4e+170) tmp = t_1; else tmp = Float64(Float64(b * c) - Float64(Float64(27.0 * Float64(j * k)) + Float64(4.0 * Float64(x * i)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 * (t * (y * z))) - (i * 4.0));
t_2 = (b * c) - (4.0 * ((t * a) + (x * i)));
t_3 = k * (j * 27.0);
tmp = 0.0;
if (t_3 <= -1e+167)
tmp = (t * (a * -4.0)) - t_3;
elseif (t_3 <= -5e-196)
tmp = t_2;
elseif (t_3 <= 1e-235)
tmp = t_1;
elseif (t_3 <= 2e-72)
tmp = t_2;
elseif (t_3 <= 4e+170)
tmp = t_1;
else
tmp = (b * c) - ((27.0 * (j * k)) + (4.0 * (x * i)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+167], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision], If[LessEqual[t$95$3, -5e-196], t$95$2, If[LessEqual[t$95$3, 1e-235], t$95$1, If[LessEqual[t$95$3, 2e-72], t$95$2, If[LessEqual[t$95$3, 4e+170], t$95$1, N[(N[(b * c), $MachinePrecision] - N[(N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - i \cdot 4\right)\\
t_2 := b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\\
t_3 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t_3 \leq -1 \cdot 10^{+167}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right) - t_3\\
\mathbf{elif}\;t_3 \leq -5 \cdot 10^{-196}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 10^{-235}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_3 \leq 2 \cdot 10^{-72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 4 \cdot 10^{+170}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \left(27 \cdot \left(j \cdot k\right) + 4 \cdot \left(x \cdot i\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -1e167Initial program 82.0%
Taylor expanded in t around -inf 83.4%
associate-*r*83.4%
neg-mul-183.4%
cancel-sign-sub-inv83.4%
*-commutative83.4%
metadata-eval83.4%
Simplified83.4%
Taylor expanded in x around 0 80.9%
associate-*r*80.9%
Simplified80.9%
if -1e167 < (*.f64 (*.f64 j 27) k) < -5.0000000000000005e-196 or 9.9999999999999996e-236 < (*.f64 (*.f64 j 27) k) < 1.9999999999999999e-72Initial program 84.8%
Taylor expanded in y around 0 82.6%
distribute-lft-out82.6%
*-commutative82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in j around 0 77.6%
if -5.0000000000000005e-196 < (*.f64 (*.f64 j 27) k) < 9.9999999999999996e-236 or 1.9999999999999999e-72 < (*.f64 (*.f64 j 27) k) < 4.00000000000000014e170Initial program 84.8%
Simplified84.8%
Taylor expanded in x around inf 68.4%
if 4.00000000000000014e170 < (*.f64 (*.f64 j 27) k) Initial program 93.0%
Simplified92.8%
Taylor expanded in t around 0 93.0%
Final simplification76.4%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* t (* y z))) (* i 4.0))))
(t_2 (- (* b c) (* 4.0 (+ (* t a) (* x i)))))
(t_3 (* k (* j 27.0))))
(if (<= t_3 -1e+167)
(- (* t (* a -4.0)) t_3)
(if (<= t_3 -5e-196)
t_2
(if (<= t_3 1e-235)
t_1
(if (<= t_3 2e-72)
t_2
(if (<= t_3 4e+170) t_1 (- (* b c) (* 27.0 (* j k))))))))))assert(y < 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 t_1 = x * ((18.0 * (t * (y * z))) - (i * 4.0));
double t_2 = (b * c) - (4.0 * ((t * a) + (x * i)));
double t_3 = k * (j * 27.0);
double tmp;
if (t_3 <= -1e+167) {
tmp = (t * (a * -4.0)) - t_3;
} else if (t_3 <= -5e-196) {
tmp = t_2;
} else if (t_3 <= 1e-235) {
tmp = t_1;
} else if (t_3 <= 2e-72) {
tmp = t_2;
} else if (t_3 <= 4e+170) {
tmp = t_1;
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = x * ((18.0d0 * (t * (y * z))) - (i * 4.0d0))
t_2 = (b * c) - (4.0d0 * ((t * a) + (x * i)))
t_3 = k * (j * 27.0d0)
if (t_3 <= (-1d+167)) then
tmp = (t * (a * (-4.0d0))) - t_3
else if (t_3 <= (-5d-196)) then
tmp = t_2
else if (t_3 <= 1d-235) then
tmp = t_1
else if (t_3 <= 2d-72) then
tmp = t_2
else if (t_3 <= 4d+170) then
tmp = t_1
else
tmp = (b * c) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
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 * (t * (y * z))) - (i * 4.0));
double t_2 = (b * c) - (4.0 * ((t * a) + (x * i)));
double t_3 = k * (j * 27.0);
double tmp;
if (t_3 <= -1e+167) {
tmp = (t * (a * -4.0)) - t_3;
} else if (t_3 <= -5e-196) {
tmp = t_2;
} else if (t_3 <= 1e-235) {
tmp = t_1;
} else if (t_3 <= 2e-72) {
tmp = t_2;
} else if (t_3 <= 4e+170) {
tmp = t_1;
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (t * (y * z))) - (i * 4.0)) t_2 = (b * c) - (4.0 * ((t * a) + (x * i))) t_3 = k * (j * 27.0) tmp = 0 if t_3 <= -1e+167: tmp = (t * (a * -4.0)) - t_3 elif t_3 <= -5e-196: tmp = t_2 elif t_3 <= 1e-235: tmp = t_1 elif t_3 <= 2e-72: tmp = t_2 elif t_3 <= 4e+170: tmp = t_1 else: tmp = (b * c) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) 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(t * Float64(y * z))) - Float64(i * 4.0))) t_2 = Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) t_3 = Float64(k * Float64(j * 27.0)) tmp = 0.0 if (t_3 <= -1e+167) tmp = Float64(Float64(t * Float64(a * -4.0)) - t_3); elseif (t_3 <= -5e-196) tmp = t_2; elseif (t_3 <= 1e-235) tmp = t_1; elseif (t_3 <= 2e-72) tmp = t_2; elseif (t_3 <= 4e+170) tmp = t_1; else tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 * (t * (y * z))) - (i * 4.0));
t_2 = (b * c) - (4.0 * ((t * a) + (x * i)));
t_3 = k * (j * 27.0);
tmp = 0.0;
if (t_3 <= -1e+167)
tmp = (t * (a * -4.0)) - t_3;
elseif (t_3 <= -5e-196)
tmp = t_2;
elseif (t_3 <= 1e-235)
tmp = t_1;
elseif (t_3 <= 2e-72)
tmp = t_2;
elseif (t_3 <= 4e+170)
tmp = t_1;
else
tmp = (b * c) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -1e+167], N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$3), $MachinePrecision], If[LessEqual[t$95$3, -5e-196], t$95$2, If[LessEqual[t$95$3, 1e-235], t$95$1, If[LessEqual[t$95$3, 2e-72], t$95$2, If[LessEqual[t$95$3, 4e+170], t$95$1, N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - i \cdot 4\right)\\
t_2 := b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\\
t_3 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t_3 \leq -1 \cdot 10^{+167}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right) - t_3\\
\mathbf{elif}\;t_3 \leq -5 \cdot 10^{-196}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 10^{-235}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_3 \leq 2 \cdot 10^{-72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 4 \cdot 10^{+170}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -1e167Initial program 82.0%
Taylor expanded in t around -inf 83.4%
associate-*r*83.4%
neg-mul-183.4%
cancel-sign-sub-inv83.4%
*-commutative83.4%
metadata-eval83.4%
Simplified83.4%
Taylor expanded in x around 0 80.9%
associate-*r*80.9%
Simplified80.9%
if -1e167 < (*.f64 (*.f64 j 27) k) < -5.0000000000000005e-196 or 9.9999999999999996e-236 < (*.f64 (*.f64 j 27) k) < 1.9999999999999999e-72Initial program 84.8%
Taylor expanded in y around 0 82.6%
distribute-lft-out82.6%
*-commutative82.6%
*-commutative82.6%
Simplified82.6%
Taylor expanded in j around 0 77.6%
if -5.0000000000000005e-196 < (*.f64 (*.f64 j 27) k) < 9.9999999999999996e-236 or 1.9999999999999999e-72 < (*.f64 (*.f64 j 27) k) < 4.00000000000000014e170Initial program 84.8%
Simplified84.8%
Taylor expanded in x around inf 68.4%
if 4.00000000000000014e170 < (*.f64 (*.f64 j 27) k) Initial program 93.0%
Taylor expanded in a around 0 86.6%
sub-neg86.6%
+-commutative86.6%
associate-+l+86.6%
associate-*r*86.6%
*-commutative86.6%
associate-*r*89.8%
associate-*r*89.8%
distribute-lft-neg-in89.8%
metadata-eval89.8%
associate-*r*89.8%
distribute-rgt-in89.8%
metadata-eval89.8%
cancel-sign-sub-inv89.8%
+-commutative89.8%
fma-def93.3%
Simplified93.3%
Taylor expanded in x around 0 89.8%
Final simplification76.0%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* t (* y z))) (* i 4.0))))
(t_2 (* k (* j 27.0)))
(t_3 (- (* t (* a -4.0)) t_2)))
(if (<= t_2 -1e+111)
t_3
(if (<= t_2 -2e-39)
t_1
(if (<= t_2 -2e-75)
t_3
(if (<= t_2 4e+170) t_1 (- (* b c) (* 27.0 (* j k)))))))))assert(y < 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 t_1 = x * ((18.0 * (t * (y * z))) - (i * 4.0));
double t_2 = k * (j * 27.0);
double t_3 = (t * (a * -4.0)) - t_2;
double tmp;
if (t_2 <= -1e+111) {
tmp = t_3;
} else if (t_2 <= -2e-39) {
tmp = t_1;
} else if (t_2 <= -2e-75) {
tmp = t_3;
} else if (t_2 <= 4e+170) {
tmp = t_1;
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = x * ((18.0d0 * (t * (y * z))) - (i * 4.0d0))
t_2 = k * (j * 27.0d0)
t_3 = (t * (a * (-4.0d0))) - t_2
if (t_2 <= (-1d+111)) then
tmp = t_3
else if (t_2 <= (-2d-39)) then
tmp = t_1
else if (t_2 <= (-2d-75)) then
tmp = t_3
else if (t_2 <= 4d+170) then
tmp = t_1
else
tmp = (b * c) - (27.0d0 * (j * k))
end if
code = tmp
end function
assert y < z;
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 * (t * (y * z))) - (i * 4.0));
double t_2 = k * (j * 27.0);
double t_3 = (t * (a * -4.0)) - t_2;
double tmp;
if (t_2 <= -1e+111) {
tmp = t_3;
} else if (t_2 <= -2e-39) {
tmp = t_1;
} else if (t_2 <= -2e-75) {
tmp = t_3;
} else if (t_2 <= 4e+170) {
tmp = t_1;
} else {
tmp = (b * c) - (27.0 * (j * k));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * ((18.0 * (t * (y * z))) - (i * 4.0)) t_2 = k * (j * 27.0) t_3 = (t * (a * -4.0)) - t_2 tmp = 0 if t_2 <= -1e+111: tmp = t_3 elif t_2 <= -2e-39: tmp = t_1 elif t_2 <= -2e-75: tmp = t_3 elif t_2 <= 4e+170: tmp = t_1 else: tmp = (b * c) - (27.0 * (j * k)) return tmp
y, z = sort([y, z]) 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(t * Float64(y * z))) - Float64(i * 4.0))) t_2 = Float64(k * Float64(j * 27.0)) t_3 = Float64(Float64(t * Float64(a * -4.0)) - t_2) tmp = 0.0 if (t_2 <= -1e+111) tmp = t_3; elseif (t_2 <= -2e-39) tmp = t_1; elseif (t_2 <= -2e-75) tmp = t_3; elseif (t_2 <= 4e+170) tmp = t_1; else tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 * (t * (y * z))) - (i * 4.0));
t_2 = k * (j * 27.0);
t_3 = (t * (a * -4.0)) - t_2;
tmp = 0.0;
if (t_2 <= -1e+111)
tmp = t_3;
elseif (t_2 <= -2e-39)
tmp = t_1;
elseif (t_2 <= -2e-75)
tmp = t_3;
elseif (t_2 <= 4e+170)
tmp = t_1;
else
tmp = (b * c) - (27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+111], t$95$3, If[LessEqual[t$95$2, -2e-39], t$95$1, If[LessEqual[t$95$2, -2e-75], t$95$3, If[LessEqual[t$95$2, 4e+170], t$95$1, N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - i \cdot 4\right)\\
t_2 := k \cdot \left(j \cdot 27\right)\\
t_3 := t \cdot \left(a \cdot -4\right) - t_2\\
\mathbf{if}\;t_2 \leq -1 \cdot 10^{+111}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-39}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t_2 \leq -2 \cdot 10^{-75}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_2 \leq 4 \cdot 10^{+170}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -9.99999999999999957e110 or -1.99999999999999986e-39 < (*.f64 (*.f64 j 27) k) < -1.9999999999999999e-75Initial program 84.8%
Taylor expanded in t around -inf 77.4%
associate-*r*77.4%
neg-mul-177.4%
cancel-sign-sub-inv77.4%
*-commutative77.4%
metadata-eval77.4%
Simplified77.4%
Taylor expanded in x around 0 74.1%
associate-*r*74.1%
Simplified74.1%
if -9.99999999999999957e110 < (*.f64 (*.f64 j 27) k) < -1.99999999999999986e-39 or -1.9999999999999999e-75 < (*.f64 (*.f64 j 27) k) < 4.00000000000000014e170Initial program 84.2%
Simplified85.3%
Taylor expanded in x around inf 61.4%
if 4.00000000000000014e170 < (*.f64 (*.f64 j 27) k) Initial program 93.0%
Taylor expanded in a around 0 86.6%
sub-neg86.6%
+-commutative86.6%
associate-+l+86.6%
associate-*r*86.6%
*-commutative86.6%
associate-*r*89.8%
associate-*r*89.8%
distribute-lft-neg-in89.8%
metadata-eval89.8%
associate-*r*89.8%
distribute-rgt-in89.8%
metadata-eval89.8%
cancel-sign-sub-inv89.8%
+-commutative89.8%
fma-def93.3%
Simplified93.3%
Taylor expanded in x around 0 89.8%
Final simplification67.6%
NOTE: y and z should be sorted in increasing order before calling this function.
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) (* t (- (* 18.0 (* x (* y z))) (* 4.0 a))))
(* 27.0 (* j k)))))
(if (<= t -2.25e+42)
t_1
(if (<= t -1.45e-210)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) (* k (* j 27.0)))
(if (<= t 5.5e-18)
(-
(+ (* b c) (* 18.0 (* x (* y (* t z)))))
(+ (* j (* 27.0 k)) (* x (* i 4.0))))
t_1)))))assert(y < 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 t_1 = ((b * c) + (t * ((18.0 * (x * (y * z))) - (4.0 * a)))) - (27.0 * (j * k));
double tmp;
if (t <= -2.25e+42) {
tmp = t_1;
} else if (t <= -1.45e-210) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
} else if (t <= 5.5e-18) {
tmp = ((b * c) + (18.0 * (x * (y * (t * z))))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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) + (t * ((18.0d0 * (x * (y * z))) - (4.0d0 * a)))) - (27.0d0 * (j * k))
if (t <= (-2.25d+42)) then
tmp = t_1
else if (t <= (-1.45d-210)) then
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - (k * (j * 27.0d0))
else if (t <= 5.5d-18) then
tmp = ((b * c) + (18.0d0 * (x * (y * (t * z))))) - ((j * (27.0d0 * k)) + (x * (i * 4.0d0)))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
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) + (t * ((18.0 * (x * (y * z))) - (4.0 * a)))) - (27.0 * (j * k));
double tmp;
if (t <= -2.25e+42) {
tmp = t_1;
} else if (t <= -1.45e-210) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
} else if (t <= 5.5e-18) {
tmp = ((b * c) + (18.0 * (x * (y * (t * z))))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = ((b * c) + (t * ((18.0 * (x * (y * z))) - (4.0 * a)))) - (27.0 * (j * k)) tmp = 0 if t <= -2.25e+42: tmp = t_1 elif t <= -1.45e-210: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0)) elif t <= 5.5e-18: tmp = ((b * c) + (18.0 * (x * (y * (t * z))))) - ((j * (27.0 * k)) + (x * (i * 4.0))) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(4.0 * a)))) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (t <= -2.25e+42) tmp = t_1; elseif (t <= -1.45e-210) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - Float64(k * Float64(j * 27.0))); elseif (t <= 5.5e-18) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(x * Float64(y * Float64(t * z))))) - Float64(Float64(j * Float64(27.0 * k)) + Float64(x * Float64(i * 4.0)))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = ((b * c) + (t * ((18.0 * (x * (y * z))) - (4.0 * a)))) - (27.0 * (j * k));
tmp = 0.0;
if (t <= -2.25e+42)
tmp = t_1;
elseif (t <= -1.45e-210)
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
elseif (t <= 5.5e-18)
tmp = ((b * c) + (18.0 * (x * (y * (t * z))))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.25e+42], t$95$1, If[LessEqual[t, -1.45e-210], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.5e-18], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(x * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;t \leq -2.25 \cdot 10^{+42}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.45 \cdot 10^{-210}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{-18}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(x \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\right) - \left(j \cdot \left(27 \cdot k\right) + x \cdot \left(i \cdot 4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -2.25000000000000006e42 or 5.5e-18 < t Initial program 86.5%
Simplified88.9%
Taylor expanded in i around 0 87.7%
if -2.25000000000000006e42 < t < -1.45000000000000003e-210Initial program 91.9%
Taylor expanded in y around 0 94.0%
distribute-lft-out94.0%
*-commutative94.0%
*-commutative94.0%
Simplified94.0%
if -1.45000000000000003e-210 < t < 5.5e-18Initial program 79.6%
Simplified79.5%
Taylor expanded in x around inf 77.1%
*-commutative77.1%
associate-*l*86.8%
associate-*l*92.6%
Simplified92.6%
Final simplification90.4%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* y z))) (t_2 (* k (* j 27.0))))
(if (<= t -6e+38)
(- (+ (* b c) (* t (- (* 18.0 t_1) (* 4.0 a)))) (* 27.0 (* j k)))
(if (<= t -1.25e-216)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) t_2)
(if (<= t 5e-16)
(-
(+ (* b c) (* 18.0 (* x (* y (* t z)))))
(+ (* j (* 27.0 k)) (* x (* i 4.0))))
(- (- (+ (* b c) (* 18.0 (* t t_1))) (* 4.0 (* t a))) t_2))))))assert(y < 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 t_1 = x * (y * z);
double t_2 = k * (j * 27.0);
double tmp;
if (t <= -6e+38) {
tmp = ((b * c) + (t * ((18.0 * t_1) - (4.0 * a)))) - (27.0 * (j * k));
} else if (t <= -1.25e-216) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_2;
} else if (t <= 5e-16) {
tmp = ((b * c) + (18.0 * (x * (y * (t * z))))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
} else {
tmp = (((b * c) + (18.0 * (t * t_1))) - (4.0 * (t * a))) - t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = x * (y * z)
t_2 = k * (j * 27.0d0)
if (t <= (-6d+38)) then
tmp = ((b * c) + (t * ((18.0d0 * t_1) - (4.0d0 * a)))) - (27.0d0 * (j * k))
else if (t <= (-1.25d-216)) then
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - t_2
else if (t <= 5d-16) then
tmp = ((b * c) + (18.0d0 * (x * (y * (t * z))))) - ((j * (27.0d0 * k)) + (x * (i * 4.0d0)))
else
tmp = (((b * c) + (18.0d0 * (t * t_1))) - (4.0d0 * (t * a))) - t_2
end if
code = tmp
end function
assert y < z;
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 * (y * z);
double t_2 = k * (j * 27.0);
double tmp;
if (t <= -6e+38) {
tmp = ((b * c) + (t * ((18.0 * t_1) - (4.0 * a)))) - (27.0 * (j * k));
} else if (t <= -1.25e-216) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_2;
} else if (t <= 5e-16) {
tmp = ((b * c) + (18.0 * (x * (y * (t * z))))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
} else {
tmp = (((b * c) + (18.0 * (t * t_1))) - (4.0 * (t * a))) - t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (y * z) t_2 = k * (j * 27.0) tmp = 0 if t <= -6e+38: tmp = ((b * c) + (t * ((18.0 * t_1) - (4.0 * a)))) - (27.0 * (j * k)) elif t <= -1.25e-216: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_2 elif t <= 5e-16: tmp = ((b * c) + (18.0 * (x * (y * (t * z))))) - ((j * (27.0 * k)) + (x * (i * 4.0))) else: tmp = (((b * c) + (18.0 * (t * t_1))) - (4.0 * (t * a))) - t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(y * z)) t_2 = Float64(k * Float64(j * 27.0)) tmp = 0.0 if (t <= -6e+38) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * t_1) - Float64(4.0 * a)))) - Float64(27.0 * Float64(j * k))); elseif (t <= -1.25e-216) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_2); elseif (t <= 5e-16) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(x * Float64(y * Float64(t * z))))) - Float64(Float64(j * Float64(27.0 * k)) + Float64(x * Float64(i * 4.0)))); else tmp = Float64(Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(t * t_1))) - Float64(4.0 * Float64(t * a))) - t_2); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (y * z);
t_2 = k * (j * 27.0);
tmp = 0.0;
if (t <= -6e+38)
tmp = ((b * c) + (t * ((18.0 * t_1) - (4.0 * a)))) - (27.0 * (j * k));
elseif (t <= -1.25e-216)
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_2;
elseif (t <= 5e-16)
tmp = ((b * c) + (18.0 * (x * (y * (t * z))))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
else
tmp = (((b * c) + (18.0 * (t * t_1))) - (4.0 * (t * a))) - t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6e+38], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * t$95$1), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -1.25e-216], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t, 5e-16], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(x * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
t_2 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t \leq -6 \cdot 10^{+38}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot t_1 - 4 \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq -1.25 \cdot 10^{-216}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_2\\
\mathbf{elif}\;t \leq 5 \cdot 10^{-16}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(x \cdot \left(y \cdot \left(t \cdot z\right)\right)\right)\right) - \left(j \cdot \left(27 \cdot k\right) + x \cdot \left(i \cdot 4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(b \cdot c + 18 \cdot \left(t \cdot t_1\right)\right) - 4 \cdot \left(t \cdot a\right)\right) - t_2\\
\end{array}
\end{array}
if t < -6.0000000000000002e38Initial program 84.6%
Simplified91.4%
Taylor expanded in i around 0 88.6%
if -6.0000000000000002e38 < t < -1.25000000000000005e-216Initial program 91.9%
Taylor expanded in y around 0 94.0%
distribute-lft-out94.0%
*-commutative94.0%
*-commutative94.0%
Simplified94.0%
if -1.25000000000000005e-216 < t < 5.0000000000000004e-16Initial program 79.6%
Simplified79.5%
Taylor expanded in x around inf 77.1%
*-commutative77.1%
associate-*l*86.8%
associate-*l*92.6%
Simplified92.6%
if 5.0000000000000004e-16 < t Initial program 88.2%
Taylor expanded in i around 0 86.9%
Final simplification90.4%
NOTE: y and z should be sorted in increasing order before calling this function. 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 (<= t -4e+36) (not (<= t 3.4e+31))) (- (+ (* b c) (* t (- (* 18.0 (* x (* y z))) (* 4.0 a)))) (* 27.0 (* j k))) (- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) (* k (* j 27.0)))))
assert(y < 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 ((t <= -4e+36) || !(t <= 3.4e+31)) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (4.0 * a)))) - (27.0 * (j * k));
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 ((t <= (-4d+36)) .or. (.not. (t <= 3.4d+31))) then
tmp = ((b * c) + (t * ((18.0d0 * (x * (y * z))) - (4.0d0 * a)))) - (27.0d0 * (j * k))
else
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - (k * (j * 27.0d0))
end if
code = tmp
end function
assert y < z;
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 <= -4e+36) || !(t <= 3.4e+31)) {
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (4.0 * a)))) - (27.0 * (j * k));
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -4e+36) or not (t <= 3.4e+31): tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (4.0 * a)))) - (27.0 * (j * k)) else: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -4e+36) || !(t <= 3.4e+31)) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(4.0 * a)))) - Float64(27.0 * Float64(j * k))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - Float64(k * Float64(j * 27.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 <= -4e+36) || ~((t <= 3.4e+31)))
tmp = ((b * c) + (t * ((18.0 * (x * (y * z))) - (4.0 * a)))) - (27.0 * (j * k));
else
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[t, -4e+36], N[Not[LessEqual[t, 3.4e+31]], $MachinePrecision]], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4 \cdot 10^{+36} \lor \neg \left(t \leq 3.4 \cdot 10^{+31}\right):\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - 4 \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\
\end{array}
\end{array}
if t < -4.00000000000000017e36 or 3.3999999999999998e31 < t Initial program 85.6%
Simplified88.9%
Taylor expanded in i around 0 88.5%
if -4.00000000000000017e36 < t < 3.3999999999999998e31Initial program 85.1%
Taylor expanded in y around 0 89.1%
distribute-lft-out89.1%
*-commutative89.1%
*-commutative89.1%
Simplified89.1%
Final simplification88.8%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (<= x -7.5e+72)
(* x (- (* i (- 4.0)) (* -18.0 (* (* t y) z))))
(if (<= x 2.7e-168)
(- (+ (* b c) (* -4.0 (* t a))) (* 27.0 (* j k)))
(if (<= x 3.2e+83)
(- (+ (* b c) (* 18.0 (* t (* x (* y z))))) (* k (* j 27.0)))
(* x (- (* 18.0 (* t (* y z))) (* i 4.0)))))))assert(y < 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 (x <= -7.5e+72) {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
} else if (x <= 2.7e-168) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else if (x <= 3.2e+83) {
tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (k * (j * 27.0));
} else {
tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 <= (-7.5d+72)) then
tmp = x * ((i * -4.0d0) - ((-18.0d0) * ((t * y) * z)))
else if (x <= 2.7d-168) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (27.0d0 * (j * k))
else if (x <= 3.2d+83) then
tmp = ((b * c) + (18.0d0 * (t * (x * (y * z))))) - (k * (j * 27.0d0))
else
tmp = x * ((18.0d0 * (t * (y * z))) - (i * 4.0d0))
end if
code = tmp
end function
assert y < z;
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 <= -7.5e+72) {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
} else if (x <= 2.7e-168) {
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
} else if (x <= 3.2e+83) {
tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (k * (j * 27.0));
} else {
tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -7.5e+72: tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z))) elif x <= 2.7e-168: tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k)) elif x <= 3.2e+83: tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (k * (j * 27.0)) else: tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -7.5e+72) tmp = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(Float64(t * y) * z)))); elseif (x <= 2.7e-168) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(27.0 * Float64(j * k))); elseif (x <= 3.2e+83) tmp = Float64(Float64(Float64(b * c) + Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))) - Float64(k * Float64(j * 27.0))); else tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(i * 4.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 <= -7.5e+72)
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
elseif (x <= 2.7e-168)
tmp = ((b * c) + (-4.0 * (t * a))) - (27.0 * (j * k));
elseif (x <= 3.2e+83)
tmp = ((b * c) + (18.0 * (t * (x * (y * z))))) - (k * (j * 27.0));
else
tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[x, -7.5e+72], N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.7e-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], If[LessEqual[x, 3.2e+83], N[(N[(N[(b * c), $MachinePrecision] + N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+72}:\\
\;\;\;\;x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(\left(t \cdot y\right) \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{-168}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+83}:\\
\;\;\;\;\left(b \cdot c + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - i \cdot 4\right)\\
\end{array}
\end{array}
if x < -7.50000000000000027e72Initial program 71.5%
Simplified73.7%
Taylor expanded in x around inf 67.6%
*-commutative67.6%
associate-*l*76.3%
associate-*l*78.1%
Simplified78.1%
Taylor expanded in x around -inf 80.9%
mul-1-neg80.9%
cancel-sign-sub-inv80.9%
associate-*r*85.0%
metadata-eval85.0%
*-commutative85.0%
Simplified85.0%
if -7.50000000000000027e72 < x < 2.70000000000000016e-168Initial program 90.0%
Simplified90.0%
Taylor expanded in x around 0 77.9%
if 2.70000000000000016e-168 < x < 3.1999999999999999e83Initial program 94.1%
Taylor expanded in a around 0 86.3%
sub-neg86.3%
+-commutative86.3%
associate-+l+86.3%
associate-*r*86.3%
*-commutative86.3%
associate-*r*84.4%
associate-*r*84.4%
distribute-lft-neg-in84.4%
metadata-eval84.4%
associate-*r*84.5%
distribute-rgt-in84.5%
metadata-eval84.5%
cancel-sign-sub-inv84.5%
+-commutative84.5%
fma-def84.5%
Simplified84.5%
Taylor expanded in i around 0 73.8%
if 3.1999999999999999e83 < x Initial program 78.7%
Simplified82.5%
Taylor expanded in x around inf 70.7%
Final simplification76.9%
NOTE: y and z should be sorted in increasing order before calling this function.
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))))
(if (<= t -2.4e+85)
(- (* t (- (* -18.0 (* x (* y (- z)))) (* 4.0 a))) t_1)
(if (<= t 8.8e+29)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) t_1)
(- (+ (* 18.0 (* t (* x (* y z)))) (* -4.0 (* t a))) t_1)))))assert(y < 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 t_1 = k * (j * 27.0);
double tmp;
if (t <= -2.4e+85) {
tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1;
} else if (t <= 8.8e+29) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
} else {
tmp = ((18.0 * (t * (x * (y * z)))) + (-4.0 * (t * a))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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)
if (t <= (-2.4d+85)) then
tmp = (t * (((-18.0d0) * (x * (y * -z))) - (4.0d0 * a))) - t_1
else if (t <= 8.8d+29) then
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - t_1
else
tmp = ((18.0d0 * (t * (x * (y * z)))) + ((-4.0d0) * (t * a))) - t_1
end if
code = tmp
end function
assert y < z;
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);
double tmp;
if (t <= -2.4e+85) {
tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1;
} else if (t <= 8.8e+29) {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
} else {
tmp = ((18.0 * (t * (x * (y * z)))) + (-4.0 * (t * a))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = k * (j * 27.0) tmp = 0 if t <= -2.4e+85: tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1 elif t <= 8.8e+29: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1 else: tmp = ((18.0 * (t * (x * (y * z)))) + (-4.0 * (t * a))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(k * Float64(j * 27.0)) tmp = 0.0 if (t <= -2.4e+85) tmp = Float64(Float64(t * Float64(Float64(-18.0 * Float64(x * Float64(y * Float64(-z)))) - Float64(4.0 * a))) - t_1); elseif (t <= 8.8e+29) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_1); else tmp = Float64(Float64(Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))) + Float64(-4.0 * Float64(t * a))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
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);
tmp = 0.0;
if (t <= -2.4e+85)
tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1;
elseif (t <= 8.8e+29)
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
else
tmp = ((18.0 * (t * (x * (y * z)))) + (-4.0 * (t * a))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.4e+85], N[(N[(t * N[(N[(-18.0 * N[(x * N[(y * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 8.8e+29], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{+85}:\\
\;\;\;\;t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot \left(-z\right)\right)\right) - 4 \cdot a\right) - t_1\\
\mathbf{elif}\;t \leq 8.8 \cdot 10^{+29}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + -4 \cdot \left(t \cdot a\right)\right) - t_1\\
\end{array}
\end{array}
if t < -2.39999999999999997e85Initial program 83.5%
Taylor expanded in t around -inf 84.3%
associate-*r*84.3%
neg-mul-184.3%
cancel-sign-sub-inv84.3%
*-commutative84.3%
metadata-eval84.3%
Simplified84.3%
if -2.39999999999999997e85 < t < 8.8000000000000005e29Initial program 85.4%
Taylor expanded in y around 0 88.5%
distribute-lft-out88.5%
*-commutative88.5%
*-commutative88.5%
Simplified88.5%
if 8.8000000000000005e29 < t Initial program 86.6%
Taylor expanded in t around -inf 83.6%
associate-*r*83.6%
neg-mul-183.6%
cancel-sign-sub-inv83.6%
*-commutative83.6%
metadata-eval83.6%
Simplified83.6%
Taylor expanded in x around 0 83.7%
Final simplification86.5%
NOTE: y and z should be sorted in increasing order before calling this function.
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))))
(if (<= t -3.4e+85)
(- (* t (- (* -18.0 (* x (* y (- z)))) (* 4.0 a))) t_1)
(if (<= t 1.3e+29)
(- (+ (* b c) (* t (* a -4.0))) (+ (* j (* 27.0 k)) (* x (* i 4.0))))
(- (+ (* 18.0 (* t (* x (* y z)))) (* -4.0 (* t a))) t_1)))))assert(y < 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 t_1 = k * (j * 27.0);
double tmp;
if (t <= -3.4e+85) {
tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1;
} else if (t <= 1.3e+29) {
tmp = ((b * c) + (t * (a * -4.0))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
} else {
tmp = ((18.0 * (t * (x * (y * z)))) + (-4.0 * (t * a))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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)
if (t <= (-3.4d+85)) then
tmp = (t * (((-18.0d0) * (x * (y * -z))) - (4.0d0 * a))) - t_1
else if (t <= 1.3d+29) then
tmp = ((b * c) + (t * (a * (-4.0d0)))) - ((j * (27.0d0 * k)) + (x * (i * 4.0d0)))
else
tmp = ((18.0d0 * (t * (x * (y * z)))) + ((-4.0d0) * (t * a))) - t_1
end if
code = tmp
end function
assert y < z;
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);
double tmp;
if (t <= -3.4e+85) {
tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1;
} else if (t <= 1.3e+29) {
tmp = ((b * c) + (t * (a * -4.0))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
} else {
tmp = ((18.0 * (t * (x * (y * z)))) + (-4.0 * (t * a))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = k * (j * 27.0) tmp = 0 if t <= -3.4e+85: tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1 elif t <= 1.3e+29: tmp = ((b * c) + (t * (a * -4.0))) - ((j * (27.0 * k)) + (x * (i * 4.0))) else: tmp = ((18.0 * (t * (x * (y * z)))) + (-4.0 * (t * a))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(k * Float64(j * 27.0)) tmp = 0.0 if (t <= -3.4e+85) tmp = Float64(Float64(t * Float64(Float64(-18.0 * Float64(x * Float64(y * Float64(-z)))) - Float64(4.0 * a))) - t_1); elseif (t <= 1.3e+29) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(a * -4.0))) - Float64(Float64(j * Float64(27.0 * k)) + Float64(x * Float64(i * 4.0)))); else tmp = Float64(Float64(Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))) + Float64(-4.0 * Float64(t * a))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
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);
tmp = 0.0;
if (t <= -3.4e+85)
tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1;
elseif (t <= 1.3e+29)
tmp = ((b * c) + (t * (a * -4.0))) - ((j * (27.0 * k)) + (x * (i * 4.0)));
else
tmp = ((18.0 * (t * (x * (y * z)))) + (-4.0 * (t * a))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e+85], N[(N[(t * N[(N[(-18.0 * N[(x * N[(y * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 1.3e+29], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+85}:\\
\;\;\;\;t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot \left(-z\right)\right)\right) - 4 \cdot a\right) - t_1\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{+29}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(a \cdot -4\right)\right) - \left(j \cdot \left(27 \cdot k\right) + x \cdot \left(i \cdot 4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right) + -4 \cdot \left(t \cdot a\right)\right) - t_1\\
\end{array}
\end{array}
if t < -3.4000000000000003e85Initial program 83.5%
Taylor expanded in t around -inf 84.3%
associate-*r*84.3%
neg-mul-184.3%
cancel-sign-sub-inv84.3%
*-commutative84.3%
metadata-eval84.3%
Simplified84.3%
if -3.4000000000000003e85 < t < 1.3e29Initial program 85.4%
Simplified85.3%
Taylor expanded in x around 0 88.5%
*-commutative88.5%
*-commutative88.5%
associate-*r*88.5%
Simplified88.5%
if 1.3e29 < t Initial program 86.6%
Taylor expanded in t around -inf 83.6%
associate-*r*83.6%
neg-mul-183.6%
cancel-sign-sub-inv83.6%
*-commutative83.6%
metadata-eval83.6%
Simplified83.6%
Taylor expanded in x around 0 83.7%
Final simplification86.5%
NOTE: y and z should be sorted in increasing order before calling this function.
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))))
(if (or (<= t -2.95e+85) (not (<= t 1.12e+33)))
(- (* t (- (* -18.0 (* x (* y (- z)))) (* 4.0 a))) t_1)
(- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) t_1))))assert(y < 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 t_1 = k * (j * 27.0);
double tmp;
if ((t <= -2.95e+85) || !(t <= 1.12e+33)) {
tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1;
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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)
if ((t <= (-2.95d+85)) .or. (.not. (t <= 1.12d+33))) then
tmp = (t * (((-18.0d0) * (x * (y * -z))) - (4.0d0 * a))) - t_1
else
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - t_1
end if
code = tmp
end function
assert y < z;
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);
double tmp;
if ((t <= -2.95e+85) || !(t <= 1.12e+33)) {
tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1;
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = k * (j * 27.0) tmp = 0 if (t <= -2.95e+85) or not (t <= 1.12e+33): tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1 else: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(k * Float64(j * 27.0)) tmp = 0.0 if ((t <= -2.95e+85) || !(t <= 1.12e+33)) tmp = Float64(Float64(t * Float64(Float64(-18.0 * Float64(x * Float64(y * Float64(-z)))) - Float64(4.0 * a))) - t_1); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
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);
tmp = 0.0;
if ((t <= -2.95e+85) || ~((t <= 1.12e+33)))
tmp = (t * ((-18.0 * (x * (y * -z))) - (4.0 * a))) - t_1;
else
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t, -2.95e+85], N[Not[LessEqual[t, 1.12e+33]], $MachinePrecision]], N[(N[(t * N[(N[(-18.0 * N[(x * N[(y * (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t \leq -2.95 \cdot 10^{+85} \lor \neg \left(t \leq 1.12 \cdot 10^{+33}\right):\\
\;\;\;\;t \cdot \left(-18 \cdot \left(x \cdot \left(y \cdot \left(-z\right)\right)\right) - 4 \cdot a\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - t_1\\
\end{array}
\end{array}
if t < -2.95e85 or 1.12e33 < t Initial program 85.2%
Taylor expanded in t around -inf 83.9%
associate-*r*83.9%
neg-mul-183.9%
cancel-sign-sub-inv83.9%
*-commutative83.9%
metadata-eval83.9%
Simplified83.9%
if -2.95e85 < t < 1.12e33Initial program 85.4%
Taylor expanded in y around 0 88.5%
distribute-lft-out88.5%
*-commutative88.5%
*-commutative88.5%
Simplified88.5%
Final simplification86.5%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* i -4.0))) (t_2 (- (* b c) (* 27.0 (* j k)))))
(if (<= x -1.15e+68)
(* x (* z (* t (* -18.0 (- y)))))
(if (<= x 5.2e-64)
t_2
(if (<= x 2.35e-32)
(* (* t z) (* y (* -18.0 (- x))))
(if (<= x 2.9e+102)
t_2
(if (<= x 1.16e+181)
t_1
(if (<= x 1.12e+200)
(* j (* k -27.0))
(if (<= x 6.2e+242) (* x (* (* y z) (* t 18.0))) t_1)))))))))assert(y < 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 t_1 = x * (i * -4.0);
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (x <= -1.15e+68) {
tmp = x * (z * (t * (-18.0 * -y)));
} else if (x <= 5.2e-64) {
tmp = t_2;
} else if (x <= 2.35e-32) {
tmp = (t * z) * (y * (-18.0 * -x));
} else if (x <= 2.9e+102) {
tmp = t_2;
} else if (x <= 1.16e+181) {
tmp = t_1;
} else if (x <= 1.12e+200) {
tmp = j * (k * -27.0);
} else if (x <= 6.2e+242) {
tmp = x * ((y * z) * (t * 18.0));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = x * (i * (-4.0d0))
t_2 = (b * c) - (27.0d0 * (j * k))
if (x <= (-1.15d+68)) then
tmp = x * (z * (t * ((-18.0d0) * -y)))
else if (x <= 5.2d-64) then
tmp = t_2
else if (x <= 2.35d-32) then
tmp = (t * z) * (y * ((-18.0d0) * -x))
else if (x <= 2.9d+102) then
tmp = t_2
else if (x <= 1.16d+181) then
tmp = t_1
else if (x <= 1.12d+200) then
tmp = j * (k * (-27.0d0))
else if (x <= 6.2d+242) then
tmp = x * ((y * z) * (t * 18.0d0))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
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 * (i * -4.0);
double t_2 = (b * c) - (27.0 * (j * k));
double tmp;
if (x <= -1.15e+68) {
tmp = x * (z * (t * (-18.0 * -y)));
} else if (x <= 5.2e-64) {
tmp = t_2;
} else if (x <= 2.35e-32) {
tmp = (t * z) * (y * (-18.0 * -x));
} else if (x <= 2.9e+102) {
tmp = t_2;
} else if (x <= 1.16e+181) {
tmp = t_1;
} else if (x <= 1.12e+200) {
tmp = j * (k * -27.0);
} else if (x <= 6.2e+242) {
tmp = x * ((y * z) * (t * 18.0));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (i * -4.0) t_2 = (b * c) - (27.0 * (j * k)) tmp = 0 if x <= -1.15e+68: tmp = x * (z * (t * (-18.0 * -y))) elif x <= 5.2e-64: tmp = t_2 elif x <= 2.35e-32: tmp = (t * z) * (y * (-18.0 * -x)) elif x <= 2.9e+102: tmp = t_2 elif x <= 1.16e+181: tmp = t_1 elif x <= 1.12e+200: tmp = j * (k * -27.0) elif x <= 6.2e+242: tmp = x * ((y * z) * (t * 18.0)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(i * -4.0)) t_2 = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))) tmp = 0.0 if (x <= -1.15e+68) tmp = Float64(x * Float64(z * Float64(t * Float64(-18.0 * Float64(-y))))); elseif (x <= 5.2e-64) tmp = t_2; elseif (x <= 2.35e-32) tmp = Float64(Float64(t * z) * Float64(y * Float64(-18.0 * Float64(-x)))); elseif (x <= 2.9e+102) tmp = t_2; elseif (x <= 1.16e+181) tmp = t_1; elseif (x <= 1.12e+200) tmp = Float64(j * Float64(k * -27.0)); elseif (x <= 6.2e+242) tmp = Float64(x * Float64(Float64(y * z) * Float64(t * 18.0))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (i * -4.0);
t_2 = (b * c) - (27.0 * (j * k));
tmp = 0.0;
if (x <= -1.15e+68)
tmp = x * (z * (t * (-18.0 * -y)));
elseif (x <= 5.2e-64)
tmp = t_2;
elseif (x <= 2.35e-32)
tmp = (t * z) * (y * (-18.0 * -x));
elseif (x <= 2.9e+102)
tmp = t_2;
elseif (x <= 1.16e+181)
tmp = t_1;
elseif (x <= 1.12e+200)
tmp = j * (k * -27.0);
elseif (x <= 6.2e+242)
tmp = x * ((y * z) * (t * 18.0));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(i * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+68], N[(x * N[(z * N[(t * N[(-18.0 * (-y)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.2e-64], t$95$2, If[LessEqual[x, 2.35e-32], N[(N[(t * z), $MachinePrecision] * N[(y * N[(-18.0 * (-x)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+102], t$95$2, If[LessEqual[x, 1.16e+181], t$95$1, If[LessEqual[x, 1.12e+200], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e+242], N[(x * N[(N[(y * z), $MachinePrecision] * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(i \cdot -4\right)\\
t_2 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+68}:\\
\;\;\;\;x \cdot \left(z \cdot \left(t \cdot \left(-18 \cdot \left(-y\right)\right)\right)\right)\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-64}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-32}:\\
\;\;\;\;\left(t \cdot z\right) \cdot \left(y \cdot \left(-18 \cdot \left(-x\right)\right)\right)\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+102}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.16 \cdot 10^{+181}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.12 \cdot 10^{+200}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+242}:\\
\;\;\;\;x \cdot \left(\left(y \cdot z\right) \cdot \left(t \cdot 18\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if x < -1.15e68Initial program 70.2%
Simplified74.3%
Taylor expanded in x around inf 66.2%
*-commutative66.2%
associate-*l*74.7%
associate-*l*76.5%
Simplified76.5%
Taylor expanded in x around -inf 79.3%
mul-1-neg79.3%
cancel-sign-sub-inv79.3%
associate-*r*83.3%
metadata-eval83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in t around inf 53.8%
*-commutative53.8%
associate-*r*51.7%
associate-*l*51.7%
associate-*r*53.7%
*-commutative53.7%
associate-*r*55.8%
associate-*l*55.8%
associate-*r*55.4%
*-commutative55.4%
*-commutative55.4%
*-commutative55.4%
associate-*l*55.4%
*-commutative55.4%
associate-*l*55.5%
Simplified55.5%
if -1.15e68 < x < 5.2e-64 or 2.3500000000000001e-32 < x < 2.9000000000000002e102Initial program 92.7%
Taylor expanded in a around 0 74.7%
sub-neg74.7%
+-commutative74.7%
associate-+l+74.7%
associate-*r*74.1%
*-commutative74.1%
associate-*r*74.1%
associate-*r*74.8%
distribute-lft-neg-in74.8%
metadata-eval74.8%
associate-*r*75.5%
distribute-rgt-in75.5%
metadata-eval75.5%
cancel-sign-sub-inv75.5%
+-commutative75.5%
fma-def76.1%
Simplified76.1%
Taylor expanded in x around 0 56.0%
if 5.2e-64 < x < 2.3500000000000001e-32Initial program 71.1%
Simplified70.9%
Taylor expanded in x around inf 51.5%
*-commutative51.5%
associate-*l*51.6%
associate-*l*70.4%
Simplified70.4%
Taylor expanded in x around -inf 52.4%
mul-1-neg52.4%
cancel-sign-sub-inv52.4%
associate-*r*61.9%
metadata-eval61.9%
*-commutative61.9%
Simplified61.9%
Taylor expanded in t around inf 51.8%
associate-*r*51.8%
*-commutative51.8%
associate-*r*51.8%
associate-*r*51.8%
associate-*r*51.9%
associate-*l*52.0%
associate-*r*70.7%
*-commutative70.7%
*-commutative70.7%
associate-*l*70.7%
*-commutative70.7%
*-commutative70.7%
Simplified70.7%
if 2.9000000000000002e102 < x < 1.16000000000000003e181 or 6.2000000000000002e242 < x Initial program 81.9%
Simplified81.9%
Taylor expanded in i around inf 60.9%
associate-*r*60.9%
*-commutative60.9%
Simplified60.9%
if 1.16000000000000003e181 < x < 1.12000000000000004e200Initial program 50.0%
Simplified75.0%
Taylor expanded in j around inf 50.2%
*-commutative50.2%
associate-*l*50.2%
Simplified50.2%
if 1.12000000000000004e200 < x < 6.2000000000000002e242Initial program 81.1%
Simplified90.5%
Taylor expanded in x around inf 90.6%
*-commutative90.6%
associate-*l*99.8%
associate-*l*99.8%
Simplified99.8%
fma-def99.7%
associate-*r*99.7%
*-commutative99.7%
associate-*r*99.7%
Applied egg-rr99.7%
Taylor expanded in y around inf 42.0%
*-commutative42.0%
associate-*r*51.3%
*-commutative51.3%
associate-*r*51.3%
associate-*r*51.5%
*-commutative51.5%
associate-*r*51.3%
associate-*l*51.3%
Simplified51.3%
Final simplification56.9%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* t a))) t_1)))
(if (<= x -4.2e+74)
(* x (- (* i (- 4.0)) (* -18.0 (* (* t y) z))))
(if (<= x 4.3e-168)
t_2
(if (<= x 1.6e-55)
(- (* b c) (+ t_1 (* 4.0 (* x i))))
(if (<= x 2.4e+47)
t_2
(* x (- (* 18.0 (* t (* y z))) (* i 4.0)))))))))assert(y < 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 t_1 = 27.0 * (j * k);
double t_2 = ((b * c) + (-4.0 * (t * a))) - t_1;
double tmp;
if (x <= -4.2e+74) {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
} else if (x <= 4.3e-168) {
tmp = t_2;
} else if (x <= 1.6e-55) {
tmp = (b * c) - (t_1 + (4.0 * (x * i)));
} else if (x <= 2.4e+47) {
tmp = t_2;
} else {
tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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)
t_2 = ((b * c) + ((-4.0d0) * (t * a))) - t_1
if (x <= (-4.2d+74)) then
tmp = x * ((i * -4.0d0) - ((-18.0d0) * ((t * y) * z)))
else if (x <= 4.3d-168) then
tmp = t_2
else if (x <= 1.6d-55) then
tmp = (b * c) - (t_1 + (4.0d0 * (x * i)))
else if (x <= 2.4d+47) then
tmp = t_2
else
tmp = x * ((18.0d0 * (t * (y * z))) - (i * 4.0d0))
end if
code = tmp
end function
assert y < z;
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 * (t * a))) - t_1;
double tmp;
if (x <= -4.2e+74) {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
} else if (x <= 4.3e-168) {
tmp = t_2;
} else if (x <= 1.6e-55) {
tmp = (b * c) - (t_1 + (4.0 * (x * i)));
} else if (x <= 2.4e+47) {
tmp = t_2;
} else {
tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0));
}
return tmp;
}
[y, z] = sort([y, z]) [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 * (t * a))) - t_1 tmp = 0 if x <= -4.2e+74: tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z))) elif x <= 4.3e-168: tmp = t_2 elif x <= 1.6e-55: tmp = (b * c) - (t_1 + (4.0 * (x * i))) elif x <= 2.4e+47: tmp = t_2 else: tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0)) return tmp
y, z = sort([y, z]) 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(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - t_1) tmp = 0.0 if (x <= -4.2e+74) tmp = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(Float64(t * y) * z)))); elseif (x <= 4.3e-168) tmp = t_2; elseif (x <= 1.6e-55) tmp = Float64(Float64(b * c) - Float64(t_1 + Float64(4.0 * Float64(x * i)))); elseif (x <= 2.4e+47) tmp = t_2; else tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(i * 4.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 * (t * a))) - t_1;
tmp = 0.0;
if (x <= -4.2e+74)
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
elseif (x <= 4.3e-168)
tmp = t_2;
elseif (x <= 1.6e-55)
tmp = (b * c) - (t_1 + (4.0 * (x * i)));
elseif (x <= 2.4e+47)
tmp = t_2;
else
tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[x, -4.2e+74], N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.3e-168], t$95$2, If[LessEqual[x, 1.6e-55], N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.4e+47], t$95$2, N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
t_2 := \left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{+74}:\\
\;\;\;\;x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(\left(t \cdot y\right) \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-168}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{-55}:\\
\;\;\;\;b \cdot c - \left(t_1 + 4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+47}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - i \cdot 4\right)\\
\end{array}
\end{array}
if x < -4.1999999999999998e74Initial program 71.5%
Simplified73.7%
Taylor expanded in x around inf 67.6%
*-commutative67.6%
associate-*l*76.3%
associate-*l*78.1%
Simplified78.1%
Taylor expanded in x around -inf 80.9%
mul-1-neg80.9%
cancel-sign-sub-inv80.9%
associate-*r*85.0%
metadata-eval85.0%
*-commutative85.0%
Simplified85.0%
if -4.1999999999999998e74 < x < 4.29999999999999995e-168 or 1.6000000000000001e-55 < x < 2.40000000000000019e47Initial program 89.1%
Simplified89.1%
Taylor expanded in x around 0 75.4%
if 4.29999999999999995e-168 < x < 1.6000000000000001e-55Initial program 99.8%
Simplified99.9%
Taylor expanded in t around 0 79.0%
if 2.40000000000000019e47 < x Initial program 80.6%
Simplified84.0%
Taylor expanded in x around inf 70.7%
Final simplification76.5%
NOTE: y and z should be sorted in increasing order before calling this function.
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))))
(if (<= x -1.9e+73)
(* x (- (* i (- 4.0)) (* -18.0 (* (* t y) z))))
(if (<= x 9.6e-169)
(- (+ (* b c) (* -4.0 (* t a))) t_1)
(if (<= x 2.35e-77)
(- (* b c) (+ t_1 (* 4.0 (* x i))))
(if (<= x 1.8e+46)
(- (- (* b c) (* 4.0 (* t a))) (* k (* j 27.0)))
(* x (- (* 18.0 (* t (* y z))) (* i 4.0)))))))))assert(y < 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 t_1 = 27.0 * (j * k);
double tmp;
if (x <= -1.9e+73) {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
} else if (x <= 9.6e-169) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
} else if (x <= 2.35e-77) {
tmp = (b * c) - (t_1 + (4.0 * (x * i)));
} else if (x <= 1.8e+46) {
tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0));
} else {
tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = 27.0d0 * (j * k)
if (x <= (-1.9d+73)) then
tmp = x * ((i * -4.0d0) - ((-18.0d0) * ((t * y) * z)))
else if (x <= 9.6d-169) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - t_1
else if (x <= 2.35d-77) then
tmp = (b * c) - (t_1 + (4.0d0 * (x * i)))
else if (x <= 1.8d+46) then
tmp = ((b * c) - (4.0d0 * (t * a))) - (k * (j * 27.0d0))
else
tmp = x * ((18.0d0 * (t * (y * z))) - (i * 4.0d0))
end if
code = tmp
end function
assert y < z;
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 tmp;
if (x <= -1.9e+73) {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
} else if (x <= 9.6e-169) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
} else if (x <= 2.35e-77) {
tmp = (b * c) - (t_1 + (4.0 * (x * i)));
} else if (x <= 1.8e+46) {
tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0));
} else {
tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 27.0 * (j * k) tmp = 0 if x <= -1.9e+73: tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z))) elif x <= 9.6e-169: tmp = ((b * c) + (-4.0 * (t * a))) - t_1 elif x <= 2.35e-77: tmp = (b * c) - (t_1 + (4.0 * (x * i))) elif x <= 1.8e+46: tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0)) else: tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0)) return tmp
y, z = sort([y, z]) 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)) tmp = 0.0 if (x <= -1.9e+73) tmp = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(Float64(t * y) * z)))); elseif (x <= 9.6e-169) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - t_1); elseif (x <= 2.35e-77) tmp = Float64(Float64(b * c) - Float64(t_1 + Float64(4.0 * Float64(x * i)))); elseif (x <= 1.8e+46) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(k * Float64(j * 27.0))); else tmp = Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(i * 4.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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);
tmp = 0.0;
if (x <= -1.9e+73)
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
elseif (x <= 9.6e-169)
tmp = ((b * c) + (-4.0 * (t * a))) - t_1;
elseif (x <= 2.35e-77)
tmp = (b * c) - (t_1 + (4.0 * (x * i)));
elseif (x <= 1.8e+46)
tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0));
else
tmp = x * ((18.0 * (t * (y * z))) - (i * 4.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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]}, If[LessEqual[x, -1.9e+73], N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.6e-169], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[x, 2.35e-77], N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.8e+46], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;x \leq -1.9 \cdot 10^{+73}:\\
\;\;\;\;x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(\left(t \cdot y\right) \cdot z\right)\right)\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-169}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;x \leq 2.35 \cdot 10^{-77}:\\
\;\;\;\;b \cdot c - \left(t_1 + 4 \cdot \left(x \cdot i\right)\right)\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+46}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - i \cdot 4\right)\\
\end{array}
\end{array}
if x < -1.90000000000000011e73Initial program 71.5%
Simplified73.7%
Taylor expanded in x around inf 67.6%
*-commutative67.6%
associate-*l*76.3%
associate-*l*78.1%
Simplified78.1%
Taylor expanded in x around -inf 80.9%
mul-1-neg80.9%
cancel-sign-sub-inv80.9%
associate-*r*85.0%
metadata-eval85.0%
*-commutative85.0%
Simplified85.0%
if -1.90000000000000011e73 < x < 9.60000000000000043e-169Initial program 90.0%
Simplified90.0%
Taylor expanded in x around 0 77.9%
if 9.60000000000000043e-169 < x < 2.3499999999999999e-77Initial program 99.8%
Simplified99.9%
Taylor expanded in t around 0 83.7%
if 2.3499999999999999e-77 < x < 1.7999999999999999e46Initial program 86.2%
Taylor expanded in y around 0 63.1%
distribute-lft-out63.1%
*-commutative63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in t around inf 58.1%
*-commutative58.1%
Simplified58.1%
if 1.7999999999999999e46 < x Initial program 80.6%
Simplified84.0%
Taylor expanded in x around inf 70.7%
Final simplification76.5%
NOTE: y and z should be sorted in increasing order before calling this function.
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 c) -1.08e+148)
(* b c)
(if (<= (* b c) -7.2e-224)
(* k (* j -27.0))
(if (<= (* b c) -5e-314)
(* t (* a -4.0))
(if (<= (* b c) 2e+78) (* j (* k -27.0)) (* b c))))))assert(y < 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 ((b * c) <= -1.08e+148) {
tmp = b * c;
} else if ((b * c) <= -7.2e-224) {
tmp = k * (j * -27.0);
} else if ((b * c) <= -5e-314) {
tmp = t * (a * -4.0);
} else if ((b * c) <= 2e+78) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 * c) <= (-1.08d+148)) then
tmp = b * c
else if ((b * c) <= (-7.2d-224)) then
tmp = k * (j * (-27.0d0))
else if ((b * c) <= (-5d-314)) then
tmp = t * (a * (-4.0d0))
else if ((b * c) <= 2d+78) then
tmp = j * (k * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
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 * c) <= -1.08e+148) {
tmp = b * c;
} else if ((b * c) <= -7.2e-224) {
tmp = k * (j * -27.0);
} else if ((b * c) <= -5e-314) {
tmp = t * (a * -4.0);
} else if ((b * c) <= 2e+78) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -1.08e+148: tmp = b * c elif (b * c) <= -7.2e-224: tmp = k * (j * -27.0) elif (b * c) <= -5e-314: tmp = t * (a * -4.0) elif (b * c) <= 2e+78: tmp = j * (k * -27.0) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -1.08e+148) tmp = Float64(b * c); elseif (Float64(b * c) <= -7.2e-224) tmp = Float64(k * Float64(j * -27.0)); elseif (Float64(b * c) <= -5e-314) tmp = Float64(t * Float64(a * -4.0)); elseif (Float64(b * c) <= 2e+78) tmp = Float64(j * Float64(k * -27.0)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 * c) <= -1.08e+148)
tmp = b * c;
elseif ((b * c) <= -7.2e-224)
tmp = k * (j * -27.0);
elseif ((b * c) <= -5e-314)
tmp = t * (a * -4.0);
elseif ((b * c) <= 2e+78)
tmp = j * (k * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[(b * c), $MachinePrecision], -1.08e+148], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -7.2e-224], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -5e-314], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+78], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.08 \cdot 10^{+148}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -7.2 \cdot 10^{-224}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-314}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+78}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.07999999999999999e148 or 2.00000000000000002e78 < (*.f64 b c) Initial program 80.6%
Simplified82.0%
Taylor expanded in b around inf 55.5%
if -1.07999999999999999e148 < (*.f64 b c) < -7.1999999999999999e-224Initial program 86.5%
Simplified86.5%
Taylor expanded in j around inf 34.1%
*-commutative34.1%
*-commutative34.1%
associate-*l*34.1%
Simplified34.1%
if -7.1999999999999999e-224 < (*.f64 b c) < -4.99999999982e-314Initial program 99.9%
Taylor expanded in y around 0 91.6%
distribute-lft-out91.6%
*-commutative91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in t around inf 62.0%
associate-*r*62.0%
*-commutative62.0%
Simplified62.0%
if -4.99999999982e-314 < (*.f64 b c) < 2.00000000000000002e78Initial program 86.1%
Simplified88.1%
Taylor expanded in j around inf 24.7%
*-commutative24.7%
associate-*l*24.8%
Simplified24.8%
Final simplification37.8%
NOTE: y and z should be sorted in increasing order before calling this function. 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 (<= x -2e+79) (* x (- (* i (- 4.0)) (* -18.0 (* (* t y) z)))) (- (- (* b c) (* 4.0 (+ (* t a) (* x i)))) (* k (* j 27.0)))))
assert(y < 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 (x <= -2e+79) {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 <= (-2d+79)) then
tmp = x * ((i * -4.0d0) - ((-18.0d0) * ((t * y) * z)))
else
tmp = ((b * c) - (4.0d0 * ((t * a) + (x * i)))) - (k * (j * 27.0d0))
end if
code = tmp
end function
assert y < z;
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 <= -2e+79) {
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
} else {
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -2e+79: tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z))) else: tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -2e+79) tmp = Float64(x * Float64(Float64(i * Float64(-4.0)) - Float64(-18.0 * Float64(Float64(t * y) * z)))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(Float64(t * a) + Float64(x * i)))) - Float64(k * Float64(j * 27.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 <= -2e+79)
tmp = x * ((i * -4.0) - (-18.0 * ((t * y) * z)));
else
tmp = ((b * c) - (4.0 * ((t * a) + (x * i)))) - (k * (j * 27.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[x, -2e+79], N[(x * N[(N[(i * (-4.0)), $MachinePrecision] - N[(-18.0 * N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+79}:\\
\;\;\;\;x \cdot \left(i \cdot \left(-4\right) - -18 \cdot \left(\left(t \cdot y\right) \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a + x \cdot i\right)\right) - k \cdot \left(j \cdot 27\right)\\
\end{array}
\end{array}
if x < -1.99999999999999993e79Initial program 70.9%
Simplified73.1%
Taylor expanded in x around inf 66.8%
*-commutative66.8%
associate-*l*75.7%
associate-*l*77.6%
Simplified77.6%
Taylor expanded in x around -inf 80.5%
mul-1-neg80.5%
cancel-sign-sub-inv80.5%
associate-*r*84.6%
metadata-eval84.6%
*-commutative84.6%
Simplified84.6%
if -1.99999999999999993e79 < x Initial program 88.3%
Taylor expanded in y around 0 79.8%
distribute-lft-out79.8%
*-commutative79.8%
*-commutative79.8%
Simplified79.8%
Final simplification80.7%
NOTE: y and z should be sorted in increasing order before calling this function.
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))) (t_2 (* k (* j 27.0))))
(if (<= t -1.05e+105)
(* 18.0 (* t (* x (* y z))))
(if (<= t -185000.0)
(- (* b c) (* 27.0 (* j k)))
(if (<= t 1050.0)
(- (* x (* i -4.0)) t_2)
(if (<= t 6.6e+174)
(- t_1 t_2)
(if (<= t 1.95e+288) (* x (* (* y z) (* t 18.0))) t_1)))))))assert(y < 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 t_1 = t * (a * -4.0);
double t_2 = k * (j * 27.0);
double tmp;
if (t <= -1.05e+105) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (t <= -185000.0) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 1050.0) {
tmp = (x * (i * -4.0)) - t_2;
} else if (t <= 6.6e+174) {
tmp = t_1 - t_2;
} else if (t <= 1.95e+288) {
tmp = x * ((y * z) * (t * 18.0));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = t * (a * (-4.0d0))
t_2 = k * (j * 27.0d0)
if (t <= (-1.05d+105)) then
tmp = 18.0d0 * (t * (x * (y * z)))
else if (t <= (-185000.0d0)) then
tmp = (b * c) - (27.0d0 * (j * k))
else if (t <= 1050.0d0) then
tmp = (x * (i * (-4.0d0))) - t_2
else if (t <= 6.6d+174) then
tmp = t_1 - t_2
else if (t <= 1.95d+288) then
tmp = x * ((y * z) * (t * 18.0d0))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
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 t_2 = k * (j * 27.0);
double tmp;
if (t <= -1.05e+105) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (t <= -185000.0) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 1050.0) {
tmp = (x * (i * -4.0)) - t_2;
} else if (t <= 6.6e+174) {
tmp = t_1 - t_2;
} else if (t <= 1.95e+288) {
tmp = x * ((y * z) * (t * 18.0));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * (a * -4.0) t_2 = k * (j * 27.0) tmp = 0 if t <= -1.05e+105: tmp = 18.0 * (t * (x * (y * z))) elif t <= -185000.0: tmp = (b * c) - (27.0 * (j * k)) elif t <= 1050.0: tmp = (x * (i * -4.0)) - t_2 elif t <= 6.6e+174: tmp = t_1 - t_2 elif t <= 1.95e+288: tmp = x * ((y * z) * (t * 18.0)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(a * -4.0)) t_2 = Float64(k * Float64(j * 27.0)) tmp = 0.0 if (t <= -1.05e+105) tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))); elseif (t <= -185000.0) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); elseif (t <= 1050.0) tmp = Float64(Float64(x * Float64(i * -4.0)) - t_2); elseif (t <= 6.6e+174) tmp = Float64(t_1 - t_2); elseif (t <= 1.95e+288) tmp = Float64(x * Float64(Float64(y * z) * Float64(t * 18.0))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
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);
t_2 = k * (j * 27.0);
tmp = 0.0;
if (t <= -1.05e+105)
tmp = 18.0 * (t * (x * (y * z)));
elseif (t <= -185000.0)
tmp = (b * c) - (27.0 * (j * k));
elseif (t <= 1050.0)
tmp = (x * (i * -4.0)) - t_2;
elseif (t <= 6.6e+174)
tmp = t_1 - t_2;
elseif (t <= 1.95e+288)
tmp = x * ((y * z) * (t * 18.0));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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]}, Block[{t$95$2 = N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e+105], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -185000.0], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1050.0], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t, 6.6e+174], N[(t$95$1 - t$95$2), $MachinePrecision], If[LessEqual[t, 1.95e+288], N[(x * N[(N[(y * z), $MachinePrecision] * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
t_2 := k \cdot \left(j \cdot 27\right)\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{+105}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq -185000:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 1050:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) - t_2\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{+174}:\\
\;\;\;\;t_1 - t_2\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+288}:\\
\;\;\;\;x \cdot \left(\left(y \cdot z\right) \cdot \left(t \cdot 18\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.05000000000000005e105Initial program 84.6%
Simplified91.2%
Taylor expanded in x around inf 73.1%
*-commutative73.1%
associate-*l*71.1%
associate-*l*64.7%
Simplified64.7%
fma-def64.8%
associate-*r*71.1%
*-commutative71.1%
associate-*r*64.8%
Applied egg-rr64.8%
Taylor expanded in y around inf 59.4%
if -1.05000000000000005e105 < t < -185000Initial program 87.4%
Taylor expanded in a around 0 87.7%
sub-neg87.7%
+-commutative87.7%
associate-+l+87.7%
associate-*r*87.7%
*-commutative87.7%
associate-*r*87.7%
associate-*r*87.7%
distribute-lft-neg-in87.7%
metadata-eval87.7%
associate-*r*87.7%
distribute-rgt-in87.7%
metadata-eval87.7%
cancel-sign-sub-inv87.7%
+-commutative87.7%
fma-def87.7%
Simplified87.7%
Taylor expanded in x around 0 69.5%
if -185000 < t < 1050Initial program 84.1%
Taylor expanded in a around 0 77.4%
sub-neg77.4%
+-commutative77.4%
associate-+l+77.4%
associate-*r*77.4%
*-commutative77.4%
associate-*r*84.2%
associate-*r*84.2%
distribute-lft-neg-in84.2%
metadata-eval84.2%
associate-*r*84.2%
distribute-rgt-in84.2%
metadata-eval84.2%
cancel-sign-sub-inv84.2%
+-commutative84.2%
fma-def84.2%
Simplified84.2%
Taylor expanded in i around inf 61.4%
associate-*r*61.5%
*-commutative61.5%
Simplified61.5%
if 1050 < t < 6.6000000000000001e174Initial program 93.7%
Taylor expanded in t around -inf 79.7%
associate-*r*79.7%
neg-mul-179.7%
cancel-sign-sub-inv79.7%
*-commutative79.7%
metadata-eval79.7%
Simplified79.7%
Taylor expanded in x around 0 52.5%
associate-*r*52.5%
Simplified52.5%
if 6.6000000000000001e174 < t < 1.94999999999999989e288Initial program 81.3%
Simplified81.4%
Taylor expanded in x around inf 74.8%
*-commutative74.8%
associate-*l*78.3%
associate-*l*70.8%
Simplified70.8%
fma-def70.8%
associate-*r*78.3%
*-commutative78.3%
associate-*r*70.8%
Applied egg-rr70.8%
Taylor expanded in y around inf 59.1%
*-commutative59.1%
associate-*r*63.7%
*-commutative63.7%
associate-*r*63.7%
associate-*r*63.7%
*-commutative63.7%
associate-*r*63.7%
associate-*l*63.7%
Simplified63.7%
if 1.94999999999999989e288 < t Initial program 83.3%
Taylor expanded in y around 0 74.3%
distribute-lft-out74.3%
*-commutative74.3%
*-commutative74.3%
Simplified74.3%
Taylor expanded in t around inf 74.2%
associate-*r*74.2%
*-commutative74.2%
Simplified74.2%
Final simplification61.0%
NOTE: y and z should be sorted in increasing order before calling this function. 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 (<= t -4.2e+100) (not (<= t 1.92e+31))) (- (* (* t 18.0) (* z (* x y))) (* k (* j 27.0))) (- (* b c) (+ (* 27.0 (* j k)) (* 4.0 (* x i))))))
assert(y < 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 ((t <= -4.2e+100) || !(t <= 1.92e+31)) {
tmp = ((t * 18.0) * (z * (x * y))) - (k * (j * 27.0));
} else {
tmp = (b * c) - ((27.0 * (j * k)) + (4.0 * (x * i)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 ((t <= (-4.2d+100)) .or. (.not. (t <= 1.92d+31))) then
tmp = ((t * 18.0d0) * (z * (x * y))) - (k * (j * 27.0d0))
else
tmp = (b * c) - ((27.0d0 * (j * k)) + (4.0d0 * (x * i)))
end if
code = tmp
end function
assert y < z;
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 <= -4.2e+100) || !(t <= 1.92e+31)) {
tmp = ((t * 18.0) * (z * (x * y))) - (k * (j * 27.0));
} else {
tmp = (b * c) - ((27.0 * (j * k)) + (4.0 * (x * i)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -4.2e+100) or not (t <= 1.92e+31): tmp = ((t * 18.0) * (z * (x * y))) - (k * (j * 27.0)) else: tmp = (b * c) - ((27.0 * (j * k)) + (4.0 * (x * i))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -4.2e+100) || !(t <= 1.92e+31)) tmp = Float64(Float64(Float64(t * 18.0) * Float64(z * Float64(x * y))) - Float64(k * Float64(j * 27.0))); else tmp = Float64(Float64(b * c) - Float64(Float64(27.0 * Float64(j * k)) + Float64(4.0 * Float64(x * i)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 <= -4.2e+100) || ~((t <= 1.92e+31)))
tmp = ((t * 18.0) * (z * (x * y))) - (k * (j * 27.0));
else
tmp = (b * c) - ((27.0 * (j * k)) + (4.0 * (x * i)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[t, -4.2e+100], N[Not[LessEqual[t, 1.92e+31]], $MachinePrecision]], N[(N[(N[(t * 18.0), $MachinePrecision] * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+100} \lor \neg \left(t \leq 1.92 \cdot 10^{+31}\right):\\
\;\;\;\;\left(t \cdot 18\right) \cdot \left(z \cdot \left(x \cdot y\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \left(27 \cdot \left(j \cdot k\right) + 4 \cdot \left(x \cdot i\right)\right)\\
\end{array}
\end{array}
if t < -4.1999999999999997e100 or 1.9199999999999999e31 < t Initial program 85.8%
Taylor expanded in a around 0 68.1%
sub-neg68.1%
+-commutative68.1%
associate-+l+68.1%
associate-*r*67.1%
*-commutative67.1%
associate-*r*66.3%
associate-*r*67.2%
distribute-lft-neg-in67.2%
metadata-eval67.2%
associate-*r*68.2%
distribute-rgt-in72.9%
metadata-eval72.9%
cancel-sign-sub-inv72.9%
+-commutative72.9%
fma-def73.8%
Simplified73.8%
Taylor expanded in y around inf 62.2%
associate-*r*62.3%
associate-*r*62.3%
Simplified62.3%
if -4.1999999999999997e100 < t < 1.9199999999999999e31Initial program 85.0%
Simplified85.0%
Taylor expanded in t around 0 79.1%
Final simplification72.1%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* 18.0 (* t (* x (* y z))))))
(if (<= k -2.1e+24)
(* j (* k -27.0))
(if (<= k 1.9e-280)
t_1
(if (<= k 3.35e-233)
(* b c)
(if (<= k 4.4e-138)
t_1
(if (<= k 2.9e+128) (* x (* i -4.0)) (* k (* j -27.0)))))))))assert(y < 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 t_1 = 18.0 * (t * (x * (y * z)));
double tmp;
if (k <= -2.1e+24) {
tmp = j * (k * -27.0);
} else if (k <= 1.9e-280) {
tmp = t_1;
} else if (k <= 3.35e-233) {
tmp = b * c;
} else if (k <= 4.4e-138) {
tmp = t_1;
} else if (k <= 2.9e+128) {
tmp = x * (i * -4.0);
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 = 18.0d0 * (t * (x * (y * z)))
if (k <= (-2.1d+24)) then
tmp = j * (k * (-27.0d0))
else if (k <= 1.9d-280) then
tmp = t_1
else if (k <= 3.35d-233) then
tmp = b * c
else if (k <= 4.4d-138) then
tmp = t_1
else if (k <= 2.9d+128) then
tmp = x * (i * (-4.0d0))
else
tmp = k * (j * (-27.0d0))
end if
code = tmp
end function
assert y < z;
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 = 18.0 * (t * (x * (y * z)));
double tmp;
if (k <= -2.1e+24) {
tmp = j * (k * -27.0);
} else if (k <= 1.9e-280) {
tmp = t_1;
} else if (k <= 3.35e-233) {
tmp = b * c;
} else if (k <= 4.4e-138) {
tmp = t_1;
} else if (k <= 2.9e+128) {
tmp = x * (i * -4.0);
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * (t * (x * (y * z))) tmp = 0 if k <= -2.1e+24: tmp = j * (k * -27.0) elif k <= 1.9e-280: tmp = t_1 elif k <= 3.35e-233: tmp = b * c elif k <= 4.4e-138: tmp = t_1 elif k <= 2.9e+128: tmp = x * (i * -4.0) else: tmp = k * (j * -27.0) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))) tmp = 0.0 if (k <= -2.1e+24) tmp = Float64(j * Float64(k * -27.0)); elseif (k <= 1.9e-280) tmp = t_1; elseif (k <= 3.35e-233) tmp = Float64(b * c); elseif (k <= 4.4e-138) tmp = t_1; elseif (k <= 2.9e+128) tmp = Float64(x * Float64(i * -4.0)); else tmp = Float64(k * Float64(j * -27.0)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * (t * (x * (y * z)));
tmp = 0.0;
if (k <= -2.1e+24)
tmp = j * (k * -27.0);
elseif (k <= 1.9e-280)
tmp = t_1;
elseif (k <= 3.35e-233)
tmp = b * c;
elseif (k <= 4.4e-138)
tmp = t_1;
elseif (k <= 2.9e+128)
tmp = x * (i * -4.0);
else
tmp = k * (j * -27.0);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -2.1e+24], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.9e-280], t$95$1, If[LessEqual[k, 3.35e-233], N[(b * c), $MachinePrecision], If[LessEqual[k, 4.4e-138], t$95$1, If[LessEqual[k, 2.9e+128], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;k \leq -2.1 \cdot 10^{+24}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;k \leq 1.9 \cdot 10^{-280}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 3.35 \cdot 10^{-233}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;k \leq 4.4 \cdot 10^{-138}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 2.9 \cdot 10^{+128}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if k < -2.1000000000000001e24Initial program 87.2%
Simplified85.7%
Taylor expanded in j around inf 39.5%
*-commutative39.5%
associate-*l*39.5%
Simplified39.5%
if -2.1000000000000001e24 < k < 1.9000000000000001e-280 or 3.35000000000000011e-233 < k < 4.3999999999999998e-138Initial program 86.3%
Simplified88.6%
Taylor expanded in x around inf 78.5%
*-commutative78.5%
associate-*l*79.7%
associate-*l*78.3%
Simplified78.3%
fma-def78.3%
associate-*r*79.7%
*-commutative79.7%
associate-*r*78.3%
Applied egg-rr78.3%
Taylor expanded in y around inf 33.3%
if 1.9000000000000001e-280 < k < 3.35000000000000011e-233Initial program 88.7%
Simplified76.9%
Taylor expanded in b around inf 30.8%
if 4.3999999999999998e-138 < k < 2.9e128Initial program 78.7%
Simplified84.6%
Taylor expanded in i around inf 30.3%
associate-*r*30.3%
*-commutative30.3%
Simplified30.3%
if 2.9e128 < k Initial program 87.3%
Simplified89.6%
Taylor expanded in j around inf 50.2%
*-commutative50.2%
*-commutative50.2%
associate-*l*50.2%
Simplified50.2%
Final simplification36.6%
NOTE: y and z should be sorted in increasing order before calling this function.
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 (* y z))))
(if (<= k -7e+18)
(* j (* k -27.0))
(if (<= k 2.5e-281)
(* t (* 18.0 t_1))
(if (<= k 7.1e-230)
(* b c)
(if (<= k 1.85e-137)
(* 18.0 (* t t_1))
(if (<= k 3.6e+125) (* x (* i -4.0)) (* k (* j -27.0)))))))))assert(y < 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 t_1 = x * (y * z);
double tmp;
if (k <= -7e+18) {
tmp = j * (k * -27.0);
} else if (k <= 2.5e-281) {
tmp = t * (18.0 * t_1);
} else if (k <= 7.1e-230) {
tmp = b * c;
} else if (k <= 1.85e-137) {
tmp = 18.0 * (t * t_1);
} else if (k <= 3.6e+125) {
tmp = x * (i * -4.0);
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 * (y * z)
if (k <= (-7d+18)) then
tmp = j * (k * (-27.0d0))
else if (k <= 2.5d-281) then
tmp = t * (18.0d0 * t_1)
else if (k <= 7.1d-230) then
tmp = b * c
else if (k <= 1.85d-137) then
tmp = 18.0d0 * (t * t_1)
else if (k <= 3.6d+125) then
tmp = x * (i * (-4.0d0))
else
tmp = k * (j * (-27.0d0))
end if
code = tmp
end function
assert y < z;
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 * (y * z);
double tmp;
if (k <= -7e+18) {
tmp = j * (k * -27.0);
} else if (k <= 2.5e-281) {
tmp = t * (18.0 * t_1);
} else if (k <= 7.1e-230) {
tmp = b * c;
} else if (k <= 1.85e-137) {
tmp = 18.0 * (t * t_1);
} else if (k <= 3.6e+125) {
tmp = x * (i * -4.0);
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = x * (y * z) tmp = 0 if k <= -7e+18: tmp = j * (k * -27.0) elif k <= 2.5e-281: tmp = t * (18.0 * t_1) elif k <= 7.1e-230: tmp = b * c elif k <= 1.85e-137: tmp = 18.0 * (t * t_1) elif k <= 3.6e+125: tmp = x * (i * -4.0) else: tmp = k * (j * -27.0) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (k <= -7e+18) tmp = Float64(j * Float64(k * -27.0)); elseif (k <= 2.5e-281) tmp = Float64(t * Float64(18.0 * t_1)); elseif (k <= 7.1e-230) tmp = Float64(b * c); elseif (k <= 1.85e-137) tmp = Float64(18.0 * Float64(t * t_1)); elseif (k <= 3.6e+125) tmp = Float64(x * Float64(i * -4.0)); else tmp = Float64(k * Float64(j * -27.0)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = x * (y * z);
tmp = 0.0;
if (k <= -7e+18)
tmp = j * (k * -27.0);
elseif (k <= 2.5e-281)
tmp = t * (18.0 * t_1);
elseif (k <= 7.1e-230)
tmp = b * c;
elseif (k <= 1.85e-137)
tmp = 18.0 * (t * t_1);
elseif (k <= 3.6e+125)
tmp = x * (i * -4.0);
else
tmp = k * (j * -27.0);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -7e+18], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.5e-281], N[(t * N[(18.0 * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 7.1e-230], N[(b * c), $MachinePrecision], If[LessEqual[k, 1.85e-137], N[(18.0 * N[(t * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 3.6e+125], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;k \leq -7 \cdot 10^{+18}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;k \leq 2.5 \cdot 10^{-281}:\\
\;\;\;\;t \cdot \left(18 \cdot t_1\right)\\
\mathbf{elif}\;k \leq 7.1 \cdot 10^{-230}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;k \leq 1.85 \cdot 10^{-137}:\\
\;\;\;\;18 \cdot \left(t \cdot t_1\right)\\
\mathbf{elif}\;k \leq 3.6 \cdot 10^{+125}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if k < -7e18Initial program 87.2%
Simplified85.7%
Taylor expanded in j around inf 39.5%
*-commutative39.5%
associate-*l*39.5%
Simplified39.5%
if -7e18 < k < 2.4999999999999999e-281Initial program 85.0%
Simplified87.8%
Taylor expanded in x around inf 77.0%
*-commutative77.0%
associate-*l*78.5%
associate-*l*78.2%
Simplified78.2%
fma-def78.2%
associate-*r*78.5%
*-commutative78.5%
associate-*r*78.2%
Applied egg-rr78.2%
Taylor expanded in y around inf 32.6%
*-commutative32.6%
associate-*r*31.3%
associate-*l*31.3%
associate-*r*32.6%
Simplified32.6%
if 2.4999999999999999e-281 < k < 7.10000000000000018e-230Initial program 89.3%
Simplified78.2%
Taylor expanded in b around inf 29.3%
if 7.10000000000000018e-230 < k < 1.85e-137Initial program 92.3%
Simplified92.3%
Taylor expanded in x around inf 85.0%
*-commutative85.0%
associate-*l*85.0%
associate-*l*77.2%
Simplified77.2%
fma-def77.2%
associate-*r*85.0%
*-commutative85.0%
associate-*r*77.2%
Applied egg-rr77.2%
Taylor expanded in y around inf 32.1%
if 1.85e-137 < k < 3.6000000000000003e125Initial program 78.7%
Simplified84.6%
Taylor expanded in i around inf 30.3%
associate-*r*30.3%
*-commutative30.3%
Simplified30.3%
if 3.6000000000000003e125 < k Initial program 87.3%
Simplified89.6%
Taylor expanded in j around inf 50.2%
*-commutative50.2%
*-commutative50.2%
associate-*l*50.2%
Simplified50.2%
Final simplification36.3%
NOTE: y and z should be sorted in increasing order before calling this function.
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 -3.65e+25)
(* j (* k -27.0))
(if (<= k 6.2e-282)
(* x (* (* y z) (* t 18.0)))
(if (<= k 6.9e-227)
(* b c)
(if (<= k 8.2e-139)
(* 18.0 (* t (* x (* y z))))
(if (<= k 4e+126) (* x (* i -4.0)) (* k (* j -27.0))))))))assert(y < 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 (k <= -3.65e+25) {
tmp = j * (k * -27.0);
} else if (k <= 6.2e-282) {
tmp = x * ((y * z) * (t * 18.0));
} else if (k <= 6.9e-227) {
tmp = b * c;
} else if (k <= 8.2e-139) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (k <= 4e+126) {
tmp = x * (i * -4.0);
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 <= (-3.65d+25)) then
tmp = j * (k * (-27.0d0))
else if (k <= 6.2d-282) then
tmp = x * ((y * z) * (t * 18.0d0))
else if (k <= 6.9d-227) then
tmp = b * c
else if (k <= 8.2d-139) then
tmp = 18.0d0 * (t * (x * (y * z)))
else if (k <= 4d+126) then
tmp = x * (i * (-4.0d0))
else
tmp = k * (j * (-27.0d0))
end if
code = tmp
end function
assert y < z;
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 <= -3.65e+25) {
tmp = j * (k * -27.0);
} else if (k <= 6.2e-282) {
tmp = x * ((y * z) * (t * 18.0));
} else if (k <= 6.9e-227) {
tmp = b * c;
} else if (k <= 8.2e-139) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (k <= 4e+126) {
tmp = x * (i * -4.0);
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if k <= -3.65e+25: tmp = j * (k * -27.0) elif k <= 6.2e-282: tmp = x * ((y * z) * (t * 18.0)) elif k <= 6.9e-227: tmp = b * c elif k <= 8.2e-139: tmp = 18.0 * (t * (x * (y * z))) elif k <= 4e+126: tmp = x * (i * -4.0) else: tmp = k * (j * -27.0) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (k <= -3.65e+25) tmp = Float64(j * Float64(k * -27.0)); elseif (k <= 6.2e-282) tmp = Float64(x * Float64(Float64(y * z) * Float64(t * 18.0))); elseif (k <= 6.9e-227) tmp = Float64(b * c); elseif (k <= 8.2e-139) tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))); elseif (k <= 4e+126) tmp = Float64(x * Float64(i * -4.0)); else tmp = Float64(k * Float64(j * -27.0)); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 <= -3.65e+25)
tmp = j * (k * -27.0);
elseif (k <= 6.2e-282)
tmp = x * ((y * z) * (t * 18.0));
elseif (k <= 6.9e-227)
tmp = b * c;
elseif (k <= 8.2e-139)
tmp = 18.0 * (t * (x * (y * z)));
elseif (k <= 4e+126)
tmp = x * (i * -4.0);
else
tmp = k * (j * -27.0);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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, -3.65e+25], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 6.2e-282], N[(x * N[(N[(y * z), $MachinePrecision] * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 6.9e-227], N[(b * c), $MachinePrecision], If[LessEqual[k, 8.2e-139], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 4e+126], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq -3.65 \cdot 10^{+25}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;k \leq 6.2 \cdot 10^{-282}:\\
\;\;\;\;x \cdot \left(\left(y \cdot z\right) \cdot \left(t \cdot 18\right)\right)\\
\mathbf{elif}\;k \leq 6.9 \cdot 10^{-227}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;k \leq 8.2 \cdot 10^{-139}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;k \leq 4 \cdot 10^{+126}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if k < -3.6499999999999998e25Initial program 86.8%
Simplified86.8%
Taylor expanded in j around inf 39.1%
*-commutative39.1%
associate-*l*39.1%
Simplified39.1%
if -3.6499999999999998e25 < k < 6.20000000000000027e-282Initial program 85.4%
Simplified86.7%
Taylor expanded in x around inf 76.3%
*-commutative76.3%
associate-*l*77.7%
associate-*l*78.8%
Simplified78.8%
fma-def78.8%
associate-*r*77.7%
*-commutative77.7%
associate-*r*78.8%
Applied egg-rr78.8%
Taylor expanded in y around inf 31.8%
*-commutative31.8%
associate-*r*32.2%
*-commutative32.2%
associate-*r*32.0%
associate-*r*32.0%
*-commutative32.0%
associate-*r*32.2%
associate-*l*32.2%
Simplified32.2%
if 6.20000000000000027e-282 < k < 6.89999999999999989e-227Initial program 89.3%
Simplified78.2%
Taylor expanded in b around inf 29.3%
if 6.89999999999999989e-227 < k < 8.20000000000000028e-139Initial program 92.3%
Simplified92.3%
Taylor expanded in x around inf 85.0%
*-commutative85.0%
associate-*l*85.0%
associate-*l*77.2%
Simplified77.2%
fma-def77.2%
associate-*r*85.0%
*-commutative85.0%
associate-*r*77.2%
Applied egg-rr77.2%
Taylor expanded in y around inf 32.1%
if 8.20000000000000028e-139 < k < 3.9999999999999997e126Initial program 78.7%
Simplified84.6%
Taylor expanded in i around inf 30.3%
associate-*r*30.3%
*-commutative30.3%
Simplified30.3%
if 3.9999999999999997e126 < k Initial program 87.3%
Simplified89.6%
Taylor expanded in j around inf 50.2%
*-commutative50.2%
*-commutative50.2%
associate-*l*50.2%
Simplified50.2%
Final simplification36.0%
NOTE: y and z should be sorted in increasing order before calling this function.
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)))) (t_2 (* x (* (* y z) (* t 18.0)))))
(if (<= x -3.7e+65)
t_2
(if (<= x 5.2e-64)
t_1
(if (<= x 9.6e+65) t_2 (if (<= x 3.9e+102) t_1 (* x (* i -4.0))))))))assert(y < 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 t_1 = (b * c) - (27.0 * (j * k));
double t_2 = x * ((y * z) * (t * 18.0));
double tmp;
if (x <= -3.7e+65) {
tmp = t_2;
} else if (x <= 5.2e-64) {
tmp = t_1;
} else if (x <= 9.6e+65) {
tmp = t_2;
} else if (x <= 3.9e+102) {
tmp = t_1;
} else {
tmp = x * (i * -4.0);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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) - (27.0d0 * (j * k))
t_2 = x * ((y * z) * (t * 18.0d0))
if (x <= (-3.7d+65)) then
tmp = t_2
else if (x <= 5.2d-64) then
tmp = t_1
else if (x <= 9.6d+65) then
tmp = t_2
else if (x <= 3.9d+102) then
tmp = t_1
else
tmp = x * (i * (-4.0d0))
end if
code = tmp
end function
assert y < z;
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 t_2 = x * ((y * z) * (t * 18.0));
double tmp;
if (x <= -3.7e+65) {
tmp = t_2;
} else if (x <= 5.2e-64) {
tmp = t_1;
} else if (x <= 9.6e+65) {
tmp = t_2;
} else if (x <= 3.9e+102) {
tmp = t_1;
} else {
tmp = x * (i * -4.0);
}
return tmp;
}
[y, z] = sort([y, z]) [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)) t_2 = x * ((y * z) * (t * 18.0)) tmp = 0 if x <= -3.7e+65: tmp = t_2 elif x <= 5.2e-64: tmp = t_1 elif x <= 9.6e+65: tmp = t_2 elif x <= 3.9e+102: tmp = t_1 else: tmp = x * (i * -4.0) return tmp
y, z = sort([y, z]) 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))) t_2 = Float64(x * Float64(Float64(y * z) * Float64(t * 18.0))) tmp = 0.0 if (x <= -3.7e+65) tmp = t_2; elseif (x <= 5.2e-64) tmp = t_1; elseif (x <= 9.6e+65) tmp = t_2; elseif (x <= 3.9e+102) tmp = t_1; else tmp = Float64(x * Float64(i * -4.0)); end return tmp end
y, z = num2cell(sort([y, z])){:}
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));
t_2 = x * ((y * z) * (t * 18.0));
tmp = 0.0;
if (x <= -3.7e+65)
tmp = t_2;
elseif (x <= 5.2e-64)
tmp = t_1;
elseif (x <= 9.6e+65)
tmp = t_2;
elseif (x <= 3.9e+102)
tmp = t_1;
else
tmp = x * (i * -4.0);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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]}, Block[{t$95$2 = N[(x * N[(N[(y * z), $MachinePrecision] * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.7e+65], t$95$2, If[LessEqual[x, 5.2e-64], t$95$1, If[LessEqual[x, 9.6e+65], t$95$2, If[LessEqual[x, 3.9e+102], t$95$1, N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := x \cdot \left(\left(y \cdot z\right) \cdot \left(t \cdot 18\right)\right)\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{+65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 5.2 \cdot 10^{-64}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{+65}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+102}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\end{array}
\end{array}
if x < -3.69999999999999995e65 or 5.2e-64 < x < 9.6000000000000007e65Initial program 76.2%
Simplified78.9%
Taylor expanded in x around inf 68.0%
*-commutative68.0%
associate-*l*73.6%
associate-*l*76.2%
Simplified76.2%
fma-def76.2%
associate-*r*73.6%
*-commutative73.6%
associate-*r*76.2%
Applied egg-rr76.2%
Taylor expanded in y around inf 50.2%
*-commutative50.2%
associate-*r*51.5%
*-commutative51.5%
associate-*r*54.1%
associate-*r*54.1%
*-commutative54.1%
associate-*r*51.5%
associate-*l*51.6%
Simplified51.6%
if -3.69999999999999995e65 < x < 5.2e-64 or 9.6000000000000007e65 < x < 3.8999999999999998e102Initial program 92.0%
Taylor expanded in a around 0 73.6%
sub-neg73.6%
+-commutative73.6%
associate-+l+73.6%
associate-*r*72.9%
*-commutative72.9%
associate-*r*73.0%
associate-*r*73.7%
distribute-lft-neg-in73.7%
metadata-eval73.7%
associate-*r*74.4%
distribute-rgt-in74.4%
metadata-eval74.4%
cancel-sign-sub-inv74.4%
+-commutative74.4%
fma-def75.1%
Simplified75.1%
Taylor expanded in x around 0 58.0%
if 3.8999999999999998e102 < x Initial program 79.1%
Simplified83.2%
Taylor expanded in i around inf 47.6%
associate-*r*47.6%
*-commutative47.6%
Simplified47.6%
Final simplification54.3%
NOTE: y and z should be sorted in increasing order before calling this function.
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))))
(t_2 (* x (* z (* t (* -18.0 (- y)))))))
(if (<= x -1.2e+72)
t_2
(if (<= x 1.05e-63)
t_1
(if (<= x 1.35e+66) t_2 (if (<= x 1.15e+103) t_1 (* x (* i -4.0))))))))assert(y < 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 t_1 = (b * c) - (27.0 * (j * k));
double t_2 = x * (z * (t * (-18.0 * -y)));
double tmp;
if (x <= -1.2e+72) {
tmp = t_2;
} else if (x <= 1.05e-63) {
tmp = t_1;
} else if (x <= 1.35e+66) {
tmp = t_2;
} else if (x <= 1.15e+103) {
tmp = t_1;
} else {
tmp = x * (i * -4.0);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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) - (27.0d0 * (j * k))
t_2 = x * (z * (t * ((-18.0d0) * -y)))
if (x <= (-1.2d+72)) then
tmp = t_2
else if (x <= 1.05d-63) then
tmp = t_1
else if (x <= 1.35d+66) then
tmp = t_2
else if (x <= 1.15d+103) then
tmp = t_1
else
tmp = x * (i * (-4.0d0))
end if
code = tmp
end function
assert y < z;
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 t_2 = x * (z * (t * (-18.0 * -y)));
double tmp;
if (x <= -1.2e+72) {
tmp = t_2;
} else if (x <= 1.05e-63) {
tmp = t_1;
} else if (x <= 1.35e+66) {
tmp = t_2;
} else if (x <= 1.15e+103) {
tmp = t_1;
} else {
tmp = x * (i * -4.0);
}
return tmp;
}
[y, z] = sort([y, z]) [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)) t_2 = x * (z * (t * (-18.0 * -y))) tmp = 0 if x <= -1.2e+72: tmp = t_2 elif x <= 1.05e-63: tmp = t_1 elif x <= 1.35e+66: tmp = t_2 elif x <= 1.15e+103: tmp = t_1 else: tmp = x * (i * -4.0) return tmp
y, z = sort([y, z]) 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))) t_2 = Float64(x * Float64(z * Float64(t * Float64(-18.0 * Float64(-y))))) tmp = 0.0 if (x <= -1.2e+72) tmp = t_2; elseif (x <= 1.05e-63) tmp = t_1; elseif (x <= 1.35e+66) tmp = t_2; elseif (x <= 1.15e+103) tmp = t_1; else tmp = Float64(x * Float64(i * -4.0)); end return tmp end
y, z = num2cell(sort([y, z])){:}
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));
t_2 = x * (z * (t * (-18.0 * -y)));
tmp = 0.0;
if (x <= -1.2e+72)
tmp = t_2;
elseif (x <= 1.05e-63)
tmp = t_1;
elseif (x <= 1.35e+66)
tmp = t_2;
elseif (x <= 1.15e+103)
tmp = t_1;
else
tmp = x * (i * -4.0);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
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]}, Block[{t$95$2 = N[(x * N[(z * N[(t * N[(-18.0 * (-y)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+72], t$95$2, If[LessEqual[x, 1.05e-63], t$95$1, If[LessEqual[x, 1.35e+66], t$95$2, If[LessEqual[x, 1.15e+103], t$95$1, N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c - 27 \cdot \left(j \cdot k\right)\\
t_2 := x \cdot \left(z \cdot \left(t \cdot \left(-18 \cdot \left(-y\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-63}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+66}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{+103}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\end{array}
\end{array}
if x < -1.20000000000000005e72 or 1.05e-63 < x < 1.35e66Initial program 76.2%
Simplified78.9%
Taylor expanded in x around inf 68.0%
*-commutative68.0%
associate-*l*73.6%
associate-*l*76.2%
Simplified76.2%
Taylor expanded in x around -inf 69.2%
mul-1-neg69.2%
cancel-sign-sub-inv69.2%
associate-*r*73.2%
metadata-eval73.2%
*-commutative73.2%
Simplified73.2%
Taylor expanded in t around inf 50.2%
*-commutative50.2%
associate-*r*48.8%
associate-*l*48.8%
associate-*r*50.2%
*-commutative50.2%
associate-*r*51.6%
associate-*l*51.5%
associate-*r*52.7%
*-commutative52.7%
*-commutative52.7%
*-commutative52.7%
associate-*l*52.7%
*-commutative52.7%
associate-*l*52.7%
Simplified52.7%
if -1.20000000000000005e72 < x < 1.05e-63 or 1.35e66 < x < 1.15000000000000004e103Initial program 92.0%
Taylor expanded in a around 0 73.6%
sub-neg73.6%
+-commutative73.6%
associate-+l+73.6%
associate-*r*72.9%
*-commutative72.9%
associate-*r*73.0%
associate-*r*73.7%
distribute-lft-neg-in73.7%
metadata-eval73.7%
associate-*r*74.4%
distribute-rgt-in74.4%
metadata-eval74.4%
cancel-sign-sub-inv74.4%
+-commutative74.4%
fma-def75.1%
Simplified75.1%
Taylor expanded in x around 0 58.0%
if 1.15000000000000004e103 < x Initial program 79.1%
Simplified83.2%
Taylor expanded in i around inf 47.6%
associate-*r*47.6%
*-commutative47.6%
Simplified47.6%
Final simplification54.6%
NOTE: y and z should be sorted in increasing order before calling this function.
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 -1.05e+102)
(* 18.0 (* t (* x (* y z))))
(if (<= t -95000000.0)
(- (* b c) (* 27.0 (* j k)))
(if (<= t 6.2e+33)
(- (* x (* i -4.0)) (* k (* j 27.0)))
(* x (* (* y z) (* t 18.0)))))))assert(y < 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 (t <= -1.05e+102) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (t <= -95000000.0) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 6.2e+33) {
tmp = (x * (i * -4.0)) - (k * (j * 27.0));
} else {
tmp = x * ((y * z) * (t * 18.0));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 (t <= (-1.05d+102)) then
tmp = 18.0d0 * (t * (x * (y * z)))
else if (t <= (-95000000.0d0)) then
tmp = (b * c) - (27.0d0 * (j * k))
else if (t <= 6.2d+33) then
tmp = (x * (i * (-4.0d0))) - (k * (j * 27.0d0))
else
tmp = x * ((y * z) * (t * 18.0d0))
end if
code = tmp
end function
assert y < z;
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 <= -1.05e+102) {
tmp = 18.0 * (t * (x * (y * z)));
} else if (t <= -95000000.0) {
tmp = (b * c) - (27.0 * (j * k));
} else if (t <= 6.2e+33) {
tmp = (x * (i * -4.0)) - (k * (j * 27.0));
} else {
tmp = x * ((y * z) * (t * 18.0));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if t <= -1.05e+102: tmp = 18.0 * (t * (x * (y * z))) elif t <= -95000000.0: tmp = (b * c) - (27.0 * (j * k)) elif t <= 6.2e+33: tmp = (x * (i * -4.0)) - (k * (j * 27.0)) else: tmp = x * ((y * z) * (t * 18.0)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (t <= -1.05e+102) tmp = Float64(18.0 * Float64(t * Float64(x * Float64(y * z)))); elseif (t <= -95000000.0) tmp = Float64(Float64(b * c) - Float64(27.0 * Float64(j * k))); elseif (t <= 6.2e+33) tmp = Float64(Float64(x * Float64(i * -4.0)) - Float64(k * Float64(j * 27.0))); else tmp = Float64(x * Float64(Float64(y * z) * Float64(t * 18.0))); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 <= -1.05e+102)
tmp = 18.0 * (t * (x * (y * z)));
elseif (t <= -95000000.0)
tmp = (b * c) - (27.0 * (j * k));
elseif (t <= 6.2e+33)
tmp = (x * (i * -4.0)) - (k * (j * 27.0));
else
tmp = x * ((y * z) * (t * 18.0));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[t, -1.05e+102], N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, -95000000.0], N[(N[(b * c), $MachinePrecision] - N[(27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+33], N[(N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(y * z), $MachinePrecision] * N[(t * 18.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{+102}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;t \leq -95000000:\\
\;\;\;\;b \cdot c - 27 \cdot \left(j \cdot k\right)\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+33}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(\left(y \cdot z\right) \cdot \left(t \cdot 18\right)\right)\\
\end{array}
\end{array}
if t < -1.05000000000000001e102Initial program 84.6%
Simplified91.2%
Taylor expanded in x around inf 73.1%
*-commutative73.1%
associate-*l*71.1%
associate-*l*64.7%
Simplified64.7%
fma-def64.8%
associate-*r*71.1%
*-commutative71.1%
associate-*r*64.8%
Applied egg-rr64.8%
Taylor expanded in y around inf 59.4%
if -1.05000000000000001e102 < t < -9.5e7Initial program 87.4%
Taylor expanded in a around 0 87.7%
sub-neg87.7%
+-commutative87.7%
associate-+l+87.7%
associate-*r*87.7%
*-commutative87.7%
associate-*r*87.7%
associate-*r*87.7%
distribute-lft-neg-in87.7%
metadata-eval87.7%
associate-*r*87.7%
distribute-rgt-in87.7%
metadata-eval87.7%
cancel-sign-sub-inv87.7%
+-commutative87.7%
fma-def87.7%
Simplified87.7%
Taylor expanded in x around 0 69.5%
if -9.5e7 < t < 6.2e33Initial program 84.7%
Taylor expanded in a around 0 76.1%
sub-neg76.1%
+-commutative76.1%
associate-+l+76.1%
associate-*r*76.1%
*-commutative76.1%
associate-*r*82.6%
associate-*r*82.6%
distribute-lft-neg-in82.6%
metadata-eval82.6%
associate-*r*82.6%
distribute-rgt-in82.6%
metadata-eval82.6%
cancel-sign-sub-inv82.6%
+-commutative82.6%
fma-def82.6%
Simplified82.6%
Taylor expanded in i around inf 60.4%
associate-*r*60.4%
*-commutative60.4%
Simplified60.4%
if 6.2e33 < t Initial program 86.6%
Simplified86.5%
Taylor expanded in x around inf 65.9%
*-commutative65.9%
associate-*l*65.9%
associate-*l*59.2%
Simplified59.2%
fma-def59.2%
associate-*r*65.9%
*-commutative65.9%
associate-*r*59.2%
Applied egg-rr59.2%
Taylor expanded in y around inf 44.0%
*-commutative44.0%
associate-*r*46.0%
*-commutative46.0%
associate-*r*46.0%
associate-*r*46.0%
*-commutative46.0%
associate-*r*46.0%
associate-*l*46.0%
Simplified46.0%
Final simplification57.4%
NOTE: y and z should be sorted in increasing order before calling this function. 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 c) -5e+148) (* b c) (if (<= (* b c) 1.15e+77) (* j (* k -27.0)) (* b c))))
assert(y < 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 ((b * c) <= -5e+148) {
tmp = b * c;
} else if ((b * c) <= 1.15e+77) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 * c) <= (-5d+148)) then
tmp = b * c
else if ((b * c) <= 1.15d+77) then
tmp = j * (k * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
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 * c) <= -5e+148) {
tmp = b * c;
} else if ((b * c) <= 1.15e+77) {
tmp = j * (k * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -5e+148: tmp = b * c elif (b * c) <= 1.15e+77: tmp = j * (k * -27.0) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -5e+148) tmp = Float64(b * c); elseif (Float64(b * c) <= 1.15e+77) tmp = Float64(j * Float64(k * -27.0)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 * c) <= -5e+148)
tmp = b * c;
elseif ((b * c) <= 1.15e+77)
tmp = j * (k * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[(b * c), $MachinePrecision], -5e+148], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.15e+77], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -5 \cdot 10^{+148}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 1.15 \cdot 10^{+77}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -5.00000000000000024e148 or 1.14999999999999997e77 < (*.f64 b c) Initial program 80.6%
Simplified82.0%
Taylor expanded in b around inf 55.5%
if -5.00000000000000024e148 < (*.f64 b c) < 1.14999999999999997e77Initial program 87.2%
Simplified88.2%
Taylor expanded in j around inf 27.5%
*-commutative27.5%
associate-*l*27.5%
Simplified27.5%
Final simplification35.4%
NOTE: y and z should be sorted in increasing order before calling this function. 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 c) -1.3e+146) (* b c) (if (<= (* b c) 9.8e+76) (* k (* j -27.0)) (* b c))))
assert(y < 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 ((b * c) <= -1.3e+146) {
tmp = b * c;
} else if ((b * c) <= 9.8e+76) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 * c) <= (-1.3d+146)) then
tmp = b * c
else if ((b * c) <= 9.8d+76) then
tmp = k * (j * (-27.0d0))
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
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 * c) <= -1.3e+146) {
tmp = b * c;
} else if ((b * c) <= 9.8e+76) {
tmp = k * (j * -27.0);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -1.3e+146: tmp = b * c elif (b * c) <= 9.8e+76: tmp = k * (j * -27.0) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -1.3e+146) tmp = Float64(b * c); elseif (Float64(b * c) <= 9.8e+76) tmp = Float64(k * Float64(j * -27.0)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 * c) <= -1.3e+146)
tmp = b * c;
elseif ((b * c) <= 9.8e+76)
tmp = k * (j * -27.0);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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[(b * c), $MachinePrecision], -1.3e+146], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 9.8e+76], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.3 \cdot 10^{+146}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 9.8 \cdot 10^{+76}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.30000000000000007e146 or 9.80000000000000053e76 < (*.f64 b c) Initial program 80.6%
Simplified82.0%
Taylor expanded in b around inf 55.5%
if -1.30000000000000007e146 < (*.f64 b c) < 9.80000000000000053e76Initial program 87.2%
Simplified88.2%
Taylor expanded in j around inf 27.5%
*-commutative27.5%
*-commutative27.5%
associate-*l*27.5%
Simplified27.5%
Final simplification35.4%
NOTE: y and z should be sorted in increasing order before calling this function.
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 -2.5e-96)
(* j (* k -27.0))
(if (<= k 1.8e-168)
(* b c)
(if (<= k 4.8e+125) (* x (* i -4.0)) (* k (* j -27.0))))))assert(y < 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 (k <= -2.5e-96) {
tmp = j * (k * -27.0);
} else if (k <= 1.8e-168) {
tmp = b * c;
} else if (k <= 4.8e+125) {
tmp = x * (i * -4.0);
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 <= (-2.5d-96)) then
tmp = j * (k * (-27.0d0))
else if (k <= 1.8d-168) then
tmp = b * c
else if (k <= 4.8d+125) then
tmp = x * (i * (-4.0d0))
else
tmp = k * (j * (-27.0d0))
end if
code = tmp
end function
assert y < z;
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 <= -2.5e-96) {
tmp = j * (k * -27.0);
} else if (k <= 1.8e-168) {
tmp = b * c;
} else if (k <= 4.8e+125) {
tmp = x * (i * -4.0);
} else {
tmp = k * (j * -27.0);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if k <= -2.5e-96: tmp = j * (k * -27.0) elif k <= 1.8e-168: tmp = b * c elif k <= 4.8e+125: tmp = x * (i * -4.0) else: tmp = k * (j * -27.0) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (k <= -2.5e-96) tmp = Float64(j * Float64(k * -27.0)); elseif (k <= 1.8e-168) tmp = Float64(b * c); elseif (k <= 4.8e+125) tmp = Float64(x * Float64(i * -4.0)); else tmp = Float64(k * Float64(j * -27.0)); end return tmp end
y, z = num2cell(sort([y, z])){:}
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 <= -2.5e-96)
tmp = j * (k * -27.0);
elseif (k <= 1.8e-168)
tmp = b * c;
elseif (k <= 4.8e+125)
tmp = x * (i * -4.0);
else
tmp = k * (j * -27.0);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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, -2.5e-96], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 1.8e-168], N[(b * c), $MachinePrecision], If[LessEqual[k, 4.8e+125], N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision], N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;k \leq -2.5 \cdot 10^{-96}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;k \leq 1.8 \cdot 10^{-168}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;k \leq 4.8 \cdot 10^{+125}:\\
\;\;\;\;x \cdot \left(i \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;k \cdot \left(j \cdot -27\right)\\
\end{array}
\end{array}
if k < -2.49999999999999997e-96Initial program 87.1%
Simplified87.2%
Taylor expanded in j around inf 34.6%
*-commutative34.6%
associate-*l*34.6%
Simplified34.6%
if -2.49999999999999997e-96 < k < 1.7999999999999999e-168Initial program 87.0%
Simplified85.6%
Taylor expanded in b around inf 25.6%
if 1.7999999999999999e-168 < k < 4.7999999999999999e125Initial program 78.8%
Simplified84.2%
Taylor expanded in i around inf 31.5%
associate-*r*31.5%
*-commutative31.5%
Simplified31.5%
if 4.7999999999999999e125 < k Initial program 87.3%
Simplified89.6%
Taylor expanded in j around inf 50.2%
*-commutative50.2%
*-commutative50.2%
associate-*l*50.2%
Simplified50.2%
Final simplification33.7%
NOTE: y and z should be sorted in increasing order before calling this function. 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(y < 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) {
return b * c;
}
NOTE: y and z should be sorted in increasing order before calling this function.
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 y < z;
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;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: y and z should be sorted in increasing order before calling this function. 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}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 85.3%
Simplified86.4%
Taylor expanded in b around inf 19.6%
Final simplification19.6%
(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 2023290
(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)))