
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_1 5e+96)
t_1
(fma
j
(* k -27.0)
(fma
x
(* i -4.0)
(fma t (fma x (* 18.0 (* y z)) (* a -4.0)) (* b c)))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= 5e+96) {
tmp = t_1;
} else {
tmp = fma(j, (k * -27.0), fma(x, (i * -4.0), fma(t, fma(x, (18.0 * (y * z)), (a * -4.0)), (b * c))));
}
return tmp;
}
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (t_1 <= 5e+96) tmp = t_1; else tmp = fma(j, Float64(k * -27.0), fma(x, Float64(i * -4.0), fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(a * -4.0)), Float64(b * c)))); end return tmp end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $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]}, If[LessEqual[t$95$1, 5e+96], t$95$1, N[(j * N[(k * -27.0), $MachinePrecision] + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+96}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, k \cdot -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), b \cdot c\right)\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)) < 5.0000000000000004e96Initial program 97.9%
if 5.0000000000000004e96 < (-.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 79.0%
sub-neg79.0%
+-commutative79.0%
associate-*l*78.2%
distribute-rgt-neg-in78.2%
fma-def81.7%
*-commutative81.7%
distribute-rgt-neg-in81.7%
metadata-eval81.7%
sub-neg81.7%
+-commutative81.7%
associate-*l*82.6%
distribute-rgt-neg-in82.6%
Simplified88.7%
Final simplification93.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_1 5e+304)
t_1
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* i -4.0) (* 18.0 (* y (* z t))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= 5e+304) {
tmp = t_1;
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (((((((x * 18.0d0) * y) * z) * t) - (t * (a * 4.0d0))) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
if (t_1 <= 5d+304) then
tmp = t_1
else
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((i * (-4.0d0)) + (18.0d0 * (y * (z * t))))))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_1 <= 5e+304) {
tmp = t_1;
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k) tmp = 0 if t_1 <= 5e+304: tmp = t_1 else: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))))) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (t_1 <= 5e+304) tmp = t_1; else tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(i * -4.0) + Float64(18.0 * Float64(y * Float64(z * t))))))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
tmp = 0.0;
if (t_1 <= 5e+304)
tmp = t_1;
else
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $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]}, If[LessEqual[t$95$1, 5e+304], t$95$1, N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq 5 \cdot 10^{+304}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\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)) < 4.9999999999999997e304Initial program 98.3%
if 4.9999999999999997e304 < (-.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 67.0%
Simplified80.8%
Taylor expanded in a around 0 82.0%
Final simplification93.7%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 4.0 (* x i))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e-51)
(- (- (* b c) (+ t_1 (* 4.0 (* t a)))) t_2)
(if (<= t_2 1e+27)
(- (+ (* b c) (* t (- (* 18.0 (* y (* x z))) (* a 4.0)))) t_1)
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* i -4.0) (* 18.0 (* y (* z t)))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e-51) {
tmp = ((b * c) - (t_1 + (4.0 * (t * a)))) - t_2;
} else if (t_2 <= 1e+27) {
tmp = ((b * c) + (t * ((18.0 * (y * (x * z))) - (a * 4.0)))) - t_1;
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 4.0d0 * (x * i)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d-51)) then
tmp = ((b * c) - (t_1 + (4.0d0 * (t * a)))) - t_2
else if (t_2 <= 1d+27) then
tmp = ((b * c) + (t * ((18.0d0 * (y * (x * z))) - (a * 4.0d0)))) - t_1
else
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((i * (-4.0d0)) + (18.0d0 * (y * (z * t))))))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 4.0 * (x * i);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e-51) {
tmp = ((b * c) - (t_1 + (4.0 * (t * a)))) - t_2;
} else if (t_2 <= 1e+27) {
tmp = ((b * c) + (t * ((18.0 * (y * (x * z))) - (a * 4.0)))) - t_1;
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 4.0 * (x * i) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e-51: tmp = ((b * c) - (t_1 + (4.0 * (t * a)))) - t_2 elif t_2 <= 1e+27: tmp = ((b * c) + (t * ((18.0 * (y * (x * z))) - (a * 4.0)))) - t_1 else: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))))) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(4.0 * Float64(x * i)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e-51) tmp = Float64(Float64(Float64(b * c) - Float64(t_1 + Float64(4.0 * Float64(t * a)))) - t_2); elseif (t_2 <= 1e+27) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(18.0 * Float64(y * Float64(x * z))) - Float64(a * 4.0)))) - t_1); else tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(i * -4.0) + Float64(18.0 * Float64(y * Float64(z * t))))))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 4.0 * (x * i);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -2e-51)
tmp = ((b * c) - (t_1 + (4.0 * (t * a)))) - t_2;
elseif (t_2 <= 1e+27)
tmp = ((b * c) + (t * ((18.0 * (y * (x * z))) - (a * 4.0)))) - t_1;
else
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-51], N[(N[(N[(b * c), $MachinePrecision] - N[(t$95$1 + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t$95$2, 1e+27], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(18.0 * N[(y * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 4 \cdot \left(x \cdot i\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_2 \leq -2 \cdot 10^{-51}:\\
\;\;\;\;\left(b \cdot c - \left(t_1 + 4 \cdot \left(t \cdot a\right)\right)\right) - t_2\\
\mathbf{elif}\;t_2 \leq 10^{+27}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(18 \cdot \left(y \cdot \left(x \cdot z\right)\right) - a \cdot 4\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -2e-51Initial program 79.4%
Taylor expanded in y around 0 83.8%
if -2e-51 < (*.f64 (*.f64 j 27) k) < 1e27Initial program 96.0%
sub-neg96.0%
associate-+l-96.0%
sub-neg96.0%
sub-neg96.0%
distribute-rgt-out--96.8%
associate-*l*95.1%
distribute-lft-neg-in95.1%
cancel-sign-sub95.1%
associate-*l*96.0%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in j around 0 96.7%
if 1e27 < (*.f64 (*.f64 j 27) k) Initial program 88.5%
Simplified85.4%
Taylor expanded in a around 0 83.1%
Final simplification89.8%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -4e+258)
(* j (* k -27.0))
(-
(+
(* t (- (* x (* 18.0 (* y z))) (* a 4.0)))
(- (* b c) (* (* x 4.0) i)))
t_1))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -4e+258) {
tmp = j * (k * -27.0);
} else {
tmp = ((t * ((x * (18.0 * (y * z))) - (a * 4.0))) + ((b * c) - ((x * 4.0) * i))) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if (t_1 <= (-4d+258)) then
tmp = j * (k * (-27.0d0))
else
tmp = ((t * ((x * (18.0d0 * (y * z))) - (a * 4.0d0))) + ((b * c) - ((x * 4.0d0) * i))) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -4e+258) {
tmp = j * (k * -27.0);
} else {
tmp = ((t * ((x * (18.0 * (y * z))) - (a * 4.0))) + ((b * c) - ((x * 4.0) * i))) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k tmp = 0 if t_1 <= -4e+258: tmp = j * (k * -27.0) else: tmp = ((t * ((x * (18.0 * (y * z))) - (a * 4.0))) + ((b * c) - ((x * 4.0) * i))) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -4e+258) tmp = Float64(j * Float64(k * -27.0)); else tmp = Float64(Float64(Float64(t * Float64(Float64(x * Float64(18.0 * Float64(y * z))) - Float64(a * 4.0))) + Float64(Float64(b * c) - Float64(Float64(x * 4.0) * i))) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
tmp = 0.0;
if (t_1 <= -4e+258)
tmp = j * (k * -27.0);
else
tmp = ((t * ((x * (18.0 * (y * z))) - (a * 4.0))) + ((b * c) - ((x * 4.0) * i))) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+258], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t * N[(N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+258}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t \cdot \left(x \cdot \left(18 \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) + \left(b \cdot c - \left(x \cdot 4\right) \cdot i\right)\right) - t_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j 27) k) < -4.00000000000000023e258Initial program 62.4%
sub-neg62.4%
+-commutative62.4%
associate-*l*62.5%
distribute-rgt-neg-in62.5%
fma-def75.0%
*-commutative75.0%
distribute-rgt-neg-in75.0%
metadata-eval75.0%
sub-neg75.0%
+-commutative75.0%
associate-*l*75.0%
distribute-rgt-neg-in75.0%
Simplified79.2%
Taylor expanded in j around inf 83.6%
associate-*r*83.7%
*-commutative83.7%
*-commutative83.7%
*-commutative83.7%
Simplified83.7%
if -4.00000000000000023e258 < (*.f64 (*.f64 j 27) k) Initial program 92.3%
associate--l+92.3%
distribute-rgt-out--93.1%
associate-*r*91.4%
associate-*l*91.4%
*-commutative91.4%
Applied egg-rr91.4%
Final simplification90.7%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x 1.5e+84)
(-
(+ (* b c) (* t (- (* (* x 18.0) (* y z)) (* a 4.0))))
(+ (* x (* 4.0 i)) (* j (* 27.0 k))))
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* i -4.0) (* 18.0 (* y (* z t)))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 1.5e+84) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= 1.5d+84) then
tmp = ((b * c) + (t * (((x * 18.0d0) * (y * z)) - (a * 4.0d0)))) - ((x * (4.0d0 * i)) + (j * (27.0d0 * k)))
else
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((i * (-4.0d0)) + (18.0d0 * (y * (z * t))))))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= 1.5e+84) {
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
} else {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= 1.5e+84: tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k))) else: tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))))) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= 1.5e+84) tmp = Float64(Float64(Float64(b * c) + Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0)))) - Float64(Float64(x * Float64(4.0 * i)) + Float64(j * Float64(27.0 * k)))); else tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(i * -4.0) + Float64(18.0 * Float64(y * Float64(z * t))))))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= 1.5e+84)
tmp = ((b * c) + (t * (((x * 18.0) * (y * z)) - (a * 4.0)))) - ((x * (4.0 * i)) + (j * (27.0 * k)));
else
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, 1.5e+84], N[(N[(N[(b * c), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision] + N[(j * N[(27.0 * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.5 \cdot 10^{+84}:\\
\;\;\;\;\left(b \cdot c + t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right)\right) - \left(x \cdot \left(4 \cdot i\right) + j \cdot \left(27 \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\right)\\
\end{array}
\end{array}
if x < 1.49999999999999998e84Initial program 92.4%
sub-neg92.4%
associate-+l-92.4%
sub-neg92.4%
sub-neg92.4%
distribute-rgt-out--92.9%
associate-*l*90.6%
distribute-lft-neg-in90.6%
cancel-sign-sub90.6%
associate-*l*91.1%
associate-*l*90.7%
Simplified90.7%
if 1.49999999999999998e84 < x Initial program 74.8%
Simplified88.5%
Taylor expanded in a around 0 93.2%
Final simplification91.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (or (<= x -1.2e+68) (not (<= x 2.25e+17)))
(+
(* b c)
(+ (* -27.0 (* j k)) (* x (+ (* i -4.0) (* 18.0 (* y (* z t)))))))
(- (- (* b c) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))) (* (* j 27.0) k))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -1.2e+68) || !(x <= 2.25e+17)) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
} else {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-1.2d+68)) .or. (.not. (x <= 2.25d+17))) then
tmp = (b * c) + (((-27.0d0) * (j * k)) + (x * ((i * (-4.0d0)) + (18.0d0 * (y * (z * t))))))
else
tmp = ((b * c) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -1.2e+68) || !(x <= 2.25e+17)) {
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
} else {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -1.2e+68) or not (x <= 2.25e+17): tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))))) else: tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -1.2e+68) || !(x <= 2.25e+17)) tmp = Float64(Float64(b * c) + Float64(Float64(-27.0 * Float64(j * k)) + Float64(x * Float64(Float64(i * -4.0) + Float64(18.0 * Float64(y * Float64(z * t))))))); else tmp = Float64(Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))) - Float64(Float64(j * 27.0) * k)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -1.2e+68) || ~((x <= 2.25e+17)))
tmp = (b * c) + ((-27.0 * (j * k)) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))));
else
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -1.2e+68], N[Not[LessEqual[x, 2.25e+17]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+68} \lor \neg \left(x \leq 2.25 \cdot 10^{+17}\right):\\
\;\;\;\;b \cdot c + \left(-27 \cdot \left(j \cdot k\right) + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -1.20000000000000004e68 or 2.25e17 < x Initial program 81.9%
Simplified91.4%
Taylor expanded in a around 0 85.5%
if -1.20000000000000004e68 < x < 2.25e17Initial program 95.6%
Taylor expanded in y around 0 87.2%
Final simplification86.4%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -2.4e+190) (not (<= x 7.8e+105))) (+ (* b c) (* x (+ (* i -4.0) (* 18.0 (* y (* z t)))))) (- (- (* b c) (+ (* 4.0 (* x i)) (* 4.0 (* t a)))) (* (* j 27.0) k))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -2.4e+190) || !(x <= 7.8e+105)) {
tmp = (b * c) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))));
} else {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-2.4d+190)) .or. (.not. (x <= 7.8d+105))) then
tmp = (b * c) + (x * ((i * (-4.0d0)) + (18.0d0 * (y * (z * t)))))
else
tmp = ((b * c) - ((4.0d0 * (x * i)) + (4.0d0 * (t * a)))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -2.4e+190) || !(x <= 7.8e+105)) {
tmp = (b * c) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))));
} else {
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -2.4e+190) or not (x <= 7.8e+105): tmp = (b * c) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))) else: tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -2.4e+190) || !(x <= 7.8e+105)) tmp = Float64(Float64(b * c) + Float64(x * Float64(Float64(i * -4.0) + Float64(18.0 * Float64(y * Float64(z * t)))))); else tmp = Float64(Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(4.0 * Float64(t * a)))) - Float64(Float64(j * 27.0) * k)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -2.4e+190) || ~((x <= 7.8e+105)))
tmp = (b * c) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))));
else
tmp = ((b * c) - ((4.0 * (x * i)) + (4.0 * (t * a)))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -2.4e+190], N[Not[LessEqual[x, 7.8e+105]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+190} \lor \neg \left(x \leq 7.8 \cdot 10^{+105}\right):\\
\;\;\;\;b \cdot c + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 4 \cdot \left(t \cdot a\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -2.3999999999999999e190 or 7.79999999999999957e105 < x Initial program 76.3%
Simplified88.8%
Taylor expanded in a around 0 89.1%
Taylor expanded in k around 0 84.7%
if -2.3999999999999999e190 < x < 7.79999999999999957e105Initial program 93.8%
Taylor expanded in y around 0 83.2%
Final simplification83.6%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* k (* j -27.0)) (* -4.0 (* x i))))
(t_2 (* t (+ (* (* x z) (* 18.0 y)) (* a -4.0)))))
(if (<= t -6.5e+19)
t_2
(if (<= t -3.1e-79)
t_1
(if (<= t -2.45e-126)
t_2
(if (<= t -1.05e-295)
t_1
(if (<= t 2.35e+27) (+ (* b c) (* -27.0 (* j k))) t_2)))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * (j * -27.0)) + (-4.0 * (x * i));
double t_2 = t * (((x * z) * (18.0 * y)) + (a * -4.0));
double tmp;
if (t <= -6.5e+19) {
tmp = t_2;
} else if (t <= -3.1e-79) {
tmp = t_1;
} else if (t <= -2.45e-126) {
tmp = t_2;
} else if (t <= -1.05e-295) {
tmp = t_1;
} else if (t <= 2.35e+27) {
tmp = (b * c) + (-27.0 * (j * k));
} else {
tmp = t_2;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (k * (j * (-27.0d0))) + ((-4.0d0) * (x * i))
t_2 = t * (((x * z) * (18.0d0 * y)) + (a * (-4.0d0)))
if (t <= (-6.5d+19)) then
tmp = t_2
else if (t <= (-3.1d-79)) then
tmp = t_1
else if (t <= (-2.45d-126)) then
tmp = t_2
else if (t <= (-1.05d-295)) then
tmp = t_1
else if (t <= 2.35d+27) then
tmp = (b * c) + ((-27.0d0) * (j * k))
else
tmp = t_2
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * (j * -27.0)) + (-4.0 * (x * i));
double t_2 = t * (((x * z) * (18.0 * y)) + (a * -4.0));
double tmp;
if (t <= -6.5e+19) {
tmp = t_2;
} else if (t <= -3.1e-79) {
tmp = t_1;
} else if (t <= -2.45e-126) {
tmp = t_2;
} else if (t <= -1.05e-295) {
tmp = t_1;
} else if (t <= 2.35e+27) {
tmp = (b * c) + (-27.0 * (j * k));
} else {
tmp = t_2;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (k * (j * -27.0)) + (-4.0 * (x * i)) t_2 = t * (((x * z) * (18.0 * y)) + (a * -4.0)) tmp = 0 if t <= -6.5e+19: tmp = t_2 elif t <= -3.1e-79: tmp = t_1 elif t <= -2.45e-126: tmp = t_2 elif t <= -1.05e-295: tmp = t_1 elif t <= 2.35e+27: tmp = (b * c) + (-27.0 * (j * k)) else: tmp = t_2 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(k * Float64(j * -27.0)) + Float64(-4.0 * Float64(x * i))) t_2 = Float64(t * Float64(Float64(Float64(x * z) * Float64(18.0 * y)) + Float64(a * -4.0))) tmp = 0.0 if (t <= -6.5e+19) tmp = t_2; elseif (t <= -3.1e-79) tmp = t_1; elseif (t <= -2.45e-126) tmp = t_2; elseif (t <= -1.05e-295) tmp = t_1; elseif (t <= 2.35e+27) tmp = Float64(Float64(b * c) + Float64(-27.0 * Float64(j * k))); else tmp = t_2; end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (k * (j * -27.0)) + (-4.0 * (x * i));
t_2 = t * (((x * z) * (18.0 * y)) + (a * -4.0));
tmp = 0.0;
if (t <= -6.5e+19)
tmp = t_2;
elseif (t <= -3.1e-79)
tmp = t_1;
elseif (t <= -2.45e-126)
tmp = t_2;
elseif (t <= -1.05e-295)
tmp = t_1;
elseif (t <= 2.35e+27)
tmp = (b * c) + (-27.0 * (j * k));
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(N[(N[(x * z), $MachinePrecision] * N[(18.0 * y), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.5e+19], t$95$2, If[LessEqual[t, -3.1e-79], t$95$1, If[LessEqual[t, -2.45e-126], t$95$2, If[LessEqual[t, -1.05e-295], t$95$1, If[LessEqual[t, 2.35e+27], N[(N[(b * c), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := k \cdot \left(j \cdot -27\right) + -4 \cdot \left(x \cdot i\right)\\
t_2 := t \cdot \left(\left(x \cdot z\right) \cdot \left(18 \cdot y\right) + a \cdot -4\right)\\
\mathbf{if}\;t \leq -6.5 \cdot 10^{+19}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-79}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.45 \cdot 10^{-126}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq -1.05 \cdot 10^{-295}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{+27}:\\
\;\;\;\;b \cdot c + -27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -6.5e19 or -3.0999999999999999e-79 < t < -2.45000000000000005e-126 or 2.34999999999999988e27 < t Initial program 85.8%
associate--l+85.8%
distribute-rgt-out--87.4%
associate-*r*88.2%
associate-*l*88.2%
*-commutative88.2%
Applied egg-rr88.2%
Taylor expanded in t around inf 68.7%
cancel-sign-sub-inv68.7%
distribute-rgt-in66.2%
associate-*r*65.4%
associate-*r*65.5%
*-commutative65.5%
distribute-rgt-in68.0%
*-commutative68.0%
associate-*r*68.0%
associate-*r*68.7%
*-commutative68.7%
metadata-eval68.7%
Simplified68.7%
if -6.5e19 < t < -3.0999999999999999e-79 or -2.45000000000000005e-126 < t < -1.04999999999999997e-295Initial program 88.0%
Taylor expanded in t around 0 80.3%
Taylor expanded in c around 0 67.0%
mul-1-neg67.0%
fma-def67.0%
*-commutative67.0%
associate-*r*67.0%
*-commutative67.0%
fma-def67.0%
distribute-neg-in67.0%
sub-neg67.0%
associate-*r*67.0%
cancel-sign-sub-inv67.0%
distribute-lft-neg-in67.0%
metadata-eval67.0%
*-commutative67.0%
*-commutative67.0%
distribute-rgt-neg-in67.0%
metadata-eval67.0%
Simplified67.0%
if -1.04999999999999997e-295 < t < 2.34999999999999988e27Initial program 96.2%
Simplified93.8%
Taylor expanded in a around 0 86.3%
Taylor expanded in x around 0 61.7%
Final simplification66.2%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* (* x z) (* y t)))))
(if (<= b -3.3e+128)
(* b c)
(if (<= b -4.9e-67)
t_1
(if (<= b -1.35e-183)
(* j (* k -27.0))
(if (<= b -1.8e-275)
(* t (* a -4.0))
(if (<= b 6.2e-251)
(* -4.0 (* x i))
(if (<= b 2.9e-220)
t_1
(if (<= b 3.3e-130) (* -27.0 (* j k)) (* b c))))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * ((x * z) * (y * t));
double tmp;
if (b <= -3.3e+128) {
tmp = b * c;
} else if (b <= -4.9e-67) {
tmp = t_1;
} else if (b <= -1.35e-183) {
tmp = j * (k * -27.0);
} else if (b <= -1.8e-275) {
tmp = t * (a * -4.0);
} else if (b <= 6.2e-251) {
tmp = -4.0 * (x * i);
} else if (b <= 2.9e-220) {
tmp = t_1;
} else if (b <= 3.3e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = 18.0d0 * ((x * z) * (y * t))
if (b <= (-3.3d+128)) then
tmp = b * c
else if (b <= (-4.9d-67)) then
tmp = t_1
else if (b <= (-1.35d-183)) then
tmp = j * (k * (-27.0d0))
else if (b <= (-1.8d-275)) then
tmp = t * (a * (-4.0d0))
else if (b <= 6.2d-251) then
tmp = (-4.0d0) * (x * i)
else if (b <= 2.9d-220) then
tmp = t_1
else if (b <= 3.3d-130) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * ((x * z) * (y * t));
double tmp;
if (b <= -3.3e+128) {
tmp = b * c;
} else if (b <= -4.9e-67) {
tmp = t_1;
} else if (b <= -1.35e-183) {
tmp = j * (k * -27.0);
} else if (b <= -1.8e-275) {
tmp = t * (a * -4.0);
} else if (b <= 6.2e-251) {
tmp = -4.0 * (x * i);
} else if (b <= 2.9e-220) {
tmp = t_1;
} else if (b <= 3.3e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = 18.0 * ((x * z) * (y * t)) tmp = 0 if b <= -3.3e+128: tmp = b * c elif b <= -4.9e-67: tmp = t_1 elif b <= -1.35e-183: tmp = j * (k * -27.0) elif b <= -1.8e-275: tmp = t * (a * -4.0) elif b <= 6.2e-251: tmp = -4.0 * (x * i) elif b <= 2.9e-220: tmp = t_1 elif b <= 3.3e-130: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(Float64(x * z) * Float64(y * t))) tmp = 0.0 if (b <= -3.3e+128) tmp = Float64(b * c); elseif (b <= -4.9e-67) tmp = t_1; elseif (b <= -1.35e-183) tmp = Float64(j * Float64(k * -27.0)); elseif (b <= -1.8e-275) tmp = Float64(t * Float64(a * -4.0)); elseif (b <= 6.2e-251) tmp = Float64(-4.0 * Float64(x * i)); elseif (b <= 2.9e-220) tmp = t_1; elseif (b <= 3.3e-130) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = 18.0 * ((x * z) * (y * t));
tmp = 0.0;
if (b <= -3.3e+128)
tmp = b * c;
elseif (b <= -4.9e-67)
tmp = t_1;
elseif (b <= -1.35e-183)
tmp = j * (k * -27.0);
elseif (b <= -1.8e-275)
tmp = t * (a * -4.0);
elseif (b <= 6.2e-251)
tmp = -4.0 * (x * i);
elseif (b <= 2.9e-220)
tmp = t_1;
elseif (b <= 3.3e-130)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(N[(x * z), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.3e+128], N[(b * c), $MachinePrecision], If[LessEqual[b, -4.9e-67], t$95$1, If[LessEqual[b, -1.35e-183], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.8e-275], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.2e-251], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.9e-220], t$95$1, If[LessEqual[b, 3.3e-130], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(\left(x \cdot z\right) \cdot \left(y \cdot t\right)\right)\\
\mathbf{if}\;b \leq -3.3 \cdot 10^{+128}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -4.9 \cdot 10^{-67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -1.35 \cdot 10^{-183}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;b \leq -1.8 \cdot 10^{-275}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{-251}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{-220}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{-130}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -3.3000000000000001e128 or 3.2999999999999998e-130 < b Initial program 88.4%
sub-neg88.4%
associate-+l-88.4%
sub-neg88.4%
sub-neg88.4%
distribute-rgt-out--90.0%
associate-*l*88.5%
distribute-lft-neg-in88.5%
cancel-sign-sub88.5%
associate-*l*89.2%
associate-*l*89.2%
Simplified89.2%
fma-def90.0%
associate-*l*90.0%
Applied egg-rr90.0%
Taylor expanded in b around inf 30.9%
if -3.3000000000000001e128 < b < -4.89999999999999993e-67 or 6.20000000000000006e-251 < b < 2.8999999999999998e-220Initial program 93.8%
sub-neg93.8%
associate-+l-93.8%
sub-neg93.8%
sub-neg93.8%
distribute-rgt-out--93.8%
associate-*l*91.9%
distribute-lft-neg-in91.9%
cancel-sign-sub91.9%
associate-*l*91.9%
associate-*l*91.9%
Simplified91.9%
fma-def91.9%
associate-*l*91.9%
Applied egg-rr91.9%
Taylor expanded in y around inf 28.1%
associate-*r*26.3%
*-commutative26.3%
Simplified26.3%
if -4.89999999999999993e-67 < b < -1.35000000000000004e-183Initial program 95.0%
sub-neg95.0%
+-commutative95.0%
associate-*l*95.2%
distribute-rgt-neg-in95.2%
fma-def95.2%
*-commutative95.2%
distribute-rgt-neg-in95.2%
metadata-eval95.2%
sub-neg95.2%
+-commutative95.2%
associate-*l*95.2%
distribute-rgt-neg-in95.2%
Simplified90.7%
Taylor expanded in j around inf 37.9%
associate-*r*38.0%
*-commutative38.0%
*-commutative38.0%
*-commutative38.0%
Simplified38.0%
if -1.35000000000000004e-183 < b < -1.79999999999999985e-275Initial program 80.7%
sub-neg80.7%
associate-+l-80.7%
sub-neg80.7%
sub-neg80.7%
distribute-rgt-out--80.7%
associate-*l*80.7%
distribute-lft-neg-in80.7%
cancel-sign-sub80.7%
associate-*l*80.7%
associate-*l*80.7%
Simplified80.7%
fma-def80.7%
associate-*l*80.7%
Applied egg-rr80.7%
Taylor expanded in a around inf 51.1%
*-commutative51.1%
*-commutative51.1%
associate-*l*51.1%
Simplified51.1%
if -1.79999999999999985e-275 < b < 6.20000000000000006e-251Initial program 93.6%
sub-neg93.6%
+-commutative93.6%
associate-*l*87.7%
distribute-rgt-neg-in87.7%
fma-def87.7%
*-commutative87.7%
distribute-rgt-neg-in87.7%
metadata-eval87.7%
sub-neg87.7%
+-commutative87.7%
associate-*l*87.7%
distribute-rgt-neg-in87.7%
Simplified93.9%
Taylor expanded in i around inf 29.5%
*-commutative29.5%
Simplified29.5%
if 2.8999999999999998e-220 < b < 3.2999999999999998e-130Initial program 85.4%
sub-neg85.4%
+-commutative85.4%
associate-*l*85.5%
distribute-rgt-neg-in85.5%
fma-def85.5%
*-commutative85.5%
distribute-rgt-neg-in85.5%
metadata-eval85.5%
sub-neg85.5%
+-commutative85.5%
associate-*l*85.5%
distribute-rgt-neg-in85.5%
Simplified89.9%
Taylor expanded in j around inf 41.7%
Final simplification32.9%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= b -4.5e+129)
(* b c)
(if (<= b -1e-66)
(* 18.0 (* (* x z) (* y t)))
(if (<= b -1.3e-183)
(* j (* k -27.0))
(if (<= b -1.65e-283)
(* t (* a -4.0))
(if (<= b 6.5e-251)
(* -4.0 (* x i))
(if (<= b 6.9e-221)
(* (* 18.0 y) (* x (* z t)))
(if (<= b 3.3e-130) (* -27.0 (* j k)) (* b c)))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -4.5e+129) {
tmp = b * c;
} else if (b <= -1e-66) {
tmp = 18.0 * ((x * z) * (y * t));
} else if (b <= -1.3e-183) {
tmp = j * (k * -27.0);
} else if (b <= -1.65e-283) {
tmp = t * (a * -4.0);
} else if (b <= 6.5e-251) {
tmp = -4.0 * (x * i);
} else if (b <= 6.9e-221) {
tmp = (18.0 * y) * (x * (z * t));
} else if (b <= 3.3e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (b <= (-4.5d+129)) then
tmp = b * c
else if (b <= (-1d-66)) then
tmp = 18.0d0 * ((x * z) * (y * t))
else if (b <= (-1.3d-183)) then
tmp = j * (k * (-27.0d0))
else if (b <= (-1.65d-283)) then
tmp = t * (a * (-4.0d0))
else if (b <= 6.5d-251) then
tmp = (-4.0d0) * (x * i)
else if (b <= 6.9d-221) then
tmp = (18.0d0 * y) * (x * (z * t))
else if (b <= 3.3d-130) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -4.5e+129) {
tmp = b * c;
} else if (b <= -1e-66) {
tmp = 18.0 * ((x * z) * (y * t));
} else if (b <= -1.3e-183) {
tmp = j * (k * -27.0);
} else if (b <= -1.65e-283) {
tmp = t * (a * -4.0);
} else if (b <= 6.5e-251) {
tmp = -4.0 * (x * i);
} else if (b <= 6.9e-221) {
tmp = (18.0 * y) * (x * (z * t));
} else if (b <= 3.3e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -4.5e+129: tmp = b * c elif b <= -1e-66: tmp = 18.0 * ((x * z) * (y * t)) elif b <= -1.3e-183: tmp = j * (k * -27.0) elif b <= -1.65e-283: tmp = t * (a * -4.0) elif b <= 6.5e-251: tmp = -4.0 * (x * i) elif b <= 6.9e-221: tmp = (18.0 * y) * (x * (z * t)) elif b <= 3.3e-130: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -4.5e+129) tmp = Float64(b * c); elseif (b <= -1e-66) tmp = Float64(18.0 * Float64(Float64(x * z) * Float64(y * t))); elseif (b <= -1.3e-183) tmp = Float64(j * Float64(k * -27.0)); elseif (b <= -1.65e-283) tmp = Float64(t * Float64(a * -4.0)); elseif (b <= 6.5e-251) tmp = Float64(-4.0 * Float64(x * i)); elseif (b <= 6.9e-221) tmp = Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))); elseif (b <= 3.3e-130) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (b <= -4.5e+129)
tmp = b * c;
elseif (b <= -1e-66)
tmp = 18.0 * ((x * z) * (y * t));
elseif (b <= -1.3e-183)
tmp = j * (k * -27.0);
elseif (b <= -1.65e-283)
tmp = t * (a * -4.0);
elseif (b <= 6.5e-251)
tmp = -4.0 * (x * i);
elseif (b <= 6.9e-221)
tmp = (18.0 * y) * (x * (z * t));
elseif (b <= 3.3e-130)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[b, -4.5e+129], N[(b * c), $MachinePrecision], If[LessEqual[b, -1e-66], N[(18.0 * N[(N[(x * z), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.3e-183], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.65e-283], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.5e-251], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.9e-221], N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.3e-130], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.5 \cdot 10^{+129}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -1 \cdot 10^{-66}:\\
\;\;\;\;18 \cdot \left(\left(x \cdot z\right) \cdot \left(y \cdot t\right)\right)\\
\mathbf{elif}\;b \leq -1.3 \cdot 10^{-183}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;b \leq -1.65 \cdot 10^{-283}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{-251}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \leq 6.9 \cdot 10^{-221}:\\
\;\;\;\;\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{-130}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -4.5000000000000001e129 or 3.2999999999999998e-130 < b Initial program 88.4%
sub-neg88.4%
associate-+l-88.4%
sub-neg88.4%
sub-neg88.4%
distribute-rgt-out--90.0%
associate-*l*88.5%
distribute-lft-neg-in88.5%
cancel-sign-sub88.5%
associate-*l*89.2%
associate-*l*89.2%
Simplified89.2%
fma-def90.0%
associate-*l*90.0%
Applied egg-rr90.0%
Taylor expanded in b around inf 30.9%
if -4.5000000000000001e129 < b < -9.9999999999999998e-67Initial program 93.1%
sub-neg93.1%
associate-+l-93.1%
sub-neg93.1%
sub-neg93.1%
distribute-rgt-out--93.1%
associate-*l*91.0%
distribute-lft-neg-in91.0%
cancel-sign-sub91.0%
associate-*l*91.0%
associate-*l*91.0%
Simplified91.0%
fma-def91.0%
associate-*l*91.0%
Applied egg-rr91.0%
Taylor expanded in y around inf 28.9%
associate-*r*26.8%
*-commutative26.8%
Simplified26.8%
if -9.9999999999999998e-67 < b < -1.2999999999999999e-183Initial program 95.0%
sub-neg95.0%
+-commutative95.0%
associate-*l*95.2%
distribute-rgt-neg-in95.2%
fma-def95.2%
*-commutative95.2%
distribute-rgt-neg-in95.2%
metadata-eval95.2%
sub-neg95.2%
+-commutative95.2%
associate-*l*95.2%
distribute-rgt-neg-in95.2%
Simplified90.7%
Taylor expanded in j around inf 37.9%
associate-*r*38.0%
*-commutative38.0%
*-commutative38.0%
*-commutative38.0%
Simplified38.0%
if -1.2999999999999999e-183 < b < -1.6500000000000001e-283Initial program 77.9%
sub-neg77.9%
associate-+l-77.9%
sub-neg77.9%
sub-neg77.9%
distribute-rgt-out--77.9%
associate-*l*77.9%
distribute-lft-neg-in77.9%
cancel-sign-sub77.9%
associate-*l*77.9%
associate-*l*77.9%
Simplified77.9%
fma-def77.9%
associate-*l*77.9%
Applied egg-rr77.9%
Taylor expanded in a around inf 46.5%
*-commutative46.5%
*-commutative46.5%
associate-*l*46.5%
Simplified46.5%
if -1.6500000000000001e-283 < b < 6.5000000000000002e-251Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*93.0%
distribute-rgt-neg-in93.0%
fma-def93.0%
*-commutative93.0%
distribute-rgt-neg-in93.0%
metadata-eval93.0%
sub-neg93.0%
+-commutative93.0%
associate-*l*93.0%
distribute-rgt-neg-in93.0%
Simplified93.0%
Taylor expanded in i around inf 33.7%
*-commutative33.7%
Simplified33.7%
if 6.5000000000000002e-251 < b < 6.90000000000000001e-221Initial program 100.0%
sub-neg100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
distribute-rgt-out--100.0%
associate-*l*100.0%
distribute-lft-neg-in100.0%
cancel-sign-sub100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
fma-def100.0%
associate-*l*100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 21.7%
associate-*l*21.7%
*-commutative21.7%
Simplified21.7%
Taylor expanded in y around 0 21.7%
associate-*r*21.7%
associate-*r*21.5%
Simplified21.5%
if 6.90000000000000001e-221 < b < 3.2999999999999998e-130Initial program 85.4%
sub-neg85.4%
+-commutative85.4%
associate-*l*85.5%
distribute-rgt-neg-in85.5%
fma-def85.5%
*-commutative85.5%
distribute-rgt-neg-in85.5%
metadata-eval85.5%
sub-neg85.5%
+-commutative85.5%
associate-*l*85.5%
distribute-rgt-neg-in85.5%
Simplified89.9%
Taylor expanded in j around inf 41.7%
Final simplification32.9%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= b -4e+99)
(* b c)
(if (<= b -2.9e-32)
(* x (* 18.0 (* y (* z t))))
(if (<= b -1.3e-183)
(* j (* k -27.0))
(if (<= b -1.16e-279)
(* t (* a -4.0))
(if (<= b 1.12e-250)
(* -4.0 (* x i))
(if (<= b 2.1e-224)
(* (* 18.0 y) (* x (* z t)))
(if (<= b 8.5e-132) (* -27.0 (* j k)) (* b c)))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -4e+99) {
tmp = b * c;
} else if (b <= -2.9e-32) {
tmp = x * (18.0 * (y * (z * t)));
} else if (b <= -1.3e-183) {
tmp = j * (k * -27.0);
} else if (b <= -1.16e-279) {
tmp = t * (a * -4.0);
} else if (b <= 1.12e-250) {
tmp = -4.0 * (x * i);
} else if (b <= 2.1e-224) {
tmp = (18.0 * y) * (x * (z * t));
} else if (b <= 8.5e-132) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (b <= (-4d+99)) then
tmp = b * c
else if (b <= (-2.9d-32)) then
tmp = x * (18.0d0 * (y * (z * t)))
else if (b <= (-1.3d-183)) then
tmp = j * (k * (-27.0d0))
else if (b <= (-1.16d-279)) then
tmp = t * (a * (-4.0d0))
else if (b <= 1.12d-250) then
tmp = (-4.0d0) * (x * i)
else if (b <= 2.1d-224) then
tmp = (18.0d0 * y) * (x * (z * t))
else if (b <= 8.5d-132) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -4e+99) {
tmp = b * c;
} else if (b <= -2.9e-32) {
tmp = x * (18.0 * (y * (z * t)));
} else if (b <= -1.3e-183) {
tmp = j * (k * -27.0);
} else if (b <= -1.16e-279) {
tmp = t * (a * -4.0);
} else if (b <= 1.12e-250) {
tmp = -4.0 * (x * i);
} else if (b <= 2.1e-224) {
tmp = (18.0 * y) * (x * (z * t));
} else if (b <= 8.5e-132) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -4e+99: tmp = b * c elif b <= -2.9e-32: tmp = x * (18.0 * (y * (z * t))) elif b <= -1.3e-183: tmp = j * (k * -27.0) elif b <= -1.16e-279: tmp = t * (a * -4.0) elif b <= 1.12e-250: tmp = -4.0 * (x * i) elif b <= 2.1e-224: tmp = (18.0 * y) * (x * (z * t)) elif b <= 8.5e-132: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -4e+99) tmp = Float64(b * c); elseif (b <= -2.9e-32) tmp = Float64(x * Float64(18.0 * Float64(y * Float64(z * t)))); elseif (b <= -1.3e-183) tmp = Float64(j * Float64(k * -27.0)); elseif (b <= -1.16e-279) tmp = Float64(t * Float64(a * -4.0)); elseif (b <= 1.12e-250) tmp = Float64(-4.0 * Float64(x * i)); elseif (b <= 2.1e-224) tmp = Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))); elseif (b <= 8.5e-132) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (b <= -4e+99)
tmp = b * c;
elseif (b <= -2.9e-32)
tmp = x * (18.0 * (y * (z * t)));
elseif (b <= -1.3e-183)
tmp = j * (k * -27.0);
elseif (b <= -1.16e-279)
tmp = t * (a * -4.0);
elseif (b <= 1.12e-250)
tmp = -4.0 * (x * i);
elseif (b <= 2.1e-224)
tmp = (18.0 * y) * (x * (z * t));
elseif (b <= 8.5e-132)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[b, -4e+99], N[(b * c), $MachinePrecision], If[LessEqual[b, -2.9e-32], N[(x * N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.3e-183], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.16e-279], N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.12e-250], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e-224], N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 8.5e-132], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+99}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-32}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{elif}\;b \leq -1.3 \cdot 10^{-183}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;b \leq -1.16 \cdot 10^{-279}:\\
\;\;\;\;t \cdot \left(a \cdot -4\right)\\
\mathbf{elif}\;b \leq 1.12 \cdot 10^{-250}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{-224}:\\
\;\;\;\;\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{-132}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -3.9999999999999999e99 or 8.49999999999999988e-132 < b Initial program 87.5%
sub-neg87.5%
associate-+l-87.5%
sub-neg87.5%
sub-neg87.5%
distribute-rgt-out--88.9%
associate-*l*87.5%
distribute-lft-neg-in87.5%
cancel-sign-sub87.5%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
fma-def88.9%
associate-*l*89.0%
Applied egg-rr89.0%
Taylor expanded in b around inf 31.1%
if -3.9999999999999999e99 < b < -2.89999999999999996e-32Initial program 96.2%
sub-neg96.2%
associate-+l-96.2%
sub-neg96.2%
sub-neg96.2%
distribute-rgt-out--96.2%
associate-*l*96.3%
distribute-lft-neg-in96.3%
cancel-sign-sub96.3%
associate-*l*96.3%
associate-*l*96.3%
Simplified96.3%
Taylor expanded in x around inf 52.4%
Taylor expanded in y around inf 34.3%
*-commutative34.3%
Simplified34.3%
if -2.89999999999999996e-32 < b < -1.2999999999999999e-183Initial program 96.7%
sub-neg96.7%
+-commutative96.7%
associate-*l*96.8%
distribute-rgt-neg-in96.8%
fma-def96.8%
*-commutative96.8%
distribute-rgt-neg-in96.8%
metadata-eval96.8%
sub-neg96.8%
+-commutative96.8%
associate-*l*96.8%
distribute-rgt-neg-in96.8%
Simplified90.9%
Taylor expanded in j around inf 31.9%
associate-*r*32.0%
*-commutative32.0%
*-commutative32.0%
*-commutative32.0%
Simplified32.0%
if -1.2999999999999999e-183 < b < -1.16e-279Initial program 76.9%
sub-neg76.9%
associate-+l-76.9%
sub-neg76.9%
sub-neg76.9%
distribute-rgt-out--76.9%
associate-*l*76.9%
distribute-lft-neg-in76.9%
cancel-sign-sub76.9%
associate-*l*76.9%
associate-*l*76.9%
Simplified76.9%
fma-def76.9%
associate-*l*76.9%
Applied egg-rr76.9%
Taylor expanded in a around inf 48.7%
*-commutative48.7%
*-commutative48.7%
associate-*l*48.7%
Simplified48.7%
if -1.16e-279 < b < 1.11999999999999996e-250Initial program 99.8%
sub-neg99.8%
+-commutative99.8%
associate-*l*93.5%
distribute-rgt-neg-in93.5%
fma-def93.5%
*-commutative93.5%
distribute-rgt-neg-in93.5%
metadata-eval93.5%
sub-neg93.5%
+-commutative93.5%
associate-*l*93.5%
distribute-rgt-neg-in93.5%
Simplified93.5%
Taylor expanded in i around inf 31.5%
*-commutative31.5%
Simplified31.5%
if 1.11999999999999996e-250 < b < 2.10000000000000006e-224Initial program 100.0%
sub-neg100.0%
associate-+l-100.0%
sub-neg100.0%
sub-neg100.0%
distribute-rgt-out--100.0%
associate-*l*100.0%
distribute-lft-neg-in100.0%
cancel-sign-sub100.0%
associate-*l*100.0%
associate-*l*100.0%
Simplified100.0%
fma-def100.0%
associate-*l*100.0%
Applied egg-rr100.0%
Taylor expanded in y around inf 21.7%
associate-*l*21.7%
*-commutative21.7%
Simplified21.7%
Taylor expanded in y around 0 21.7%
associate-*r*21.7%
associate-*r*21.5%
Simplified21.5%
if 2.10000000000000006e-224 < b < 8.49999999999999988e-132Initial program 85.4%
sub-neg85.4%
+-commutative85.4%
associate-*l*85.5%
distribute-rgt-neg-in85.5%
fma-def85.5%
*-commutative85.5%
distribute-rgt-neg-in85.5%
metadata-eval85.5%
sub-neg85.5%
+-commutative85.5%
associate-*l*85.5%
distribute-rgt-neg-in85.5%
Simplified89.9%
Taylor expanded in j around inf 41.7%
Final simplification33.6%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)) (t_2 (* 4.0 (* x i))))
(if (<= i -6.5e+22)
(- (+ (* b c) (* -4.0 (* t a))) t_2)
(if (<= i 6.2e-122)
(- (- (* b c) (* 4.0 (* t a))) t_1)
(if (<= i 2.6e-11)
(* x (- (* 18.0 (* y (* z t))) (* 4.0 i)))
(- (- (* b c) t_2) t_1))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = 4.0 * (x * i);
double tmp;
if (i <= -6.5e+22) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_2;
} else if (i <= 6.2e-122) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (i <= 2.6e-11) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else {
tmp = ((b * c) - t_2) - t_1;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (j * 27.0d0) * k
t_2 = 4.0d0 * (x * i)
if (i <= (-6.5d+22)) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - t_2
else if (i <= 6.2d-122) then
tmp = ((b * c) - (4.0d0 * (t * a))) - t_1
else if (i <= 2.6d-11) then
tmp = x * ((18.0d0 * (y * (z * t))) - (4.0d0 * i))
else
tmp = ((b * c) - t_2) - t_1
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double t_2 = 4.0 * (x * i);
double tmp;
if (i <= -6.5e+22) {
tmp = ((b * c) + (-4.0 * (t * a))) - t_2;
} else if (i <= 6.2e-122) {
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
} else if (i <= 2.6e-11) {
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
} else {
tmp = ((b * c) - t_2) - t_1;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (j * 27.0) * k t_2 = 4.0 * (x * i) tmp = 0 if i <= -6.5e+22: tmp = ((b * c) + (-4.0 * (t * a))) - t_2 elif i <= 6.2e-122: tmp = ((b * c) - (4.0 * (t * a))) - t_1 elif i <= 2.6e-11: tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i)) else: tmp = ((b * c) - t_2) - t_1 return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) t_2 = Float64(4.0 * Float64(x * i)) tmp = 0.0 if (i <= -6.5e+22) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - t_2); elseif (i <= 6.2e-122) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - t_1); elseif (i <= 2.6e-11) tmp = Float64(x * Float64(Float64(18.0 * Float64(y * Float64(z * t))) - Float64(4.0 * i))); else tmp = Float64(Float64(Float64(b * c) - t_2) - t_1); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (j * 27.0) * k;
t_2 = 4.0 * (x * i);
tmp = 0.0;
if (i <= -6.5e+22)
tmp = ((b * c) + (-4.0 * (t * a))) - t_2;
elseif (i <= 6.2e-122)
tmp = ((b * c) - (4.0 * (t * a))) - t_1;
elseif (i <= 2.6e-11)
tmp = x * ((18.0 * (y * (z * t))) - (4.0 * i));
else
tmp = ((b * c) - t_2) - t_1;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, Block[{t$95$2 = N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -6.5e+22], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[i, 6.2e-122], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[i, 2.6e-11], N[(x * N[(N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
t_2 := 4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;i \leq -6.5 \cdot 10^{+22}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - t_2\\
\mathbf{elif}\;i \leq 6.2 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - t_1\\
\mathbf{elif}\;i \leq 2.6 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(y \cdot \left(z \cdot t\right)\right) - 4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - t_2\right) - t_1\\
\end{array}
\end{array}
if i < -6.49999999999999979e22Initial program 88.6%
associate--l+88.6%
distribute-rgt-out--90.5%
associate-*r*85.0%
associate-*l*85.0%
*-commutative85.0%
Applied egg-rr85.0%
Taylor expanded in y around 0 79.9%
Taylor expanded in j around 0 72.8%
if -6.49999999999999979e22 < i < 6.1999999999999997e-122Initial program 94.3%
Taylor expanded in x around 0 79.5%
if 6.1999999999999997e-122 < i < 2.6000000000000001e-11Initial program 81.7%
sub-neg81.7%
associate-+l-81.7%
sub-neg81.7%
sub-neg81.7%
distribute-rgt-out--81.7%
associate-*l*88.7%
distribute-lft-neg-in88.7%
cancel-sign-sub88.7%
associate-*l*92.4%
associate-*l*92.5%
Simplified92.5%
Taylor expanded in x around inf 68.3%
if 2.6000000000000001e-11 < i Initial program 85.8%
Taylor expanded in t around 0 76.1%
Final simplification76.0%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -4e+26) (not (<= x 1e+20))) (+ (* b c) (* x (+ (* i -4.0) (* 18.0 (* y (* z t)))))) (- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -4e+26) || !(x <= 1e+20)) {
tmp = (b * c) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-4d+26)) .or. (.not. (x <= 1d+20))) then
tmp = (b * c) + (x * ((i * (-4.0d0)) + (18.0d0 * (y * (z * t)))))
else
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -4e+26) || !(x <= 1e+20)) {
tmp = (b * c) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -4e+26) or not (x <= 1e+20): tmp = (b * c) + (x * ((i * -4.0) + (18.0 * (y * (z * t))))) else: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -4e+26) || !(x <= 1e+20)) tmp = Float64(Float64(b * c) + Float64(x * Float64(Float64(i * -4.0) + Float64(18.0 * Float64(y * Float64(z * t)))))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -4e+26) || ~((x <= 1e+20)))
tmp = (b * c) + (x * ((i * -4.0) + (18.0 * (y * (z * t)))));
else
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -4e+26], N[Not[LessEqual[x, 1e+20]], $MachinePrecision]], N[(N[(b * c), $MachinePrecision] + N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(18.0 * N[(y * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+26} \lor \neg \left(x \leq 10^{+20}\right):\\
\;\;\;\;b \cdot c + x \cdot \left(i \cdot -4 + 18 \cdot \left(y \cdot \left(z \cdot t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -4.00000000000000019e26 or 1e20 < x Initial program 82.0%
Simplified91.8%
Taylor expanded in a around 0 85.4%
Taylor expanded in k around 0 77.4%
if -4.00000000000000019e26 < x < 1e20Initial program 96.2%
Taylor expanded in x around 0 80.7%
Final simplification79.1%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= x -1.25e+30) (not (<= x 5.2e+45))) (* x (+ (* i -4.0) (* (* z t) (* 18.0 y)))) (- (- (* b c) (* 4.0 (* t a))) (* (* j 27.0) k))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -1.25e+30) || !(x <= 5.2e+45)) {
tmp = x * ((i * -4.0) + ((z * t) * (18.0 * y)));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((x <= (-1.25d+30)) .or. (.not. (x <= 5.2d+45))) then
tmp = x * ((i * (-4.0d0)) + ((z * t) * (18.0d0 * y)))
else
tmp = ((b * c) - (4.0d0 * (t * a))) - ((j * 27.0d0) * k)
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((x <= -1.25e+30) || !(x <= 5.2e+45)) {
tmp = x * ((i * -4.0) + ((z * t) * (18.0 * y)));
} else {
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (x <= -1.25e+30) or not (x <= 5.2e+45): tmp = x * ((i * -4.0) + ((z * t) * (18.0 * y))) else: tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((x <= -1.25e+30) || !(x <= 5.2e+45)) tmp = Float64(x * Float64(Float64(i * -4.0) + Float64(Float64(z * t) * Float64(18.0 * y)))); else tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(Float64(j * 27.0) * k)); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((x <= -1.25e+30) || ~((x <= 5.2e+45)))
tmp = x * ((i * -4.0) + ((z * t) * (18.0 * y)));
else
tmp = ((b * c) - (4.0 * (t * a))) - ((j * 27.0) * k);
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[x, -1.25e+30], N[Not[LessEqual[x, 5.2e+45]], $MachinePrecision]], N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+30} \lor \neg \left(x \leq 5.2 \cdot 10^{+45}\right):\\
\;\;\;\;x \cdot \left(i \cdot -4 + \left(z \cdot t\right) \cdot \left(18 \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -1.25e30 or 5.20000000000000014e45 < x Initial program 80.3%
associate--l+80.3%
distribute-rgt-out--81.2%
associate-*r*84.6%
associate-*l*84.6%
*-commutative84.6%
Applied egg-rr84.6%
Taylor expanded in x around inf 69.3%
*-commutative69.3%
cancel-sign-sub-inv69.3%
associate-*r*69.3%
metadata-eval69.3%
*-commutative69.3%
Simplified69.3%
if -1.25e30 < x < 5.20000000000000014e45Initial program 96.4%
Taylor expanded in x around 0 78.8%
Final simplification74.7%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= y -6.2e+172)
(* t (+ (* (* x z) (* 18.0 y)) (* a -4.0)))
(if (<= y 1.05e+66)
(- (+ (* b c) (* -4.0 (* t a))) (* 4.0 (* x i)))
(* x (+ (* i -4.0) (* (* z t) (* 18.0 y)))))))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 (y <= -6.2e+172) {
tmp = t * (((x * z) * (18.0 * y)) + (a * -4.0));
} else if (y <= 1.05e+66) {
tmp = ((b * c) + (-4.0 * (t * a))) - (4.0 * (x * i));
} else {
tmp = x * ((i * -4.0) + ((z * t) * (18.0 * y)));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (y <= (-6.2d+172)) then
tmp = t * (((x * z) * (18.0d0 * y)) + (a * (-4.0d0)))
else if (y <= 1.05d+66) then
tmp = ((b * c) + ((-4.0d0) * (t * a))) - (4.0d0 * (x * i))
else
tmp = x * ((i * (-4.0d0)) + ((z * t) * (18.0d0 * y)))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (y <= -6.2e+172) {
tmp = t * (((x * z) * (18.0 * y)) + (a * -4.0));
} else if (y <= 1.05e+66) {
tmp = ((b * c) + (-4.0 * (t * a))) - (4.0 * (x * i));
} else {
tmp = x * ((i * -4.0) + ((z * t) * (18.0 * y)));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if y <= -6.2e+172: tmp = t * (((x * z) * (18.0 * y)) + (a * -4.0)) elif y <= 1.05e+66: tmp = ((b * c) + (-4.0 * (t * a))) - (4.0 * (x * i)) else: tmp = x * ((i * -4.0) + ((z * t) * (18.0 * y))) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (y <= -6.2e+172) tmp = Float64(t * Float64(Float64(Float64(x * z) * Float64(18.0 * y)) + Float64(a * -4.0))); elseif (y <= 1.05e+66) tmp = Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(4.0 * Float64(x * i))); else tmp = Float64(x * Float64(Float64(i * -4.0) + Float64(Float64(z * t) * Float64(18.0 * y)))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (y <= -6.2e+172)
tmp = t * (((x * z) * (18.0 * y)) + (a * -4.0));
elseif (y <= 1.05e+66)
tmp = ((b * c) + (-4.0 * (t * a))) - (4.0 * (x * i));
else
tmp = x * ((i * -4.0) + ((z * t) * (18.0 * y)));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -6.2e+172], N[(t * N[(N[(N[(x * z), $MachinePrecision] * N[(18.0 * y), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+66], N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(i * -4.0), $MachinePrecision] + N[(N[(z * t), $MachinePrecision] * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+172}:\\
\;\;\;\;t \cdot \left(\left(x \cdot z\right) \cdot \left(18 \cdot y\right) + a \cdot -4\right)\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+66}:\\
\;\;\;\;\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(i \cdot -4 + \left(z \cdot t\right) \cdot \left(18 \cdot y\right)\right)\\
\end{array}
\end{array}
if y < -6.19999999999999976e172Initial program 73.2%
associate--l+73.2%
distribute-rgt-out--76.3%
associate-*r*67.2%
associate-*l*67.2%
*-commutative67.2%
Applied egg-rr67.2%
Taylor expanded in t around inf 68.2%
cancel-sign-sub-inv68.2%
distribute-rgt-in65.2%
associate-*r*58.5%
associate-*r*58.6%
*-commutative58.6%
distribute-rgt-in61.6%
*-commutative61.6%
associate-*r*61.6%
associate-*r*68.2%
*-commutative68.2%
metadata-eval68.2%
Simplified68.2%
if -6.19999999999999976e172 < y < 1.05000000000000003e66Initial program 93.8%
associate--l+93.8%
distribute-rgt-out--94.4%
associate-*r*94.4%
associate-*l*94.4%
*-commutative94.4%
Applied egg-rr94.4%
Taylor expanded in y around 0 85.4%
Taylor expanded in j around 0 65.3%
if 1.05000000000000003e66 < y Initial program 83.2%
associate--l+83.2%
distribute-rgt-out--83.2%
associate-*r*83.1%
associate-*l*83.2%
*-commutative83.2%
Applied egg-rr83.2%
Taylor expanded in x around inf 45.3%
*-commutative45.3%
cancel-sign-sub-inv45.3%
associate-*r*45.3%
metadata-eval45.3%
*-commutative45.3%
Simplified45.3%
Final simplification62.5%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -2.05e+188)
(* (* 18.0 y) (* x (* z t)))
(if (or (<= x -1.12e+30) (not (<= x 1.05e-40)))
(+ (* k (* j -27.0)) (* -4.0 (* x i)))
(+ (* b c) (* -27.0 (* j k))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2.05e+188) {
tmp = (18.0 * y) * (x * (z * t));
} else if ((x <= -1.12e+30) || !(x <= 1.05e-40)) {
tmp = (k * (j * -27.0)) + (-4.0 * (x * i));
} else {
tmp = (b * c) + (-27.0 * (j * k));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (x <= (-2.05d+188)) then
tmp = (18.0d0 * y) * (x * (z * t))
else if ((x <= (-1.12d+30)) .or. (.not. (x <= 1.05d-40))) then
tmp = (k * (j * (-27.0d0))) + ((-4.0d0) * (x * i))
else
tmp = (b * c) + ((-27.0d0) * (j * k))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2.05e+188) {
tmp = (18.0 * y) * (x * (z * t));
} else if ((x <= -1.12e+30) || !(x <= 1.05e-40)) {
tmp = (k * (j * -27.0)) + (-4.0 * (x * i));
} else {
tmp = (b * c) + (-27.0 * (j * k));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if x <= -2.05e+188: tmp = (18.0 * y) * (x * (z * t)) elif (x <= -1.12e+30) or not (x <= 1.05e-40): tmp = (k * (j * -27.0)) + (-4.0 * (x * i)) else: tmp = (b * c) + (-27.0 * (j * k)) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -2.05e+188) tmp = Float64(Float64(18.0 * y) * Float64(x * Float64(z * t))); elseif ((x <= -1.12e+30) || !(x <= 1.05e-40)) tmp = Float64(Float64(k * Float64(j * -27.0)) + Float64(-4.0 * Float64(x * i))); else tmp = Float64(Float64(b * c) + Float64(-27.0 * Float64(j * k))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (x <= -2.05e+188)
tmp = (18.0 * y) * (x * (z * t));
elseif ((x <= -1.12e+30) || ~((x <= 1.05e-40)))
tmp = (k * (j * -27.0)) + (-4.0 * (x * i));
else
tmp = (b * c) + (-27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -2.05e+188], N[(N[(18.0 * y), $MachinePrecision] * N[(x * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[x, -1.12e+30], N[Not[LessEqual[x, 1.05e-40]], $MachinePrecision]], N[(N[(k * N[(j * -27.0), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.05 \cdot 10^{+188}:\\
\;\;\;\;\left(18 \cdot y\right) \cdot \left(x \cdot \left(z \cdot t\right)\right)\\
\mathbf{elif}\;x \leq -1.12 \cdot 10^{+30} \lor \neg \left(x \leq 1.05 \cdot 10^{-40}\right):\\
\;\;\;\;k \cdot \left(j \cdot -27\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + -27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if x < -2.05e188Initial program 76.9%
sub-neg76.9%
associate-+l-76.9%
sub-neg76.9%
sub-neg76.9%
distribute-rgt-out--76.9%
associate-*l*76.9%
distribute-lft-neg-in76.9%
cancel-sign-sub76.9%
associate-*l*80.8%
associate-*l*80.8%
Simplified80.8%
fma-def80.8%
associate-*l*80.8%
Applied egg-rr80.8%
Taylor expanded in y around inf 59.4%
associate-*l*59.4%
*-commutative59.4%
Simplified59.4%
Taylor expanded in y around 0 59.4%
associate-*r*59.4%
associate-*r*59.4%
Simplified59.4%
if -2.05e188 < x < -1.12e30 or 1.05000000000000009e-40 < x Initial program 84.9%
Taylor expanded in t around 0 62.3%
Taylor expanded in c around 0 51.6%
mul-1-neg51.6%
fma-def51.6%
*-commutative51.6%
associate-*r*51.6%
*-commutative51.6%
fma-def51.6%
distribute-neg-in51.6%
sub-neg51.6%
associate-*r*51.6%
cancel-sign-sub-inv51.6%
distribute-lft-neg-in51.6%
metadata-eval51.6%
*-commutative51.6%
*-commutative51.6%
distribute-rgt-neg-in51.6%
metadata-eval51.6%
Simplified51.6%
if -1.12e30 < x < 1.05000000000000009e-40Initial program 96.5%
Simplified86.9%
Taylor expanded in a around 0 68.9%
Taylor expanded in x around 0 57.4%
Final simplification55.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (* a -4.0))))
(if (<= b -5.5e+131)
(* b c)
(if (<= b -5.2e-92)
t_1
(if (<= b -8.8e-184)
(* j (* k -27.0))
(if (<= b -1.75e-274)
t_1
(if (<= b 3.2e-130) (* -27.0 (* j k)) (* b c))))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double tmp;
if (b <= -5.5e+131) {
tmp = b * c;
} else if (b <= -5.2e-92) {
tmp = t_1;
} else if (b <= -8.8e-184) {
tmp = j * (k * -27.0);
} else if (b <= -1.75e-274) {
tmp = t_1;
} else if (b <= 3.2e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = t * (a * (-4.0d0))
if (b <= (-5.5d+131)) then
tmp = b * c
else if (b <= (-5.2d-92)) then
tmp = t_1
else if (b <= (-8.8d-184)) then
tmp = j * (k * (-27.0d0))
else if (b <= (-1.75d-274)) then
tmp = t_1
else if (b <= 3.2d-130) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * (a * -4.0);
double tmp;
if (b <= -5.5e+131) {
tmp = b * c;
} else if (b <= -5.2e-92) {
tmp = t_1;
} else if (b <= -8.8e-184) {
tmp = j * (k * -27.0);
} else if (b <= -1.75e-274) {
tmp = t_1;
} else if (b <= 3.2e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * (a * -4.0) tmp = 0 if b <= -5.5e+131: tmp = b * c elif b <= -5.2e-92: tmp = t_1 elif b <= -8.8e-184: tmp = j * (k * -27.0) elif b <= -1.75e-274: tmp = t_1 elif b <= 3.2e-130: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(a * -4.0)) tmp = 0.0 if (b <= -5.5e+131) tmp = Float64(b * c); elseif (b <= -5.2e-92) tmp = t_1; elseif (b <= -8.8e-184) tmp = Float64(j * Float64(k * -27.0)); elseif (b <= -1.75e-274) tmp = t_1; elseif (b <= 3.2e-130) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * (a * -4.0);
tmp = 0.0;
if (b <= -5.5e+131)
tmp = b * c;
elseif (b <= -5.2e-92)
tmp = t_1;
elseif (b <= -8.8e-184)
tmp = j * (k * -27.0);
elseif (b <= -1.75e-274)
tmp = t_1;
elseif (b <= 3.2e-130)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(a * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.5e+131], N[(b * c), $MachinePrecision], If[LessEqual[b, -5.2e-92], t$95$1, If[LessEqual[b, -8.8e-184], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.75e-274], t$95$1, If[LessEqual[b, 3.2e-130], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(a \cdot -4\right)\\
\mathbf{if}\;b \leq -5.5 \cdot 10^{+131}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -5.2 \cdot 10^{-92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq -8.8 \cdot 10^{-184}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;b \leq -1.75 \cdot 10^{-274}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 3.2 \cdot 10^{-130}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -5.49999999999999971e131 or 3.2e-130 < b Initial program 88.4%
sub-neg88.4%
associate-+l-88.4%
sub-neg88.4%
sub-neg88.4%
distribute-rgt-out--90.0%
associate-*l*88.5%
distribute-lft-neg-in88.5%
cancel-sign-sub88.5%
associate-*l*89.2%
associate-*l*89.2%
Simplified89.2%
fma-def90.0%
associate-*l*90.0%
Applied egg-rr90.0%
Taylor expanded in b around inf 30.9%
if -5.49999999999999971e131 < b < -5.2e-92 or -8.79999999999999967e-184 < b < -1.74999999999999991e-274Initial program 89.7%
sub-neg89.7%
associate-+l-89.7%
sub-neg89.7%
sub-neg89.7%
distribute-rgt-out--89.7%
associate-*l*88.3%
distribute-lft-neg-in88.3%
cancel-sign-sub88.3%
associate-*l*88.3%
associate-*l*88.3%
Simplified88.3%
fma-def88.3%
associate-*l*88.3%
Applied egg-rr88.3%
Taylor expanded in a around inf 36.7%
*-commutative36.7%
*-commutative36.7%
associate-*l*36.7%
Simplified36.7%
if -5.2e-92 < b < -8.79999999999999967e-184Initial program 94.3%
sub-neg94.3%
+-commutative94.3%
associate-*l*94.4%
distribute-rgt-neg-in94.4%
fma-def94.4%
*-commutative94.4%
distribute-rgt-neg-in94.4%
metadata-eval94.4%
sub-neg94.4%
+-commutative94.4%
associate-*l*94.4%
distribute-rgt-neg-in94.4%
Simplified89.1%
Taylor expanded in j around inf 43.7%
associate-*r*43.8%
*-commutative43.8%
*-commutative43.8%
*-commutative43.8%
Simplified43.8%
if -1.74999999999999991e-274 < b < 3.2e-130Initial program 90.4%
sub-neg90.4%
+-commutative90.4%
associate-*l*88.1%
distribute-rgt-neg-in88.1%
fma-def88.1%
*-commutative88.1%
distribute-rgt-neg-in88.1%
metadata-eval88.1%
sub-neg88.1%
+-commutative88.1%
associate-*l*88.1%
distribute-rgt-neg-in88.1%
Simplified92.7%
Taylor expanded in j around inf 35.6%
Final simplification34.1%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k))))
(if (<= b -3e-27)
(* b c)
(if (<= b -1.52e-235)
t_1
(if (<= b 6.2e-273)
(* -4.0 (* x i))
(if (<= b 2.7e-130) t_1 (* b c)))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double tmp;
if (b <= -3e-27) {
tmp = b * c;
} else if (b <= -1.52e-235) {
tmp = t_1;
} else if (b <= 6.2e-273) {
tmp = -4.0 * (x * i);
} else if (b <= 2.7e-130) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
if (b <= (-3d-27)) then
tmp = b * c
else if (b <= (-1.52d-235)) then
tmp = t_1
else if (b <= 6.2d-273) then
tmp = (-4.0d0) * (x * i)
else if (b <= 2.7d-130) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double tmp;
if (b <= -3e-27) {
tmp = b * c;
} else if (b <= -1.52e-235) {
tmp = t_1;
} else if (b <= 6.2e-273) {
tmp = -4.0 * (x * i);
} else if (b <= 2.7e-130) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) tmp = 0 if b <= -3e-27: tmp = b * c elif b <= -1.52e-235: tmp = t_1 elif b <= 6.2e-273: tmp = -4.0 * (x * i) elif b <= 2.7e-130: tmp = t_1 else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) tmp = 0.0 if (b <= -3e-27) tmp = Float64(b * c); elseif (b <= -1.52e-235) tmp = t_1; elseif (b <= 6.2e-273) tmp = Float64(-4.0 * Float64(x * i)); elseif (b <= 2.7e-130) tmp = t_1; else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
tmp = 0.0;
if (b <= -3e-27)
tmp = b * c;
elseif (b <= -1.52e-235)
tmp = t_1;
elseif (b <= 6.2e-273)
tmp = -4.0 * (x * i);
elseif (b <= 2.7e-130)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3e-27], N[(b * c), $MachinePrecision], If[LessEqual[b, -1.52e-235], t$95$1, If[LessEqual[b, 6.2e-273], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.7e-130], t$95$1, N[(b * c), $MachinePrecision]]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
\mathbf{if}\;b \leq -3 \cdot 10^{-27}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -1.52 \cdot 10^{-235}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{-273}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \leq 2.7 \cdot 10^{-130}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -3.0000000000000001e-27 or 2.69999999999999991e-130 < b Initial program 88.9%
sub-neg88.9%
associate-+l-88.9%
sub-neg88.9%
sub-neg88.9%
distribute-rgt-out--90.1%
associate-*l*88.9%
distribute-lft-neg-in88.9%
cancel-sign-sub88.9%
associate-*l*89.5%
associate-*l*89.5%
Simplified89.5%
fma-def90.1%
associate-*l*90.1%
Applied egg-rr90.1%
Taylor expanded in b around inf 28.9%
if -3.0000000000000001e-27 < b < -1.52e-235 or 6.19999999999999976e-273 < b < 2.69999999999999991e-130Initial program 92.7%
sub-neg92.7%
+-commutative92.7%
associate-*l*91.6%
distribute-rgt-neg-in91.6%
fma-def91.6%
*-commutative91.6%
distribute-rgt-neg-in91.6%
metadata-eval91.6%
sub-neg91.6%
+-commutative91.6%
associate-*l*91.6%
distribute-rgt-neg-in91.6%
Simplified90.3%
Taylor expanded in j around inf 29.7%
if -1.52e-235 < b < 6.19999999999999976e-273Initial program 77.4%
sub-neg77.4%
+-commutative77.4%
associate-*l*77.4%
distribute-rgt-neg-in77.4%
fma-def77.4%
*-commutative77.4%
distribute-rgt-neg-in77.4%
metadata-eval77.4%
sub-neg77.4%
+-commutative77.4%
associate-*l*77.4%
distribute-rgt-neg-in77.4%
Simplified85.1%
Taylor expanded in i around inf 24.3%
*-commutative24.3%
Simplified24.3%
Final simplification28.9%
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= b -3.3e-25)
(* b c)
(if (<= b -3.9e-237)
(* j (* k -27.0))
(if (<= b 1e-272)
(* -4.0 (* x i))
(if (<= b 3.3e-130) (* -27.0 (* j k)) (* b c))))))assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -3.3e-25) {
tmp = b * c;
} else if (b <= -3.9e-237) {
tmp = j * (k * -27.0);
} else if (b <= 1e-272) {
tmp = -4.0 * (x * i);
} else if (b <= 3.3e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (b <= (-3.3d-25)) then
tmp = b * c
else if (b <= (-3.9d-237)) then
tmp = j * (k * (-27.0d0))
else if (b <= 1d-272) then
tmp = (-4.0d0) * (x * i)
else if (b <= 3.3d-130) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -3.3e-25) {
tmp = b * c;
} else if (b <= -3.9e-237) {
tmp = j * (k * -27.0);
} else if (b <= 1e-272) {
tmp = -4.0 * (x * i);
} else if (b <= 3.3e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -3.3e-25: tmp = b * c elif b <= -3.9e-237: tmp = j * (k * -27.0) elif b <= 1e-272: tmp = -4.0 * (x * i) elif b <= 3.3e-130: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -3.3e-25) tmp = Float64(b * c); elseif (b <= -3.9e-237) tmp = Float64(j * Float64(k * -27.0)); elseif (b <= 1e-272) tmp = Float64(-4.0 * Float64(x * i)); elseif (b <= 3.3e-130) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (b <= -3.3e-25)
tmp = b * c;
elseif (b <= -3.9e-237)
tmp = j * (k * -27.0);
elseif (b <= 1e-272)
tmp = -4.0 * (x * i);
elseif (b <= 3.3e-130)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[b, -3.3e-25], N[(b * c), $MachinePrecision], If[LessEqual[b, -3.9e-237], N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1e-272], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.3e-130], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.3 \cdot 10^{-25}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq -3.9 \cdot 10^{-237}:\\
\;\;\;\;j \cdot \left(k \cdot -27\right)\\
\mathbf{elif}\;b \leq 10^{-272}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \leq 3.3 \cdot 10^{-130}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -3.2999999999999998e-25 or 3.2999999999999998e-130 < b Initial program 88.9%
sub-neg88.9%
associate-+l-88.9%
sub-neg88.9%
sub-neg88.9%
distribute-rgt-out--90.1%
associate-*l*88.9%
distribute-lft-neg-in88.9%
cancel-sign-sub88.9%
associate-*l*89.5%
associate-*l*89.5%
Simplified89.5%
fma-def90.1%
associate-*l*90.1%
Applied egg-rr90.1%
Taylor expanded in b around inf 28.9%
if -3.2999999999999998e-25 < b < -3.8999999999999998e-237Initial program 93.7%
sub-neg93.7%
+-commutative93.7%
associate-*l*93.8%
distribute-rgt-neg-in93.8%
fma-def93.8%
*-commutative93.8%
distribute-rgt-neg-in93.8%
metadata-eval93.8%
sub-neg93.8%
+-commutative93.8%
associate-*l*93.8%
distribute-rgt-neg-in93.8%
Simplified89.9%
Taylor expanded in j around inf 23.9%
associate-*r*24.0%
*-commutative24.0%
*-commutative24.0%
*-commutative24.0%
Simplified24.0%
if -3.8999999999999998e-237 < b < 9.9999999999999993e-273Initial program 75.6%
sub-neg75.6%
+-commutative75.6%
associate-*l*75.6%
distribute-rgt-neg-in75.6%
fma-def75.6%
*-commutative75.6%
distribute-rgt-neg-in75.6%
metadata-eval75.6%
sub-neg75.6%
+-commutative75.6%
associate-*l*75.6%
distribute-rgt-neg-in75.6%
Simplified83.9%
Taylor expanded in i around inf 25.9%
*-commutative25.9%
Simplified25.9%
if 9.9999999999999993e-273 < b < 3.2999999999999998e-130Initial program 91.4%
sub-neg91.4%
+-commutative91.4%
associate-*l*88.7%
distribute-rgt-neg-in88.7%
fma-def88.7%
*-commutative88.7%
distribute-rgt-neg-in88.7%
metadata-eval88.7%
sub-neg88.7%
+-commutative88.7%
associate-*l*88.7%
distribute-rgt-neg-in88.7%
Simplified91.3%
Taylor expanded in j around inf 37.2%
Final simplification28.9%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= y -2.76e+132) (* 18.0 (* (* x z) (* y t))) (+ (* b c) (* -27.0 (* j k)))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (y <= -2.76e+132) {
tmp = 18.0 * ((x * z) * (y * t));
} else {
tmp = (b * c) + (-27.0 * (j * k));
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (y <= (-2.76d+132)) then
tmp = 18.0d0 * ((x * z) * (y * t))
else
tmp = (b * c) + ((-27.0d0) * (j * k))
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (y <= -2.76e+132) {
tmp = 18.0 * ((x * z) * (y * t));
} else {
tmp = (b * c) + (-27.0 * (j * k));
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if y <= -2.76e+132: tmp = 18.0 * ((x * z) * (y * t)) else: tmp = (b * c) + (-27.0 * (j * k)) return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (y <= -2.76e+132) tmp = Float64(18.0 * Float64(Float64(x * z) * Float64(y * t))); else tmp = Float64(Float64(b * c) + Float64(-27.0 * Float64(j * k))); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (y <= -2.76e+132)
tmp = 18.0 * ((x * z) * (y * t));
else
tmp = (b * c) + (-27.0 * (j * k));
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[y, -2.76e+132], N[(18.0 * N[(N[(x * z), $MachinePrecision] * N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.76 \cdot 10^{+132}:\\
\;\;\;\;18 \cdot \left(\left(x \cdot z\right) \cdot \left(y \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + -27 \cdot \left(j \cdot k\right)\\
\end{array}
\end{array}
if y < -2.7600000000000001e132Initial program 72.2%
sub-neg72.2%
associate-+l-72.2%
sub-neg72.2%
sub-neg72.2%
distribute-rgt-out--74.8%
associate-*l*69.6%
distribute-lft-neg-in69.6%
cancel-sign-sub69.6%
associate-*l*72.2%
associate-*l*72.2%
Simplified72.2%
fma-def72.2%
associate-*l*72.2%
Applied egg-rr72.2%
Taylor expanded in y around inf 60.6%
associate-*r*58.2%
*-commutative58.2%
Simplified58.2%
if -2.7600000000000001e132 < y Initial program 92.6%
Simplified93.6%
Taylor expanded in a around 0 76.6%
Taylor expanded in x around 0 47.1%
Final simplification48.8%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= b -1.45e-27) (* b c) (if (<= b 3.1e-130) (* -27.0 (* j k)) (* b c))))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -1.45e-27) {
tmp = b * c;
} else if (b <= 3.1e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (b <= (-1.45d-27)) then
tmp = b * c
else if (b <= 3.1d-130) then
tmp = (-27.0d0) * (j * k)
else
tmp = b * c
end if
code = tmp
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (b <= -1.45e-27) {
tmp = b * c;
} else if (b <= 3.1e-130) {
tmp = -27.0 * (j * k);
} else {
tmp = b * c;
}
return tmp;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if b <= -1.45e-27: tmp = b * c elif b <= 3.1e-130: tmp = -27.0 * (j * k) else: tmp = b * c return tmp
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (b <= -1.45e-27) tmp = Float64(b * c); elseif (b <= 3.1e-130) tmp = Float64(-27.0 * Float64(j * k)); else tmp = Float64(b * c); end return tmp end
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (b <= -1.45e-27)
tmp = b * c;
elseif (b <= 3.1e-130)
tmp = -27.0 * (j * k);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[b, -1.45e-27], N[(b * c), $MachinePrecision], If[LessEqual[b, 3.1e-130], N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.45 \cdot 10^{-27}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{-130}:\\
\;\;\;\;-27 \cdot \left(j \cdot k\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if b < -1.45000000000000002e-27 or 3.10000000000000011e-130 < b Initial program 88.9%
sub-neg88.9%
associate-+l-88.9%
sub-neg88.9%
sub-neg88.9%
distribute-rgt-out--90.1%
associate-*l*88.9%
distribute-lft-neg-in88.9%
cancel-sign-sub88.9%
associate-*l*89.5%
associate-*l*89.5%
Simplified89.5%
fma-def90.1%
associate-*l*90.1%
Applied egg-rr90.1%
Taylor expanded in b around inf 28.9%
if -1.45000000000000002e-27 < b < 3.10000000000000011e-130Initial program 90.6%
sub-neg90.6%
+-commutative90.6%
associate-*l*89.6%
distribute-rgt-neg-in89.6%
fma-def89.6%
*-commutative89.6%
distribute-rgt-neg-in89.6%
metadata-eval89.6%
sub-neg89.6%
+-commutative89.6%
associate-*l*89.6%
distribute-rgt-neg-in89.6%
Simplified89.6%
Taylor expanded in j around inf 28.9%
Final simplification28.9%
NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = b * c
end function
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 89.5%
sub-neg89.5%
associate-+l-89.5%
sub-neg89.5%
sub-neg89.5%
distribute-rgt-out--90.3%
associate-*l*89.1%
distribute-lft-neg-in89.1%
cancel-sign-sub89.1%
associate-*l*89.5%
associate-*l*89.1%
Simplified89.1%
fma-def89.5%
associate-*l*89.5%
Applied egg-rr89.5%
Taylor expanded in b around inf 22.6%
Final simplification22.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 2023213
(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)))