
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 24 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
INFINITY)
(fma
(* k -27.0)
j
(fma t (fma x (* y (* 18.0 z)) (* a -4.0)) (fma b c (* -4.0 (* x i)))))
(+ (fma x (fma -4.0 i (* (* y t) (* 18.0 z))) (* b c)) (* (* k -27.0) j))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) <= ((double) INFINITY)) {
tmp = fma((k * -27.0), j, fma(t, fma(x, (y * (18.0 * z)), (a * -4.0)), fma(b, c, (-4.0 * (x * i)))));
} else {
tmp = fma(x, fma(-4.0, i, ((y * t) * (18.0 * z))), (b * c)) + ((k * -27.0) * j);
}
return tmp;
}
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) <= Inf) tmp = fma(Float64(k * -27.0), j, fma(t, fma(x, Float64(y * Float64(18.0 * z)), Float64(a * -4.0)), fma(b, c, Float64(-4.0 * Float64(x * i))))); else tmp = Float64(fma(x, fma(-4.0, i, Float64(Float64(y * t) * Float64(18.0 * z))), Float64(b * c)) + Float64(Float64(k * -27.0) * j)); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[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], Infinity], N[(N[(k * -27.0), $MachinePrecision] * j + N[(t * N[(x * N[(y * N[(18.0 * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(-4.0 * i + N[(N[(y * t), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] + N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\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 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(t, \mathsf{fma}\left(x, y \cdot \left(18 \cdot z\right), a \cdot -4\right), \mathsf{fma}\left(b, c, -4 \cdot \left(x \cdot i\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(x, \mathsf{fma}\left(-4, i, \left(y \cdot t\right) \cdot \left(18 \cdot z\right)\right), b \cdot c\right) + \left(k \cdot -27\right) \cdot j\\
\end{array}
\end{array}
if (-.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)) < +inf.0Initial program 94.9%
Simplified94.9%
+-commutative94.9%
*-commutative94.9%
associate-*r*94.9%
*-commutative94.9%
fma-def95.8%
*-commutative95.8%
associate-*r*95.8%
associate-*r*95.8%
*-commutative95.8%
associate-*r*95.7%
associate-*r*95.7%
Applied egg-rr95.7%
if +inf.0 < (-.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)) Initial program 0.0%
Simplified38.5%
Taylor expanded in a around 0 30.8%
associate-+r+30.8%
*-commutative30.8%
associate-*r*34.6%
associate-*l*34.6%
associate-*r*34.6%
distribute-rgt-in73.1%
fma-def80.8%
fma-def80.8%
*-commutative80.8%
associate-*r*80.8%
associate-*l*80.8%
*-commutative80.8%
Simplified80.8%
Final simplification94.2%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* k -27.0) j)))
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* k (* j 27.0)))
INFINITY)
(+
t_1
(fma t (fma x (* 18.0 (* y z)) (* a -4.0)) (fma b c (* x (* i -4.0)))))
(+ t_1 (* t (fma -4.0 a (* y (* x (* 18.0 z)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * -27.0) * j;
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0))) <= ((double) INFINITY)) {
tmp = t_1 + fma(t, fma(x, (18.0 * (y * z)), (a * -4.0)), fma(b, c, (x * (i * -4.0))));
} else {
tmp = t_1 + (t * fma(-4.0, a, (y * (x * (18.0 * z)))));
}
return tmp;
}
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(k * -27.0) * j) tmp = 0.0 if (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(k * Float64(j * 27.0))) <= Inf) tmp = Float64(t_1 + fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(a * -4.0)), fma(b, c, Float64(x * Float64(i * -4.0))))); else tmp = Float64(t_1 + Float64(t * fma(-4.0, a, Float64(y * Float64(x * Float64(18.0 * z)))))); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[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[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(t * N[(-4.0 * a + N[(y * N[(x * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(k \cdot -27\right) \cdot j\\
\mathbf{if}\;\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) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;t_1 + \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + t \cdot \mathsf{fma}\left(-4, a, y \cdot \left(x \cdot \left(18 \cdot z\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)) < +inf.0Initial program 96.5%
Simplified96.1%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
Simplified36.7%
Taylor expanded in t around inf 63.5%
fma-def63.5%
*-commutative63.5%
associate-*l*63.5%
associate-*r*63.5%
*-commutative63.5%
associate-*r*66.9%
*-commutative66.9%
*-commutative66.9%
Simplified66.9%
Final simplification92.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* k (* j 27.0)))
INFINITY)
(-
(+ (* t (- (* (* x 18.0) (* y z)) (* a 4.0))) (- (* b c) (* x (* 4.0 i))))
(* j (* k 27.0)))
(+ (* (* k -27.0) j) (* t (fma -4.0 a (* y (* x (* 18.0 z))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0))) <= ((double) INFINITY)) {
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + ((b * c) - (x * (4.0 * i)))) - (j * (k * 27.0));
} else {
tmp = ((k * -27.0) * j) + (t * fma(-4.0, a, (y * (x * (18.0 * z)))));
}
return tmp;
}
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(Float64(Float64(Float64(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(k * Float64(j * 27.0))) <= Inf) tmp = Float64(Float64(Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0))) + Float64(Float64(b * c) - Float64(x * Float64(4.0 * i)))) - Float64(j * Float64(k * 27.0))); else tmp = Float64(Float64(Float64(k * -27.0) * j) + Float64(t * fma(-4.0, a, Float64(y * Float64(x * Float64(18.0 * z)))))); end return tmp end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[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[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision] + N[(t * N[(-4.0 * a + N[(y * N[(x * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(\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) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;\left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right) + \left(b \cdot c - x \cdot \left(4 \cdot i\right)\right)\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j + t \cdot \mathsf{fma}\left(-4, a, y \cdot \left(x \cdot \left(18 \cdot z\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)) < +inf.0Initial program 96.5%
associate-*l*96.5%
associate--l+96.5%
distribute-rgt-out--96.5%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
Simplified36.7%
Taylor expanded in t around inf 63.5%
fma-def63.5%
*-commutative63.5%
associate-*l*63.5%
associate-*r*63.5%
*-commutative63.5%
associate-*r*66.9%
*-commutative66.9%
*-commutative66.9%
Simplified66.9%
Final simplification92.7%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k 27.0))))
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* k (* j 27.0)))
INFINITY)
(-
(+
(* t (- (* (* x 18.0) (* y z)) (* a 4.0)))
(- (* b c) (* x (* 4.0 i))))
t_1)
(- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) t_1))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0))) <= ((double) INFINITY)) {
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + ((b * c) - (x * (4.0 * i)))) - t_1;
} else {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
}
return tmp;
}
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0))) <= Double.POSITIVE_INFINITY) {
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + ((b * c) - (x * (4.0 * i)))) - t_1;
} else {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * 27.0) tmp = 0 if ((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0))) <= math.inf: tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + ((b * c) - (x * (4.0 * i)))) - t_1 else: tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * 27.0)) tmp = 0.0 if (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(k * Float64(j * 27.0))) <= Inf) tmp = Float64(Float64(Float64(t * Float64(Float64(Float64(x * 18.0) * Float64(y * z)) - Float64(a * 4.0))) + Float64(Float64(b * c) - Float64(x * Float64(4.0 * i)))) - t_1); else tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * 27.0);
tmp = 0.0;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - (k * (j * 27.0))) <= Inf)
tmp = ((t * (((x * 18.0) * (y * z)) - (a * 4.0))) + ((b * c) - (x * (4.0 * i)))) - t_1;
else
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot 27\right)\\
\mathbf{if}\;\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) - k \cdot \left(j \cdot 27\right) \leq \infty:\\
\;\;\;\;\left(t \cdot \left(\left(x \cdot 18\right) \cdot \left(y \cdot z\right) - a \cdot 4\right) + \left(b \cdot c - x \cdot \left(4 \cdot i\right)\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - t_1\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) < +inf.0Initial program 96.5%
associate-*l*96.5%
associate--l+96.5%
distribute-rgt-out--96.5%
associate-*l*96.1%
associate-*l*96.1%
Simplified96.1%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x 18) y) z) t) (*.f64 (*.f64 a 4) t)) (*.f64 b c)) (*.f64 (*.f64 x 4) i)) (*.f64 (*.f64 j 27) k)) Initial program 0.0%
associate-*l*3.3%
associate--l+3.3%
distribute-rgt-out--26.7%
associate-*l*30.0%
associate-*l*33.3%
Simplified33.3%
Taylor expanded in t around inf 63.5%
Final simplification92.3%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* i (* x -4.0))) (t_2 (* -4.0 (* t a))))
(if (<= (* b c) -5.6e+46)
(* b c)
(if (<= (* b c) -8e-10)
t_1
(if (<= (* b c) -4.5e-71)
t_2
(if (<= (* b c) -8.5e-174)
t_1
(if (<= (* b c) -3.9e-265)
(* -27.0 (* k j))
(if (<= (* b c) 2e-318)
t_1
(if (<= (* b c) 2.9e-211)
(* (* k -27.0) j)
(if (<= (* b c) 2.1e-83)
t_2
(if (<= (* b c) 2.1e+21)
t_1
(if (<= (* b c) 7e+227)
(* k (* -27.0 j))
(* b c)))))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = i * (x * -4.0);
double t_2 = -4.0 * (t * a);
double tmp;
if ((b * c) <= -5.6e+46) {
tmp = b * c;
} else if ((b * c) <= -8e-10) {
tmp = t_1;
} else if ((b * c) <= -4.5e-71) {
tmp = t_2;
} else if ((b * c) <= -8.5e-174) {
tmp = t_1;
} else if ((b * c) <= -3.9e-265) {
tmp = -27.0 * (k * j);
} else if ((b * c) <= 2e-318) {
tmp = t_1;
} else if ((b * c) <= 2.9e-211) {
tmp = (k * -27.0) * j;
} else if ((b * c) <= 2.1e-83) {
tmp = t_2;
} else if ((b * c) <= 2.1e+21) {
tmp = t_1;
} else if ((b * c) <= 7e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = i * (x * (-4.0d0))
t_2 = (-4.0d0) * (t * a)
if ((b * c) <= (-5.6d+46)) then
tmp = b * c
else if ((b * c) <= (-8d-10)) then
tmp = t_1
else if ((b * c) <= (-4.5d-71)) then
tmp = t_2
else if ((b * c) <= (-8.5d-174)) then
tmp = t_1
else if ((b * c) <= (-3.9d-265)) then
tmp = (-27.0d0) * (k * j)
else if ((b * c) <= 2d-318) then
tmp = t_1
else if ((b * c) <= 2.9d-211) then
tmp = (k * (-27.0d0)) * j
else if ((b * c) <= 2.1d-83) then
tmp = t_2
else if ((b * c) <= 2.1d+21) then
tmp = t_1
else if ((b * c) <= 7d+227) then
tmp = k * ((-27.0d0) * j)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = i * (x * -4.0);
double t_2 = -4.0 * (t * a);
double tmp;
if ((b * c) <= -5.6e+46) {
tmp = b * c;
} else if ((b * c) <= -8e-10) {
tmp = t_1;
} else if ((b * c) <= -4.5e-71) {
tmp = t_2;
} else if ((b * c) <= -8.5e-174) {
tmp = t_1;
} else if ((b * c) <= -3.9e-265) {
tmp = -27.0 * (k * j);
} else if ((b * c) <= 2e-318) {
tmp = t_1;
} else if ((b * c) <= 2.9e-211) {
tmp = (k * -27.0) * j;
} else if ((b * c) <= 2.1e-83) {
tmp = t_2;
} else if ((b * c) <= 2.1e+21) {
tmp = t_1;
} else if ((b * c) <= 7e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = i * (x * -4.0) t_2 = -4.0 * (t * a) tmp = 0 if (b * c) <= -5.6e+46: tmp = b * c elif (b * c) <= -8e-10: tmp = t_1 elif (b * c) <= -4.5e-71: tmp = t_2 elif (b * c) <= -8.5e-174: tmp = t_1 elif (b * c) <= -3.9e-265: tmp = -27.0 * (k * j) elif (b * c) <= 2e-318: tmp = t_1 elif (b * c) <= 2.9e-211: tmp = (k * -27.0) * j elif (b * c) <= 2.1e-83: tmp = t_2 elif (b * c) <= 2.1e+21: tmp = t_1 elif (b * c) <= 7e+227: tmp = k * (-27.0 * j) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(i * Float64(x * -4.0)) t_2 = Float64(-4.0 * Float64(t * a)) tmp = 0.0 if (Float64(b * c) <= -5.6e+46) tmp = Float64(b * c); elseif (Float64(b * c) <= -8e-10) tmp = t_1; elseif (Float64(b * c) <= -4.5e-71) tmp = t_2; elseif (Float64(b * c) <= -8.5e-174) tmp = t_1; elseif (Float64(b * c) <= -3.9e-265) tmp = Float64(-27.0 * Float64(k * j)); elseif (Float64(b * c) <= 2e-318) tmp = t_1; elseif (Float64(b * c) <= 2.9e-211) tmp = Float64(Float64(k * -27.0) * j); elseif (Float64(b * c) <= 2.1e-83) tmp = t_2; elseif (Float64(b * c) <= 2.1e+21) tmp = t_1; elseif (Float64(b * c) <= 7e+227) tmp = Float64(k * Float64(-27.0 * j)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = i * (x * -4.0);
t_2 = -4.0 * (t * a);
tmp = 0.0;
if ((b * c) <= -5.6e+46)
tmp = b * c;
elseif ((b * c) <= -8e-10)
tmp = t_1;
elseif ((b * c) <= -4.5e-71)
tmp = t_2;
elseif ((b * c) <= -8.5e-174)
tmp = t_1;
elseif ((b * c) <= -3.9e-265)
tmp = -27.0 * (k * j);
elseif ((b * c) <= 2e-318)
tmp = t_1;
elseif ((b * c) <= 2.9e-211)
tmp = (k * -27.0) * j;
elseif ((b * c) <= 2.1e-83)
tmp = t_2;
elseif ((b * c) <= 2.1e+21)
tmp = t_1;
elseif ((b * c) <= 7e+227)
tmp = k * (-27.0 * j);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(i * N[(x * -4.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -5.6e+46], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -8e-10], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -4.5e-71], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], -8.5e-174], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -3.9e-265], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e-318], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 2.9e-211], N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.1e-83], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 2.1e+21], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 7e+227], N[(k * N[(-27.0 * j), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := i \cdot \left(x \cdot -4\right)\\
t_2 := -4 \cdot \left(t \cdot a\right)\\
\mathbf{if}\;b \cdot c \leq -5.6 \cdot 10^{+46}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -8 \cdot 10^{-10}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -4.5 \cdot 10^{-71}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq -8.5 \cdot 10^{-174}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -3.9 \cdot 10^{-265}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{-318}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 2.9 \cdot 10^{-211}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j\\
\mathbf{elif}\;b \cdot c \leq 2.1 \cdot 10^{-83}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq 2.1 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 7 \cdot 10^{+227}:\\
\;\;\;\;k \cdot \left(-27 \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -5.60000000000000037e46 or 6.9999999999999998e227 < (*.f64 b c) Initial program 78.9%
Simplified82.5%
Taylor expanded in t around 0 73.3%
*-commutative73.3%
*-commutative73.3%
+-commutative73.3%
fma-def73.3%
associate-*l*73.3%
*-commutative73.3%
Simplified73.3%
Taylor expanded in b around inf 60.9%
if -5.60000000000000037e46 < (*.f64 b c) < -8.00000000000000029e-10 or -4.5000000000000002e-71 < (*.f64 b c) < -8.4999999999999996e-174 or -3.8999999999999999e-265 < (*.f64 b c) < 2.0000024e-318 or 2.0999999999999999e-83 < (*.f64 b c) < 2.1e21Initial program 85.3%
Simplified92.1%
Taylor expanded in t around 0 60.2%
*-commutative60.2%
*-commutative60.2%
+-commutative60.2%
fma-def60.2%
associate-*l*60.2%
*-commutative60.2%
Simplified60.2%
Taylor expanded in x around inf 44.6%
associate-*r*44.6%
*-commutative44.6%
associate-*r*44.6%
Simplified44.6%
if -8.00000000000000029e-10 < (*.f64 b c) < -4.5000000000000002e-71 or 2.90000000000000014e-211 < (*.f64 b c) < 2.0999999999999999e-83Initial program 89.0%
Simplified91.8%
Taylor expanded in a around inf 67.6%
*-commutative67.6%
Simplified67.6%
Taylor expanded in t around inf 46.0%
if -8.4999999999999996e-174 < (*.f64 b c) < -3.8999999999999999e-265Initial program 99.6%
Simplified99.7%
Taylor expanded in j around inf 43.8%
if 2.0000024e-318 < (*.f64 b c) < 2.90000000000000014e-211Initial program 99.4%
Simplified90.1%
Taylor expanded in a around 0 90.1%
associate-+r+90.1%
*-commutative90.1%
associate-*r*90.1%
associate-*l*90.1%
associate-*r*90.1%
distribute-rgt-in90.1%
fma-def90.2%
fma-def90.2%
*-commutative90.2%
associate-*r*90.2%
associate-*l*90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in j around inf 70.9%
*-commutative70.9%
associate-*r*70.9%
*-commutative70.9%
Simplified70.9%
if 2.1e21 < (*.f64 b c) < 6.9999999999999998e227Initial program 88.6%
Simplified92.3%
Taylor expanded in j around inf 54.0%
associate-*r*54.0%
*-commutative54.0%
*-commutative54.0%
*-commutative54.0%
Simplified54.0%
Final simplification52.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* t a) (* x i)))))
(if (<= (* b c) -3.55e+252)
(* b c)
(if (<= (* b c) -1.25e-175)
t_1
(if (<= (* b c) -1.15e-273)
(* t (* (* 18.0 z) (* x y)))
(if (<= (* b c) 2e-309)
t_1
(if (<= (* b c) 6e-208)
(* (* k -27.0) j)
(if (<= (* b c) 1.65e+40)
t_1
(if (<= (* b c) 1.3e+227) (* k (* -27.0 j)) (* b c))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -3.55e+252) {
tmp = b * c;
} else if ((b * c) <= -1.25e-175) {
tmp = t_1;
} else if ((b * c) <= -1.15e-273) {
tmp = t * ((18.0 * z) * (x * y));
} else if ((b * c) <= 2e-309) {
tmp = t_1;
} else if ((b * c) <= 6e-208) {
tmp = (k * -27.0) * j;
} else if ((b * c) <= 1.65e+40) {
tmp = t_1;
} else if ((b * c) <= 1.3e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((t * a) + (x * i))
if ((b * c) <= (-3.55d+252)) then
tmp = b * c
else if ((b * c) <= (-1.25d-175)) then
tmp = t_1
else if ((b * c) <= (-1.15d-273)) then
tmp = t * ((18.0d0 * z) * (x * y))
else if ((b * c) <= 2d-309) then
tmp = t_1
else if ((b * c) <= 6d-208) then
tmp = (k * (-27.0d0)) * j
else if ((b * c) <= 1.65d+40) then
tmp = t_1
else if ((b * c) <= 1.3d+227) then
tmp = k * ((-27.0d0) * j)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -3.55e+252) {
tmp = b * c;
} else if ((b * c) <= -1.25e-175) {
tmp = t_1;
} else if ((b * c) <= -1.15e-273) {
tmp = t * ((18.0 * z) * (x * y));
} else if ((b * c) <= 2e-309) {
tmp = t_1;
} else if ((b * c) <= 6e-208) {
tmp = (k * -27.0) * j;
} else if ((b * c) <= 1.65e+40) {
tmp = t_1;
} else if ((b * c) <= 1.3e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((t * a) + (x * i)) tmp = 0 if (b * c) <= -3.55e+252: tmp = b * c elif (b * c) <= -1.25e-175: tmp = t_1 elif (b * c) <= -1.15e-273: tmp = t * ((18.0 * z) * (x * y)) elif (b * c) <= 2e-309: tmp = t_1 elif (b * c) <= 6e-208: tmp = (k * -27.0) * j elif (b * c) <= 1.65e+40: tmp = t_1 elif (b * c) <= 1.3e+227: tmp = k * (-27.0 * j) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) tmp = 0.0 if (Float64(b * c) <= -3.55e+252) tmp = Float64(b * c); elseif (Float64(b * c) <= -1.25e-175) tmp = t_1; elseif (Float64(b * c) <= -1.15e-273) tmp = Float64(t * Float64(Float64(18.0 * z) * Float64(x * y))); elseif (Float64(b * c) <= 2e-309) tmp = t_1; elseif (Float64(b * c) <= 6e-208) tmp = Float64(Float64(k * -27.0) * j); elseif (Float64(b * c) <= 1.65e+40) tmp = t_1; elseif (Float64(b * c) <= 1.3e+227) tmp = Float64(k * Float64(-27.0 * j)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((t * a) + (x * i));
tmp = 0.0;
if ((b * c) <= -3.55e+252)
tmp = b * c;
elseif ((b * c) <= -1.25e-175)
tmp = t_1;
elseif ((b * c) <= -1.15e-273)
tmp = t * ((18.0 * z) * (x * y));
elseif ((b * c) <= 2e-309)
tmp = t_1;
elseif ((b * c) <= 6e-208)
tmp = (k * -27.0) * j;
elseif ((b * c) <= 1.65e+40)
tmp = t_1;
elseif ((b * c) <= 1.3e+227)
tmp = k * (-27.0 * j);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -3.55e+252], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.25e-175], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -1.15e-273], N[(t * N[(N[(18.0 * z), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e-309], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 6e-208], N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.65e+40], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 1.3e+227], N[(k * N[(-27.0 * j), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{if}\;b \cdot c \leq -3.55 \cdot 10^{+252}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq -1.25 \cdot 10^{-175}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -1.15 \cdot 10^{-273}:\\
\;\;\;\;t \cdot \left(\left(18 \cdot z\right) \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{-309}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 6 \cdot 10^{-208}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j\\
\mathbf{elif}\;b \cdot c \leq 1.65 \cdot 10^{+40}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 1.3 \cdot 10^{+227}:\\
\;\;\;\;k \cdot \left(-27 \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -3.5499999999999999e252 or 1.29999999999999991e227 < (*.f64 b c) Initial program 75.7%
Simplified79.7%
Taylor expanded in t around 0 77.7%
*-commutative77.7%
*-commutative77.7%
+-commutative77.7%
fma-def77.7%
associate-*l*77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in b around inf 78.1%
if -3.5499999999999999e252 < (*.f64 b c) < -1.25e-175 or -1.1499999999999999e-273 < (*.f64 b c) < 1.9999999999999988e-309 or 5.99999999999999972e-208 < (*.f64 b c) < 1.6499999999999999e40Initial program 87.3%
associate-*l*87.9%
associate--l+87.9%
distribute-rgt-out--90.9%
associate-*l*90.9%
associate-*l*90.9%
Simplified90.9%
Taylor expanded in y around 0 80.6%
Taylor expanded in j around 0 65.4%
Taylor expanded in b around 0 54.1%
cancel-sign-sub-inv54.1%
*-commutative54.1%
metadata-eval54.1%
*-commutative54.1%
distribute-lft-out54.1%
*-commutative54.1%
Simplified54.1%
if -1.25e-175 < (*.f64 b c) < -1.1499999999999999e-273Initial program 85.4%
Simplified99.8%
Taylor expanded in a around 0 92.9%
associate-+r+92.9%
*-commutative92.9%
associate-*r*93.1%
associate-*l*93.2%
associate-*r*93.2%
distribute-rgt-in93.2%
fma-def93.2%
fma-def93.2%
*-commutative93.2%
associate-*r*79.5%
associate-*l*79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in t around inf 79.4%
*-commutative79.4%
associate-*r*79.6%
*-commutative79.6%
associate-*l*79.6%
Simplified79.6%
Taylor expanded in y around inf 51.9%
*-commutative51.9%
associate-*r*52.1%
associate-*l*52.2%
associate-*l*52.2%
Simplified52.2%
if 1.9999999999999988e-309 < (*.f64 b c) < 5.99999999999999972e-208Initial program 99.4%
Simplified90.1%
Taylor expanded in a around 0 90.1%
associate-+r+90.1%
*-commutative90.1%
associate-*r*90.1%
associate-*l*90.1%
associate-*r*90.1%
distribute-rgt-in90.1%
fma-def90.2%
fma-def90.2%
*-commutative90.2%
associate-*r*90.2%
associate-*l*90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in j around inf 70.9%
*-commutative70.9%
associate-*r*70.9%
*-commutative70.9%
Simplified70.9%
if 1.6499999999999999e40 < (*.f64 b c) < 1.29999999999999991e227Initial program 84.4%
Simplified89.6%
Taylor expanded in j around inf 62.6%
associate-*r*62.6%
*-commutative62.6%
*-commutative62.6%
*-commutative62.6%
Simplified62.6%
Final simplification59.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* t a) (* x i)))))
(if (<= (* b c) -1.52e+41)
(+ (* b c) (* -4.0 (* t a)))
(if (<= (* b c) -1.9e-174)
t_1
(if (<= (* b c) -1.3e-273)
(* t (* (* 18.0 z) (* x y)))
(if (<= (* b c) 3e-309)
t_1
(if (<= (* b c) 4.8e-209)
(* (* k -27.0) j)
(if (<= (* b c) 3.2e+41)
t_1
(if (<= (* b c) 1.3e+227) (* k (* -27.0 j)) (* b c))))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -1.52e+41) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -1.9e-174) {
tmp = t_1;
} else if ((b * c) <= -1.3e-273) {
tmp = t * ((18.0 * z) * (x * y));
} else if ((b * c) <= 3e-309) {
tmp = t_1;
} else if ((b * c) <= 4.8e-209) {
tmp = (k * -27.0) * j;
} else if ((b * c) <= 3.2e+41) {
tmp = t_1;
} else if ((b * c) <= 1.3e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((t * a) + (x * i))
if ((b * c) <= (-1.52d+41)) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if ((b * c) <= (-1.9d-174)) then
tmp = t_1
else if ((b * c) <= (-1.3d-273)) then
tmp = t * ((18.0d0 * z) * (x * y))
else if ((b * c) <= 3d-309) then
tmp = t_1
else if ((b * c) <= 4.8d-209) then
tmp = (k * (-27.0d0)) * j
else if ((b * c) <= 3.2d+41) then
tmp = t_1
else if ((b * c) <= 1.3d+227) then
tmp = k * ((-27.0d0) * j)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -1.52e+41) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -1.9e-174) {
tmp = t_1;
} else if ((b * c) <= -1.3e-273) {
tmp = t * ((18.0 * z) * (x * y));
} else if ((b * c) <= 3e-309) {
tmp = t_1;
} else if ((b * c) <= 4.8e-209) {
tmp = (k * -27.0) * j;
} else if ((b * c) <= 3.2e+41) {
tmp = t_1;
} else if ((b * c) <= 1.3e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((t * a) + (x * i)) tmp = 0 if (b * c) <= -1.52e+41: tmp = (b * c) + (-4.0 * (t * a)) elif (b * c) <= -1.9e-174: tmp = t_1 elif (b * c) <= -1.3e-273: tmp = t * ((18.0 * z) * (x * y)) elif (b * c) <= 3e-309: tmp = t_1 elif (b * c) <= 4.8e-209: tmp = (k * -27.0) * j elif (b * c) <= 3.2e+41: tmp = t_1 elif (b * c) <= 1.3e+227: tmp = k * (-27.0 * j) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) tmp = 0.0 if (Float64(b * c) <= -1.52e+41) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif (Float64(b * c) <= -1.9e-174) tmp = t_1; elseif (Float64(b * c) <= -1.3e-273) tmp = Float64(t * Float64(Float64(18.0 * z) * Float64(x * y))); elseif (Float64(b * c) <= 3e-309) tmp = t_1; elseif (Float64(b * c) <= 4.8e-209) tmp = Float64(Float64(k * -27.0) * j); elseif (Float64(b * c) <= 3.2e+41) tmp = t_1; elseif (Float64(b * c) <= 1.3e+227) tmp = Float64(k * Float64(-27.0 * j)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((t * a) + (x * i));
tmp = 0.0;
if ((b * c) <= -1.52e+41)
tmp = (b * c) + (-4.0 * (t * a));
elseif ((b * c) <= -1.9e-174)
tmp = t_1;
elseif ((b * c) <= -1.3e-273)
tmp = t * ((18.0 * z) * (x * y));
elseif ((b * c) <= 3e-309)
tmp = t_1;
elseif ((b * c) <= 4.8e-209)
tmp = (k * -27.0) * j;
elseif ((b * c) <= 3.2e+41)
tmp = t_1;
elseif ((b * c) <= 1.3e+227)
tmp = k * (-27.0 * j);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1.52e+41], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.9e-174], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -1.3e-273], N[(t * N[(N[(18.0 * z), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3e-309], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 4.8e-209], N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.2e+41], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 1.3e+227], N[(k * N[(-27.0 * j), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{if}\;b \cdot c \leq -1.52 \cdot 10^{+41}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq -1.9 \cdot 10^{-174}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -1.3 \cdot 10^{-273}:\\
\;\;\;\;t \cdot \left(\left(18 \cdot z\right) \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 3 \cdot 10^{-309}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 4.8 \cdot 10^{-209}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j\\
\mathbf{elif}\;b \cdot c \leq 3.2 \cdot 10^{+41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 1.3 \cdot 10^{+227}:\\
\;\;\;\;k \cdot \left(-27 \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.52000000000000002e41Initial program 82.1%
Simplified85.4%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
metadata-eval78.9%
cancel-sign-sub-inv78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r*78.9%
fma-neg78.9%
associate-*r*78.9%
*-commutative78.9%
*-commutative78.9%
distribute-lft-neg-in78.9%
metadata-eval78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in j around 0 69.6%
if -1.52000000000000002e41 < (*.f64 b c) < -1.9000000000000001e-174 or -1.29999999999999992e-273 < (*.f64 b c) < 3.000000000000001e-309 or 4.8000000000000002e-209 < (*.f64 b c) < 3.2000000000000001e41Initial program 88.4%
associate-*l*89.2%
associate--l+89.2%
distribute-rgt-out--90.7%
associate-*l*92.3%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in y around 0 78.3%
Taylor expanded in j around 0 62.5%
Taylor expanded in b around 0 57.9%
cancel-sign-sub-inv57.9%
*-commutative57.9%
metadata-eval57.9%
*-commutative57.9%
distribute-lft-out57.9%
*-commutative57.9%
Simplified57.9%
if -1.9000000000000001e-174 < (*.f64 b c) < -1.29999999999999992e-273Initial program 85.4%
Simplified99.8%
Taylor expanded in a around 0 92.9%
associate-+r+92.9%
*-commutative92.9%
associate-*r*93.1%
associate-*l*93.2%
associate-*r*93.2%
distribute-rgt-in93.2%
fma-def93.2%
fma-def93.2%
*-commutative93.2%
associate-*r*79.5%
associate-*l*79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in t around inf 79.4%
*-commutative79.4%
associate-*r*79.6%
*-commutative79.6%
associate-*l*79.6%
Simplified79.6%
Taylor expanded in y around inf 51.9%
*-commutative51.9%
associate-*r*52.1%
associate-*l*52.2%
associate-*l*52.2%
Simplified52.2%
if 3.000000000000001e-309 < (*.f64 b c) < 4.8000000000000002e-209Initial program 99.4%
Simplified90.1%
Taylor expanded in a around 0 90.1%
associate-+r+90.1%
*-commutative90.1%
associate-*r*90.1%
associate-*l*90.1%
associate-*r*90.1%
distribute-rgt-in90.1%
fma-def90.2%
fma-def90.2%
*-commutative90.2%
associate-*r*90.2%
associate-*l*90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in j around inf 70.9%
*-commutative70.9%
associate-*r*70.9%
*-commutative70.9%
Simplified70.9%
if 3.2000000000000001e41 < (*.f64 b c) < 1.29999999999999991e227Initial program 84.4%
Simplified89.6%
Taylor expanded in j around inf 62.6%
associate-*r*62.6%
*-commutative62.6%
*-commutative62.6%
*-commutative62.6%
Simplified62.6%
if 1.29999999999999991e227 < (*.f64 b c) Initial program 70.8%
Simplified75.0%
Taylor expanded in t around 0 70.8%
*-commutative70.8%
*-commutative70.8%
+-commutative70.8%
fma-def70.8%
associate-*l*70.8%
*-commutative70.8%
Simplified70.8%
Taylor expanded in b around inf 71.2%
Final simplification62.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* t a) (* x i)))) (t_2 (* (* k -27.0) j)))
(if (<= (* b c) -7.2e+43)
(+ (* b c) (* -4.0 (* t a)))
(if (<= (* b c) -1.3e-175)
t_1
(if (<= (* b c) -6e-276)
(* t (* (* 18.0 z) (* x y)))
(if (<= (* b c) 1e-309)
t_1
(if (<= (* b c) 3.6e-213)
t_2
(if (<= (* b c) 1.3e+35) t_1 (+ (* b c) t_2)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double t_2 = (k * -27.0) * j;
double tmp;
if ((b * c) <= -7.2e+43) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -1.3e-175) {
tmp = t_1;
} else if ((b * c) <= -6e-276) {
tmp = t * ((18.0 * z) * (x * y));
} else if ((b * c) <= 1e-309) {
tmp = t_1;
} else if ((b * c) <= 3.6e-213) {
tmp = t_2;
} else if ((b * c) <= 1.3e+35) {
tmp = t_1;
} else {
tmp = (b * c) + t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-4.0d0) * ((t * a) + (x * i))
t_2 = (k * (-27.0d0)) * j
if ((b * c) <= (-7.2d+43)) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if ((b * c) <= (-1.3d-175)) then
tmp = t_1
else if ((b * c) <= (-6d-276)) then
tmp = t * ((18.0d0 * z) * (x * y))
else if ((b * c) <= 1d-309) then
tmp = t_1
else if ((b * c) <= 3.6d-213) then
tmp = t_2
else if ((b * c) <= 1.3d+35) then
tmp = t_1
else
tmp = (b * c) + t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double t_2 = (k * -27.0) * j;
double tmp;
if ((b * c) <= -7.2e+43) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -1.3e-175) {
tmp = t_1;
} else if ((b * c) <= -6e-276) {
tmp = t * ((18.0 * z) * (x * y));
} else if ((b * c) <= 1e-309) {
tmp = t_1;
} else if ((b * c) <= 3.6e-213) {
tmp = t_2;
} else if ((b * c) <= 1.3e+35) {
tmp = t_1;
} else {
tmp = (b * c) + t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((t * a) + (x * i)) t_2 = (k * -27.0) * j tmp = 0 if (b * c) <= -7.2e+43: tmp = (b * c) + (-4.0 * (t * a)) elif (b * c) <= -1.3e-175: tmp = t_1 elif (b * c) <= -6e-276: tmp = t * ((18.0 * z) * (x * y)) elif (b * c) <= 1e-309: tmp = t_1 elif (b * c) <= 3.6e-213: tmp = t_2 elif (b * c) <= 1.3e+35: tmp = t_1 else: tmp = (b * c) + t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) t_2 = Float64(Float64(k * -27.0) * j) tmp = 0.0 if (Float64(b * c) <= -7.2e+43) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif (Float64(b * c) <= -1.3e-175) tmp = t_1; elseif (Float64(b * c) <= -6e-276) tmp = Float64(t * Float64(Float64(18.0 * z) * Float64(x * y))); elseif (Float64(b * c) <= 1e-309) tmp = t_1; elseif (Float64(b * c) <= 3.6e-213) tmp = t_2; elseif (Float64(b * c) <= 1.3e+35) tmp = t_1; else tmp = Float64(Float64(b * c) + t_2); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((t * a) + (x * i));
t_2 = (k * -27.0) * j;
tmp = 0.0;
if ((b * c) <= -7.2e+43)
tmp = (b * c) + (-4.0 * (t * a));
elseif ((b * c) <= -1.3e-175)
tmp = t_1;
elseif ((b * c) <= -6e-276)
tmp = t * ((18.0 * z) * (x * y));
elseif ((b * c) <= 1e-309)
tmp = t_1;
elseif ((b * c) <= 3.6e-213)
tmp = t_2;
elseif ((b * c) <= 1.3e+35)
tmp = t_1;
else
tmp = (b * c) + t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -7.2e+43], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -1.3e-175], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -6e-276], N[(t * N[(N[(18.0 * z), $MachinePrecision] * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1e-309], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 3.6e-213], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 1.3e+35], t$95$1, N[(N[(b * c), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
t_2 := \left(k \cdot -27\right) \cdot j\\
\mathbf{if}\;b \cdot c \leq -7.2 \cdot 10^{+43}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq -1.3 \cdot 10^{-175}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq -6 \cdot 10^{-276}:\\
\;\;\;\;t \cdot \left(\left(18 \cdot z\right) \cdot \left(x \cdot y\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 10^{-309}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 3.6 \cdot 10^{-213}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b \cdot c \leq 1.3 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_2\\
\end{array}
\end{array}
if (*.f64 b c) < -7.2000000000000002e43Initial program 82.1%
Simplified85.4%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
metadata-eval78.9%
cancel-sign-sub-inv78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r*78.9%
fma-neg78.9%
associate-*r*78.9%
*-commutative78.9%
*-commutative78.9%
distribute-lft-neg-in78.9%
metadata-eval78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in j around 0 69.6%
if -7.2000000000000002e43 < (*.f64 b c) < -1.3e-175 or -5.99999999999999976e-276 < (*.f64 b c) < 1.000000000000002e-309 or 3.6000000000000001e-213 < (*.f64 b c) < 1.30000000000000003e35Initial program 88.2%
associate-*l*89.0%
associate--l+89.0%
distribute-rgt-out--90.6%
associate-*l*92.2%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in y around 0 78.7%
Taylor expanded in j around 0 62.7%
Taylor expanded in b around 0 58.8%
cancel-sign-sub-inv58.8%
*-commutative58.8%
metadata-eval58.8%
*-commutative58.8%
distribute-lft-out58.8%
*-commutative58.8%
Simplified58.8%
if -1.3e-175 < (*.f64 b c) < -5.99999999999999976e-276Initial program 85.4%
Simplified99.8%
Taylor expanded in a around 0 92.9%
associate-+r+92.9%
*-commutative92.9%
associate-*r*93.1%
associate-*l*93.2%
associate-*r*93.2%
distribute-rgt-in93.2%
fma-def93.2%
fma-def93.2%
*-commutative93.2%
associate-*r*79.5%
associate-*l*79.5%
*-commutative79.5%
Simplified79.5%
Taylor expanded in t around inf 79.4%
*-commutative79.4%
associate-*r*79.6%
*-commutative79.6%
associate-*l*79.6%
Simplified79.6%
Taylor expanded in y around inf 51.9%
*-commutative51.9%
associate-*r*52.1%
associate-*l*52.2%
associate-*l*52.2%
Simplified52.2%
if 1.000000000000002e-309 < (*.f64 b c) < 3.6000000000000001e-213Initial program 99.4%
Simplified90.1%
Taylor expanded in a around 0 90.1%
associate-+r+90.1%
*-commutative90.1%
associate-*r*90.1%
associate-*l*90.1%
associate-*r*90.1%
distribute-rgt-in90.1%
fma-def90.2%
fma-def90.2%
*-commutative90.2%
associate-*r*90.2%
associate-*l*90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in j around inf 70.9%
*-commutative70.9%
associate-*r*70.9%
*-commutative70.9%
Simplified70.9%
if 1.30000000000000003e35 < (*.f64 b c) Initial program 77.9%
Simplified82.3%
Taylor expanded in b around inf 70.2%
Final simplification63.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (- (* 18.0 (* x (* y z))) (* a 4.0))))
(t_2 (* (* k -27.0) j)))
(if (<= (* b c) -2.35e+46)
(+ (* b c) (* -4.0 (* t a)))
(if (<= (* b c) -7e-174)
(* -4.0 (+ (* t a) (* x i)))
(if (<= (* b c) -4.1e-280)
t_1
(if (<= (* b c) 6.5e-127)
(+ t_2 (* x (* i -4.0)))
(if (<= (* b c) 8e+38) t_1 (+ (* b c) t_2))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_2 = (k * -27.0) * j;
double tmp;
if ((b * c) <= -2.35e+46) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -7e-174) {
tmp = -4.0 * ((t * a) + (x * i));
} else if ((b * c) <= -4.1e-280) {
tmp = t_1;
} else if ((b * c) <= 6.5e-127) {
tmp = t_2 + (x * (i * -4.0));
} else if ((b * c) <= 8e+38) {
tmp = t_1;
} else {
tmp = (b * c) + t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
t_2 = (k * (-27.0d0)) * j
if ((b * c) <= (-2.35d+46)) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if ((b * c) <= (-7d-174)) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else if ((b * c) <= (-4.1d-280)) then
tmp = t_1
else if ((b * c) <= 6.5d-127) then
tmp = t_2 + (x * (i * (-4.0d0)))
else if ((b * c) <= 8d+38) then
tmp = t_1
else
tmp = (b * c) + t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double t_2 = (k * -27.0) * j;
double tmp;
if ((b * c) <= -2.35e+46) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -7e-174) {
tmp = -4.0 * ((t * a) + (x * i));
} else if ((b * c) <= -4.1e-280) {
tmp = t_1;
} else if ((b * c) <= 6.5e-127) {
tmp = t_2 + (x * (i * -4.0));
} else if ((b * c) <= 8e+38) {
tmp = t_1;
} else {
tmp = (b * c) + t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) t_2 = (k * -27.0) * j tmp = 0 if (b * c) <= -2.35e+46: tmp = (b * c) + (-4.0 * (t * a)) elif (b * c) <= -7e-174: tmp = -4.0 * ((t * a) + (x * i)) elif (b * c) <= -4.1e-280: tmp = t_1 elif (b * c) <= 6.5e-127: tmp = t_2 + (x * (i * -4.0)) elif (b * c) <= 8e+38: tmp = t_1 else: tmp = (b * c) + t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) t_2 = Float64(Float64(k * -27.0) * j) tmp = 0.0 if (Float64(b * c) <= -2.35e+46) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif (Float64(b * c) <= -7e-174) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); elseif (Float64(b * c) <= -4.1e-280) tmp = t_1; elseif (Float64(b * c) <= 6.5e-127) tmp = Float64(t_2 + Float64(x * Float64(i * -4.0))); elseif (Float64(b * c) <= 8e+38) tmp = t_1; else tmp = Float64(Float64(b * c) + t_2); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
t_2 = (k * -27.0) * j;
tmp = 0.0;
if ((b * c) <= -2.35e+46)
tmp = (b * c) + (-4.0 * (t * a));
elseif ((b * c) <= -7e-174)
tmp = -4.0 * ((t * a) + (x * i));
elseif ((b * c) <= -4.1e-280)
tmp = t_1;
elseif ((b * c) <= 6.5e-127)
tmp = t_2 + (x * (i * -4.0));
elseif ((b * c) <= 8e+38)
tmp = t_1;
else
tmp = (b * c) + t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2.35e+46], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -7e-174], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -4.1e-280], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 6.5e-127], N[(t$95$2 + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 8e+38], t$95$1, N[(N[(b * c), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
t_2 := \left(k \cdot -27\right) \cdot j\\
\mathbf{if}\;b \cdot c \leq -2.35 \cdot 10^{+46}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq -7 \cdot 10^{-174}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq -4.1 \cdot 10^{-280}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 6.5 \cdot 10^{-127}:\\
\;\;\;\;t_2 + x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 8 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_2\\
\end{array}
\end{array}
if (*.f64 b c) < -2.3499999999999998e46Initial program 82.1%
Simplified85.4%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
metadata-eval78.9%
cancel-sign-sub-inv78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r*78.9%
fma-neg78.9%
associate-*r*78.9%
*-commutative78.9%
*-commutative78.9%
distribute-lft-neg-in78.9%
metadata-eval78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in j around 0 69.6%
if -2.3499999999999998e46 < (*.f64 b c) < -6.99999999999999975e-174Initial program 86.3%
associate-*l*86.3%
associate--l+86.3%
distribute-rgt-out--88.3%
associate-*l*88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in y around 0 78.2%
Taylor expanded in j around 0 62.0%
Taylor expanded in b around 0 57.6%
cancel-sign-sub-inv57.6%
*-commutative57.6%
metadata-eval57.6%
*-commutative57.6%
distribute-lft-out57.6%
*-commutative57.6%
Simplified57.6%
if -6.99999999999999975e-174 < (*.f64 b c) < -4.1000000000000002e-280 or 6.49999999999999998e-127 < (*.f64 b c) < 7.99999999999999982e38Initial program 88.0%
associate-*l*89.9%
associate--l+89.9%
distribute-rgt-out--95.9%
associate-*l*95.9%
associate-*l*95.9%
Simplified95.9%
Taylor expanded in t around inf 76.8%
Taylor expanded in t around inf 61.1%
if -4.1000000000000002e-280 < (*.f64 b c) < 6.49999999999999998e-127Initial program 92.1%
Simplified94.0%
Taylor expanded in i around inf 61.9%
associate-*r*61.9%
*-commutative61.9%
Simplified61.9%
if 7.99999999999999982e38 < (*.f64 b c) Initial program 77.4%
Simplified81.9%
Taylor expanded in b around inf 71.7%
Final simplification64.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* t a)))
(t_2 (* (* k -27.0) j))
(t_3 (* -4.0 (+ (* t a) (* x i)))))
(if (<= (* b c) -3.05e+45)
(+ (* b c) t_1)
(if (<= (* b c) -2.8e-174)
t_3
(if (<= (* b c) -2.5e-260)
(+ t_2 t_1)
(if (<= (* b c) 7.6e-205)
(+ (* -27.0 (* k j)) (* -4.0 (* x i)))
(if (<= (* b c) 8.5e+32) t_3 (+ (* b c) t_2))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (t * a);
double t_2 = (k * -27.0) * j;
double t_3 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -3.05e+45) {
tmp = (b * c) + t_1;
} else if ((b * c) <= -2.8e-174) {
tmp = t_3;
} else if ((b * c) <= -2.5e-260) {
tmp = t_2 + t_1;
} else if ((b * c) <= 7.6e-205) {
tmp = (-27.0 * (k * j)) + (-4.0 * (x * i));
} else if ((b * c) <= 8.5e+32) {
tmp = t_3;
} else {
tmp = (b * c) + t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (-4.0d0) * (t * a)
t_2 = (k * (-27.0d0)) * j
t_3 = (-4.0d0) * ((t * a) + (x * i))
if ((b * c) <= (-3.05d+45)) then
tmp = (b * c) + t_1
else if ((b * c) <= (-2.8d-174)) then
tmp = t_3
else if ((b * c) <= (-2.5d-260)) then
tmp = t_2 + t_1
else if ((b * c) <= 7.6d-205) then
tmp = ((-27.0d0) * (k * j)) + ((-4.0d0) * (x * i))
else if ((b * c) <= 8.5d+32) then
tmp = t_3
else
tmp = (b * c) + t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (t * a);
double t_2 = (k * -27.0) * j;
double t_3 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -3.05e+45) {
tmp = (b * c) + t_1;
} else if ((b * c) <= -2.8e-174) {
tmp = t_3;
} else if ((b * c) <= -2.5e-260) {
tmp = t_2 + t_1;
} else if ((b * c) <= 7.6e-205) {
tmp = (-27.0 * (k * j)) + (-4.0 * (x * i));
} else if ((b * c) <= 8.5e+32) {
tmp = t_3;
} else {
tmp = (b * c) + t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (t * a) t_2 = (k * -27.0) * j t_3 = -4.0 * ((t * a) + (x * i)) tmp = 0 if (b * c) <= -3.05e+45: tmp = (b * c) + t_1 elif (b * c) <= -2.8e-174: tmp = t_3 elif (b * c) <= -2.5e-260: tmp = t_2 + t_1 elif (b * c) <= 7.6e-205: tmp = (-27.0 * (k * j)) + (-4.0 * (x * i)) elif (b * c) <= 8.5e+32: tmp = t_3 else: tmp = (b * c) + t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(t * a)) t_2 = Float64(Float64(k * -27.0) * j) t_3 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) tmp = 0.0 if (Float64(b * c) <= -3.05e+45) tmp = Float64(Float64(b * c) + t_1); elseif (Float64(b * c) <= -2.8e-174) tmp = t_3; elseif (Float64(b * c) <= -2.5e-260) tmp = Float64(t_2 + t_1); elseif (Float64(b * c) <= 7.6e-205) tmp = Float64(Float64(-27.0 * Float64(k * j)) + Float64(-4.0 * Float64(x * i))); elseif (Float64(b * c) <= 8.5e+32) tmp = t_3; else tmp = Float64(Float64(b * c) + t_2); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * (t * a);
t_2 = (k * -27.0) * j;
t_3 = -4.0 * ((t * a) + (x * i));
tmp = 0.0;
if ((b * c) <= -3.05e+45)
tmp = (b * c) + t_1;
elseif ((b * c) <= -2.8e-174)
tmp = t_3;
elseif ((b * c) <= -2.5e-260)
tmp = t_2 + t_1;
elseif ((b * c) <= 7.6e-205)
tmp = (-27.0 * (k * j)) + (-4.0 * (x * i));
elseif ((b * c) <= 8.5e+32)
tmp = t_3;
else
tmp = (b * c) + t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -3.05e+45], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2.8e-174], t$95$3, If[LessEqual[N[(b * c), $MachinePrecision], -2.5e-260], N[(t$95$2 + t$95$1), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 7.6e-205], N[(N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 8.5e+32], t$95$3, N[(N[(b * c), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
t_2 := \left(k \cdot -27\right) \cdot j\\
t_3 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{if}\;b \cdot c \leq -3.05 \cdot 10^{+45}:\\
\;\;\;\;b \cdot c + t_1\\
\mathbf{elif}\;b \cdot c \leq -2.8 \cdot 10^{-174}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \cdot c \leq -2.5 \cdot 10^{-260}:\\
\;\;\;\;t_2 + t_1\\
\mathbf{elif}\;b \cdot c \leq 7.6 \cdot 10^{-205}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 8.5 \cdot 10^{+32}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_2\\
\end{array}
\end{array}
if (*.f64 b c) < -3.05e45Initial program 82.1%
Simplified85.4%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
metadata-eval78.9%
cancel-sign-sub-inv78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r*78.9%
fma-neg78.9%
associate-*r*78.9%
*-commutative78.9%
*-commutative78.9%
distribute-lft-neg-in78.9%
metadata-eval78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in j around 0 69.6%
if -3.05e45 < (*.f64 b c) < -2.79999999999999999e-174 or 7.59999999999999983e-205 < (*.f64 b c) < 8.4999999999999998e32Initial program 88.7%
associate-*l*89.7%
associate--l+89.7%
distribute-rgt-out--91.8%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around 0 78.5%
Taylor expanded in j around 0 63.3%
Taylor expanded in b around 0 58.2%
cancel-sign-sub-inv58.2%
*-commutative58.2%
metadata-eval58.2%
*-commutative58.2%
distribute-lft-out58.2%
*-commutative58.2%
Simplified58.2%
if -2.79999999999999999e-174 < (*.f64 b c) < -2.5000000000000002e-260Initial program 99.6%
Simplified99.7%
Taylor expanded in a around inf 60.4%
*-commutative60.4%
Simplified60.4%
if -2.5000000000000002e-260 < (*.f64 b c) < 7.59999999999999983e-205Initial program 85.6%
Simplified92.8%
Taylor expanded in i around inf 62.5%
associate-*r*62.5%
*-commutative62.5%
Simplified62.5%
Taylor expanded in x around 0 62.5%
if 8.4999999999999998e32 < (*.f64 b c) Initial program 77.9%
Simplified82.3%
Taylor expanded in b around inf 70.2%
Final simplification63.8%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* t a)))
(t_2 (* (* k -27.0) j))
(t_3 (* -4.0 (+ (* t a) (* x i)))))
(if (<= (* b c) -2.65e+46)
(+ (* b c) t_1)
(if (<= (* b c) -6.8e-174)
t_3
(if (<= (* b c) -1.45e-265)
(+ t_2 t_1)
(if (<= (* b c) 1.1e-204)
(+ t_2 (* x (* i -4.0)))
(if (<= (* b c) 2.1e+34) t_3 (+ (* b c) t_2))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (t * a);
double t_2 = (k * -27.0) * j;
double t_3 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -2.65e+46) {
tmp = (b * c) + t_1;
} else if ((b * c) <= -6.8e-174) {
tmp = t_3;
} else if ((b * c) <= -1.45e-265) {
tmp = t_2 + t_1;
} else if ((b * c) <= 1.1e-204) {
tmp = t_2 + (x * (i * -4.0));
} else if ((b * c) <= 2.1e+34) {
tmp = t_3;
} else {
tmp = (b * c) + t_2;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (-4.0d0) * (t * a)
t_2 = (k * (-27.0d0)) * j
t_3 = (-4.0d0) * ((t * a) + (x * i))
if ((b * c) <= (-2.65d+46)) then
tmp = (b * c) + t_1
else if ((b * c) <= (-6.8d-174)) then
tmp = t_3
else if ((b * c) <= (-1.45d-265)) then
tmp = t_2 + t_1
else if ((b * c) <= 1.1d-204) then
tmp = t_2 + (x * (i * (-4.0d0)))
else if ((b * c) <= 2.1d+34) then
tmp = t_3
else
tmp = (b * c) + t_2
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (t * a);
double t_2 = (k * -27.0) * j;
double t_3 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -2.65e+46) {
tmp = (b * c) + t_1;
} else if ((b * c) <= -6.8e-174) {
tmp = t_3;
} else if ((b * c) <= -1.45e-265) {
tmp = t_2 + t_1;
} else if ((b * c) <= 1.1e-204) {
tmp = t_2 + (x * (i * -4.0));
} else if ((b * c) <= 2.1e+34) {
tmp = t_3;
} else {
tmp = (b * c) + t_2;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (t * a) t_2 = (k * -27.0) * j t_3 = -4.0 * ((t * a) + (x * i)) tmp = 0 if (b * c) <= -2.65e+46: tmp = (b * c) + t_1 elif (b * c) <= -6.8e-174: tmp = t_3 elif (b * c) <= -1.45e-265: tmp = t_2 + t_1 elif (b * c) <= 1.1e-204: tmp = t_2 + (x * (i * -4.0)) elif (b * c) <= 2.1e+34: tmp = t_3 else: tmp = (b * c) + t_2 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(t * a)) t_2 = Float64(Float64(k * -27.0) * j) t_3 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) tmp = 0.0 if (Float64(b * c) <= -2.65e+46) tmp = Float64(Float64(b * c) + t_1); elseif (Float64(b * c) <= -6.8e-174) tmp = t_3; elseif (Float64(b * c) <= -1.45e-265) tmp = Float64(t_2 + t_1); elseif (Float64(b * c) <= 1.1e-204) tmp = Float64(t_2 + Float64(x * Float64(i * -4.0))); elseif (Float64(b * c) <= 2.1e+34) tmp = t_3; else tmp = Float64(Float64(b * c) + t_2); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * (t * a);
t_2 = (k * -27.0) * j;
t_3 = -4.0 * ((t * a) + (x * i));
tmp = 0.0;
if ((b * c) <= -2.65e+46)
tmp = (b * c) + t_1;
elseif ((b * c) <= -6.8e-174)
tmp = t_3;
elseif ((b * c) <= -1.45e-265)
tmp = t_2 + t_1;
elseif ((b * c) <= 1.1e-204)
tmp = t_2 + (x * (i * -4.0));
elseif ((b * c) <= 2.1e+34)
tmp = t_3;
else
tmp = (b * c) + t_2;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$3 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2.65e+46], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -6.8e-174], t$95$3, If[LessEqual[N[(b * c), $MachinePrecision], -1.45e-265], N[(t$95$2 + t$95$1), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1.1e-204], N[(t$95$2 + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2.1e+34], t$95$3, N[(N[(b * c), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a\right)\\
t_2 := \left(k \cdot -27\right) \cdot j\\
t_3 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{if}\;b \cdot c \leq -2.65 \cdot 10^{+46}:\\
\;\;\;\;b \cdot c + t_1\\
\mathbf{elif}\;b \cdot c \leq -6.8 \cdot 10^{-174}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;b \cdot c \leq -1.45 \cdot 10^{-265}:\\
\;\;\;\;t_2 + t_1\\
\mathbf{elif}\;b \cdot c \leq 1.1 \cdot 10^{-204}:\\
\;\;\;\;t_2 + x \cdot \left(i \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 2.1 \cdot 10^{+34}:\\
\;\;\;\;t_3\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_2\\
\end{array}
\end{array}
if (*.f64 b c) < -2.64999999999999989e46Initial program 82.1%
Simplified85.4%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
metadata-eval78.9%
cancel-sign-sub-inv78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r*78.9%
fma-neg78.9%
associate-*r*78.9%
*-commutative78.9%
*-commutative78.9%
distribute-lft-neg-in78.9%
metadata-eval78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in j around 0 69.6%
if -2.64999999999999989e46 < (*.f64 b c) < -6.8000000000000004e-174 or 1.0999999999999999e-204 < (*.f64 b c) < 2.10000000000000017e34Initial program 88.7%
associate-*l*89.7%
associate--l+89.7%
distribute-rgt-out--91.8%
associate-*l*91.8%
associate-*l*91.8%
Simplified91.8%
Taylor expanded in y around 0 78.5%
Taylor expanded in j around 0 63.3%
Taylor expanded in b around 0 58.2%
cancel-sign-sub-inv58.2%
*-commutative58.2%
metadata-eval58.2%
*-commutative58.2%
distribute-lft-out58.2%
*-commutative58.2%
Simplified58.2%
if -6.8000000000000004e-174 < (*.f64 b c) < -1.44999999999999987e-265Initial program 99.6%
Simplified99.7%
Taylor expanded in a around inf 60.4%
*-commutative60.4%
Simplified60.4%
if -1.44999999999999987e-265 < (*.f64 b c) < 1.0999999999999999e-204Initial program 85.6%
Simplified92.8%
Taylor expanded in i around inf 62.5%
associate-*r*62.5%
*-commutative62.5%
Simplified62.5%
if 2.10000000000000017e34 < (*.f64 b c) Initial program 77.9%
Simplified82.3%
Taylor expanded in b around inf 70.2%
Final simplification63.8%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* k -27.0) j)) (t_2 (* x (* y z))))
(if (<= (* b c) -4.1e+43)
(+ (* b c) (* -4.0 (* t a)))
(if (<= (* b c) -3.2e-174)
(* -4.0 (+ (* t a) (* x i)))
(if (<= (* b c) 3.8e-211)
(+ t_1 (* 18.0 (* t t_2)))
(if (<= (* b c) 8e+38)
(* t (- (* 18.0 t_2) (* a 4.0)))
(+ (* b c) t_1)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * -27.0) * j;
double t_2 = x * (y * z);
double tmp;
if ((b * c) <= -4.1e+43) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -3.2e-174) {
tmp = -4.0 * ((t * a) + (x * i));
} else if ((b * c) <= 3.8e-211) {
tmp = t_1 + (18.0 * (t * t_2));
} else if ((b * c) <= 8e+38) {
tmp = t * ((18.0 * t_2) - (a * 4.0));
} else {
tmp = (b * c) + t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (k * (-27.0d0)) * j
t_2 = x * (y * z)
if ((b * c) <= (-4.1d+43)) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if ((b * c) <= (-3.2d-174)) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else if ((b * c) <= 3.8d-211) then
tmp = t_1 + (18.0d0 * (t * t_2))
else if ((b * c) <= 8d+38) then
tmp = t * ((18.0d0 * t_2) - (a * 4.0d0))
else
tmp = (b * c) + t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * -27.0) * j;
double t_2 = x * (y * z);
double tmp;
if ((b * c) <= -4.1e+43) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -3.2e-174) {
tmp = -4.0 * ((t * a) + (x * i));
} else if ((b * c) <= 3.8e-211) {
tmp = t_1 + (18.0 * (t * t_2));
} else if ((b * c) <= 8e+38) {
tmp = t * ((18.0 * t_2) - (a * 4.0));
} else {
tmp = (b * c) + t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (k * -27.0) * j t_2 = x * (y * z) tmp = 0 if (b * c) <= -4.1e+43: tmp = (b * c) + (-4.0 * (t * a)) elif (b * c) <= -3.2e-174: tmp = -4.0 * ((t * a) + (x * i)) elif (b * c) <= 3.8e-211: tmp = t_1 + (18.0 * (t * t_2)) elif (b * c) <= 8e+38: tmp = t * ((18.0 * t_2) - (a * 4.0)) else: tmp = (b * c) + t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(k * -27.0) * j) t_2 = Float64(x * Float64(y * z)) tmp = 0.0 if (Float64(b * c) <= -4.1e+43) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif (Float64(b * c) <= -3.2e-174) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); elseif (Float64(b * c) <= 3.8e-211) tmp = Float64(t_1 + Float64(18.0 * Float64(t * t_2))); elseif (Float64(b * c) <= 8e+38) tmp = Float64(t * Float64(Float64(18.0 * t_2) - Float64(a * 4.0))); else tmp = Float64(Float64(b * c) + t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (k * -27.0) * j;
t_2 = x * (y * z);
tmp = 0.0;
if ((b * c) <= -4.1e+43)
tmp = (b * c) + (-4.0 * (t * a));
elseif ((b * c) <= -3.2e-174)
tmp = -4.0 * ((t * a) + (x * i));
elseif ((b * c) <= 3.8e-211)
tmp = t_1 + (18.0 * (t * t_2));
elseif ((b * c) <= 8e+38)
tmp = t * ((18.0 * t_2) - (a * 4.0));
else
tmp = (b * c) + t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -4.1e+43], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -3.2e-174], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.8e-211], N[(t$95$1 + N[(18.0 * N[(t * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 8e+38], N[(t * N[(N[(18.0 * t$95$2), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(k \cdot -27\right) \cdot j\\
t_2 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;b \cdot c \leq -4.1 \cdot 10^{+43}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq -3.2 \cdot 10^{-174}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 3.8 \cdot 10^{-211}:\\
\;\;\;\;t_1 + 18 \cdot \left(t \cdot t_2\right)\\
\mathbf{elif}\;b \cdot c \leq 8 \cdot 10^{+38}:\\
\;\;\;\;t \cdot \left(18 \cdot t_2 - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_1\\
\end{array}
\end{array}
if (*.f64 b c) < -4.1e43Initial program 82.1%
Simplified85.4%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
metadata-eval78.9%
cancel-sign-sub-inv78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r*78.9%
fma-neg78.9%
associate-*r*78.9%
*-commutative78.9%
*-commutative78.9%
distribute-lft-neg-in78.9%
metadata-eval78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in j around 0 69.6%
if -4.1e43 < (*.f64 b c) < -3.2e-174Initial program 86.3%
associate-*l*86.3%
associate--l+86.3%
distribute-rgt-out--88.3%
associate-*l*88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in y around 0 78.2%
Taylor expanded in j around 0 62.0%
Taylor expanded in b around 0 57.6%
cancel-sign-sub-inv57.6%
*-commutative57.6%
metadata-eval57.6%
*-commutative57.6%
distribute-lft-out57.6%
*-commutative57.6%
Simplified57.6%
if -3.2e-174 < (*.f64 b c) < 3.80000000000000012e-211Initial program 88.7%
Simplified94.4%
Taylor expanded in y around inf 64.3%
if 3.80000000000000012e-211 < (*.f64 b c) < 7.99999999999999982e38Initial program 91.5%
associate-*l*93.6%
associate--l+93.6%
distribute-rgt-out--95.7%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in t around inf 71.2%
Taylor expanded in t around inf 58.9%
if 7.99999999999999982e38 < (*.f64 b c) Initial program 77.4%
Simplified81.9%
Taylor expanded in b around inf 71.7%
Final simplification64.5%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* k -27.0) j)))
(if (<= (* b c) -2.35e+41)
(+ (* b c) (* -4.0 (* t a)))
(if (<= (* b c) -6.5e-174)
(* -4.0 (+ (* t a) (* x i)))
(if (<= (* b c) 3.8e-211)
(+ t_1 (* x (* (* y t) (* 18.0 z))))
(if (<= (* b c) 7.8e+38)
(* t (- (* 18.0 (* x (* y z))) (* a 4.0)))
(+ (* b c) t_1)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * -27.0) * j;
double tmp;
if ((b * c) <= -2.35e+41) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -6.5e-174) {
tmp = -4.0 * ((t * a) + (x * i));
} else if ((b * c) <= 3.8e-211) {
tmp = t_1 + (x * ((y * t) * (18.0 * z)));
} else if ((b * c) <= 7.8e+38) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = (b * c) + t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (k * (-27.0d0)) * j
if ((b * c) <= (-2.35d+41)) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if ((b * c) <= (-6.5d-174)) then
tmp = (-4.0d0) * ((t * a) + (x * i))
else if ((b * c) <= 3.8d-211) then
tmp = t_1 + (x * ((y * t) * (18.0d0 * z)))
else if ((b * c) <= 7.8d+38) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else
tmp = (b * c) + t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (k * -27.0) * j;
double tmp;
if ((b * c) <= -2.35e+41) {
tmp = (b * c) + (-4.0 * (t * a));
} else if ((b * c) <= -6.5e-174) {
tmp = -4.0 * ((t * a) + (x * i));
} else if ((b * c) <= 3.8e-211) {
tmp = t_1 + (x * ((y * t) * (18.0 * z)));
} else if ((b * c) <= 7.8e+38) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = (b * c) + t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (k * -27.0) * j tmp = 0 if (b * c) <= -2.35e+41: tmp = (b * c) + (-4.0 * (t * a)) elif (b * c) <= -6.5e-174: tmp = -4.0 * ((t * a) + (x * i)) elif (b * c) <= 3.8e-211: tmp = t_1 + (x * ((y * t) * (18.0 * z))) elif (b * c) <= 7.8e+38: tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) else: tmp = (b * c) + t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(k * -27.0) * j) tmp = 0.0 if (Float64(b * c) <= -2.35e+41) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif (Float64(b * c) <= -6.5e-174) tmp = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))); elseif (Float64(b * c) <= 3.8e-211) tmp = Float64(t_1 + Float64(x * Float64(Float64(y * t) * Float64(18.0 * z)))); elseif (Float64(b * c) <= 7.8e+38) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); else tmp = Float64(Float64(b * c) + t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (k * -27.0) * j;
tmp = 0.0;
if ((b * c) <= -2.35e+41)
tmp = (b * c) + (-4.0 * (t * a));
elseif ((b * c) <= -6.5e-174)
tmp = -4.0 * ((t * a) + (x * i));
elseif ((b * c) <= 3.8e-211)
tmp = t_1 + (x * ((y * t) * (18.0 * z)));
elseif ((b * c) <= 7.8e+38)
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
else
tmp = (b * c) + t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2.35e+41], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -6.5e-174], N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3.8e-211], N[(t$95$1 + N[(x * N[(N[(y * t), $MachinePrecision] * N[(18.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 7.8e+38], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := \left(k \cdot -27\right) \cdot j\\
\mathbf{if}\;b \cdot c \leq -2.35 \cdot 10^{+41}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq -6.5 \cdot 10^{-174}:\\
\;\;\;\;-4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{elif}\;b \cdot c \leq 3.8 \cdot 10^{-211}:\\
\;\;\;\;t_1 + x \cdot \left(\left(y \cdot t\right) \cdot \left(18 \cdot z\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 7.8 \cdot 10^{+38}:\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + t_1\\
\end{array}
\end{array}
if (*.f64 b c) < -2.35e41Initial program 82.1%
Simplified85.4%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
metadata-eval78.9%
cancel-sign-sub-inv78.9%
*-commutative78.9%
*-commutative78.9%
associate-*r*78.9%
fma-neg78.9%
associate-*r*78.9%
*-commutative78.9%
*-commutative78.9%
distribute-lft-neg-in78.9%
metadata-eval78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in j around 0 69.6%
if -2.35e41 < (*.f64 b c) < -6.50000000000000009e-174Initial program 86.3%
associate-*l*86.3%
associate--l+86.3%
distribute-rgt-out--88.3%
associate-*l*88.3%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in y around 0 78.2%
Taylor expanded in j around 0 62.0%
Taylor expanded in b around 0 57.6%
cancel-sign-sub-inv57.6%
*-commutative57.6%
metadata-eval57.6%
*-commutative57.6%
distribute-lft-out57.6%
*-commutative57.6%
Simplified57.6%
if -6.50000000000000009e-174 < (*.f64 b c) < 3.80000000000000012e-211Initial program 88.7%
Simplified94.4%
Taylor expanded in y around inf 64.3%
*-commutative64.3%
*-commutative64.3%
associate-*l*66.1%
*-commutative66.1%
associate-*r*66.1%
associate-*r*62.5%
associate-*l*62.5%
*-commutative62.5%
Simplified62.5%
if 3.80000000000000012e-211 < (*.f64 b c) < 7.80000000000000047e38Initial program 91.5%
associate-*l*93.6%
associate--l+93.6%
distribute-rgt-out--95.7%
associate-*l*95.7%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in t around inf 71.2%
Taylor expanded in t around inf 58.9%
if 7.80000000000000047e38 < (*.f64 b c) Initial program 77.4%
Simplified81.9%
Taylor expanded in b around inf 71.7%
Final simplification64.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (+ (* t a) (* x i)))))
(if (<= (* b c) -5.2e+255)
(* b c)
(if (<= (* b c) 3e-309)
t_1
(if (<= (* b c) 6.6e-213)
(* (* k -27.0) j)
(if (<= (* b c) 5e+41)
t_1
(if (<= (* b c) 1.32e+227) (* k (* -27.0 j)) (* b c))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -5.2e+255) {
tmp = b * c;
} else if ((b * c) <= 3e-309) {
tmp = t_1;
} else if ((b * c) <= 6.6e-213) {
tmp = (k * -27.0) * j;
} else if ((b * c) <= 5e+41) {
tmp = t_1;
} else if ((b * c) <= 1.32e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-4.0d0) * ((t * a) + (x * i))
if ((b * c) <= (-5.2d+255)) then
tmp = b * c
else if ((b * c) <= 3d-309) then
tmp = t_1
else if ((b * c) <= 6.6d-213) then
tmp = (k * (-27.0d0)) * j
else if ((b * c) <= 5d+41) then
tmp = t_1
else if ((b * c) <= 1.32d+227) then
tmp = k * ((-27.0d0) * j)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * ((t * a) + (x * i));
double tmp;
if ((b * c) <= -5.2e+255) {
tmp = b * c;
} else if ((b * c) <= 3e-309) {
tmp = t_1;
} else if ((b * c) <= 6.6e-213) {
tmp = (k * -27.0) * j;
} else if ((b * c) <= 5e+41) {
tmp = t_1;
} else if ((b * c) <= 1.32e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * ((t * a) + (x * i)) tmp = 0 if (b * c) <= -5.2e+255: tmp = b * c elif (b * c) <= 3e-309: tmp = t_1 elif (b * c) <= 6.6e-213: tmp = (k * -27.0) * j elif (b * c) <= 5e+41: tmp = t_1 elif (b * c) <= 1.32e+227: tmp = k * (-27.0 * j) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(Float64(t * a) + Float64(x * i))) tmp = 0.0 if (Float64(b * c) <= -5.2e+255) tmp = Float64(b * c); elseif (Float64(b * c) <= 3e-309) tmp = t_1; elseif (Float64(b * c) <= 6.6e-213) tmp = Float64(Float64(k * -27.0) * j); elseif (Float64(b * c) <= 5e+41) tmp = t_1; elseif (Float64(b * c) <= 1.32e+227) tmp = Float64(k * Float64(-27.0 * j)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -4.0 * ((t * a) + (x * i));
tmp = 0.0;
if ((b * c) <= -5.2e+255)
tmp = b * c;
elseif ((b * c) <= 3e-309)
tmp = t_1;
elseif ((b * c) <= 6.6e-213)
tmp = (k * -27.0) * j;
elseif ((b * c) <= 5e+41)
tmp = t_1;
elseif ((b * c) <= 1.32e+227)
tmp = k * (-27.0 * j);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(N[(t * a), $MachinePrecision] + N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -5.2e+255], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3e-309], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 6.6e-213], N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5e+41], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 1.32e+227], N[(k * N[(-27.0 * j), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(t \cdot a + x \cdot i\right)\\
\mathbf{if}\;b \cdot c \leq -5.2 \cdot 10^{+255}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 3 \cdot 10^{-309}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 6.6 \cdot 10^{-213}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+41}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 1.32 \cdot 10^{+227}:\\
\;\;\;\;k \cdot \left(-27 \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -5.20000000000000019e255 or 1.31999999999999991e227 < (*.f64 b c) Initial program 75.7%
Simplified79.7%
Taylor expanded in t around 0 77.7%
*-commutative77.7%
*-commutative77.7%
+-commutative77.7%
fma-def77.7%
associate-*l*77.7%
*-commutative77.7%
Simplified77.7%
Taylor expanded in b around inf 78.1%
if -5.20000000000000019e255 < (*.f64 b c) < 3.000000000000001e-309 or 6.60000000000000062e-213 < (*.f64 b c) < 5.00000000000000022e41Initial program 87.1%
associate-*l*87.7%
associate--l+87.7%
distribute-rgt-out--91.6%
associate-*l*91.6%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in y around 0 79.4%
Taylor expanded in j around 0 62.6%
Taylor expanded in b around 0 51.2%
cancel-sign-sub-inv51.2%
*-commutative51.2%
metadata-eval51.2%
*-commutative51.2%
distribute-lft-out51.2%
*-commutative51.2%
Simplified51.2%
if 3.000000000000001e-309 < (*.f64 b c) < 6.60000000000000062e-213Initial program 99.4%
Simplified90.1%
Taylor expanded in a around 0 90.1%
associate-+r+90.1%
*-commutative90.1%
associate-*r*90.1%
associate-*l*90.1%
associate-*r*90.1%
distribute-rgt-in90.1%
fma-def90.2%
fma-def90.2%
*-commutative90.2%
associate-*r*90.2%
associate-*l*90.2%
*-commutative90.2%
Simplified90.2%
Taylor expanded in j around inf 70.9%
*-commutative70.9%
associate-*r*70.9%
*-commutative70.9%
Simplified70.9%
if 5.00000000000000022e41 < (*.f64 b c) < 1.31999999999999991e227Initial program 84.4%
Simplified89.6%
Taylor expanded in j around inf 62.6%
associate-*r*62.6%
*-commutative62.6%
*-commutative62.6%
*-commutative62.6%
Simplified62.6%
Final simplification58.0%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* j (* k 27.0))))
(if (<= z -9e+113)
(+ (* (* k -27.0) j) (* 18.0 (* t (* x (* y z)))))
(if (<= z 9.2e+149)
(- (- (+ (* b c) (* -4.0 (* t a))) (* 4.0 (* x i))) t_1)
(- (* x (- (* 18.0 (* t (* y z))) (* 4.0 i))) t_1)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if (z <= -9e+113) {
tmp = ((k * -27.0) * j) + (18.0 * (t * (x * (y * z))));
} else if (z <= 9.2e+149) {
tmp = (((b * c) + (-4.0 * (t * a))) - (4.0 * (x * i))) - t_1;
} else {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = j * (k * 27.0d0)
if (z <= (-9d+113)) then
tmp = ((k * (-27.0d0)) * j) + (18.0d0 * (t * (x * (y * z))))
else if (z <= 9.2d+149) then
tmp = (((b * c) + ((-4.0d0) * (t * a))) - (4.0d0 * (x * i))) - t_1
else
tmp = (x * ((18.0d0 * (t * (y * z))) - (4.0d0 * i))) - t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = j * (k * 27.0);
double tmp;
if (z <= -9e+113) {
tmp = ((k * -27.0) * j) + (18.0 * (t * (x * (y * z))));
} else if (z <= 9.2e+149) {
tmp = (((b * c) + (-4.0 * (t * a))) - (4.0 * (x * i))) - t_1;
} else {
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * 27.0) tmp = 0 if z <= -9e+113: tmp = ((k * -27.0) * j) + (18.0 * (t * (x * (y * z)))) elif z <= 9.2e+149: tmp = (((b * c) + (-4.0 * (t * a))) - (4.0 * (x * i))) - t_1 else: tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * 27.0)) tmp = 0.0 if (z <= -9e+113) tmp = Float64(Float64(Float64(k * -27.0) * j) + Float64(18.0 * Float64(t * Float64(x * Float64(y * z))))); elseif (z <= 9.2e+149) tmp = Float64(Float64(Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))) - Float64(4.0 * Float64(x * i))) - t_1); else tmp = Float64(Float64(x * Float64(Float64(18.0 * Float64(t * Float64(y * z))) - Float64(4.0 * i))) - t_1); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * 27.0);
tmp = 0.0;
if (z <= -9e+113)
tmp = ((k * -27.0) * j) + (18.0 * (t * (x * (y * z))));
elseif (z <= 9.2e+149)
tmp = (((b * c) + (-4.0 * (t * a))) - (4.0 * (x * i))) - t_1;
else
tmp = (x * ((18.0 * (t * (y * z))) - (4.0 * i))) - t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -9e+113], N[(N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision] + N[(18.0 * N[(t * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+149], N[(N[(N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[(x * N[(N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot 27\right)\\
\mathbf{if}\;z \leq -9 \cdot 10^{+113}:\\
\;\;\;\;\left(k \cdot -27\right) \cdot j + 18 \cdot \left(t \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+149}:\\
\;\;\;\;\left(\left(b \cdot c + -4 \cdot \left(t \cdot a\right)\right) - 4 \cdot \left(x \cdot i\right)\right) - t_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(18 \cdot \left(t \cdot \left(y \cdot z\right)\right) - 4 \cdot i\right) - t_1\\
\end{array}
\end{array}
if z < -9.0000000000000001e113Initial program 79.5%
Simplified77.2%
Taylor expanded in y around inf 49.8%
if -9.0000000000000001e113 < z < 9.1999999999999993e149Initial program 87.0%
associate-*l*87.5%
associate--l+87.5%
distribute-rgt-out--88.1%
associate-*l*90.9%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in y around 0 87.0%
if 9.1999999999999993e149 < z Initial program 83.2%
associate-*l*83.2%
associate--l+83.2%
distribute-rgt-out--92.7%
associate-*l*88.2%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in x around inf 83.8%
Final simplification80.8%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (- (* 18.0 (* x (* y z))) (* a 4.0)))))
(if (<= t -7.8e+121)
t_1
(if (<= t -2.5e+93)
(- (- (* b c) (* 4.0 (* t a))) (* k (* j 27.0)))
(if (or (<= t -7.2e+46) (not (<= t 2.7e+24)))
t_1
(- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* k j)))))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -7.8e+121) {
tmp = t_1;
} else if (t <= -2.5e+93) {
tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0));
} else if ((t <= -7.2e+46) || !(t <= 2.7e+24)) {
tmp = t_1;
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
if (t <= (-7.8d+121)) then
tmp = t_1
else if (t <= (-2.5d+93)) then
tmp = ((b * c) - (4.0d0 * (t * a))) - (k * (j * 27.0d0))
else if ((t <= (-7.2d+46)) .or. (.not. (t <= 2.7d+24))) then
tmp = t_1
else
tmp = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (k * j)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
double tmp;
if (t <= -7.8e+121) {
tmp = t_1;
} else if (t <= -2.5e+93) {
tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0));
} else if ((t <= -7.2e+46) || !(t <= 2.7e+24)) {
tmp = t_1;
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0)) tmp = 0 if t <= -7.8e+121: tmp = t_1 elif t <= -2.5e+93: tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0)) elif (t <= -7.2e+46) or not (t <= 2.7e+24): tmp = t_1 else: tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) tmp = 0.0 if (t <= -7.8e+121) tmp = t_1; elseif (t <= -2.5e+93) tmp = Float64(Float64(Float64(b * c) - Float64(4.0 * Float64(t * a))) - Float64(k * Float64(j * 27.0))); elseif ((t <= -7.2e+46) || !(t <= 2.7e+24)) tmp = t_1; else tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(k * j)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = t * ((18.0 * (x * (y * z))) - (a * 4.0));
tmp = 0.0;
if (t <= -7.8e+121)
tmp = t_1;
elseif (t <= -2.5e+93)
tmp = ((b * c) - (4.0 * (t * a))) - (k * (j * 27.0));
elseif ((t <= -7.2e+46) || ~((t <= 2.7e+24)))
tmp = t_1;
else
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.8e+121], t$95$1, If[LessEqual[t, -2.5e+93], N[(N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(k * N[(j * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t, -7.2e+46], N[Not[LessEqual[t, 2.7e+24]], $MachinePrecision]], t$95$1, N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{if}\;t \leq -7.8 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -2.5 \cdot 10^{+93}:\\
\;\;\;\;\left(b \cdot c - 4 \cdot \left(t \cdot a\right)\right) - k \cdot \left(j \cdot 27\right)\\
\mathbf{elif}\;t \leq -7.2 \cdot 10^{+46} \lor \neg \left(t \leq 2.7 \cdot 10^{+24}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(k \cdot j\right)\right)\\
\end{array}
\end{array}
if t < -7.79999999999999967e121 or -2.5000000000000001e93 < t < -7.1999999999999997e46 or 2.7e24 < t Initial program 78.9%
associate-*l*79.9%
associate--l+79.9%
distribute-rgt-out--86.9%
associate-*l*85.0%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in t around inf 78.5%
Taylor expanded in t around inf 73.6%
if -7.79999999999999967e121 < t < -2.5000000000000001e93Initial program 99.8%
Taylor expanded in x around 0 89.3%
if -7.1999999999999997e46 < t < 2.7e24Initial program 88.6%
associate-*l*88.6%
associate--l+88.6%
distribute-rgt-out--88.6%
associate-*l*89.9%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in t around 0 82.4%
Final simplification79.2%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= t -3.5e+45) (not (<= t 5.2e-28))) (- (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) (* j (* k 27.0))) (- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* k j))))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -3.5e+45) || !(t <= 5.2e-28)) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - (j * (k * 27.0));
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((t <= (-3.5d+45)) .or. (.not. (t <= 5.2d-28))) then
tmp = (t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))) - (j * (k * 27.0d0))
else
tmp = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (k * j)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -3.5e+45) || !(t <= 5.2e-28)) {
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - (j * (k * 27.0));
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -3.5e+45) or not (t <= 5.2e-28): tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - (j * (k * 27.0)) else: tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -3.5e+45) || !(t <= 5.2e-28)) tmp = Float64(Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))) - Float64(j * Float64(k * 27.0))); else tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(k * j)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((t <= -3.5e+45) || ~((t <= 5.2e-28)))
tmp = (t * ((18.0 * (x * (y * z))) - (a * 4.0))) - (j * (k * 27.0));
else
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -3.5e+45], N[Not[LessEqual[t, 5.2e-28]], $MachinePrecision]], N[(N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.5 \cdot 10^{+45} \lor \neg \left(t \leq 5.2 \cdot 10^{-28}\right):\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(k \cdot j\right)\right)\\
\end{array}
\end{array}
if t < -3.50000000000000023e45 or 5.2e-28 < t Initial program 81.2%
associate-*l*82.0%
associate--l+82.0%
distribute-rgt-out--87.7%
associate-*l*86.1%
associate-*l*87.0%
Simplified87.0%
Taylor expanded in t around inf 77.8%
if -3.50000000000000023e45 < t < 5.2e-28Initial program 88.9%
associate-*l*88.9%
associate--l+88.9%
distribute-rgt-out--88.9%
associate-*l*90.4%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in t around 0 84.2%
Final simplification81.1%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* k j))))
(if (<= (* b c) -1.9e+80)
(* b c)
(if (<= (* b c) 4.8e-207)
t_1
(if (<= (* b c) 20000000000000.0)
(* -4.0 (* t a))
(if (<= (* b c) 3e+227) t_1 (* b c)))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (k * j);
double tmp;
if ((b * c) <= -1.9e+80) {
tmp = b * c;
} else if ((b * c) <= 4.8e-207) {
tmp = t_1;
} else if ((b * c) <= 20000000000000.0) {
tmp = -4.0 * (t * a);
} else if ((b * c) <= 3e+227) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (-27.0d0) * (k * j)
if ((b * c) <= (-1.9d+80)) then
tmp = b * c
else if ((b * c) <= 4.8d-207) then
tmp = t_1
else if ((b * c) <= 20000000000000.0d0) then
tmp = (-4.0d0) * (t * a)
else if ((b * c) <= 3d+227) then
tmp = t_1
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (k * j);
double tmp;
if ((b * c) <= -1.9e+80) {
tmp = b * c;
} else if ((b * c) <= 4.8e-207) {
tmp = t_1;
} else if ((b * c) <= 20000000000000.0) {
tmp = -4.0 * (t * a);
} else if ((b * c) <= 3e+227) {
tmp = t_1;
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (k * j) tmp = 0 if (b * c) <= -1.9e+80: tmp = b * c elif (b * c) <= 4.8e-207: tmp = t_1 elif (b * c) <= 20000000000000.0: tmp = -4.0 * (t * a) elif (b * c) <= 3e+227: tmp = t_1 else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(k * j)) tmp = 0.0 if (Float64(b * c) <= -1.9e+80) tmp = Float64(b * c); elseif (Float64(b * c) <= 4.8e-207) tmp = t_1; elseif (Float64(b * c) <= 20000000000000.0) tmp = Float64(-4.0 * Float64(t * a)); elseif (Float64(b * c) <= 3e+227) tmp = t_1; else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (k * j);
tmp = 0.0;
if ((b * c) <= -1.9e+80)
tmp = b * c;
elseif ((b * c) <= 4.8e-207)
tmp = t_1;
elseif ((b * c) <= 20000000000000.0)
tmp = -4.0 * (t * a);
elseif ((b * c) <= 3e+227)
tmp = t_1;
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1.9e+80], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4.8e-207], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 20000000000000.0], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3e+227], t$95$1, N[(b * c), $MachinePrecision]]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(k \cdot j\right)\\
\mathbf{if}\;b \cdot c \leq -1.9 \cdot 10^{+80}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 4.8 \cdot 10^{-207}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b \cdot c \leq 20000000000000:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 3 \cdot 10^{+227}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -1.89999999999999999e80 or 2.99999999999999986e227 < (*.f64 b c) Initial program 79.3%
Simplified81.9%
Taylor expanded in t around 0 73.1%
*-commutative73.1%
*-commutative73.1%
+-commutative73.1%
fma-def73.1%
associate-*l*73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in b around inf 63.2%
if -1.89999999999999999e80 < (*.f64 b c) < 4.79999999999999978e-207 or 2e13 < (*.f64 b c) < 2.99999999999999986e227Initial program 87.2%
Simplified91.5%
Taylor expanded in j around inf 36.2%
if 4.79999999999999978e-207 < (*.f64 b c) < 2e13Initial program 89.8%
Simplified94.9%
Taylor expanded in a around inf 48.1%
*-commutative48.1%
Simplified48.1%
Taylor expanded in t around inf 33.3%
Final simplification43.9%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= (* b c) -8.6e+77)
(* b c)
(if (<= (* b c) 7.2e-211)
(* -27.0 (* k j))
(if (<= (* b c) 25000000000000.0)
(* -4.0 (* t a))
(if (<= (* b c) 3e+227) (* k (* -27.0 j)) (* b c))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -8.6e+77) {
tmp = b * c;
} else if ((b * c) <= 7.2e-211) {
tmp = -27.0 * (k * j);
} else if ((b * c) <= 25000000000000.0) {
tmp = -4.0 * (t * a);
} else if ((b * c) <= 3e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-8.6d+77)) then
tmp = b * c
else if ((b * c) <= 7.2d-211) then
tmp = (-27.0d0) * (k * j)
else if ((b * c) <= 25000000000000.0d0) then
tmp = (-4.0d0) * (t * a)
else if ((b * c) <= 3d+227) then
tmp = k * ((-27.0d0) * j)
else
tmp = b * c
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -8.6e+77) {
tmp = b * c;
} else if ((b * c) <= 7.2e-211) {
tmp = -27.0 * (k * j);
} else if ((b * c) <= 25000000000000.0) {
tmp = -4.0 * (t * a);
} else if ((b * c) <= 3e+227) {
tmp = k * (-27.0 * j);
} else {
tmp = b * c;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (b * c) <= -8.6e+77: tmp = b * c elif (b * c) <= 7.2e-211: tmp = -27.0 * (k * j) elif (b * c) <= 25000000000000.0: tmp = -4.0 * (t * a) elif (b * c) <= 3e+227: tmp = k * (-27.0 * j) else: tmp = b * c return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -8.6e+77) tmp = Float64(b * c); elseif (Float64(b * c) <= 7.2e-211) tmp = Float64(-27.0 * Float64(k * j)); elseif (Float64(b * c) <= 25000000000000.0) tmp = Float64(-4.0 * Float64(t * a)); elseif (Float64(b * c) <= 3e+227) tmp = Float64(k * Float64(-27.0 * j)); else tmp = Float64(b * c); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((b * c) <= -8.6e+77)
tmp = b * c;
elseif ((b * c) <= 7.2e-211)
tmp = -27.0 * (k * j);
elseif ((b * c) <= 25000000000000.0)
tmp = -4.0 * (t * a);
elseif ((b * c) <= 3e+227)
tmp = k * (-27.0 * j);
else
tmp = b * c;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -8.6e+77], N[(b * c), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 7.2e-211], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 25000000000000.0], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 3e+227], N[(k * N[(-27.0 * j), $MachinePrecision]), $MachinePrecision], N[(b * c), $MachinePrecision]]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -8.6 \cdot 10^{+77}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;b \cdot c \leq 7.2 \cdot 10^{-211}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{elif}\;b \cdot c \leq 25000000000000:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;b \cdot c \leq 3 \cdot 10^{+227}:\\
\;\;\;\;k \cdot \left(-27 \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c\\
\end{array}
\end{array}
if (*.f64 b c) < -8.59999999999999983e77 or 2.99999999999999986e227 < (*.f64 b c) Initial program 79.3%
Simplified81.9%
Taylor expanded in t around 0 73.1%
*-commutative73.1%
*-commutative73.1%
+-commutative73.1%
fma-def73.1%
associate-*l*73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in b around inf 63.2%
if -8.59999999999999983e77 < (*.f64 b c) < 7.1999999999999998e-211Initial program 86.7%
Simplified91.2%
Taylor expanded in j around inf 32.7%
if 7.1999999999999998e-211 < (*.f64 b c) < 2.5e13Initial program 89.8%
Simplified94.9%
Taylor expanded in a around inf 48.1%
*-commutative48.1%
Simplified48.1%
Taylor expanded in t around inf 33.3%
if 2.5e13 < (*.f64 b c) < 2.99999999999999986e227Initial program 89.4%
Simplified92.8%
Taylor expanded in j around inf 50.3%
associate-*r*50.3%
*-commutative50.3%
*-commutative50.3%
*-commutative50.3%
Simplified50.3%
Final simplification43.9%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= t -6e+44) (not (<= t 1.3e+23))) (* t (- (* 18.0 (* x (* y z))) (* a 4.0))) (- (* b c) (+ (* 4.0 (* x i)) (* 27.0 (* k j))))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -6e+44) || !(t <= 1.3e+23)) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((t <= (-6d+44)) .or. (.not. (t <= 1.3d+23))) then
tmp = t * ((18.0d0 * (x * (y * z))) - (a * 4.0d0))
else
tmp = (b * c) - ((4.0d0 * (x * i)) + (27.0d0 * (k * j)))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((t <= -6e+44) || !(t <= 1.3e+23)) {
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
} else {
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if (t <= -6e+44) or not (t <= 1.3e+23): tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0)) else: tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j))) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((t <= -6e+44) || !(t <= 1.3e+23)) tmp = Float64(t * Float64(Float64(18.0 * Float64(x * Float64(y * z))) - Float64(a * 4.0))); else tmp = Float64(Float64(b * c) - Float64(Float64(4.0 * Float64(x * i)) + Float64(27.0 * Float64(k * j)))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if ((t <= -6e+44) || ~((t <= 1.3e+23)))
tmp = t * ((18.0 * (x * (y * z))) - (a * 4.0));
else
tmp = (b * c) - ((4.0 * (x * i)) + (27.0 * (k * j)));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[t, -6e+44], N[Not[LessEqual[t, 1.3e+23]], $MachinePrecision]], N[(t * N[(N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] - N[(N[(4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision] + N[(27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6 \cdot 10^{+44} \lor \neg \left(t \leq 1.3 \cdot 10^{+23}\right):\\
\;\;\;\;t \cdot \left(18 \cdot \left(x \cdot \left(y \cdot z\right)\right) - a \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c - \left(4 \cdot \left(x \cdot i\right) + 27 \cdot \left(k \cdot j\right)\right)\\
\end{array}
\end{array}
if t < -5.99999999999999974e44 or 1.29999999999999996e23 < t Initial program 80.6%
associate-*l*81.6%
associate--l+81.6%
distribute-rgt-out--88.0%
associate-*l*86.2%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in t around inf 78.5%
Taylor expanded in t around inf 70.6%
if -5.99999999999999974e44 < t < 1.29999999999999996e23Initial program 88.6%
associate-*l*88.6%
associate--l+88.6%
distribute-rgt-out--88.6%
associate-*l*89.9%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in t around 0 82.4%
Final simplification77.4%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (+ (* b c) (* (* k -27.0) j))))
(if (<= k -4.2e-54)
t_1
(if (<= k 1.38e-275)
(+ (* b c) (* -4.0 (* t a)))
(if (<= k 2.5e+110) (- (* b c) (* x (* 4.0 i))) t_1)))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + ((k * -27.0) * j);
double tmp;
if (k <= -4.2e-54) {
tmp = t_1;
} else if (k <= 1.38e-275) {
tmp = (b * c) + (-4.0 * (t * a));
} else if (k <= 2.5e+110) {
tmp = (b * c) - (x * (4.0 * i));
} else {
tmp = t_1;
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (b * c) + ((k * (-27.0d0)) * j)
if (k <= (-4.2d-54)) then
tmp = t_1
else if (k <= 1.38d-275) then
tmp = (b * c) + ((-4.0d0) * (t * a))
else if (k <= 2.5d+110) then
tmp = (b * c) - (x * (4.0d0 * i))
else
tmp = t_1
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (b * c) + ((k * -27.0) * j);
double tmp;
if (k <= -4.2e-54) {
tmp = t_1;
} else if (k <= 1.38e-275) {
tmp = (b * c) + (-4.0 * (t * a));
} else if (k <= 2.5e+110) {
tmp = (b * c) - (x * (4.0 * i));
} else {
tmp = t_1;
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = (b * c) + ((k * -27.0) * j) tmp = 0 if k <= -4.2e-54: tmp = t_1 elif k <= 1.38e-275: tmp = (b * c) + (-4.0 * (t * a)) elif k <= 2.5e+110: tmp = (b * c) - (x * (4.0 * i)) else: tmp = t_1 return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(b * c) + Float64(Float64(k * -27.0) * j)) tmp = 0.0 if (k <= -4.2e-54) tmp = t_1; elseif (k <= 1.38e-275) tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); elseif (k <= 2.5e+110) tmp = Float64(Float64(b * c) - Float64(x * Float64(4.0 * i))); else tmp = t_1; end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = (b * c) + ((k * -27.0) * j);
tmp = 0.0;
if (k <= -4.2e-54)
tmp = t_1;
elseif (k <= 1.38e-275)
tmp = (b * c) + (-4.0 * (t * a));
elseif (k <= 2.5e+110)
tmp = (b * c) - (x * (4.0 * i));
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(b * c), $MachinePrecision] + N[(N[(k * -27.0), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[k, -4.2e-54], t$95$1, If[LessEqual[k, 1.38e-275], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[k, 2.5e+110], N[(N[(b * c), $MachinePrecision] - N[(x * N[(4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
t_1 := b \cdot c + \left(k \cdot -27\right) \cdot j\\
\mathbf{if}\;k \leq -4.2 \cdot 10^{-54}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;k \leq 1.38 \cdot 10^{-275}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;k \leq 2.5 \cdot 10^{+110}:\\
\;\;\;\;b \cdot c - x \cdot \left(4 \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if k < -4.2e-54 or 2.49999999999999989e110 < k Initial program 87.7%
Simplified89.6%
Taylor expanded in b around inf 59.7%
if -4.2e-54 < k < 1.37999999999999997e-275Initial program 87.6%
Simplified95.4%
Taylor expanded in x around 0 53.6%
+-commutative53.6%
metadata-eval53.6%
cancel-sign-sub-inv53.6%
*-commutative53.6%
*-commutative53.6%
associate-*r*53.6%
fma-neg53.6%
associate-*r*53.6%
*-commutative53.6%
*-commutative53.6%
distribute-lft-neg-in53.6%
metadata-eval53.6%
*-commutative53.6%
Simplified53.6%
Taylor expanded in j around 0 46.4%
if 1.37999999999999997e-275 < k < 2.49999999999999989e110Initial program 80.3%
associate-*l*81.5%
associate--l+81.5%
distribute-rgt-out--83.8%
associate-*l*83.8%
associate-*l*83.8%
Simplified83.8%
Taylor expanded in t around 0 59.7%
Taylor expanded in i around inf 47.2%
associate-*r*47.2%
*-commutative47.2%
*-commutative47.2%
Simplified47.2%
Final simplification52.2%
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= c -7.4e+79)
(* b c)
(if (<= c 6.5e+40)
(+ (* -27.0 (* k j)) (* -4.0 (* x i)))
(+ (* b c) (* -4.0 (* t a))))))assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (c <= -7.4e+79) {
tmp = b * c;
} else if (c <= 6.5e+40) {
tmp = (-27.0 * (k * j)) + (-4.0 * (x * i));
} else {
tmp = (b * c) + (-4.0 * (t * a));
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (c <= (-7.4d+79)) then
tmp = b * c
else if (c <= 6.5d+40) then
tmp = ((-27.0d0) * (k * j)) + ((-4.0d0) * (x * i))
else
tmp = (b * c) + ((-4.0d0) * (t * a))
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (c <= -7.4e+79) {
tmp = b * c;
} else if (c <= 6.5e+40) {
tmp = (-27.0 * (k * j)) + (-4.0 * (x * i));
} else {
tmp = (b * c) + (-4.0 * (t * a));
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if c <= -7.4e+79: tmp = b * c elif c <= 6.5e+40: tmp = (-27.0 * (k * j)) + (-4.0 * (x * i)) else: tmp = (b * c) + (-4.0 * (t * a)) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (c <= -7.4e+79) tmp = Float64(b * c); elseif (c <= 6.5e+40) tmp = Float64(Float64(-27.0 * Float64(k * j)) + Float64(-4.0 * Float64(x * i))); else tmp = Float64(Float64(b * c) + Float64(-4.0 * Float64(t * a))); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (c <= -7.4e+79)
tmp = b * c;
elseif (c <= 6.5e+40)
tmp = (-27.0 * (k * j)) + (-4.0 * (x * i));
else
tmp = (b * c) + (-4.0 * (t * a));
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[c, -7.4e+79], N[(b * c), $MachinePrecision], If[LessEqual[c, 6.5e+40], N[(N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision] + N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(b * c), $MachinePrecision] + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;c \leq -7.4 \cdot 10^{+79}:\\
\;\;\;\;b \cdot c\\
\mathbf{elif}\;c \leq 6.5 \cdot 10^{+40}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right) + -4 \cdot \left(x \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot c + -4 \cdot \left(t \cdot a\right)\\
\end{array}
\end{array}
if c < -7.40000000000000019e79Initial program 76.6%
Simplified78.6%
Taylor expanded in t around 0 75.7%
*-commutative75.7%
*-commutative75.7%
+-commutative75.7%
fma-def75.7%
associate-*l*75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in b around inf 47.6%
if -7.40000000000000019e79 < c < 6.5000000000000001e40Initial program 89.9%
Simplified93.9%
Taylor expanded in i around inf 52.6%
associate-*r*52.6%
*-commutative52.6%
Simplified52.6%
Taylor expanded in x around 0 52.6%
if 6.5000000000000001e40 < c Initial program 81.1%
Simplified86.3%
Taylor expanded in x around 0 66.3%
+-commutative66.3%
metadata-eval66.3%
cancel-sign-sub-inv66.3%
*-commutative66.3%
*-commutative66.3%
associate-*r*66.3%
fma-neg66.3%
associate-*r*66.3%
*-commutative66.3%
*-commutative66.3%
distribute-lft-neg-in66.3%
metadata-eval66.3%
*-commutative66.3%
Simplified66.3%
Taylor expanded in j around 0 57.8%
Final simplification52.8%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (or (<= (* b c) -1.05e+80) (not (<= (* b c) 1.32e+227))) (* b c) (* -27.0 (* k j))))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((b * c) <= -1.05e+80) || !((b * c) <= 1.32e+227)) {
tmp = b * c;
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (((b * c) <= (-1.05d+80)) .or. (.not. ((b * c) <= 1.32d+227))) then
tmp = b * c
else
tmp = (-27.0d0) * (k * j)
end if
code = tmp
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (((b * c) <= -1.05e+80) || !((b * c) <= 1.32e+227)) {
tmp = b * c;
} else {
tmp = -27.0 * (k * j);
}
return tmp;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): tmp = 0 if ((b * c) <= -1.05e+80) or not ((b * c) <= 1.32e+227): tmp = b * c else: tmp = -27.0 * (k * j) return tmp
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if ((Float64(b * c) <= -1.05e+80) || !(Float64(b * c) <= 1.32e+227)) tmp = Float64(b * c); else tmp = Float64(-27.0 * Float64(k * j)); end return tmp end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
tmp = 0.0;
if (((b * c) <= -1.05e+80) || ~(((b * c) <= 1.32e+227)))
tmp = b * c;
else
tmp = -27.0 * (k * j);
end
tmp_2 = tmp;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[Or[LessEqual[N[(b * c), $MachinePrecision], -1.05e+80], N[Not[LessEqual[N[(b * c), $MachinePrecision], 1.32e+227]], $MachinePrecision]], N[(b * c), $MachinePrecision], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -1.05 \cdot 10^{+80} \lor \neg \left(b \cdot c \leq 1.32 \cdot 10^{+227}\right):\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -1.05000000000000001e80 or 1.31999999999999991e227 < (*.f64 b c) Initial program 79.3%
Simplified81.9%
Taylor expanded in t around 0 73.1%
*-commutative73.1%
*-commutative73.1%
+-commutative73.1%
fma-def73.1%
associate-*l*73.1%
*-commutative73.1%
Simplified73.1%
Taylor expanded in b around inf 63.2%
if -1.05000000000000001e80 < (*.f64 b c) < 1.31999999999999991e227Initial program 87.8%
Simplified92.2%
Taylor expanded in j around inf 32.3%
Final simplification41.6%
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* b c))
assert(y < z);
assert(j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
NOTE: y and z should be sorted in increasing order before calling this function.
NOTE: j and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = b * c
end function
assert y < z;
assert j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return b * c;
}
[y, z] = sort([y, z]) [j, k] = sort([j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
y, z = sort([y, z]) j, k = sort([j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
y, z = num2cell(sort([y, z])){:}
j, k = num2cell(sort([j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: y and z should be sorted in increasing order before calling this function. NOTE: j and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(b * c), $MachinePrecision]
\begin{array}{l}
[y, z] = \mathsf{sort}([y, z])\\
[j, k] = \mathsf{sort}([j, k])\\
\\
b \cdot c
\end{array}
Initial program 85.2%
Simplified89.1%
Taylor expanded in t around 0 63.9%
*-commutative63.9%
*-commutative63.9%
+-commutative63.9%
fma-def63.9%
associate-*l*63.9%
*-commutative63.9%
Simplified63.9%
Taylor expanded in b around inf 24.0%
Final simplification24.0%
(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 2023310
(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)))