
(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}
Herbie found 21 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
(let* ((t_1 (* -27.0 (* k j)))
(t_2
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))))
(if (<= t_2 (- INFINITY))
(fma (* (* z x) t) (* y 18.0) (fma c b (fma (fma i x (* a t)) -4.0 t_1)))
(if (<= t_2 2e+292)
t_2
(fma
(* -4.0 t)
a
(fma (fma -4.0 i (* (* (* z y) t) 18.0)) x (fma c b t_1)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (k * j);
double t_2 = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(((z * x) * t), (y * 18.0), fma(c, b, fma(fma(i, x, (a * t)), -4.0, t_1)));
} else if (t_2 <= 2e+292) {
tmp = t_2;
} else {
tmp = fma((-4.0 * t), a, fma(fma(-4.0, i, (((z * y) * t) * 18.0)), x, fma(c, b, t_1)));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(k * j)) t_2 = 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)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(Float64(Float64(z * x) * t), Float64(y * 18.0), fma(c, b, fma(fma(i, x, Float64(a * t)), -4.0, t_1))); elseif (t_2 <= 2e+292) tmp = t_2; else tmp = fma(Float64(-4.0 * t), a, fma(fma(-4.0, i, Float64(Float64(Float64(z * y) * t) * 18.0)), x, fma(c, b, 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[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(z * x), $MachinePrecision] * t), $MachinePrecision] * N[(y * 18.0), $MachinePrecision] + N[(c * b + N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+292], t$95$2, N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(-4.0 * i + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * x + N[(c * b + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(k \cdot j\right)\\
t_2 := \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\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\left(z \cdot x\right) \cdot t, y \cdot 18, \mathsf{fma}\left(c, b, \mathsf{fma}\left(\mathsf{fma}\left(i, x, a \cdot t\right), -4, t\_1\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+292}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, \mathsf{fma}\left(\mathsf{fma}\left(-4, i, \left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right), x, \mathsf{fma}\left(c, b, t\_1\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < -inf.0Initial program 91.9%
Applied rewrites95.1%
if -inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < 2e292Initial program 99.4%
if 2e292 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 61.7%
Applied rewrites83.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* k j)))
(t_2
(fma
(* -4.0 t)
a
(fma (fma -4.0 i (* (* (* z y) t) 18.0)) x (fma c b t_1)))))
(if (<= x -5e-34)
t_2
(if (<= x 2.9e-91)
(fma
(* (* z x) t)
(* y 18.0)
(fma c b (fma (fma i x (* a t)) -4.0 t_1)))
t_2))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (k * j);
double t_2 = fma((-4.0 * t), a, fma(fma(-4.0, i, (((z * y) * t) * 18.0)), x, fma(c, b, t_1)));
double tmp;
if (x <= -5e-34) {
tmp = t_2;
} else if (x <= 2.9e-91) {
tmp = fma(((z * x) * t), (y * 18.0), fma(c, b, fma(fma(i, x, (a * t)), -4.0, t_1)));
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(k * j)) t_2 = fma(Float64(-4.0 * t), a, fma(fma(-4.0, i, Float64(Float64(Float64(z * y) * t) * 18.0)), x, fma(c, b, t_1))) tmp = 0.0 if (x <= -5e-34) tmp = t_2; elseif (x <= 2.9e-91) tmp = fma(Float64(Float64(z * x) * t), Float64(y * 18.0), fma(c, b, fma(fma(i, x, Float64(a * t)), -4.0, t_1))); else tmp = t_2; 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[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(-4.0 * i + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * x + N[(c * b + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -5e-34], t$95$2, If[LessEqual[x, 2.9e-91], N[(N[(N[(z * x), $MachinePrecision] * t), $MachinePrecision] * N[(y * 18.0), $MachinePrecision] + N[(c * b + N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(k \cdot j\right)\\
t_2 := \mathsf{fma}\left(-4 \cdot t, a, \mathsf{fma}\left(\mathsf{fma}\left(-4, i, \left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right), x, \mathsf{fma}\left(c, b, t\_1\right)\right)\right)\\
\mathbf{if}\;x \leq -5 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{-91}:\\
\;\;\;\;\mathsf{fma}\left(\left(z \cdot x\right) \cdot t, y \cdot 18, \mathsf{fma}\left(c, b, \mathsf{fma}\left(\mathsf{fma}\left(i, x, a \cdot t\right), -4, t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -5.0000000000000003e-34 or 2.9000000000000001e-91 < x Initial program 78.7%
Applied rewrites93.0%
if -5.0000000000000003e-34 < x < 2.9000000000000001e-91Initial program 94.6%
Applied rewrites96.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 -4.6e+238)
(fma
(* -27.0 j)
k
(- (fma b c (* (* (* x y) 18.0) (* z t))) (* (* a t) 4.0)))
(fma
(* -4.0 t)
a
(fma (fma -4.0 i (* (* (* z y) t) 18.0)) x (fma c b (* -27.0 (* k j)))))))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 <= -4.6e+238) {
tmp = fma((-27.0 * j), k, (fma(b, c, (((x * y) * 18.0) * (z * t))) - ((a * t) * 4.0)));
} else {
tmp = fma((-4.0 * t), a, fma(fma(-4.0, i, (((z * y) * t) * 18.0)), x, fma(c, b, (-27.0 * (k * j)))));
}
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 <= -4.6e+238) tmp = fma(Float64(-27.0 * j), k, Float64(fma(b, c, Float64(Float64(Float64(x * y) * 18.0) * Float64(z * t))) - Float64(Float64(a * t) * 4.0))); else tmp = fma(Float64(-4.0 * t), a, fma(fma(-4.0, i, Float64(Float64(Float64(z * y) * t) * 18.0)), x, fma(c, b, Float64(-27.0 * Float64(k * j))))); 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, -4.6e+238], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(b * c + N[(N[(N[(x * y), $MachinePrecision] * 18.0), $MachinePrecision] * N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(a * t), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(-4.0 * i + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * x + N[(c * b + N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+238}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(b, c, \left(\left(x \cdot y\right) \cdot 18\right) \cdot \left(z \cdot t\right)\right) - \left(a \cdot t\right) \cdot 4\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, \mathsf{fma}\left(\mathsf{fma}\left(-4, i, \left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right), x, \mathsf{fma}\left(c, b, -27 \cdot \left(k \cdot j\right)\right)\right)\right)\\
\end{array}
\end{array}
if y < -4.60000000000000005e238Initial program 70.5%
Taylor expanded in i around 0
Applied rewrites75.7%
Applied rewrites77.3%
if -4.60000000000000005e238 < y Initial program 86.8%
Applied rewrites91.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(fma
(* -27.0 j)
k
(fma (fma -4.0 a (* (* (* z y) x) 18.0)) t (* c b))))
(t_2 (* (* j 27.0) k)))
(if (<= t_2 -2e+164)
(fma (* -4.0 t) a (fma (* i -4.0) x (fma c b (* -27.0 (* k j)))))
(if (<= t_2 -10000000000000.0)
t_1
(if (<= t_2 2000000.0)
(fma (* -4.0 t) a (fma c b (* (fma -4.0 i (* (* (* t y) z) 18.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 = fma((-27.0 * j), k, fma(fma(-4.0, a, (((z * y) * x) * 18.0)), t, (c * b)));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -2e+164) {
tmp = fma((-4.0 * t), a, fma((i * -4.0), x, fma(c, b, (-27.0 * (k * j)))));
} else if (t_2 <= -10000000000000.0) {
tmp = t_1;
} else if (t_2 <= 2000000.0) {
tmp = fma((-4.0 * t), a, fma(c, b, (fma(-4.0, i, (((t * y) * z) * 18.0)) * x)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(-27.0 * j), k, fma(fma(-4.0, a, Float64(Float64(Float64(z * y) * x) * 18.0)), t, Float64(c * b))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -2e+164) tmp = fma(Float64(-4.0 * t), a, fma(Float64(i * -4.0), x, fma(c, b, Float64(-27.0 * Float64(k * j))))); elseif (t_2 <= -10000000000000.0) tmp = t_1; elseif (t_2 <= 2000000.0) tmp = fma(Float64(-4.0 * t), a, fma(c, b, Float64(fma(-4.0, i, Float64(Float64(Float64(t * y) * z) * 18.0)) * x))); 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[(-27.0 * j), $MachinePrecision] * k + N[(N[(-4.0 * a + N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+164], N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(i * -4.0), $MachinePrecision] * x + N[(c * b + N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -10000000000000.0], t$95$1, If[LessEqual[t$95$2, 2000000.0], N[(N[(-4.0 * t), $MachinePrecision] * a + N[(c * b + N[(N[(-4.0 * i + N[(N[(N[(t * y), $MachinePrecision] * z), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, \left(\left(z \cdot y\right) \cdot x\right) \cdot 18\right), t, c \cdot b\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+164}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, \mathsf{fma}\left(i \cdot -4, x, \mathsf{fma}\left(c, b, -27 \cdot \left(k \cdot j\right)\right)\right)\right)\\
\mathbf{elif}\;t\_2 \leq -10000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2000000:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, \mathsf{fma}\left(c, b, \mathsf{fma}\left(-4, i, \left(\left(t \cdot y\right) \cdot z\right) \cdot 18\right) \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -2e164Initial program 79.1%
Applied rewrites86.6%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6484.1
Applied rewrites84.1%
if -2e164 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -1e13 or 2e6 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 84.5%
Taylor expanded in i around 0
Applied rewrites80.6%
if -1e13 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2e6Initial program 87.0%
Applied rewrites92.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6476.1
Applied rewrites76.1%
Taylor expanded in b around inf
lower-*.f6473.8
Applied rewrites73.8%
Taylor expanded in j around 0
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6490.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6490.2
Applied rewrites90.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
(* -27.0 j)
k
(fma (fma -4.0 a (* (* (* z y) x) 18.0)) t (* c b)))))
(if (<= t -1.05e-13)
t_1
(if (<= t 3.6e+29)
(fma (* -4.0 t) a (fma (* i -4.0) x (fma c b (* -27.0 (* k j)))))
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((-27.0 * j), k, fma(fma(-4.0, a, (((z * y) * x) * 18.0)), t, (c * b)));
double tmp;
if (t <= -1.05e-13) {
tmp = t_1;
} else if (t <= 3.6e+29) {
tmp = fma((-4.0 * t), a, fma((i * -4.0), x, fma(c, b, (-27.0 * (k * j)))));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(-27.0 * j), k, fma(fma(-4.0, a, Float64(Float64(Float64(z * y) * x) * 18.0)), t, Float64(c * b))) tmp = 0.0 if (t <= -1.05e-13) tmp = t_1; elseif (t <= 3.6e+29) tmp = fma(Float64(-4.0 * t), a, fma(Float64(i * -4.0), x, fma(c, b, Float64(-27.0 * Float64(k * j))))); 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[(-27.0 * j), $MachinePrecision] * k + N[(N[(-4.0 * a + N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e-13], t$95$1, If[LessEqual[t, 3.6e+29], N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(i * -4.0), $MachinePrecision] * x + N[(c * b + N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, \left(\left(z \cdot y\right) \cdot x\right) \cdot 18\right), t, c \cdot b\right)\right)\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.6 \cdot 10^{+29}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, \mathsf{fma}\left(i \cdot -4, x, \mathsf{fma}\left(c, b, -27 \cdot \left(k \cdot j\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.04999999999999994e-13 or 3.59999999999999976e29 < t Initial program 83.4%
Taylor expanded in i around 0
Applied rewrites86.3%
if -1.04999999999999994e-13 < t < 3.59999999999999976e29Initial program 86.6%
Applied rewrites92.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6486.7
Applied rewrites86.7%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (fma (* (* y z) x) 18.0 (* a -4.0)) t (* (* j k) -27.0))))
(if (<= t -4.5e+96)
t_1
(if (<= t 4.2e+30)
(fma (* -4.0 t) a (fma (* i -4.0) x (fma c b (* -27.0 (* k j)))))
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(fma(((y * z) * x), 18.0, (a * -4.0)), t, ((j * k) * -27.0));
double tmp;
if (t <= -4.5e+96) {
tmp = t_1;
} else if (t <= 4.2e+30) {
tmp = fma((-4.0 * t), a, fma((i * -4.0), x, fma(c, b, (-27.0 * (k * j)))));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(fma(Float64(Float64(y * z) * x), 18.0, Float64(a * -4.0)), t, Float64(Float64(j * k) * -27.0)) tmp = 0.0 if (t <= -4.5e+96) tmp = t_1; elseif (t <= 4.2e+30) tmp = fma(Float64(-4.0 * t), a, fma(Float64(i * -4.0), x, fma(c, b, Float64(-27.0 * Float64(k * j))))); 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[(N[(y * z), $MachinePrecision] * x), $MachinePrecision] * 18.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.5e+96], t$95$1, If[LessEqual[t, 4.2e+30], N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(i * -4.0), $MachinePrecision] * x + N[(c * b + N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot z\right) \cdot x, 18, a \cdot -4\right), t, \left(j \cdot k\right) \cdot -27\right)\\
\mathbf{if}\;t \leq -4.5 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.2 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, \mathsf{fma}\left(i \cdot -4, x, \mathsf{fma}\left(c, b, -27 \cdot \left(k \cdot j\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.49999999999999957e96 or 4.2e30 < t Initial program 82.2%
Taylor expanded in i around 0
Applied rewrites87.4%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6477.1
Applied rewrites77.1%
if -4.49999999999999957e96 < t < 4.2e30Initial program 86.9%
Applied rewrites92.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6485.1
Applied rewrites85.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (fma (* (* y z) x) 18.0 (* a -4.0)) t (* (* j k) -27.0))))
(if (<= t -3.9e+96)
t_1
(if (<= t 4e+30)
(- (fma (fma i x (* a t)) -4.0 (* c b)) (* (* 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(fma(((y * z) * x), 18.0, (a * -4.0)), t, ((j * k) * -27.0));
double tmp;
if (t <= -3.9e+96) {
tmp = t_1;
} else if (t <= 4e+30) {
tmp = fma(fma(i, x, (a * t)), -4.0, (c * b)) - ((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 = fma(fma(Float64(Float64(y * z) * x), 18.0, Float64(a * -4.0)), t, Float64(Float64(j * k) * -27.0)) tmp = 0.0 if (t <= -3.9e+96) tmp = t_1; elseif (t <= 4e+30) tmp = Float64(fma(fma(i, x, Float64(a * t)), -4.0, Float64(c * b)) - 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[(N[(y * z), $MachinePrecision] * x), $MachinePrecision] * 18.0 + N[(a * -4.0), $MachinePrecision]), $MachinePrecision] * t + N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.9e+96], t$95$1, If[LessEqual[t, 4e+30], N[(N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(c * b), $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(\mathsf{fma}\left(\left(y \cdot z\right) \cdot x, 18, a \cdot -4\right), t, \left(j \cdot k\right) \cdot -27\right)\\
\mathbf{if}\;t \leq -3.9 \cdot 10^{+96}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, x, a \cdot t\right), -4, c \cdot b\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.9e96 or 4.0000000000000001e30 < t Initial program 82.2%
Taylor expanded in i around 0
Applied rewrites87.4%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6477.1
Applied rewrites77.1%
if -3.9e96 < t < 4.0000000000000001e30Initial program 86.9%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate--r-N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-+r+N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied rewrites84.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -2.45e+148)
(* (fma -4.0 i (* (* (* z y) t) 18.0)) x)
(if (<= x 9.5e+246)
(- (fma (fma i x (* a t)) -4.0 (* c b)) (* (* j 27.0) k))
(* (fma -4.0 a (* (* (* z y) x) 18.0)) 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 (x <= -2.45e+148) {
tmp = fma(-4.0, i, (((z * y) * t) * 18.0)) * x;
} else if (x <= 9.5e+246) {
tmp = fma(fma(i, x, (a * t)), -4.0, (c * b)) - ((j * 27.0) * k);
} else {
tmp = fma(-4.0, a, (((z * y) * x) * 18.0)) * 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 (x <= -2.45e+148) tmp = Float64(fma(-4.0, i, Float64(Float64(Float64(z * y) * t) * 18.0)) * x); elseif (x <= 9.5e+246) tmp = Float64(fma(fma(i, x, Float64(a * t)), -4.0, Float64(c * b)) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(fma(-4.0, a, Float64(Float64(Float64(z * y) * x) * 18.0)) * 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[x, -2.45e+148], N[(N[(-4.0 * i + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 9.5e+246], N[(N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * a + N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0), $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}\;x \leq -2.45 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(-4, i, \left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{+246}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(i, x, a \cdot t\right), -4, c \cdot b\right) - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-4, a, \left(\left(z \cdot y\right) \cdot x\right) \cdot 18\right) \cdot t\\
\end{array}
\end{array}
if x < -2.45e148Initial program 68.3%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-lft-neg-outN/A
associate-*r*N/A
distribute-lft-neg-outN/A
distribute-neg-inN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
Applied rewrites76.6%
if -2.45e148 < x < 9.50000000000000055e246Initial program 88.8%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
associate--r-N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-+r+N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
Applied rewrites80.4%
if 9.50000000000000055e246 < x Initial program 66.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6456.9
Applied rewrites56.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 (<= x -1.06e+141)
(* (fma -4.0 i (* (* (* z y) t) 18.0)) x)
(if (<= x -2.7e-62)
(fma (* -4.0 t) a (fma (* i -4.0) x (* (* j k) -27.0)))
(if (<= x 2.3e+98)
(fma (* -4.0 t) a (fma (* k -27.0) j (* b c)))
(* (fma (* (* y t) z) 18.0 (* 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 <= -1.06e+141) {
tmp = fma(-4.0, i, (((z * y) * t) * 18.0)) * x;
} else if (x <= -2.7e-62) {
tmp = fma((-4.0 * t), a, fma((i * -4.0), x, ((j * k) * -27.0)));
} else if (x <= 2.3e+98) {
tmp = fma((-4.0 * t), a, fma((k * -27.0), j, (b * c)));
} else {
tmp = fma(((y * t) * z), 18.0, (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 <= -1.06e+141) tmp = Float64(fma(-4.0, i, Float64(Float64(Float64(z * y) * t) * 18.0)) * x); elseif (x <= -2.7e-62) tmp = fma(Float64(-4.0 * t), a, fma(Float64(i * -4.0), x, Float64(Float64(j * k) * -27.0))); elseif (x <= 2.3e+98) tmp = fma(Float64(-4.0 * t), a, fma(Float64(k * -27.0), j, Float64(b * c))); else tmp = Float64(fma(Float64(Float64(y * t) * z), 18.0, 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, -1.06e+141], N[(N[(-4.0 * i + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -2.7e-62], N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(i * -4.0), $MachinePrecision] * x + N[(N[(j * k), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.3e+98], N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * t), $MachinePrecision] * z), $MachinePrecision] * 18.0 + 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 -1.06 \cdot 10^{+141}:\\
\;\;\;\;\mathsf{fma}\left(-4, i, \left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-62}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, \mathsf{fma}\left(i \cdot -4, x, \left(j \cdot k\right) \cdot -27\right)\right)\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, \mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot t\right) \cdot z, 18, i \cdot -4\right) \cdot x\\
\end{array}
\end{array}
if x < -1.05999999999999997e141Initial program 69.1%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-lft-neg-outN/A
associate-*r*N/A
distribute-lft-neg-outN/A
distribute-neg-inN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
Applied rewrites76.1%
if -1.05999999999999997e141 < x < -2.70000000000000019e-62Initial program 86.5%
Applied rewrites92.7%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f6478.6
Applied rewrites78.6%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
lower-*.f6460.6
Applied rewrites60.6%
if -2.70000000000000019e-62 < x < 2.30000000000000013e98Initial program 93.1%
Applied rewrites88.3%
Taylor expanded in x around 0
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6477.0
Applied rewrites77.0%
if 2.30000000000000013e98 < x Initial program 71.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6415.4
Applied rewrites15.4%
Taylor expanded in x around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.4
Applied rewrites72.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.9
Applied rewrites72.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 (<= x -3.4e+131)
(* (fma -4.0 i (* (* (* z y) t) 18.0)) x)
(if (<= x 2.3e+98)
(fma (* j k) -27.0 (fma (* a t) -4.0 (* b c)))
(* (fma (* (* y t) z) 18.0 (* 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 <= -3.4e+131) {
tmp = fma(-4.0, i, (((z * y) * t) * 18.0)) * x;
} else if (x <= 2.3e+98) {
tmp = fma((j * k), -27.0, fma((a * t), -4.0, (b * c)));
} else {
tmp = fma(((y * t) * z), 18.0, (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 <= -3.4e+131) tmp = Float64(fma(-4.0, i, Float64(Float64(Float64(z * y) * t) * 18.0)) * x); elseif (x <= 2.3e+98) tmp = fma(Float64(j * k), -27.0, fma(Float64(a * t), -4.0, Float64(b * c))); else tmp = Float64(fma(Float64(Float64(y * t) * z), 18.0, 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, -3.4e+131], N[(N[(-4.0 * i + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, 2.3e+98], N[(N[(j * k), $MachinePrecision] * -27.0 + N[(N[(a * t), $MachinePrecision] * -4.0 + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(y * t), $MachinePrecision] * z), $MachinePrecision] * 18.0 + 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 -3.4 \cdot 10^{+131}:\\
\;\;\;\;\mathsf{fma}\left(-4, i, \left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+98}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot k, -27, \mathsf{fma}\left(a \cdot t, -4, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot t\right) \cdot z, 18, i \cdot -4\right) \cdot x\\
\end{array}
\end{array}
if x < -3.39999999999999986e131Initial program 69.8%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-lft-neg-outN/A
associate-*r*N/A
distribute-lft-neg-outN/A
distribute-neg-inN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
Applied rewrites75.6%
if -3.39999999999999986e131 < x < 2.30000000000000013e98Initial program 91.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6427.3
Applied rewrites27.3%
Taylor expanded in x around 0
associate--r+N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6472.1
Applied rewrites72.1%
if 2.30000000000000013e98 < x Initial program 71.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6415.4
Applied rewrites15.4%
Taylor expanded in x around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.4
Applied rewrites72.4%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6472.9
Applied rewrites72.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 (* (fma -4.0 a (* (* (* z y) x) 18.0)) t)))
(if (<= t -7e+44)
t_1
(if (<= t 4e+30) (fma (* j -27.0) k (fma (* x i) -4.0 (* b c))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma(-4.0, a, (((z * y) * x) * 18.0)) * t;
double tmp;
if (t <= -7e+44) {
tmp = t_1;
} else if (t <= 4e+30) {
tmp = fma((j * -27.0), k, fma((x * i), -4.0, (b * c)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(fma(-4.0, a, Float64(Float64(Float64(z * y) * x) * 18.0)) * t) tmp = 0.0 if (t <= -7e+44) tmp = t_1; elseif (t <= 4e+30) tmp = fma(Float64(j * -27.0), k, fma(Float64(x * i), -4.0, Float64(b * c))); 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[(-4.0 * a + N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -7e+44], t$95$1, If[LessEqual[t, 4e+30], N[(N[(j * -27.0), $MachinePrecision] * k + N[(N[(x * i), $MachinePrecision] * -4.0 + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-4, a, \left(\left(z \cdot y\right) \cdot x\right) \cdot 18\right) \cdot t\\
\mathbf{if}\;t \leq -7 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+30}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, \mathsf{fma}\left(x \cdot i, -4, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.9999999999999998e44 or 4.0000000000000001e30 < t Initial program 82.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6466.9
Applied rewrites66.9%
if -6.9999999999999998e44 < t < 4.0000000000000001e30Initial program 86.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6428.4
Applied rewrites28.4%
Taylor expanded in t around 0
associate--r+N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6477.1
Applied rewrites77.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (* -4.0 t) a (* b c))))
(if (<= (* b c) -1e+22)
t_1
(if (<= (* b c) -2e-209)
(fma (* -27.0 j) k (* (* a t) -4.0))
(if (<= (* b c) 2e+63)
(* (fma (* (* y t) z) 18.0 (* 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 = fma((-4.0 * t), a, (b * c));
double tmp;
if ((b * c) <= -1e+22) {
tmp = t_1;
} else if ((b * c) <= -2e-209) {
tmp = fma((-27.0 * j), k, ((a * t) * -4.0));
} else if ((b * c) <= 2e+63) {
tmp = fma(((y * t) * z), 18.0, (i * -4.0)) * x;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(-4.0 * t), a, Float64(b * c)) tmp = 0.0 if (Float64(b * c) <= -1e+22) tmp = t_1; elseif (Float64(b * c) <= -2e-209) tmp = fma(Float64(-27.0 * j), k, Float64(Float64(a * t) * -4.0)); elseif (Float64(b * c) <= 2e+63) tmp = Float64(fma(Float64(Float64(y * t) * z), 18.0, Float64(i * -4.0)) * x); 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[(-4.0 * t), $MachinePrecision] * a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1e+22], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -2e-209], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(a * t), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+63], N[(N[(N[(N[(y * t), $MachinePrecision] * z), $MachinePrecision] * 18.0 + N[(i * -4.0), $MachinePrecision]), $MachinePrecision] * x), $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(-4 \cdot t, a, b \cdot c\right)\\
\mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq -2 \cdot 10^{-209}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \left(a \cdot t\right) \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(\left(y \cdot t\right) \cdot z, 18, i \cdot -4\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -1e22 or 2.00000000000000012e63 < (*.f64 b c) Initial program 82.8%
Applied rewrites89.5%
Taylor expanded in b around inf
lower-*.f6459.5
Applied rewrites59.5%
if -1e22 < (*.f64 b c) < -2.0000000000000001e-209Initial program 86.3%
Taylor expanded in i around 0
Applied rewrites74.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6451.3
Applied rewrites51.3%
if -2.0000000000000001e-209 < (*.f64 b c) < 2.00000000000000012e63Initial program 86.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f644.6
Applied rewrites4.6%
Taylor expanded in x around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.3
Applied rewrites49.3%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6450.6
Applied rewrites50.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (* -4.0 t) a (* b c))))
(if (<= (* b c) -1e+22)
t_1
(if (<= (* b c) -2e-209)
(fma (* -27.0 j) k (* (* a t) -4.0))
(if (<= (* b c) 2e+63)
(* (fma -4.0 i (* (* (* z y) t) 18.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 = fma((-4.0 * t), a, (b * c));
double tmp;
if ((b * c) <= -1e+22) {
tmp = t_1;
} else if ((b * c) <= -2e-209) {
tmp = fma((-27.0 * j), k, ((a * t) * -4.0));
} else if ((b * c) <= 2e+63) {
tmp = fma(-4.0, i, (((z * y) * t) * 18.0)) * x;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(-4.0 * t), a, Float64(b * c)) tmp = 0.0 if (Float64(b * c) <= -1e+22) tmp = t_1; elseif (Float64(b * c) <= -2e-209) tmp = fma(Float64(-27.0 * j), k, Float64(Float64(a * t) * -4.0)); elseif (Float64(b * c) <= 2e+63) tmp = Float64(fma(-4.0, i, Float64(Float64(Float64(z * y) * t) * 18.0)) * x); 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[(-4.0 * t), $MachinePrecision] * a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1e+22], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -2e-209], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(a * t), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+63], N[(N[(-4.0 * i + N[(N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * x), $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(-4 \cdot t, a, b \cdot c\right)\\
\mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq -2 \cdot 10^{-209}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \left(a \cdot t\right) \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+63}:\\
\;\;\;\;\mathsf{fma}\left(-4, i, \left(\left(z \cdot y\right) \cdot t\right) \cdot 18\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -1e22 or 2.00000000000000012e63 < (*.f64 b c) Initial program 82.8%
Applied rewrites89.5%
Taylor expanded in b around inf
lower-*.f6459.5
Applied rewrites59.5%
if -1e22 < (*.f64 b c) < -2.0000000000000001e-209Initial program 86.3%
Taylor expanded in i around 0
Applied rewrites74.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6451.3
Applied rewrites51.3%
if -2.0000000000000001e-209 < (*.f64 b c) < 2.00000000000000012e63Initial program 86.9%
Taylor expanded in x around inf
fp-cancel-sub-sign-invN/A
associate-*r*N/A
metadata-evalN/A
distribute-lft-neg-inN/A
distribute-lft-neg-outN/A
associate-*r*N/A
distribute-lft-neg-outN/A
distribute-neg-inN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
Applied rewrites49.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 (* -4.0 t) a (* b c)))
(t_2 (fma (* -27.0 j) k (* (* a t) -4.0))))
(if (<= (* b c) -1e+22)
t_1
(if (<= (* b c) -5e-124)
t_2
(if (<= (* b c) 1e-13)
(fma (* -4.0 t) a (* (* x i) -4.0))
(if (<= (* b c) 5e+67) t_2 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((-4.0 * t), a, (b * c));
double t_2 = fma((-27.0 * j), k, ((a * t) * -4.0));
double tmp;
if ((b * c) <= -1e+22) {
tmp = t_1;
} else if ((b * c) <= -5e-124) {
tmp = t_2;
} else if ((b * c) <= 1e-13) {
tmp = fma((-4.0 * t), a, ((x * i) * -4.0));
} else if ((b * c) <= 5e+67) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(-4.0 * t), a, Float64(b * c)) t_2 = fma(Float64(-27.0 * j), k, Float64(Float64(a * t) * -4.0)) tmp = 0.0 if (Float64(b * c) <= -1e+22) tmp = t_1; elseif (Float64(b * c) <= -5e-124) tmp = t_2; elseif (Float64(b * c) <= 1e-13) tmp = fma(Float64(-4.0 * t), a, Float64(Float64(x * i) * -4.0)); elseif (Float64(b * c) <= 5e+67) tmp = t_2; 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[(-4.0 * t), $MachinePrecision] * a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(a * t), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1e+22], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], -5e-124], t$95$2, If[LessEqual[N[(b * c), $MachinePrecision], 1e-13], N[(N[(-4.0 * t), $MachinePrecision] * a + N[(N[(x * i), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5e+67], t$95$2, 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(-4 \cdot t, a, b \cdot c\right)\\
t_2 := \mathsf{fma}\left(-27 \cdot j, k, \left(a \cdot t\right) \cdot -4\right)\\
\mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq -5 \cdot 10^{-124}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \cdot c \leq 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, \left(x \cdot i\right) \cdot -4\right)\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+67}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -1e22 or 4.99999999999999976e67 < (*.f64 b c) Initial program 82.8%
Applied rewrites89.5%
Taylor expanded in b around inf
lower-*.f6459.8
Applied rewrites59.8%
if -1e22 < (*.f64 b c) < -5.0000000000000003e-124 or 1e-13 < (*.f64 b c) < 4.99999999999999976e67Initial program 87.1%
Taylor expanded in i around 0
Applied rewrites74.8%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6449.5
Applied rewrites49.5%
if -5.0000000000000003e-124 < (*.f64 b c) < 1e-13Initial program 86.6%
Applied rewrites91.3%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.2
Applied rewrites49.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 -4.0 a (* (* (* z y) x) 18.0)) t)))
(if (<= t -1.05e+44)
t_1
(if (<= t 1.65e-17) (fma (* -27.0 j) k (* b c)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma(-4.0, a, (((z * y) * x) * 18.0)) * t;
double tmp;
if (t <= -1.05e+44) {
tmp = t_1;
} else if (t <= 1.65e-17) {
tmp = fma((-27.0 * j), k, (b * c));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(fma(-4.0, a, Float64(Float64(Float64(z * y) * x) * 18.0)) * t) tmp = 0.0 if (t <= -1.05e+44) tmp = t_1; elseif (t <= 1.65e-17) tmp = fma(Float64(-27.0 * j), k, Float64(b * c)); 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[(-4.0 * a + N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * 18.0), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.05e+44], t$95$1, If[LessEqual[t, 1.65e-17], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(b * c), $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(-4, a, \left(\left(z \cdot y\right) \cdot x\right) \cdot 18\right) \cdot t\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.04999999999999993e44 or 1.65e-17 < t Initial program 83.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6464.6
Applied rewrites64.6%
if -1.04999999999999993e44 < t < 1.65e-17Initial program 86.6%
Taylor expanded in i around 0
Applied rewrites68.8%
Taylor expanded in t around 0
lower-*.f6455.5
Applied rewrites55.5%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (* -4.0 t) a (* b c))))
(if (<= (* b c) -1e+22)
t_1
(if (<= (* b c) 5e+67) (fma (* -27.0 j) k (* (* a t) -4.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 = fma((-4.0 * t), a, (b * c));
double tmp;
if ((b * c) <= -1e+22) {
tmp = t_1;
} else if ((b * c) <= 5e+67) {
tmp = fma((-27.0 * j), k, ((a * t) * -4.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 = fma(Float64(-4.0 * t), a, Float64(b * c)) tmp = 0.0 if (Float64(b * c) <= -1e+22) tmp = t_1; elseif (Float64(b * c) <= 5e+67) tmp = fma(Float64(-27.0 * j), k, Float64(Float64(a * t) * -4.0)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(-4.0 * t), $MachinePrecision] * a + N[(b * c), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1e+22], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 5e+67], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(a * t), $MachinePrecision] * -4.0), $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(-4 \cdot t, a, b \cdot c\right)\\
\mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+67}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \left(a \cdot t\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -1e22 or 4.99999999999999976e67 < (*.f64 b c) Initial program 82.8%
Applied rewrites89.5%
Taylor expanded in b around inf
lower-*.f6459.8
Applied rewrites59.8%
if -1e22 < (*.f64 b c) < 4.99999999999999976e67Initial program 86.7%
Taylor expanded in i around 0
Applied rewrites73.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6450.7
Applied rewrites50.7%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* (* j 27.0) k)))
(if (<= t_1 -5e+216)
(* -27.0 (* k j))
(if (<= t_1 1e+71)
(fma (* -4.0 t) a (* b c))
(fma (* -27.0 j) k (* b c))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = (j * 27.0) * k;
double tmp;
if (t_1 <= -5e+216) {
tmp = -27.0 * (k * j);
} else if (t_1 <= 1e+71) {
tmp = fma((-4.0 * t), a, (b * c));
} else {
tmp = fma((-27.0 * j), k, (b * c));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_1 <= -5e+216) tmp = Float64(-27.0 * Float64(k * j)); elseif (t_1 <= 1e+71) tmp = fma(Float64(-4.0 * t), a, Float64(b * c)); else tmp = fma(Float64(-27.0 * j), k, Float64(b * c)); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+216], N[(-27.0 * N[(k * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+71], N[(N[(-4.0 * t), $MachinePrecision] * a + N[(b * c), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+216}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(-4 \cdot t, a, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, b \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.9999999999999998e216Initial program 75.9%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6470.4
Applied rewrites70.4%
if -4.9999999999999998e216 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1e71Initial program 87.2%
Applied rewrites91.7%
Taylor expanded in b around inf
lower-*.f6448.3
Applied rewrites48.3%
if 1e71 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 82.3%
Taylor expanded in i around 0
Applied rewrites83.5%
Taylor expanded in t around 0
lower-*.f6463.2
Applied rewrites63.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 (<= i 4.4e+211) (fma (* -27.0 j) k (* b c)) (* (* -4.0 i) 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 (i <= 4.4e+211) {
tmp = fma((-27.0 * j), k, (b * c));
} else {
tmp = (-4.0 * i) * 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 (i <= 4.4e+211) tmp = fma(Float64(-27.0 * j), k, Float64(b * c)); else tmp = Float64(Float64(-4.0 * i) * 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[i, 4.4e+211], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(b * c), $MachinePrecision]), $MachinePrecision], N[(N[(-4.0 * i), $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}\;i \leq 4.4 \cdot 10^{+211}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if i < 4.40000000000000009e211Initial program 85.4%
Taylor expanded in i around 0
Applied rewrites78.4%
Taylor expanded in t around 0
lower-*.f6445.5
Applied rewrites45.5%
if 4.40000000000000009e211 < i Initial program 80.7%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.1
Applied rewrites51.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 (<= (* b c) -2e+135)
(* c b)
(if (<= (* b c) -2e-209)
(* -4.0 (* a t))
(if (<= (* b c) 1e-13)
(* (* -4.0 i) x)
(if (<= (* b c) 5e+67) (* -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 tmp;
if ((b * c) <= -2e+135) {
tmp = c * b;
} else if ((b * c) <= -2e-209) {
tmp = -4.0 * (a * t);
} else if ((b * c) <= 1e-13) {
tmp = (-4.0 * i) * x;
} else if ((b * c) <= 5e+67) {
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) :: tmp
if ((b * c) <= (-2d+135)) then
tmp = c * b
else if ((b * c) <= (-2d-209)) then
tmp = (-4.0d0) * (a * t)
else if ((b * c) <= 1d-13) then
tmp = ((-4.0d0) * i) * x
else if ((b * c) <= 5d+67) 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 tmp;
if ((b * c) <= -2e+135) {
tmp = c * b;
} else if ((b * c) <= -2e-209) {
tmp = -4.0 * (a * t);
} else if ((b * c) <= 1e-13) {
tmp = (-4.0 * i) * x;
} else if ((b * c) <= 5e+67) {
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): tmp = 0 if (b * c) <= -2e+135: tmp = c * b elif (b * c) <= -2e-209: tmp = -4.0 * (a * t) elif (b * c) <= 1e-13: tmp = (-4.0 * i) * x elif (b * c) <= 5e+67: 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) tmp = 0.0 if (Float64(b * c) <= -2e+135) tmp = Float64(c * b); elseif (Float64(b * c) <= -2e-209) tmp = Float64(-4.0 * Float64(a * t)); elseif (Float64(b * c) <= 1e-13) tmp = Float64(Float64(-4.0 * i) * x); elseif (Float64(b * c) <= 5e+67) 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)
tmp = 0.0;
if ((b * c) <= -2e+135)
tmp = c * b;
elseif ((b * c) <= -2e-209)
tmp = -4.0 * (a * t);
elseif ((b * c) <= 1e-13)
tmp = (-4.0 * i) * x;
elseif ((b * c) <= 5e+67)
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_] := If[LessEqual[N[(b * c), $MachinePrecision], -2e+135], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2e-209], N[(-4.0 * N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 1e-13], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5e+67], 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}
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+135}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq -2 \cdot 10^{-209}:\\
\;\;\;\;-4 \cdot \left(a \cdot t\right)\\
\mathbf{elif}\;b \cdot c \leq 10^{-13}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+67}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -1.99999999999999992e135 or 4.99999999999999976e67 < (*.f64 b c) Initial program 81.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6454.4
Applied rewrites54.4%
if -1.99999999999999992e135 < (*.f64 b c) < -2.0000000000000001e-209Initial program 86.9%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6423.4
Applied rewrites23.4%
if -2.0000000000000001e-209 < (*.f64 b c) < 1e-13Initial program 86.6%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6427.3
Applied rewrites27.3%
if 1e-13 < (*.f64 b c) < 4.99999999999999976e67Initial program 88.8%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6427.5
Applied rewrites27.5%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (if (<= (* b c) -1e+22) (* c b) (if (<= (* b c) 5e+67) (* -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 tmp;
if ((b * c) <= -1e+22) {
tmp = c * b;
} else if ((b * c) <= 5e+67) {
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) :: tmp
if ((b * c) <= (-1d+22)) then
tmp = c * b
else if ((b * c) <= 5d+67) 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 tmp;
if ((b * c) <= -1e+22) {
tmp = c * b;
} else if ((b * c) <= 5e+67) {
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): tmp = 0 if (b * c) <= -1e+22: tmp = c * b elif (b * c) <= 5e+67: 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) tmp = 0.0 if (Float64(b * c) <= -1e+22) tmp = Float64(c * b); elseif (Float64(b * c) <= 5e+67) 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)
tmp = 0.0;
if ((b * c) <= -1e+22)
tmp = c * b;
elseif ((b * c) <= 5e+67)
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_] := If[LessEqual[N[(b * c), $MachinePrecision], -1e+22], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 5e+67], 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}
\mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+22}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+67}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -1e22 or 4.99999999999999976e67 < (*.f64 b c) Initial program 82.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6447.8
Applied rewrites47.8%
if -1e22 < (*.f64 b c) < 4.99999999999999976e67Initial program 86.7%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6429.0
Applied rewrites29.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* 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 85.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6423.5
Applied rewrites23.5%
herbie shell --seed 2025130
(FPCore (x y z t a b c i j k)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, E"
:precision binary64
(- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))