
(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);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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 25 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);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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 (<= x -1e+39)
(*
(-
(fma (* (* z y) t) 18.0 (/ (* c b) x))
(fma 4.0 (+ i (/ (* a t) x)) (* (/ (* k j) x) 27.0)))
x)
(if (<= x 1e-33)
(-
(fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c))
(fma (* 4.0 x) i (* (* k j) 27.0)))
(-
(-
(fma (* 18.0 x) (* y (* t z)) (fma (* a t) -4.0 (* c b)))
(* (* x 4.0) i))
(* j (* k 27.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 <= -1e+39) {
tmp = (fma(((z * y) * t), 18.0, ((c * b) / x)) - fma(4.0, (i + ((a * t) / x)), (((k * j) / x) * 27.0))) * x;
} else if (x <= 1e-33) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - fma((4.0 * x), i, ((k * j) * 27.0));
} else {
tmp = (fma((18.0 * x), (y * (t * z)), fma((a * t), -4.0, (c * b))) - ((x * 4.0) * i)) - (j * (k * 27.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 <= -1e+39) tmp = Float64(Float64(fma(Float64(Float64(z * y) * t), 18.0, Float64(Float64(c * b) / x)) - fma(4.0, Float64(i + Float64(Float64(a * t) / x)), Float64(Float64(Float64(k * j) / x) * 27.0))) * x); elseif (x <= 1e-33) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - fma(Float64(4.0 * x), i, Float64(Float64(k * j) * 27.0))); else tmp = Float64(Float64(fma(Float64(18.0 * x), Float64(y * Float64(t * z)), fma(Float64(a * t), -4.0, Float64(c * b))) - Float64(Float64(x * 4.0) * i)) - Float64(j * Float64(k * 27.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, -1e+39], N[(N[(N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0 + N[(N[(c * b), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] - N[(4.0 * N[(i + N[(N[(a * t), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(k * j), $MachinePrecision] / x), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 1e-33], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * x), $MachinePrecision] * i + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(18.0 * x), $MachinePrecision] * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.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 -1 \cdot 10^{+39}:\\
\;\;\;\;\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot t, 18, \frac{c \cdot b}{x}\right) - \mathsf{fma}\left(4, i + \frac{a \cdot t}{x}, \frac{k \cdot j}{x} \cdot 27\right)\right) \cdot x\\
\mathbf{elif}\;x \leq 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - \mathsf{fma}\left(4 \cdot x, i, \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(18 \cdot x, y \cdot \left(t \cdot z\right), \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right)\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right)\\
\end{array}
\end{array}
if x < -9.9999999999999994e38Initial program 68.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites88.5%
if -9.9999999999999994e38 < x < 1.0000000000000001e-33Initial program 90.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6490.8
Applied rewrites90.8%
Applied rewrites96.2%
if 1.0000000000000001e-33 < x Initial program 69.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.7
Applied rewrites69.7%
Applied rewrites89.3%
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 y) x))
(t_2
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= t_2 1e+289)
(-
(fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c))
(fma (* 4.0 x) i (* (* k j) 27.0)))
(if (<= t_2 INFINITY)
(fma (* 18.0 t) t_1 (- (* c b) (* 4.0 (fma a t (* i x)))))
(fma (* j k) -27.0 (fma (fma t_1 18.0 (* a -4.0)) t (* c b)))))))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 * y) * x;
double t_2 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_2 <= 1e+289) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - fma((4.0 * x), i, ((k * j) * 27.0));
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma((18.0 * t), t_1, ((c * b) - (4.0 * fma(a, t, (i * x)))));
} else {
tmp = fma((j * k), -27.0, fma(fma(t_1, 18.0, (a * -4.0)), t, (c * b)));
}
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(z * y) * x) t_2 = 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)) tmp = 0.0 if (t_2 <= 1e+289) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - fma(Float64(4.0 * x), i, Float64(Float64(k * j) * 27.0))); elseif (t_2 <= Inf) tmp = fma(Float64(18.0 * t), t_1, Float64(Float64(c * b) - Float64(4.0 * fma(a, t, Float64(i * x))))); else tmp = fma(Float64(j * k), -27.0, fma(fma(t_1, 18.0, Float64(a * -4.0)), t, Float64(c * b))); 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[(z * y), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, 1e+289], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * x), $MachinePrecision] * i + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(18.0 * t), $MachinePrecision] * t$95$1 + N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(N[(t$95$1 * 18.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $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(z \cdot y\right) \cdot x\\
t_2 := \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\\
\mathbf{if}\;t\_2 \leq 10^{+289}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - \mathsf{fma}\left(4 \cdot x, i, \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, t\_1, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(\mathsf{fma}\left(t\_1, 18, a \cdot -4\right), t, c \cdot b\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)) < 1.0000000000000001e289Initial program 91.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6491.9
Applied rewrites91.9%
Applied rewrites92.5%
if 1.0000000000000001e289 < (-.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 78.3%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-outN/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f6487.8
Applied rewrites87.8%
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%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f640.0
Applied rewrites0.0%
Applied rewrites47.8%
Taylor expanded in i around 0
Applied rewrites65.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 (fma (* a t) -4.0 (* c b))))
(if (<= x -1e+39)
(*
(- (fma (* 18.0 t) (* z y) (/ t_1 x)) (fma (/ (* k j) x) 27.0 (* i 4.0)))
x)
(if (<= x 1e-33)
(-
(fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c))
(fma (* 4.0 x) i (* (* k j) 27.0)))
(-
(- (fma (* 18.0 x) (* y (* t z)) t_1) (* (* x 4.0) i))
(* j (* k 27.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 t_1 = fma((a * t), -4.0, (c * b));
double tmp;
if (x <= -1e+39) {
tmp = (fma((18.0 * t), (z * y), (t_1 / x)) - fma(((k * j) / x), 27.0, (i * 4.0))) * x;
} else if (x <= 1e-33) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - fma((4.0 * x), i, ((k * j) * 27.0));
} else {
tmp = (fma((18.0 * x), (y * (t * z)), t_1) - ((x * 4.0) * i)) - (j * (k * 27.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) t_1 = fma(Float64(a * t), -4.0, Float64(c * b)) tmp = 0.0 if (x <= -1e+39) tmp = Float64(Float64(fma(Float64(18.0 * t), Float64(z * y), Float64(t_1 / x)) - fma(Float64(Float64(k * j) / x), 27.0, Float64(i * 4.0))) * x); elseif (x <= 1e-33) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - fma(Float64(4.0 * x), i, Float64(Float64(k * j) * 27.0))); else tmp = Float64(Float64(fma(Float64(18.0 * x), Float64(y * Float64(t * z)), t_1) - Float64(Float64(x * 4.0) * i)) - Float64(j * Float64(k * 27.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_] := Block[{t$95$1 = N[(N[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e+39], N[(N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(k * j), $MachinePrecision] / x), $MachinePrecision] * 27.0 + N[(i * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 1e-33], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(4.0 * x), $MachinePrecision] * i + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(18.0 * x), $MachinePrecision] * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.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}
t_1 := \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{+39}:\\
\;\;\;\;\left(\mathsf{fma}\left(18 \cdot t, z \cdot y, \frac{t\_1}{x}\right) - \mathsf{fma}\left(\frac{k \cdot j}{x}, 27, i \cdot 4\right)\right) \cdot x\\
\mathbf{elif}\;x \leq 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - \mathsf{fma}\left(4 \cdot x, i, \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(18 \cdot x, y \cdot \left(t \cdot z\right), t\_1\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right)\\
\end{array}
\end{array}
if x < -9.9999999999999994e38Initial program 68.8%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*l*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-neg.f64N/A
lower-*.f6477.0
Applied rewrites77.0%
Taylor expanded in x around inf
Applied rewrites88.5%
if -9.9999999999999994e38 < x < 1.0000000000000001e-33Initial program 90.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6490.8
Applied rewrites90.8%
Applied rewrites96.2%
if 1.0000000000000001e-33 < x Initial program 69.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.7
Applied rewrites69.7%
Applied rewrites89.3%
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 -6.8e+15)
(- (fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c)) (* (* j k) 27.0))
(if (<= t 1e+49)
(-
(-
(fma (* 18.0 x) (* y (* t z)) (fma (* a t) -4.0 (* c b)))
(* (* x 4.0) i))
(* j (* k 27.0)))
(*
(fma
(* -18.0 x)
(* z y)
(fma 4.0 a (/ (- (fma b c (* (* i -4.0) x)) (* (* k j) 27.0)) (- t))))
(- t)))))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 <= -6.8e+15) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - ((j * k) * 27.0);
} else if (t <= 1e+49) {
tmp = (fma((18.0 * x), (y * (t * z)), fma((a * t), -4.0, (c * b))) - ((x * 4.0) * i)) - (j * (k * 27.0));
} else {
tmp = fma((-18.0 * x), (z * y), fma(4.0, a, ((fma(b, c, ((i * -4.0) * x)) - ((k * j) * 27.0)) / -t))) * -t;
}
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 <= -6.8e+15) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - Float64(Float64(j * k) * 27.0)); elseif (t <= 1e+49) tmp = Float64(Float64(fma(Float64(18.0 * x), Float64(y * Float64(t * z)), fma(Float64(a * t), -4.0, Float64(c * b))) - Float64(Float64(x * 4.0) * i)) - Float64(j * Float64(k * 27.0))); else tmp = Float64(fma(Float64(-18.0 * x), Float64(z * y), fma(4.0, a, Float64(Float64(fma(b, c, Float64(Float64(i * -4.0) * x)) - Float64(Float64(k * j) * 27.0)) / Float64(-t)))) * Float64(-t)); 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, -6.8e+15], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(j * k), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+49], N[(N[(N[(N[(18.0 * x), $MachinePrecision] * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-18.0 * x), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(4.0 * a + N[(N[(N[(b * c + N[(N[(i * -4.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision] / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-t)), $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 -6.8 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - \left(j \cdot k\right) \cdot 27\\
\mathbf{elif}\;t \leq 10^{+49}:\\
\;\;\;\;\left(\mathsf{fma}\left(18 \cdot x, y \cdot \left(t \cdot z\right), \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right)\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-18 \cdot x, z \cdot y, \mathsf{fma}\left(4, a, \frac{\mathsf{fma}\left(b, c, \left(i \cdot -4\right) \cdot x\right) - \left(k \cdot j\right) \cdot 27}{-t}\right)\right) \cdot \left(-t\right)\\
\end{array}
\end{array}
if t < -6.8e15Initial program 77.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.1
Applied rewrites77.1%
Applied rewrites88.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6488.8
Applied rewrites88.8%
if -6.8e15 < t < 9.99999999999999946e48Initial program 78.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.8
Applied rewrites78.8%
Applied rewrites91.8%
if 9.99999999999999946e48 < t Initial program 86.8%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6413.4
Applied rewrites13.4%
Taylor expanded in t around -inf
Applied rewrites96.7%
Final simplification92.3%
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 -6.8e+15)
(- (fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c)) (* (* j k) 27.0))
(if (<= t 2.4e-74)
(-
(-
(fma (* 18.0 x) (* y (* t z)) (fma (* a t) -4.0 (* c b)))
(* (* x 4.0) i))
(* j (* k 27.0)))
(*
(fma
(* -18.0 x)
(* z y)
(fma 4.0 a (/ (- (* c b) (fma (* i x) 4.0 (* (* k j) 27.0))) (- t))))
(- t)))))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 <= -6.8e+15) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - ((j * k) * 27.0);
} else if (t <= 2.4e-74) {
tmp = (fma((18.0 * x), (y * (t * z)), fma((a * t), -4.0, (c * b))) - ((x * 4.0) * i)) - (j * (k * 27.0));
} else {
tmp = fma((-18.0 * x), (z * y), fma(4.0, a, (((c * b) - fma((i * x), 4.0, ((k * j) * 27.0))) / -t))) * -t;
}
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 <= -6.8e+15) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - Float64(Float64(j * k) * 27.0)); elseif (t <= 2.4e-74) tmp = Float64(Float64(fma(Float64(18.0 * x), Float64(y * Float64(t * z)), fma(Float64(a * t), -4.0, Float64(c * b))) - Float64(Float64(x * 4.0) * i)) - Float64(j * Float64(k * 27.0))); else tmp = Float64(fma(Float64(-18.0 * x), Float64(z * y), fma(4.0, a, Float64(Float64(Float64(c * b) - fma(Float64(i * x), 4.0, Float64(Float64(k * j) * 27.0))) / Float64(-t)))) * Float64(-t)); 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, -6.8e+15], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(j * k), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.4e-74], N[(N[(N[(N[(18.0 * x), $MachinePrecision] * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-18.0 * x), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(4.0 * a + N[(N[(N[(c * b), $MachinePrecision] - N[(N[(i * x), $MachinePrecision] * 4.0 + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / (-t)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * (-t)), $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 -6.8 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - \left(j \cdot k\right) \cdot 27\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{-74}:\\
\;\;\;\;\left(\mathsf{fma}\left(18 \cdot x, y \cdot \left(t \cdot z\right), \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right)\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-18 \cdot x, z \cdot y, \mathsf{fma}\left(4, a, \frac{c \cdot b - \mathsf{fma}\left(i \cdot x, 4, \left(k \cdot j\right) \cdot 27\right)}{-t}\right)\right) \cdot \left(-t\right)\\
\end{array}
\end{array}
if t < -6.8e15Initial program 77.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.1
Applied rewrites77.1%
Applied rewrites88.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6488.8
Applied rewrites88.8%
if -6.8e15 < t < 2.3999999999999999e-74Initial program 76.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6476.9
Applied rewrites76.9%
Applied rewrites91.2%
if 2.3999999999999999e-74 < t Initial program 87.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.6
Applied rewrites87.6%
Taylor expanded in t around -inf
Applied rewrites96.3%
Final simplification92.3%
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)))
(if (<= t -6.8e+15)
(- (fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c)) t_1)
(if (<= t 2e-127)
(-
(-
(fma (* 18.0 x) (* y (* t z)) (fma (* a t) -4.0 (* c b)))
(* (* x 4.0) i))
(* j (* k 27.0)))
(fma
(fma (* (* z y) x) 18.0 (* a -4.0))
t
(- (fma c b (* (* i -4.0) x)) 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 tmp;
if (t <= -6.8e+15) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - t_1;
} else if (t <= 2e-127) {
tmp = (fma((18.0 * x), (y * (t * z)), fma((a * t), -4.0, (c * b))) - ((x * 4.0) * i)) - (j * (k * 27.0));
} else {
tmp = fma(fma(((z * y) * x), 18.0, (a * -4.0)), t, (fma(c, b, ((i * -4.0) * x)) - 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(j * k) * 27.0) tmp = 0.0 if (t <= -6.8e+15) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - t_1); elseif (t <= 2e-127) tmp = Float64(Float64(fma(Float64(18.0 * x), Float64(y * Float64(t * z)), fma(Float64(a * t), -4.0, Float64(c * b))) - Float64(Float64(x * 4.0) * i)) - Float64(j * Float64(k * 27.0))); else tmp = fma(fma(Float64(Float64(z * y) * x), 18.0, Float64(a * -4.0)), t, Float64(fma(c, b, Float64(Float64(i * -4.0) * x)) - 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[(j * k), $MachinePrecision] * 27.0), $MachinePrecision]}, If[LessEqual[t, -6.8e+15], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 2e-127], N[(N[(N[(N[(18.0 * x), $MachinePrecision] * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(N[(c * b + N[(N[(i * -4.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - t$95$1), $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 k\right) \cdot 27\\
\mathbf{if}\;t \leq -6.8 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-127}:\\
\;\;\;\;\left(\mathsf{fma}\left(18 \cdot x, y \cdot \left(t \cdot z\right), \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right)\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot x, 18, a \cdot -4\right), t, \mathsf{fma}\left(c, b, \left(i \cdot -4\right) \cdot x\right) - t\_1\right)\\
\end{array}
\end{array}
if t < -6.8e15Initial program 77.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.1
Applied rewrites77.1%
Applied rewrites88.6%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6488.8
Applied rewrites88.8%
if -6.8e15 < t < 2.0000000000000001e-127Initial program 74.6%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6474.6
Applied rewrites74.6%
Applied rewrites90.0%
if 2.0000000000000001e-127 < t Initial program 88.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6488.4
Applied rewrites88.4%
Applied rewrites92.6%
Applied rewrites96.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 (* (* j k) 27.0)))
(if (<= t -1.36e-133)
(- (fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c)) t_1)
(if (<= t 2.2e-134)
(-
(- (fma (* 18.0 x) (* y (* t z)) (* b c)) (* (* x 4.0) i))
(* j (* k 27.0)))
(fma
(fma (* (* z y) x) 18.0 (* a -4.0))
t
(- (fma c b (* (* i -4.0) x)) 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 tmp;
if (t <= -1.36e-133) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - t_1;
} else if (t <= 2.2e-134) {
tmp = (fma((18.0 * x), (y * (t * z)), (b * c)) - ((x * 4.0) * i)) - (j * (k * 27.0));
} else {
tmp = fma(fma(((z * y) * x), 18.0, (a * -4.0)), t, (fma(c, b, ((i * -4.0) * x)) - 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(j * k) * 27.0) tmp = 0.0 if (t <= -1.36e-133) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - t_1); elseif (t <= 2.2e-134) tmp = Float64(Float64(fma(Float64(18.0 * x), Float64(y * Float64(t * z)), Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(j * Float64(k * 27.0))); else tmp = fma(fma(Float64(Float64(z * y) * x), 18.0, Float64(a * -4.0)), t, Float64(fma(c, b, Float64(Float64(i * -4.0) * x)) - 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[(j * k), $MachinePrecision] * 27.0), $MachinePrecision]}, If[LessEqual[t, -1.36e-133], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 2.2e-134], N[(N[(N[(N[(18.0 * x), $MachinePrecision] * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(N[(c * b + N[(N[(i * -4.0), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] - t$95$1), $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 k\right) \cdot 27\\
\mathbf{if}\;t \leq -1.36 \cdot 10^{-133}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - t\_1\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-134}:\\
\;\;\;\;\left(\mathsf{fma}\left(18 \cdot x, y \cdot \left(t \cdot z\right), b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot x, 18, a \cdot -4\right), t, \mathsf{fma}\left(c, b, \left(i \cdot -4\right) \cdot x\right) - t\_1\right)\\
\end{array}
\end{array}
if t < -1.35999999999999991e-133Initial program 77.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied rewrites77.5%
Applied rewrites85.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.9
Applied rewrites86.9%
if -1.35999999999999991e-133 < t < 2.2e-134Initial program 72.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites92.7%
Taylor expanded in t around 0
lift-*.f6487.2
Applied rewrites87.2%
if 2.2e-134 < t Initial program 88.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6488.4
Applied rewrites88.4%
Applied rewrites92.6%
Applied rewrites96.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 -1.36e-133)
(- (fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c)) (* (* j k) 27.0))
(if (<= t 4.55e-26)
(-
(- (fma (* 18.0 x) (* y (* t z)) (* b c)) (* (* x 4.0) i))
(* j (* k 27.0)))
(fma (* j k) -27.0 (fma (fma (* (* z y) x) 18.0 (* a -4.0)) t (* c b))))))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 <= -1.36e-133) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - ((j * k) * 27.0);
} else if (t <= 4.55e-26) {
tmp = (fma((18.0 * x), (y * (t * z)), (b * c)) - ((x * 4.0) * i)) - (j * (k * 27.0));
} else {
tmp = fma((j * k), -27.0, fma(fma(((z * y) * x), 18.0, (a * -4.0)), t, (c * b)));
}
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 <= -1.36e-133) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - Float64(Float64(j * k) * 27.0)); elseif (t <= 4.55e-26) tmp = Float64(Float64(fma(Float64(18.0 * x), Float64(y * Float64(t * z)), Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(j * Float64(k * 27.0))); else tmp = fma(Float64(j * k), -27.0, fma(fma(Float64(Float64(z * y) * x), 18.0, Float64(a * -4.0)), t, Float64(c * b))); 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, -1.36e-133], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(j * k), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.55e-26], N[(N[(N[(N[(18.0 * x), $MachinePrecision] * N[(y * N[(t * z), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $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 -1.36 \cdot 10^{-133}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - \left(j \cdot k\right) \cdot 27\\
\mathbf{elif}\;t \leq 4.55 \cdot 10^{-26}:\\
\;\;\;\;\left(\mathsf{fma}\left(18 \cdot x, y \cdot \left(t \cdot z\right), b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot x, 18, a \cdot -4\right), t, c \cdot b\right)\right)\\
\end{array}
\end{array}
if t < -1.35999999999999991e-133Initial program 77.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied rewrites77.5%
Applied rewrites85.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.9
Applied rewrites86.9%
if -1.35999999999999991e-133 < t < 4.5499999999999997e-26Initial program 76.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6476.8
Applied rewrites76.8%
Applied rewrites94.3%
Taylor expanded in t around 0
lift-*.f6489.0
Applied rewrites89.0%
if 4.5499999999999997e-26 < t Initial program 88.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.9
Applied rewrites87.9%
Applied rewrites93.3%
Taylor expanded in i around 0
Applied rewrites86.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 (* (* j k) 27.0)))
(if (<= t -2.5e-134)
(- (fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c)) t_1)
(if (<= t 1.4e-252)
(- (fma (* 18.0 x) (* (* z y) t) (* c b)) (fma (* i x) 4.0 t_1))
(if (<= t 2.6e+113)
(- (* c b) (fma 4.0 (fma a t (* i x)) (* (* k j) 27.0)))
(fma
(* j k)
-27.0
(fma (fma (* (* z y) x) 18.0 (* a -4.0)) t (* c b))))))))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 tmp;
if (t <= -2.5e-134) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - t_1;
} else if (t <= 1.4e-252) {
tmp = fma((18.0 * x), ((z * y) * t), (c * b)) - fma((i * x), 4.0, t_1);
} else if (t <= 2.6e+113) {
tmp = (c * b) - fma(4.0, fma(a, t, (i * x)), ((k * j) * 27.0));
} else {
tmp = fma((j * k), -27.0, fma(fma(((z * y) * x), 18.0, (a * -4.0)), t, (c * b)));
}
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 * k) * 27.0) tmp = 0.0 if (t <= -2.5e-134) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - t_1); elseif (t <= 1.4e-252) tmp = Float64(fma(Float64(18.0 * x), Float64(Float64(z * y) * t), Float64(c * b)) - fma(Float64(i * x), 4.0, t_1)); elseif (t <= 2.6e+113) tmp = Float64(Float64(c * b) - fma(4.0, fma(a, t, Float64(i * x)), Float64(Float64(k * j) * 27.0))); else tmp = fma(Float64(j * k), -27.0, fma(fma(Float64(Float64(z * y) * x), 18.0, Float64(a * -4.0)), t, Float64(c * b))); 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 * k), $MachinePrecision] * 27.0), $MachinePrecision]}, If[LessEqual[t, -2.5e-134], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[t, 1.4e-252], N[(N[(N[(18.0 * x), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(c * b), $MachinePrecision]), $MachinePrecision] - N[(N[(i * x), $MachinePrecision] * 4.0 + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+113], N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $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 k\right) \cdot 27\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{-134}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - t\_1\\
\mathbf{elif}\;t \leq 1.4 \cdot 10^{-252}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot x, \left(z \cdot y\right) \cdot t, c \cdot b\right) - \mathsf{fma}\left(i \cdot x, 4, t\_1\right)\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+113}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(4, \mathsf{fma}\left(a, t, i \cdot x\right), \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot x, 18, a \cdot -4\right), t, c \cdot b\right)\right)\\
\end{array}
\end{array}
if t < -2.5000000000000002e-134Initial program 77.5%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.5
Applied rewrites77.5%
Applied rewrites85.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6486.9
Applied rewrites86.9%
if -2.5000000000000002e-134 < t < 1.40000000000000009e-252Initial program 75.0%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6475.0
Applied rewrites75.0%
Applied rewrites90.9%
Taylor expanded in t around 0
lift-*.f6488.8
Applied rewrites88.8%
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate--l-N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
Applied rewrites86.3%
if 1.40000000000000009e-252 < t < 2.5999999999999999e113Initial program 83.9%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6489.5
Applied rewrites89.5%
if 2.5999999999999999e113 < t Initial program 85.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.3
Applied rewrites85.3%
Applied rewrites95.1%
Taylor expanded in i around 0
Applied rewrites92.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 (or (<= t -2e-76) (not (<= t 2.6e+113))) (fma (* j k) -27.0 (fma (fma (* (* z y) x) 18.0 (* a -4.0)) t (* c b))) (- (* c b) (fma 4.0 (fma a t (* i x)) (* (* k j) 27.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 ((t <= -2e-76) || !(t <= 2.6e+113)) {
tmp = fma((j * k), -27.0, fma(fma(((z * y) * x), 18.0, (a * -4.0)), t, (c * b)));
} else {
tmp = (c * b) - fma(4.0, fma(a, t, (i * x)), ((k * j) * 27.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 ((t <= -2e-76) || !(t <= 2.6e+113)) tmp = fma(Float64(j * k), -27.0, fma(fma(Float64(Float64(z * y) * x), 18.0, Float64(a * -4.0)), t, Float64(c * b))); else tmp = Float64(Float64(c * b) - fma(4.0, fma(a, t, Float64(i * x)), Float64(Float64(k * j) * 27.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[Or[LessEqual[t, -2e-76], N[Not[LessEqual[t, 2.6e+113]], $MachinePrecision]], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(N[(k * j), $MachinePrecision] * 27.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}\;t \leq -2 \cdot 10^{-76} \lor \neg \left(t \leq 2.6 \cdot 10^{+113}\right):\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot x, 18, a \cdot -4\right), t, c \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(4, \mathsf{fma}\left(a, t, i \cdot x\right), \left(k \cdot j\right) \cdot 27\right)\\
\end{array}
\end{array}
if t < -1.99999999999999985e-76 or 2.5999999999999999e113 < t Initial program 79.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6479.7
Applied rewrites79.7%
Applied rewrites88.7%
Taylor expanded in i around 0
Applied rewrites87.7%
if -1.99999999999999985e-76 < t < 2.5999999999999999e113Initial program 80.9%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.1
Applied rewrites84.1%
Final simplification85.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 -2.2e-151)
(- (fma (fma (* (* y x) 18.0) z (* -4.0 a)) t (* b c)) (* (* j k) 27.0))
(if (<= t 2.6e+113)
(- (* c b) (fma 4.0 (fma a t (* i x)) (* (* k j) 27.0)))
(fma (* j k) -27.0 (fma (fma (* (* z y) x) 18.0 (* a -4.0)) t (* c b))))))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.2e-151) {
tmp = fma(fma(((y * x) * 18.0), z, (-4.0 * a)), t, (b * c)) - ((j * k) * 27.0);
} else if (t <= 2.6e+113) {
tmp = (c * b) - fma(4.0, fma(a, t, (i * x)), ((k * j) * 27.0));
} else {
tmp = fma((j * k), -27.0, fma(fma(((z * y) * x), 18.0, (a * -4.0)), t, (c * b)));
}
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.2e-151) tmp = Float64(fma(fma(Float64(Float64(y * x) * 18.0), z, Float64(-4.0 * a)), t, Float64(b * c)) - Float64(Float64(j * k) * 27.0)); elseif (t <= 2.6e+113) tmp = Float64(Float64(c * b) - fma(4.0, fma(a, t, Float64(i * x)), Float64(Float64(k * j) * 27.0))); else tmp = fma(Float64(j * k), -27.0, fma(fma(Float64(Float64(z * y) * x), 18.0, Float64(a * -4.0)), t, Float64(c * b))); 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.2e-151], N[(N[(N[(N[(N[(y * x), $MachinePrecision] * 18.0), $MachinePrecision] * z + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision] * t + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(j * k), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.6e+113], N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $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.2 \cdot 10^{-151}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot x\right) \cdot 18, z, -4 \cdot a\right), t, b \cdot c\right) - \left(j \cdot k\right) \cdot 27\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+113}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(4, \mathsf{fma}\left(a, t, i \cdot x\right), \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(\mathsf{fma}\left(\left(z \cdot y\right) \cdot x, 18, a \cdot -4\right), t, c \cdot b\right)\right)\\
\end{array}
\end{array}
if t < -2.1999999999999999e-151Initial program 78.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.9
Applied rewrites78.9%
Applied rewrites85.9%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6485.7
Applied rewrites85.7%
if -2.1999999999999999e-151 < t < 2.5999999999999999e113Initial program 79.8%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.2
Applied rewrites85.2%
if 2.5999999999999999e113 < t Initial program 85.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.3
Applied rewrites85.3%
Applied rewrites95.1%
Taylor expanded in i around 0
Applied rewrites92.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 (<= (* b c) -5e+200)
(* c b)
(if (<= (* b c) 0.0)
(* -4.0 (* a t))
(if (<= (* b c) 2e-116)
(* (* -27.0 j) k)
(if (<= (* b c) 4e+159) (* (* -4.0 i) x) (* c b))))))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 ((b * c) <= -5e+200) {
tmp = c * b;
} else if ((b * c) <= 0.0) {
tmp = -4.0 * (a * t);
} else if ((b * c) <= 2e-116) {
tmp = (-27.0 * j) * k;
} else if ((b * c) <= 4e+159) {
tmp = (-4.0 * i) * x;
} else {
tmp = c * b;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if ((b * c) <= (-5d+200)) then
tmp = c * b
else if ((b * c) <= 0.0d0) then
tmp = (-4.0d0) * (a * t)
else if ((b * c) <= 2d-116) then
tmp = ((-27.0d0) * j) * k
else if ((b * c) <= 4d+159) then
tmp = ((-4.0d0) * i) * x
else
tmp = c * b
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 tmp;
if ((b * c) <= -5e+200) {
tmp = c * b;
} else if ((b * c) <= 0.0) {
tmp = -4.0 * (a * t);
} else if ((b * c) <= 2e-116) {
tmp = (-27.0 * j) * k;
} else if ((b * c) <= 4e+159) {
tmp = (-4.0 * i) * x;
} else {
tmp = c * b;
}
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): tmp = 0 if (b * c) <= -5e+200: tmp = c * b elif (b * c) <= 0.0: tmp = -4.0 * (a * t) elif (b * c) <= 2e-116: tmp = (-27.0 * j) * k elif (b * c) <= 4e+159: tmp = (-4.0 * i) * x else: tmp = c * b 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 (Float64(b * c) <= -5e+200) tmp = Float64(c * b); elseif (Float64(b * c) <= 0.0) tmp = Float64(-4.0 * Float64(a * t)); elseif (Float64(b * c) <= 2e-116) tmp = Float64(Float64(-27.0 * j) * k); elseif (Float64(b * c) <= 4e+159) tmp = Float64(Float64(-4.0 * i) * x); else tmp = Float64(c * b); 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)
tmp = 0.0;
if ((b * c) <= -5e+200)
tmp = c * b;
elseif ((b * c) <= 0.0)
tmp = -4.0 * (a * t);
elseif ((b * c) <= 2e-116)
tmp = (-27.0 * j) * k;
elseif ((b * c) <= 4e+159)
tmp = (-4.0 * i) * x;
else
tmp = c * b;
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_] := If[LessEqual[N[(b * c), $MachinePrecision], -5e+200], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 0.0], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e-116], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 4e+159], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], N[(c * b), $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}\;b \cdot c \leq -5 \cdot 10^{+200}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq 0:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{-116}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\mathbf{elif}\;b \cdot c \leq 4 \cdot 10^{+159}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -5.00000000000000019e200 or 3.9999999999999997e159 < (*.f64 b c) Initial program 74.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6470.0
Applied rewrites70.0%
if -5.00000000000000019e200 < (*.f64 b c) < 0.0Initial program 82.2%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6434.0
Applied rewrites34.0%
if 0.0 < (*.f64 b c) < 2e-116Initial program 89.8%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6442.7
Applied rewrites42.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6442.7
Applied rewrites42.7%
if 2e-116 < (*.f64 b c) < 3.9999999999999997e159Initial program 78.4%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6433.8
Applied rewrites33.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 (or (<= (* b c) -1e+124) (not (<= (* b c) 5e+144))) (- (* c b) (* j (* k 27.0))) (- (* -4.0 (* a t)) (* (* j 27.0) k))))
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 (((b * c) <= -1e+124) || !((b * c) <= 5e+144)) {
tmp = (c * b) - (j * (k * 27.0));
} else {
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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) <= (-1d+124)) .or. (.not. ((b * c) <= 5d+144))) then
tmp = (c * b) - (j * (k * 27.0d0))
else
tmp = ((-4.0d0) * (a * t)) - ((j * 27.0d0) * k)
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 tmp;
if (((b * c) <= -1e+124) || !((b * c) <= 5e+144)) {
tmp = (c * b) - (j * (k * 27.0));
} else {
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
}
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): tmp = 0 if ((b * c) <= -1e+124) or not ((b * c) <= 5e+144): tmp = (c * b) - (j * (k * 27.0)) else: tmp = (-4.0 * (a * t)) - ((j * 27.0) * k) 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 ((Float64(b * c) <= -1e+124) || !(Float64(b * c) <= 5e+144)) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); else tmp = Float64(Float64(-4.0 * Float64(a * t)) - Float64(Float64(j * 27.0) * k)); 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)
tmp = 0.0;
if (((b * c) <= -1e+124) || ~(((b * c) <= 5e+144)))
tmp = (c * b) - (j * (k * 27.0));
else
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
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_] := If[Or[LessEqual[N[(b * c), $MachinePrecision], -1e+124], N[Not[LessEqual[N[(b * c), $MachinePrecision], 5e+144]], $MachinePrecision]], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $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}\;b \cdot c \leq -1 \cdot 10^{+124} \lor \neg \left(b \cdot c \leq 5 \cdot 10^{+144}\right):\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if (*.f64 b c) < -9.99999999999999948e123 or 4.9999999999999999e144 < (*.f64 b c) Initial program 76.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6476.8
Applied rewrites76.8%
Taylor expanded in b around inf
*-commutativeN/A
lift-*.f6470.2
Applied rewrites70.2%
if -9.99999999999999948e123 < (*.f64 b c) < 4.9999999999999999e144Initial program 81.7%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6453.9
Applied rewrites53.9%
Final simplification58.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
(if (<= x -2.3e+37)
(* (fma -18.0 (* (* z y) t) (* i 4.0)) (- x))
(if (<= x -6.8e-171)
(- (* c b) (* j (* k 27.0)))
(if (<= x 5.8e-55)
(- (* -4.0 (* a t)) (* (* j 27.0) k))
(* (fma (* (* t z) 18.0) y (* i -4.0)) x)))))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 <= -2.3e+37) {
tmp = fma(-18.0, ((z * y) * t), (i * 4.0)) * -x;
} else if (x <= -6.8e-171) {
tmp = (c * b) - (j * (k * 27.0));
} else if (x <= 5.8e-55) {
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
} else {
tmp = fma(((t * z) * 18.0), y, (i * -4.0)) * x;
}
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 <= -2.3e+37) tmp = Float64(fma(-18.0, Float64(Float64(z * y) * t), Float64(i * 4.0)) * Float64(-x)); elseif (x <= -6.8e-171) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (x <= 5.8e-55) tmp = Float64(Float64(-4.0 * Float64(a * t)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(fma(Float64(Float64(t * z) * 18.0), y, Float64(i * -4.0)) * x); 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, -2.3e+37], N[(N[(-18.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(i * 4.0), $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision], If[LessEqual[x, -6.8e-171], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.8e-55], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * z), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $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.3 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot t, i \cdot 4\right) \cdot \left(-x\right)\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-171}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-55}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, i \cdot -4\right) \cdot x\\
\end{array}
\end{array}
if x < -2.30000000000000002e37Initial program 68.8%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6471.0
Applied rewrites71.0%
if -2.30000000000000002e37 < x < -6.7999999999999997e-171Initial program 86.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.0
Applied rewrites87.0%
Taylor expanded in b around inf
*-commutativeN/A
lift-*.f6464.0
Applied rewrites64.0%
if -6.7999999999999997e-171 < x < 5.8e-55Initial program 93.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6464.1
Applied rewrites64.1%
if 5.8e-55 < x Initial program 70.4%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6410.3
Applied rewrites10.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.8
Applied rewrites63.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6466.3
Applied rewrites66.3%
Final simplification66.3%
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 -2.3e+37)
(* (fma (* 18.0 t) (* z y) (* -4.0 i)) x)
(if (<= x -6.8e-171)
(- (* c b) (* j (* k 27.0)))
(if (<= x 5.8e-55)
(- (* -4.0 (* a t)) (* (* j 27.0) k))
(* (fma (* (* t z) 18.0) y (* i -4.0)) x)))))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 <= -2.3e+37) {
tmp = fma((18.0 * t), (z * y), (-4.0 * i)) * x;
} else if (x <= -6.8e-171) {
tmp = (c * b) - (j * (k * 27.0));
} else if (x <= 5.8e-55) {
tmp = (-4.0 * (a * t)) - ((j * 27.0) * k);
} else {
tmp = fma(((t * z) * 18.0), y, (i * -4.0)) * x;
}
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 <= -2.3e+37) tmp = Float64(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)) * x); elseif (x <= -6.8e-171) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (x <= 5.8e-55) tmp = Float64(Float64(-4.0 * Float64(a * t)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(fma(Float64(Float64(t * z) * 18.0), y, Float64(i * -4.0)) * x); 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, -2.3e+37], N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -6.8e-171], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 5.8e-55], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t * z), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $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.3 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-171}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;x \leq 5.8 \cdot 10^{-55}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, i \cdot -4\right) \cdot x\\
\end{array}
\end{array}
if x < -2.30000000000000002e37Initial program 68.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.0
Applied rewrites71.0%
if -2.30000000000000002e37 < x < -6.7999999999999997e-171Initial program 86.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.0
Applied rewrites87.0%
Taylor expanded in b around inf
*-commutativeN/A
lift-*.f6464.0
Applied rewrites64.0%
if -6.7999999999999997e-171 < x < 5.8e-55Initial program 93.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6464.1
Applied rewrites64.1%
if 5.8e-55 < x Initial program 70.4%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6410.3
Applied rewrites10.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6463.8
Applied rewrites63.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6466.3
Applied rewrites66.3%
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 (* 18.0 t) (* z y) (* -4.0 i)) x)))
(if (<= x -2.3e+37)
t_1
(if (<= x -6.8e-171)
(- (* c b) (* j (* k 27.0)))
(if (<= x 1.25e-33) (- (* -4.0 (* a t)) (* (* j 27.0) 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 = fma((18.0 * t), (z * y), (-4.0 * i)) * x;
double tmp;
if (x <= -2.3e+37) {
tmp = t_1;
} else if (x <= -6.8e-171) {
tmp = (c * b) - (j * (k * 27.0));
} else if (x <= 1.25e-33) {
tmp = (-4.0 * (a * t)) - ((j * 27.0) * 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(fma(Float64(18.0 * t), Float64(z * y), Float64(-4.0 * i)) * x) tmp = 0.0 if (x <= -2.3e+37) tmp = t_1; elseif (x <= -6.8e-171) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); elseif (x <= 1.25e-33) tmp = Float64(Float64(-4.0 * Float64(a * t)) - Float64(Float64(j * 27.0) * 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[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -2.3e+37], t$95$1, If[LessEqual[x, -6.8e-171], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.25e-33], N[(N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $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(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\mathbf{if}\;x \leq -2.3 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -6.8 \cdot 10^{-171}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{-33}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.30000000000000002e37 or 1.25000000000000007e-33 < x Initial program 69.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6467.4
Applied rewrites67.4%
if -2.30000000000000002e37 < x < -6.7999999999999997e-171Initial program 86.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6487.0
Applied rewrites87.0%
Taylor expanded in b around inf
*-commutativeN/A
lift-*.f6464.0
Applied rewrites64.0%
if -6.7999999999999997e-171 < x < 1.25000000000000007e-33Initial program 92.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6463.9
Applied rewrites63.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 (* -4.0 (* a t))))
(if (<= a -3.4e+145)
t_1
(if (<= a -1.4e-226)
(- (* c b) (* (* j 27.0) k))
(if (<= a 2.3e-208)
(* (* (* (* z y) t) 18.0) x)
(if (<= a 1.3e+45) (- (* c b) (* 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 = -4.0 * (a * t);
double tmp;
if (a <= -3.4e+145) {
tmp = t_1;
} else if (a <= -1.4e-226) {
tmp = (c * b) - ((j * 27.0) * k);
} else if (a <= 2.3e-208) {
tmp = (((z * y) * t) * 18.0) * x;
} else if (a <= 1.3e+45) {
tmp = (c * b) - (j * (k * 27.0));
} 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.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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) * (a * t)
if (a <= (-3.4d+145)) then
tmp = t_1
else if (a <= (-1.4d-226)) then
tmp = (c * b) - ((j * 27.0d0) * k)
else if (a <= 2.3d-208) then
tmp = (((z * y) * t) * 18.0d0) * x
else if (a <= 1.3d+45) then
tmp = (c * b) - (j * (k * 27.0d0))
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 = -4.0 * (a * t);
double tmp;
if (a <= -3.4e+145) {
tmp = t_1;
} else if (a <= -1.4e-226) {
tmp = (c * b) - ((j * 27.0) * k);
} else if (a <= 2.3e-208) {
tmp = (((z * y) * t) * 18.0) * x;
} else if (a <= 1.3e+45) {
tmp = (c * b) - (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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -4.0 * (a * t) tmp = 0 if a <= -3.4e+145: tmp = t_1 elif a <= -1.4e-226: tmp = (c * b) - ((j * 27.0) * k) elif a <= 2.3e-208: tmp = (((z * y) * t) * 18.0) * x elif a <= 1.3e+45: tmp = (c * b) - (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(-4.0 * Float64(a * t)) tmp = 0.0 if (a <= -3.4e+145) tmp = t_1; elseif (a <= -1.4e-226) tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k)); elseif (a <= 2.3e-208) tmp = Float64(Float64(Float64(Float64(z * y) * t) * 18.0) * x); elseif (a <= 1.3e+45) tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); 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 = -4.0 * (a * t);
tmp = 0.0;
if (a <= -3.4e+145)
tmp = t_1;
elseif (a <= -1.4e-226)
tmp = (c * b) - ((j * 27.0) * k);
elseif (a <= 2.3e-208)
tmp = (((z * y) * t) * 18.0) * x;
elseif (a <= 1.3e+45)
tmp = (c * b) - (j * (k * 27.0));
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[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -3.4e+145], t$95$1, If[LessEqual[a, -1.4e-226], N[(N[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.3e-208], N[(N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[a, 1.3e+45], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.0), $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(a \cdot t\right)\\
\mathbf{if}\;a \leq -3.4 \cdot 10^{+145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.4 \cdot 10^{-226}:\\
\;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{-208}:\\
\;\;\;\;\left(\left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x\\
\mathbf{elif}\;a \leq 1.3 \cdot 10^{+45}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -3.3999999999999999e145 or 1.30000000000000004e45 < a Initial program 73.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6447.3
Applied rewrites47.3%
if -3.3999999999999999e145 < a < -1.40000000000000004e-226Initial program 84.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6456.7
Applied rewrites56.7%
if -1.40000000000000004e-226 < a < 2.29999999999999997e-208Initial program 81.7%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6411.6
Applied rewrites11.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6478.7
Applied rewrites78.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6451.3
Applied rewrites51.3%
if 2.29999999999999997e-208 < a < 1.30000000000000004e45Initial program 85.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6485.4
Applied rewrites85.4%
Taylor expanded in b around inf
*-commutativeN/A
lift-*.f6455.4
Applied rewrites55.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 (or (<= t_1 -4e+122) (not (<= t_1 4e+160))) (* -27.0 (* k j)) (* c b))))
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 ((t_1 <= -4e+122) || !(t_1 <= 4e+160)) {
tmp = -27.0 * (k * j);
} else {
tmp = c * b;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: tmp
t_1 = (j * 27.0d0) * k
if ((t_1 <= (-4d+122)) .or. (.not. (t_1 <= 4d+160))) then
tmp = (-27.0d0) * (k * j)
else
tmp = c * b
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 * 27.0) * k;
double tmp;
if ((t_1 <= -4e+122) || !(t_1 <= 4e+160)) {
tmp = -27.0 * (k * j);
} else {
tmp = c * b;
}
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 * 27.0) * k tmp = 0 if (t_1 <= -4e+122) or not (t_1 <= 4e+160): tmp = -27.0 * (k * j) else: tmp = c * b 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 ((t_1 <= -4e+122) || !(t_1 <= 4e+160)) tmp = Float64(-27.0 * Float64(k * j)); else tmp = Float64(c * b); 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 * 27.0) * k;
tmp = 0.0;
if ((t_1 <= -4e+122) || ~((t_1 <= 4e+160)))
tmp = -27.0 * (k * j);
else
tmp = c * b;
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[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -4e+122], N[Not[LessEqual[t$95$1, 4e+160]], $MachinePrecision]], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], N[(c * b), $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}\;t\_1 \leq -4 \cdot 10^{+122} \lor \neg \left(t\_1 \leq 4 \cdot 10^{+160}\right):\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.00000000000000006e122 or 4.00000000000000003e160 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 77.1%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.2
Applied rewrites61.2%
if -4.00000000000000006e122 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.00000000000000003e160Initial program 81.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6427.3
Applied rewrites27.3%
Final simplification36.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 (if (or (<= x -9.2e+72) (not (<= x 2.3e+28))) (* (fma (* (* t z) 18.0) y (* i -4.0)) x) (- (fma (* a -4.0) t (* c b)) (* (* j 27.0) k))))
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 <= -9.2e+72) || !(x <= 2.3e+28)) {
tmp = fma(((t * z) * 18.0), y, (i * -4.0)) * x;
} else {
tmp = fma((a * -4.0), t, (c * b)) - ((j * 27.0) * k);
}
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 <= -9.2e+72) || !(x <= 2.3e+28)) tmp = Float64(fma(Float64(Float64(t * z) * 18.0), y, Float64(i * -4.0)) * x); else tmp = Float64(fma(Float64(a * -4.0), t, Float64(c * b)) - Float64(Float64(j * 27.0) * k)); 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[Or[LessEqual[x, -9.2e+72], N[Not[LessEqual[x, 2.3e+28]], $MachinePrecision]], N[(N[(N[(N[(t * z), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(a * -4.0), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $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 -9.2 \cdot 10^{+72} \lor \neg \left(x \leq 2.3 \cdot 10^{+28}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, i \cdot -4\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot -4, t, c \cdot b\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -9.199999999999999e72 or 2.29999999999999984e28 < x Initial program 66.6%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6414.0
Applied rewrites14.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6470.0
Applied rewrites70.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6472.6
Applied rewrites72.6%
if -9.199999999999999e72 < x < 2.29999999999999984e28Initial program 90.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6437.7
Applied rewrites37.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6480.7
Applied rewrites80.7%
Final simplification77.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 (if (or (<= x -9.2e+72) (not (<= x 2.3e+28))) (* (fma (* (* t z) 18.0) y (* i -4.0)) x) (- (fma c b (* -4.0 (* a t))) (* (* j 27.0) k))))
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 <= -9.2e+72) || !(x <= 2.3e+28)) {
tmp = fma(((t * z) * 18.0), y, (i * -4.0)) * x;
} else {
tmp = fma(c, b, (-4.0 * (a * t))) - ((j * 27.0) * k);
}
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 <= -9.2e+72) || !(x <= 2.3e+28)) tmp = Float64(fma(Float64(Float64(t * z) * 18.0), y, Float64(i * -4.0)) * x); else tmp = Float64(fma(c, b, Float64(-4.0 * Float64(a * t))) - Float64(Float64(j * 27.0) * k)); 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[Or[LessEqual[x, -9.2e+72], N[Not[LessEqual[x, 2.3e+28]], $MachinePrecision]], N[(N[(N[(N[(t * z), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(c * b + N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $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 -9.2 \cdot 10^{+72} \lor \neg \left(x \leq 2.3 \cdot 10^{+28}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t \cdot z\right) \cdot 18, y, i \cdot -4\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, -4 \cdot \left(a \cdot t\right)\right) - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if x < -9.199999999999999e72 or 2.29999999999999984e28 < x Initial program 66.6%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6414.0
Applied rewrites14.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6470.0
Applied rewrites70.0%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-fma.f64N/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6472.6
Applied rewrites72.6%
if -9.199999999999999e72 < x < 2.29999999999999984e28Initial program 90.4%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6478.7
Applied rewrites78.7%
Final simplification76.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 (if (<= y -2.15e+220) (* (fma -18.0 (* (* z y) t) (* i 4.0)) (- x)) (- (* c b) (fma 4.0 (fma a t (* i x)) (* (* k j) 27.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 (y <= -2.15e+220) {
tmp = fma(-18.0, ((z * y) * t), (i * 4.0)) * -x;
} else {
tmp = (c * b) - fma(4.0, fma(a, t, (i * x)), ((k * j) * 27.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 (y <= -2.15e+220) tmp = Float64(fma(-18.0, Float64(Float64(z * y) * t), Float64(i * 4.0)) * Float64(-x)); else tmp = Float64(Float64(c * b) - fma(4.0, fma(a, t, Float64(i * x)), Float64(Float64(k * j) * 27.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[y, -2.15e+220], N[(N[(-18.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(i * 4.0), $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision], N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision] + N[(N[(k * j), $MachinePrecision] * 27.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}\;y \leq -2.15 \cdot 10^{+220}:\\
\;\;\;\;\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot t, i \cdot 4\right) \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b - \mathsf{fma}\left(4, \mathsf{fma}\left(a, t, i \cdot x\right), \left(k \cdot j\right) \cdot 27\right)\\
\end{array}
\end{array}
if y < -2.15e220Initial program 84.1%
Taylor expanded in x around -inf
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6467.8
Applied rewrites67.8%
if -2.15e220 < y Initial program 79.9%
Taylor expanded in y around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6477.8
Applied rewrites77.8%
Final simplification76.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 (if (or (<= (* b c) -5e+200) (not (<= (* b c) 4e+40))) (* c b) (* -4.0 (* a t))))
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 (((b * c) <= -5e+200) || !((b * c) <= 4e+40)) {
tmp = c * b;
} else {
tmp = -4.0 * (a * t);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: tmp
if (((b * c) <= (-5d+200)) .or. (.not. ((b * c) <= 4d+40))) then
tmp = c * b
else
tmp = (-4.0d0) * (a * t)
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 tmp;
if (((b * c) <= -5e+200) || !((b * c) <= 4e+40)) {
tmp = c * b;
} else {
tmp = -4.0 * (a * t);
}
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): tmp = 0 if ((b * c) <= -5e+200) or not ((b * c) <= 4e+40): tmp = c * b else: tmp = -4.0 * (a * t) 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 ((Float64(b * c) <= -5e+200) || !(Float64(b * c) <= 4e+40)) tmp = Float64(c * b); else tmp = Float64(-4.0 * Float64(a * t)); 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)
tmp = 0.0;
if (((b * c) <= -5e+200) || ~(((b * c) <= 4e+40)))
tmp = c * b;
else
tmp = -4.0 * (a * t);
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_] := If[Or[LessEqual[N[(b * c), $MachinePrecision], -5e+200], N[Not[LessEqual[N[(b * c), $MachinePrecision], 4e+40]], $MachinePrecision]], N[(c * b), $MachinePrecision], N[(-4.0 * N[(a * t), $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}\;b \cdot c \leq -5 \cdot 10^{+200} \lor \neg \left(b \cdot c \leq 4 \cdot 10^{+40}\right):\\
\;\;\;\;c \cdot b\\
\mathbf{else}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -5.00000000000000019e200 or 4.00000000000000012e40 < (*.f64 b c) Initial program 77.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6455.8
Applied rewrites55.8%
if -5.00000000000000019e200 < (*.f64 b c) < 4.00000000000000012e40Initial program 82.0%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6431.7
Applied rewrites31.7%
Final simplification39.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 (if (or (<= a -3.4e+145) (not (<= a 1.3e+45))) (* -4.0 (* a t)) (- (* c b) (* (* j 27.0) k))))
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 ((a <= -3.4e+145) || !(a <= 1.3e+45)) {
tmp = -4.0 * (a * t);
} else {
tmp = (c * b) - ((j * 27.0) * k);
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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 ((a <= (-3.4d+145)) .or. (.not. (a <= 1.3d+45))) then
tmp = (-4.0d0) * (a * t)
else
tmp = (c * b) - ((j * 27.0d0) * k)
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 tmp;
if ((a <= -3.4e+145) || !(a <= 1.3e+45)) {
tmp = -4.0 * (a * t);
} else {
tmp = (c * b) - ((j * 27.0) * k);
}
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): tmp = 0 if (a <= -3.4e+145) or not (a <= 1.3e+45): tmp = -4.0 * (a * t) else: tmp = (c * b) - ((j * 27.0) * k) 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 ((a <= -3.4e+145) || !(a <= 1.3e+45)) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k)); 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)
tmp = 0.0;
if ((a <= -3.4e+145) || ~((a <= 1.3e+45)))
tmp = -4.0 * (a * t);
else
tmp = (c * b) - ((j * 27.0) * k);
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_] := If[Or[LessEqual[a, -3.4e+145], N[Not[LessEqual[a, 1.3e+45]], $MachinePrecision]], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $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}\;a \leq -3.4 \cdot 10^{+145} \lor \neg \left(a \leq 1.3 \cdot 10^{+45}\right):\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\
\end{array}
\end{array}
if a < -3.3999999999999999e145 or 1.30000000000000004e45 < a Initial program 73.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6447.3
Applied rewrites47.3%
if -3.3999999999999999e145 < a < 1.30000000000000004e45Initial program 84.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6449.5
Applied rewrites49.5%
Final simplification48.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 (if (or (<= a -3.4e+145) (not (<= a 1.3e+45))) (* -4.0 (* a t)) (- (* c b) (* j (* k 27.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 ((a <= -3.4e+145) || !(a <= 1.3e+45)) {
tmp = -4.0 * (a * t);
} else {
tmp = (c * b) - (j * (k * 27.0));
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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 ((a <= (-3.4d+145)) .or. (.not. (a <= 1.3d+45))) then
tmp = (-4.0d0) * (a * t)
else
tmp = (c * b) - (j * (k * 27.0d0))
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 tmp;
if ((a <= -3.4e+145) || !(a <= 1.3e+45)) {
tmp = -4.0 * (a * t);
} else {
tmp = (c * b) - (j * (k * 27.0));
}
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): tmp = 0 if (a <= -3.4e+145) or not (a <= 1.3e+45): tmp = -4.0 * (a * t) else: tmp = (c * b) - (j * (k * 27.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 ((a <= -3.4e+145) || !(a <= 1.3e+45)) tmp = Float64(-4.0 * Float64(a * t)); else tmp = Float64(Float64(c * b) - Float64(j * Float64(k * 27.0))); 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)
tmp = 0.0;
if ((a <= -3.4e+145) || ~((a <= 1.3e+45)))
tmp = -4.0 * (a * t);
else
tmp = (c * b) - (j * (k * 27.0));
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_] := If[Or[LessEqual[a, -3.4e+145], N[Not[LessEqual[a, 1.3e+45]], $MachinePrecision]], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], N[(N[(c * b), $MachinePrecision] - N[(j * N[(k * 27.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}\;a \leq -3.4 \cdot 10^{+145} \lor \neg \left(a \leq 1.3 \cdot 10^{+45}\right):\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b - j \cdot \left(k \cdot 27\right)\\
\end{array}
\end{array}
if a < -3.3999999999999999e145 or 1.30000000000000004e45 < a Initial program 73.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6447.3
Applied rewrites47.3%
if -3.3999999999999999e145 < a < 1.30000000000000004e45Initial program 84.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6484.4
Applied rewrites84.4%
Taylor expanded in b around inf
*-commutativeN/A
lift-*.f6449.5
Applied rewrites49.5%
Final simplification48.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 (* c b))
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 c * b;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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 = c * b
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 c * b;
}
[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 c * b
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(c * b) 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 = c * b;
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[(c * b), $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])\\
\\
c \cdot b
\end{array}
Initial program 80.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6421.5
Applied rewrites21.5%
(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;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
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 2025043
(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)))