
(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 19 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: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= t -2.35e-124)
(fma
(* j k)
-27.0
(fma x (* i -4.0) (fma t (fma x (* 18.0 (* y z)) (* a -4.0)) (* b c))))
(if (<= t 6e-19)
(-
(fma
x
(* (* 18.0 y) (* z t))
(fma t (* a -4.0) (fma b c (* x (* i -4.0)))))
(* (* j 27.0) k))
(fma
(* j k)
-27.0
(fma
x
(* i -4.0)
(fma t (fma (* (* x 18.0) y) z (* a -4.0)) (* b c)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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 <= -2.35e-124) {
tmp = fma((j * k), -27.0, fma(x, (i * -4.0), fma(t, fma(x, (18.0 * (y * z)), (a * -4.0)), (b * c))));
} else if (t <= 6e-19) {
tmp = fma(x, ((18.0 * y) * (z * t)), fma(t, (a * -4.0), fma(b, c, (x * (i * -4.0))))) - ((j * 27.0) * k);
} else {
tmp = fma((j * k), -27.0, fma(x, (i * -4.0), fma(t, fma(((x * 18.0) * y), z, (a * -4.0)), (b * c))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (t <= -2.35e-124) tmp = fma(Float64(j * k), -27.0, fma(x, Float64(i * -4.0), fma(t, fma(x, Float64(18.0 * Float64(y * z)), Float64(a * -4.0)), Float64(b * c)))); elseif (t <= 6e-19) tmp = Float64(fma(x, Float64(Float64(18.0 * y) * Float64(z * t)), fma(t, Float64(a * -4.0), fma(b, c, Float64(x * Float64(i * -4.0))))) - Float64(Float64(j * 27.0) * k)); else tmp = fma(Float64(j * k), -27.0, fma(x, Float64(i * -4.0), fma(t, fma(Float64(Float64(x * 18.0) * y), z, Float64(a * -4.0)), Float64(b * c)))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[t, -2.35e-124], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(x * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6e-19], N[(N[(x * N[(N[(18.0 * y), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(t * N[(a * -4.0), $MachinePrecision] + N[(b * c + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.35 \cdot 10^{-124}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, 18 \cdot \left(y \cdot z\right), a \cdot -4\right), b \cdot c\right)\right)\right)\\
\mathbf{elif}\;t \leq 6 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(x, \left(18 \cdot y\right) \cdot \left(z \cdot t\right), \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(\left(x \cdot 18\right) \cdot y, z, a \cdot -4\right), b \cdot c\right)\right)\right)\\
\end{array}
\end{array}
if t < -2.35000000000000002e-124Initial program 84.4%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval84.4
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites96.0%
if -2.35000000000000002e-124 < t < 5.99999999999999985e-19Initial program 82.6%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
associate-*l*N/A
lower-fma.f64N/A
Applied rewrites95.7%
if 5.99999999999999985e-19 < t Initial program 81.6%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval81.6
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites88.4%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6491.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6491.6
Applied rewrites91.6%
Final simplification94.8%
NOTE: x, y, z, t, a, b, c, i, 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
(fma
-4.0
(* x i)
(fma t (fma -4.0 a (* 18.0 (* z (* x y)))) (* b c))))
(t_2
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))))
(if (<= t_2 -2e+243)
t_1
(if (<= t_2 4e+50)
(fma b c (fma -4.0 (* x i) (* j (* k -27.0))))
(if (<= t_2 INFINITY) t_1 (* x (fma -4.0 i (* t (* 18.0 (* y z))))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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 = fma(-4.0, (x * i), fma(t, fma(-4.0, a, (18.0 * (z * (x * y)))), (b * c)));
double t_2 = ((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_2 <= -2e+243) {
tmp = t_1;
} else if (t_2 <= 4e+50) {
tmp = fma(b, c, fma(-4.0, (x * i), (j * (k * -27.0))));
} else if (t_2 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = x * fma(-4.0, i, (t * (18.0 * (y * z))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(-4.0, Float64(x * i), fma(t, fma(-4.0, a, Float64(18.0 * Float64(z * Float64(x * y)))), Float64(b * c))) t_2 = 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)) tmp = 0.0 if (t_2 <= -2e+243) tmp = t_1; elseif (t_2 <= 4e+50) tmp = fma(b, c, fma(-4.0, Float64(x * i), Float64(j * Float64(k * -27.0)))); elseif (t_2 <= Inf) tmp = t_1; else tmp = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z))))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision] + N[(t * N[(-4.0 * a + N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, -2e+243], t$95$1, If[LessEqual[t$95$2, 4e+50], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], t$95$1, N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-4, x \cdot i, \mathsf{fma}\left(t, \mathsf{fma}\left(-4, a, 18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right), b \cdot c\right)\right)\\
t_2 := \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\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+243}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+50}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \left(k \cdot -27\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -2.0000000000000001e243 or 4.0000000000000003e50 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < +inf.0Initial program 89.9%
Taylor expanded in j around 0
associate--r+N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
sub-negN/A
+-commutativeN/A
associate-+r+N/A
Applied rewrites87.4%
if -2.0000000000000001e243 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < 4.0000000000000003e50Initial program 98.3%
Taylor expanded in t around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.9
Applied rewrites81.9%
if +inf.0 < (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) Initial program 0.0%
Taylor expanded in x around inf
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6480.8
Applied rewrites80.8%
Final simplification85.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
t_1)
INFINITY)
(-
(fma
(* t (* x (* 18.0 y)))
z
(fma t (* a -4.0) (fma b c (* x (* i -4.0)))))
t_1)
(* x (fma -4.0 i (* t (* 18.0 (* y z))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - t_1) <= ((double) INFINITY)) {
tmp = fma((t * (x * (18.0 * y))), z, fma(t, (a * -4.0), fma(b, c, (x * (i * -4.0))))) - t_1;
} else {
tmp = x * fma(-4.0, i, (t * (18.0 * (y * z))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (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)) - t_1) <= Inf) tmp = Float64(fma(Float64(t * Float64(x * Float64(18.0 * y))), z, fma(t, Float64(a * -4.0), fma(b, c, Float64(x * Float64(i * -4.0))))) - t_1); else tmp = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z))))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[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] - t$95$1), $MachinePrecision], Infinity], N[(N[(N[(t * N[(x * N[(18.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * z + N[(t * N[(a * -4.0), $MachinePrecision] + N[(b * c + N[(x * N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\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) - t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t \cdot \left(x \cdot \left(18 \cdot y\right)\right), z, \mathsf{fma}\left(t, a \cdot -4, \mathsf{fma}\left(b, c, x \cdot \left(i \cdot -4\right)\right)\right)\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 94.8%
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
lift--.f64N/A
sub-negN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites95.5%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 0.0%
Taylor expanded in x around inf
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6475.0
Applied rewrites75.0%
Final simplification93.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* x 18.0) y)))
(if (<=
(-
(- (+ (- (* (* t_1 z) t) (* t (* a 4.0))) (* b c)) (* (* x 4.0) i))
(* (* j 27.0) k))
INFINITY)
(fma
(* j k)
-27.0
(fma x (* i -4.0) (fma t (fma t_1 z (* a -4.0)) (* b c))))
(* x (fma -4.0 i (* t (* 18.0 (* y z))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (x * 18.0) * y;
double tmp;
if (((((((t_1 * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = fma((j * k), -27.0, fma(x, (i * -4.0), fma(t, fma(t_1, z, (a * -4.0)), (b * c))));
} else {
tmp = x * fma(-4.0, i, (t * (18.0 * (y * z))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(x * 18.0) * y) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(t_1 * z) * t) - Float64(t * Float64(a * 4.0))) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) <= Inf) tmp = fma(Float64(j * k), -27.0, fma(x, Float64(i * -4.0), fma(t, fma(t_1, z, Float64(a * -4.0)), Float64(b * c)))); else tmp = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z))))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, 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[(x * 18.0), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(t$95$1 * z), $MachinePrecision] * t), $MachinePrecision] - N[(t * N[(a * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(t$95$1 * z + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(x \cdot 18\right) \cdot y\\
\mathbf{if}\;\left(\left(\left(\left(t\_1 \cdot z\right) \cdot t - t \cdot \left(a \cdot 4\right)\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(t\_1, z, a \cdot -4\right), b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 94.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval95.2
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites93.9%
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
associate-*r*N/A
associate-*l*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.2
Applied rewrites95.2%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 0.0%
Taylor expanded in x around inf
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6475.0
Applied rewrites75.0%
Final simplification92.7%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* y z))))
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* t (* a 4.0))) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))
INFINITY)
(fma
(* j k)
-27.0
(fma x (* i -4.0) (fma t (fma x t_1 (* a -4.0)) (* b c))))
(* x (fma -4.0 i (* t t_1))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (y * z);
double tmp;
if (((((((((x * 18.0) * y) * z) * t) - (t * (a * 4.0))) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = fma((j * k), -27.0, fma(x, (i * -4.0), fma(t, fma(x, t_1, (a * -4.0)), (b * c))));
} else {
tmp = x * fma(-4.0, i, (t * t_1));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(y * z)) 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(Float64(j * 27.0) * k)) <= Inf) tmp = fma(Float64(j * k), -27.0, fma(x, Float64(i * -4.0), fma(t, fma(x, t_1, Float64(a * -4.0)), Float64(b * c)))); else tmp = Float64(x * fma(-4.0, i, Float64(t * t_1))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(y * z), $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[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(x * N[(i * -4.0), $MachinePrecision] + N[(t * N[(x * t$95$1 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(-4.0 * i + N[(t * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(y \cdot z\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) - \left(j \cdot 27\right) \cdot k \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(x, i \cdot -4, \mathsf{fma}\left(t, \mathsf{fma}\left(x, t\_1, a \cdot -4\right), b \cdot c\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot t\_1\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 94.8%
lift--.f64N/A
sub-negN/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-neg-inN/A
lower-fma.f64N/A
lower-*.f64N/A
metadata-eval95.2
lift--.f64N/A
sub-negN/A
+-commutativeN/A
Applied rewrites93.9%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 0.0%
Taylor expanded in x around inf
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6475.0
Applied rewrites75.0%
Final simplification91.5%
NOTE: x, y, z, t, a, b, c, i, 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))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -1e+93)
t_1
(if (<= t_2 5e-258) (* -4.0 (* x i)) (if (<= t_2 1e+106) (* b c) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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 t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+93) {
tmp = t_1;
} else if (t_2 <= 5e-258) {
tmp = -4.0 * (x * i);
} else if (t_2 <= 1e+106) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = j * (k * (-27.0d0))
t_2 = (j * 27.0d0) * k
if (t_2 <= (-1d+93)) then
tmp = t_1
else if (t_2 <= 5d-258) then
tmp = (-4.0d0) * (x * i)
else if (t_2 <= 1d+106) then
tmp = b * c
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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 t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+93) {
tmp = t_1;
} else if (t_2 <= 5e-258) {
tmp = -4.0 * (x * i);
} else if (t_2 <= 1e+106) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = j * (k * -27.0) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -1e+93: tmp = t_1 elif t_2 <= 5e-258: tmp = -4.0 * (x * i) elif t_2 <= 1e+106: tmp = b * c else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(j * Float64(k * -27.0)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -1e+93) tmp = t_1; elseif (t_2 <= 5e-258) tmp = Float64(-4.0 * Float64(x * i)); elseif (t_2 <= 1e+106) tmp = Float64(b * c); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = j * (k * -27.0);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -1e+93)
tmp = t_1;
elseif (t_2 <= 5e-258)
tmp = -4.0 * (x * i);
elseif (t_2 <= 1e+106)
tmp = b * c;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, 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]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+93], t$95$1, If[LessEqual[t$95$2, 5e-258], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+106], N[(b * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := j \cdot \left(k \cdot -27\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-258}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+106}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.00000000000000004e93 or 1.00000000000000009e106 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 76.3%
Taylor expanded in j around inf
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.5
Applied rewrites64.5%
if -1.00000000000000004e93 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.9999999999999999e-258Initial program 86.8%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6430.1
Applied rewrites30.1%
if 4.9999999999999999e-258 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000009e106Initial program 84.5%
Taylor expanded in b around inf
lower-*.f6432.8
Applied rewrites32.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -1e+93)
t_1
(if (<= t_2 5e-258) (* -4.0 (* x i)) (if (<= t_2 1e+106) (* b c) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+93) {
tmp = t_1;
} else if (t_2 <= 5e-258) {
tmp = -4.0 * (x * i);
} else if (t_2 <= 1e+106) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-1d+93)) then
tmp = t_1
else if (t_2 <= 5d-258) then
tmp = (-4.0d0) * (x * i)
else if (t_2 <= 1d+106) then
tmp = b * c
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -1e+93) {
tmp = t_1;
} else if (t_2 <= 5e-258) {
tmp = -4.0 * (x * i);
} else if (t_2 <= 1e+106) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -1e+93: tmp = t_1 elif t_2 <= 5e-258: tmp = -4.0 * (x * i) elif t_2 <= 1e+106: tmp = b * c else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -1e+93) tmp = t_1; elseif (t_2 <= 5e-258) tmp = Float64(-4.0 * Float64(x * i)); elseif (t_2 <= 1e+106) tmp = Float64(b * c); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -1e+93)
tmp = t_1;
elseif (t_2 <= 5e-258)
tmp = -4.0 * (x * i);
elseif (t_2 <= 1e+106)
tmp = b * c;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+93], t$95$1, If[LessEqual[t$95$2, 5e-258], N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+106], N[(b * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-258}:\\
\;\;\;\;-4 \cdot \left(x \cdot i\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+106}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.00000000000000004e93 or 1.00000000000000009e106 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 76.3%
Taylor expanded in b around inf
lower-*.f6416.3
Applied rewrites16.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6464.5
Applied rewrites64.5%
if -1.00000000000000004e93 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.9999999999999999e-258Initial program 86.8%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6430.1
Applied rewrites30.1%
if 4.9999999999999999e-258 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000009e106Initial program 84.5%
Taylor expanded in b around inf
lower-*.f6432.8
Applied rewrites32.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+81)
t_1
(if (<= t_2 -1e-152) (* -4.0 (* t a)) (if (<= t_2 1e+106) (* b c) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+81) {
tmp = t_1;
} else if (t_2 <= -1e-152) {
tmp = -4.0 * (t * a);
} else if (t_2 <= 1e+106) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-2d+81)) then
tmp = t_1
else if (t_2 <= (-1d-152)) then
tmp = (-4.0d0) * (t * a)
else if (t_2 <= 1d+106) then
tmp = b * c
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+81) {
tmp = t_1;
} else if (t_2 <= -1e-152) {
tmp = -4.0 * (t * a);
} else if (t_2 <= 1e+106) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -2e+81: tmp = t_1 elif t_2 <= -1e-152: tmp = -4.0 * (t * a) elif t_2 <= 1e+106: tmp = b * c else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+81) tmp = t_1; elseif (t_2 <= -1e-152) tmp = Float64(-4.0 * Float64(t * a)); elseif (t_2 <= 1e+106) tmp = Float64(b * c); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -2e+81)
tmp = t_1;
elseif (t_2 <= -1e-152)
tmp = -4.0 * (t * a);
elseif (t_2 <= 1e+106)
tmp = b * c;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+81], t$95$1, If[LessEqual[t$95$2, -1e-152], N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+106], N[(b * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-152}:\\
\;\;\;\;-4 \cdot \left(t \cdot a\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+106}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.99999999999999984e81 or 1.00000000000000009e106 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 76.3%
Taylor expanded in b around inf
lower-*.f6415.7
Applied rewrites15.7%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6462.7
Applied rewrites62.7%
if -1.99999999999999984e81 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1.00000000000000007e-152Initial program 88.6%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6433.2
Applied rewrites33.2%
if -1.00000000000000007e-152 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000009e106Initial program 85.3%
Taylor expanded in b around inf
lower-*.f6430.5
Applied rewrites30.5%
Final simplification41.5%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (- (* x (fma -4.0 i (* t (* 18.0 (* y z))))) (* (* j 27.0) k))))
(if (<= x -3.4e-7)
t_1
(if (<= x 3200000000.0)
(fma b c (fma -4.0 (* t a) (* j (* k -27.0))))
t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (x * fma(-4.0, i, (t * (18.0 * (y * z))))) - ((j * 27.0) * k);
double tmp;
if (x <= -3.4e-7) {
tmp = t_1;
} else if (x <= 3200000000.0) {
tmp = fma(b, c, fma(-4.0, (t * a), (j * (k * -27.0))));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z))))) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (x <= -3.4e-7) tmp = t_1; elseif (x <= 3200000000.0) tmp = fma(b, c, fma(-4.0, Float64(t * a), Float64(j * Float64(k * -27.0)))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, 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[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.4e-7], t$95$1, If[LessEqual[x, 3200000000.0], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;x \leq -3.4 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3200000000:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.39999999999999974e-7 or 3.2e9 < x Initial program 73.6%
Taylor expanded in x around inf
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6480.2
Applied rewrites80.2%
if -3.39999999999999974e-7 < x < 3.2e9Initial program 94.6%
Taylor expanded in x around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.0
Applied rewrites81.0%
Final simplification80.6%
NOTE: x, y, z, t, a, b, c, i, 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 (fma b c (* -27.0 (* j k)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -4e+85)
t_1
(if (<= t_2 1e-76) (fma b c (* -4.0 (* t a))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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 = fma(b, c, (-27.0 * (j * k)));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -4e+85) {
tmp = t_1;
} else if (t_2 <= 1e-76) {
tmp = fma(b, c, (-4.0 * (t * a)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(b, c, Float64(-27.0 * Float64(j * k))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -4e+85) tmp = t_1; elseif (t_2 <= 1e-76) tmp = fma(b, c, Float64(-4.0 * Float64(t * a))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, 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[(b * c + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+85], t$95$1, If[LessEqual[t$95$2, 1e-76], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-76}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -4 \cdot \left(t \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.0000000000000001e85 or 9.99999999999999927e-77 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 80.9%
Taylor expanded in x around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.5
Applied rewrites68.5%
Taylor expanded in a around 0
Applied rewrites64.4%
if -4.0000000000000001e85 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.99999999999999927e-77Initial program 84.7%
Taylor expanded in x around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.9
Applied rewrites51.9%
Taylor expanded in a around inf
Applied rewrites50.5%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k))) (if (<= t_2 -5e+129) t_1 (if (<= t_2 1e+106) (* b c) t_1))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+129) {
tmp = t_1;
} else if (t_2 <= 1e+106) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i, j, k)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-5d+129)) then
tmp = t_1
else if (t_2 <= 1d+106) then
tmp = b * c
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+129) {
tmp = t_1;
} else if (t_2 <= 1e+106) {
tmp = b * c;
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -5e+129: tmp = t_1 elif t_2 <= 1e+106: tmp = b * c else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -5e+129) tmp = t_1; elseif (t_2 <= 1e+106) tmp = Float64(b * c); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -5e+129)
tmp = t_1;
elseif (t_2 <= 1e+106)
tmp = b * c;
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+129], t$95$1, If[LessEqual[t$95$2, 1e+106], N[(b * c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+106}:\\
\;\;\;\;b \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000003e129 or 1.00000000000000009e106 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 76.7%
Taylor expanded in b around inf
lower-*.f6414.3
Applied rewrites14.3%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6466.8
Applied rewrites66.8%
if -5.0000000000000003e129 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.00000000000000009e106Initial program 85.6%
Taylor expanded in b around inf
lower-*.f6426.8
Applied rewrites26.8%
NOTE: x, y, z, t, a, b, c, i, 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 (fma -4.0 a (* 18.0 (* z (* x y)))))))
(if (<= t -1.1e-17)
t_1
(if (<= t 1.25e+35) (fma b c (fma -4.0 (* x i) (* j (* k -27.0)))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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 * fma(-4.0, a, (18.0 * (z * (x * y))));
double tmp;
if (t <= -1.1e-17) {
tmp = t_1;
} else if (t <= 1.25e+35) {
tmp = fma(b, c, fma(-4.0, (x * i), (j * (k * -27.0))));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(z * Float64(x * y))))) tmp = 0.0 if (t <= -1.1e-17) tmp = t_1; elseif (t <= 1.25e+35) tmp = fma(b, c, fma(-4.0, Float64(x * i), Float64(j * Float64(k * -27.0)))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, 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[(-4.0 * a + N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.1e-17], t$95$1, If[LessEqual[t, 1.25e+35], N[(b * c + N[(-4.0 * N[(x * i), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{if}\;t \leq -1.1 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.25 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, x \cdot i, j \cdot \left(k \cdot -27\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.1e-17 or 1.25000000000000005e35 < t Initial program 81.1%
Taylor expanded in t around inf
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6476.1
Applied rewrites76.1%
if -1.1e-17 < t < 1.25000000000000005e35Initial program 84.2%
Taylor expanded in t around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6481.5
Applied rewrites81.5%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -2e+79)
(* x (fma -4.0 i (* t (* 18.0 (* y z)))))
(if (<= x 1.06e+42)
(fma b c (fma -4.0 (* t a) (* j (* k -27.0))))
(* x (fma (* 18.0 y) (* z t) (* i -4.0))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2e+79) {
tmp = x * fma(-4.0, i, (t * (18.0 * (y * z))));
} else if (x <= 1.06e+42) {
tmp = fma(b, c, fma(-4.0, (t * a), (j * (k * -27.0))));
} else {
tmp = x * fma((18.0 * y), (z * t), (i * -4.0));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -2e+79) tmp = Float64(x * fma(-4.0, i, Float64(t * Float64(18.0 * Float64(y * z))))); elseif (x <= 1.06e+42) tmp = fma(b, c, fma(-4.0, Float64(t * a), Float64(j * Float64(k * -27.0)))); else tmp = Float64(x * fma(Float64(18.0 * y), Float64(z * t), Float64(i * -4.0))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -2e+79], N[(x * N[(-4.0 * i + N[(t * N[(18.0 * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.06e+42], N[(b * c + N[(-4.0 * N[(t * a), $MachinePrecision] + N[(j * N[(k * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(18.0 * y), $MachinePrecision] * N[(z * t), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2 \cdot 10^{+79}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(-4, i, t \cdot \left(18 \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{elif}\;x \leq 1.06 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(b, c, \mathsf{fma}\left(-4, t \cdot a, j \cdot \left(k \cdot -27\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \mathsf{fma}\left(18 \cdot y, z \cdot t, i \cdot -4\right)\\
\end{array}
\end{array}
if x < -1.99999999999999993e79Initial program 74.6%
Taylor expanded in x around inf
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6486.6
Applied rewrites86.6%
if -1.99999999999999993e79 < x < 1.0599999999999999e42Initial program 91.2%
Taylor expanded in x around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
if 1.0599999999999999e42 < x Initial program 68.8%
Taylor expanded in b around inf
lower-*.f6417.4
Applied rewrites17.4%
Taylor expanded in x around inf
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.8
Applied rewrites72.8%
Applied rewrites72.8%
Final simplification77.9%
NOTE: x, y, z, t, a, b, c, i, 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 (fma -4.0 a (* 18.0 (* z (* x y)))))))
(if (<= t -2.1e-40)
t_1
(if (<= t 400000.0) (fma b c (* -27.0 (* j k))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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 * fma(-4.0, a, (18.0 * (z * (x * y))));
double tmp;
if (t <= -2.1e-40) {
tmp = t_1;
} else if (t <= 400000.0) {
tmp = fma(b, c, (-27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(z * Float64(x * y))))) tmp = 0.0 if (t <= -2.1e-40) tmp = t_1; elseif (t <= 400000.0) tmp = fma(b, c, Float64(-27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, 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[(-4.0 * a + N[(18.0 * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.1e-40], t$95$1, If[LessEqual[t, 400000.0], N[(b * c + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{if}\;t \leq -2.1 \cdot 10^{-40}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 400000:\\
\;\;\;\;\mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.10000000000000018e-40 or 4e5 < t Initial program 81.0%
Taylor expanded in t around inf
lower-*.f64N/A
cancel-sign-sub-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6473.9
Applied rewrites73.9%
if -2.10000000000000018e-40 < t < 4e5Initial program 84.5%
Taylor expanded in x around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6468.2
Applied rewrites68.2%
Taylor expanded in a around 0
Applied rewrites62.6%
NOTE: x, y, z, t, a, b, c, i, 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 (* z (* (* x y) (* 18.0 t)))))
(if (<= t -9.6e+45)
t_1
(if (<= t 1400000.0) (fma b c (* -27.0 (* j k))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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 = z * ((x * y) * (18.0 * t));
double tmp;
if (t <= -9.6e+45) {
tmp = t_1;
} else if (t <= 1400000.0) {
tmp = fma(b, c, (-27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(z * Float64(Float64(x * y) * Float64(18.0 * t))) tmp = 0.0 if (t <= -9.6e+45) tmp = t_1; elseif (t <= 1400000.0) tmp = fma(b, c, Float64(-27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, 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[(z * N[(N[(x * y), $MachinePrecision] * N[(18.0 * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.6e+45], t$95$1, If[LessEqual[t, 1400000.0], N[(b * c + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := z \cdot \left(\left(x \cdot y\right) \cdot \left(18 \cdot t\right)\right)\\
\mathbf{if}\;t \leq -9.6 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1400000:\\
\;\;\;\;\mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.59999999999999958e45 or 1.4e6 < t Initial program 81.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
Applied rewrites56.7%
if -9.59999999999999958e45 < t < 1.4e6Initial program 84.0%
Taylor expanded in x around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Applied rewrites67.3%
Taylor expanded in a around 0
Applied rewrites60.2%
Final simplification58.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= t -9.6e+45)
(* 18.0 (* t (* z (* x y))))
(if (<= t 1400000.0)
(fma b c (* -27.0 (* j k)))
(* t (* y (* (* x 18.0) z))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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 <= -9.6e+45) {
tmp = 18.0 * (t * (z * (x * y)));
} else if (t <= 1400000.0) {
tmp = fma(b, c, (-27.0 * (j * k)));
} else {
tmp = t * (y * ((x * 18.0) * z));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (t <= -9.6e+45) tmp = Float64(18.0 * Float64(t * Float64(z * Float64(x * y)))); elseif (t <= 1400000.0) tmp = fma(b, c, Float64(-27.0 * Float64(j * k))); else tmp = Float64(t * Float64(y * Float64(Float64(x * 18.0) * z))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[t, -9.6e+45], N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1400000.0], N[(b * c + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * N[(y * N[(N[(x * 18.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.6 \cdot 10^{+45}:\\
\;\;\;\;18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{elif}\;t \leq 1400000:\\
\;\;\;\;\mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(y \cdot \left(\left(x \cdot 18\right) \cdot z\right)\right)\\
\end{array}
\end{array}
if t < -9.59999999999999958e45Initial program 83.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6457.1
Applied rewrites57.1%
if -9.59999999999999958e45 < t < 1.4e6Initial program 84.0%
Taylor expanded in x around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Applied rewrites67.3%
Taylor expanded in a around 0
Applied rewrites60.2%
if 1.4e6 < t Initial program 79.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6454.7
Applied rewrites54.7%
Applied rewrites53.0%
Final simplification58.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* t (* z (* x y))))))
(if (<= t -9.6e+45)
t_1
(if (<= t 1400000.0) (fma b c (* -27.0 (* j k))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (t * (z * (x * y)));
double tmp;
if (t <= -9.6e+45) {
tmp = t_1;
} else if (t <= 1400000.0) {
tmp = fma(b, c, (-27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(t * Float64(z * Float64(x * y)))) tmp = 0.0 if (t <= -9.6e+45) tmp = t_1; elseif (t <= 1400000.0) tmp = fma(b, c, Float64(-27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(t * N[(z * N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.6e+45], t$95$1, If[LessEqual[t, 1400000.0], N[(b * c + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(t \cdot \left(z \cdot \left(x \cdot y\right)\right)\right)\\
\mathbf{if}\;t \leq -9.6 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1400000:\\
\;\;\;\;\mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.59999999999999958e45 or 1.4e6 < t Initial program 81.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
if -9.59999999999999958e45 < t < 1.4e6Initial program 84.0%
Taylor expanded in x around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.3
Applied rewrites67.3%
Taylor expanded in a around 0
Applied rewrites60.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* x i))))
(if (<= x -3.7e+82)
t_1
(if (<= x 3.2e+188) (fma b c (* -27.0 (* j k))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (x * i);
double tmp;
if (x <= -3.7e+82) {
tmp = t_1;
} else if (x <= 3.2e+188) {
tmp = fma(b, c, (-27.0 * (j * k)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(x * i)) tmp = 0.0 if (x <= -3.7e+82) tmp = t_1; elseif (x <= 3.2e+188) tmp = fma(b, c, Float64(-27.0 * Float64(j * k))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(x * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.7e+82], t$95$1, If[LessEqual[x, 3.2e+188], N[(b * c + N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(x \cdot i\right)\\
\mathbf{if}\;x \leq -3.7 \cdot 10^{+82}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.2 \cdot 10^{+188}:\\
\;\;\;\;\mathsf{fma}\left(b, c, -27 \cdot \left(j \cdot k\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.7000000000000002e82 or 3.1999999999999997e188 < x Initial program 70.8%
Taylor expanded in i around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6455.7
Applied rewrites55.7%
if -3.7000000000000002e82 < x < 3.1999999999999997e188Initial program 87.9%
Taylor expanded in x around 0
sub-negN/A
lower-fma.f64N/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
metadata-evalN/A
distribute-lft-neg-inN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6471.5
Applied rewrites71.5%
Taylor expanded in a around 0
Applied rewrites53.6%
NOTE: x, y, z, t, a, b, c, i, 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(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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: x, y, z, t, a, b, c, i, 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 x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && 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;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): return b * c
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) return Float64(b * c) end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = b * c;
end
NOTE: x, y, z, t, a, b, c, i, 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}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
b \cdot c
\end{array}
Initial program 82.9%
Taylor expanded in b around inf
lower-*.f6423.0
Applied rewrites23.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 2024223
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
:alt
(! :herbie-platform default (if (< t -8105407698770699/5000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))) (if (< t 8284013971902611/50000000000000) (+ (- (* (* 18 y) (* x (* z t))) (* (+ (* a t) (* i x)) 4)) (- (* c b) (* 27 (* k j)))) (- (- (* (* 18 t) (* (* x y) z)) (* (+ (* a t) (* i x)) 4)) (- (* (* k j) 27) (* c b))))))
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))