
(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 20 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.
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 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
INFINITY)
(fma
(* -27.0 j)
k
(fma (* 18.0 t) (* (* z y) x) (- (* c b) (* 4.0 (fma a t (* i x))))))
(- (fma c b (* (* -4.0 i) x)) (* (* j 27.0) k))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) <= ((double) INFINITY)) {
tmp = fma((-27.0 * j), k, fma((18.0 * t), ((z * y) * x), ((c * b) - (4.0 * fma(a, t, (i * x))))));
} else {
tmp = fma(c, b, ((-4.0 * i) * x)) - ((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]) 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(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)) <= Inf) tmp = fma(Float64(-27.0 * j), k, fma(Float64(18.0 * t), Float64(Float64(z * y) * x), Float64(Float64(c * b) - Float64(4.0 * fma(a, t, Float64(i * x)))))); else tmp = Float64(fma(c, b, Float64(Float64(-4.0 * i) * x)) - 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. 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[(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], Infinity], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(18.0 * t), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(N[(c * b), $MachinePrecision] - N[(4.0 * N[(a * t + N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(c * b + N[(N[(-4.0 * i), $MachinePrecision] * x), $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])\\\\
[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}\;\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 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, c \cdot b - 4 \cdot \mathsf{fma}\left(a, t, i \cdot x\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \left(-4 \cdot i\right) \cdot x\right) - \left(j \cdot 27\right) \cdot k\\
\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)) < +inf.0Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
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 85.0%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 (* (fma i x (* a t)) -4.0)))
(if (<= (* b c) -2e+198)
(fma (* -27.0 j) k (fma c b t_2))
(if (<= (* b c) -2e-42)
(fma (* t_1 t) 18.0 (- (fma (* a t) -4.0 (* c b)) (* (* k j) 27.0)))
(if (<= (* b c) 2e+181)
(fma (* -27.0 j) k (fma (* 18.0 t) t_1 t_2))
(fma (* -27.0 j) k (fma c b (* (fma t a (* i x)) -4.0))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 t_1 = (z * y) * x;
double t_2 = fma(i, x, (a * t)) * -4.0;
double tmp;
if ((b * c) <= -2e+198) {
tmp = fma((-27.0 * j), k, fma(c, b, t_2));
} else if ((b * c) <= -2e-42) {
tmp = fma((t_1 * t), 18.0, (fma((a * t), -4.0, (c * b)) - ((k * j) * 27.0)));
} else if ((b * c) <= 2e+181) {
tmp = fma((-27.0 * j), k, fma((18.0 * t), t_1, t_2));
} else {
tmp = fma((-27.0 * j), k, fma(c, b, (fma(t, a, (i * x)) * -4.0)));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) 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(fma(i, x, Float64(a * t)) * -4.0) tmp = 0.0 if (Float64(b * c) <= -2e+198) tmp = fma(Float64(-27.0 * j), k, fma(c, b, t_2)); elseif (Float64(b * c) <= -2e-42) tmp = fma(Float64(t_1 * t), 18.0, Float64(fma(Float64(a * t), -4.0, Float64(c * b)) - Float64(Float64(k * j) * 27.0))); elseif (Float64(b * c) <= 2e+181) tmp = fma(Float64(-27.0 * j), k, fma(Float64(18.0 * t), t_1, t_2)); else tmp = fma(Float64(-27.0 * j), k, fma(c, b, Float64(fma(t, a, Float64(i * x)) * -4.0))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -2e+198], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(c * b + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], -2e-42], N[(N[(t$95$1 * t), $MachinePrecision] * 18.0 + N[(N[(N[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision] - N[(N[(k * j), $MachinePrecision] * 27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+181], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(18.0 * t), $MachinePrecision] * t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(c * b + N[(N[(t * a + N[(i * x), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[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 := \mathsf{fma}\left(i, x, a \cdot t\right) \cdot -4\\
\mathbf{if}\;b \cdot c \leq -2 \cdot 10^{+198}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(c, b, t\_2\right)\right)\\
\mathbf{elif}\;b \cdot c \leq -2 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(t\_1 \cdot t, 18, \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right) - \left(k \cdot j\right) \cdot 27\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+181}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, t\_1, t\_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(c, b, \mathsf{fma}\left(t, a, i \cdot x\right) \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -2.00000000000000004e198Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
if -2.00000000000000004e198 < (*.f64 b c) < -2.00000000000000008e-42Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate--r+N/A
lower--.f64N/A
Applied rewrites73.7%
if -2.00000000000000008e-42 < (*.f64 b c) < 1.9999999999999998e181Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6471.1
Applied rewrites71.1%
if 1.9999999999999998e181 < (*.f64 b c) Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f6478.7
Applied rewrites78.7%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 i x (* a t)) -4.0)))
(if (<= (* b c) -1e+46)
(fma (* -27.0 j) k (fma c b t_1))
(if (<= (* b c) 2e+181)
(fma (* -27.0 j) k (fma (* 18.0 t) (* (* z y) x) t_1))
(fma (* -27.0 j) k (fma c b (* (fma t a (* i x)) -4.0)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 t_1 = fma(i, x, (a * t)) * -4.0;
double tmp;
if ((b * c) <= -1e+46) {
tmp = fma((-27.0 * j), k, fma(c, b, t_1));
} else if ((b * c) <= 2e+181) {
tmp = fma((-27.0 * j), k, fma((18.0 * t), ((z * y) * x), t_1));
} else {
tmp = fma((-27.0 * j), k, fma(c, b, (fma(t, a, (i * x)) * -4.0)));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) 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(i, x, Float64(a * t)) * -4.0) tmp = 0.0 if (Float64(b * c) <= -1e+46) tmp = fma(Float64(-27.0 * j), k, fma(c, b, t_1)); elseif (Float64(b * c) <= 2e+181) tmp = fma(Float64(-27.0 * j), k, fma(Float64(18.0 * t), Float64(Float64(z * y) * x), t_1)); else tmp = fma(Float64(-27.0 * j), k, fma(c, b, Float64(fma(t, a, Float64(i * x)) * -4.0))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -1e+46], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(c * b + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+181], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(18.0 * t), $MachinePrecision] * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(c * b + N[(N[(t * a + N[(i * x), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\\\
[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(i, x, a \cdot t\right) \cdot -4\\
\mathbf{if}\;b \cdot c \leq -1 \cdot 10^{+46}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(c, b, t\_1\right)\right)\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+181}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(18 \cdot t, \left(z \cdot y\right) \cdot x, t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(c, b, \mathsf{fma}\left(t, a, i \cdot x\right) \cdot -4\right)\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -9.9999999999999999e45Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
if -9.9999999999999999e45 < (*.f64 b c) < 1.9999999999999998e181Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in b around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6471.1
Applied rewrites71.1%
if 1.9999999999999998e181 < (*.f64 b c) Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f6478.7
Applied rewrites78.7%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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.45e+145)
(- (* (fma -18.0 (* (* z y) t) (* i 4.0)) x))
(if (<= x 3.5e+107)
(fma (* -27.0 j) k (fma c b (* (fma t a (* i x)) -4.0)))
(* (fma (* 18.0 t) (* z y) (* -4.0 i)) x))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 <= -1.45e+145) {
tmp = -(fma(-18.0, ((z * y) * t), (i * 4.0)) * x);
} else if (x <= 3.5e+107) {
tmp = fma((-27.0 * j), k, fma(c, b, (fma(t, a, (i * x)) * -4.0)));
} else {
tmp = fma((18.0 * t), (z * y), (-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]) 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.45e+145) tmp = Float64(-Float64(fma(-18.0, Float64(Float64(z * y) * t), Float64(i * 4.0)) * x)); elseif (x <= 3.5e+107) tmp = fma(Float64(-27.0 * j), k, fma(c, b, Float64(fma(t, a, Float64(i * x)) * -4.0))); else tmp = Float64(fma(Float64(18.0 * t), Float64(z * y), 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. 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.45e+145], (-N[(N[(-18.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(i * 4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), If[LessEqual[x, 3.5e+107], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(c * b + N[(N[(t * a + N[(i * x), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $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])\\\\
[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.45 \cdot 10^{+145}:\\
\;\;\;\;-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot t, i \cdot 4\right) \cdot x\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(c, b, \mathsf{fma}\left(t, a, i \cdot x\right) \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if x < -1.45e145Initial program 85.0%
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-*.f6442.4
Applied rewrites42.4%
if -1.45e145 < x < 3.4999999999999997e107Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
lift-*.f64N/A
lift-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f6478.7
Applied rewrites78.7%
if 3.4999999999999997e107 < x Initial program 85.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
lower-*.f6442.4
Applied rewrites42.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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.45e+145)
(- (* (fma -18.0 (* (* z y) t) (* i 4.0)) x))
(if (<= x 3.5e+107)
(fma (* -27.0 j) k (fma c b (* (fma i x (* a t)) -4.0)))
(* (fma (* 18.0 t) (* z y) (* -4.0 i)) x))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 <= -1.45e+145) {
tmp = -(fma(-18.0, ((z * y) * t), (i * 4.0)) * x);
} else if (x <= 3.5e+107) {
tmp = fma((-27.0 * j), k, fma(c, b, (fma(i, x, (a * t)) * -4.0)));
} else {
tmp = fma((18.0 * t), (z * y), (-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]) 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.45e+145) tmp = Float64(-Float64(fma(-18.0, Float64(Float64(z * y) * t), Float64(i * 4.0)) * x)); elseif (x <= 3.5e+107) tmp = fma(Float64(-27.0 * j), k, fma(c, b, Float64(fma(i, x, Float64(a * t)) * -4.0))); else tmp = Float64(fma(Float64(18.0 * t), Float64(z * y), 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. 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.45e+145], (-N[(N[(-18.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(i * 4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), If[LessEqual[x, 3.5e+107], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(c * b + N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $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])\\\\
[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.45 \cdot 10^{+145}:\\
\;\;\;\;-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot t, i \cdot 4\right) \cdot x\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+107}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(c, b, \mathsf{fma}\left(i, x, a \cdot t\right) \cdot -4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if x < -1.45e145Initial program 85.0%
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-*.f6442.4
Applied rewrites42.4%
if -1.45e145 < x < 3.4999999999999997e107Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
if 3.4999999999999997e107 < x Initial program 85.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
lower-*.f6442.4
Applied rewrites42.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 (* (* z y) x) (* 4.0 a)) t))))
(if (<= t -1.06e+140)
t_1
(if (<= t -9e-110)
(fma (* -27.0 j) k (* (fma i x (* a t)) -4.0))
(if (<= t 3.3e+93)
(fma (* -27.0 j) k (fma (* -4.0 i) x (* c b)))
t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 t_1 = -(fma(-18.0, ((z * y) * x), (4.0 * a)) * t);
double tmp;
if (t <= -1.06e+140) {
tmp = t_1;
} else if (t <= -9e-110) {
tmp = fma((-27.0 * j), k, (fma(i, x, (a * t)) * -4.0));
} else if (t <= 3.3e+93) {
tmp = fma((-27.0 * j), k, fma((-4.0 * i), x, (c * b)));
} 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]) 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(fma(-18.0, Float64(Float64(z * y) * x), Float64(4.0 * a)) * t)) tmp = 0.0 if (t <= -1.06e+140) tmp = t_1; elseif (t <= -9e-110) tmp = fma(Float64(-27.0 * j), k, Float64(fma(i, x, Float64(a * t)) * -4.0)); elseif (t <= 3.3e+93) tmp = fma(Float64(-27.0 * j), k, fma(Float64(-4.0 * i), x, Float64(c * b))); 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.
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[(-18.0 * N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(4.0 * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision])}, If[LessEqual[t, -1.06e+140], t$95$1, If[LessEqual[t, -9e-110], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(i * x + N[(a * t), $MachinePrecision]), $MachinePrecision] * -4.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.3e+93], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(-4.0 * i), $MachinePrecision] * x + N[(c * b), $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])\\\\
[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, \left(z \cdot y\right) \cdot x, 4 \cdot a\right) \cdot t\\
\mathbf{if}\;t \leq -1.06 \cdot 10^{+140}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9 \cdot 10^{-110}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(i, x, a \cdot t\right) \cdot -4\right)\\
\mathbf{elif}\;t \leq 3.3 \cdot 10^{+93}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(-4 \cdot i, x, c \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.0600000000000001e140 or 3.30000000000000009e93 < t Initial program 85.0%
Taylor expanded in t 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
lower-*.f6442.6
Applied rewrites42.6%
if -1.0600000000000001e140 < t < -9.0000000000000002e-110Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
Taylor expanded in b around 0
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6459.1
Applied rewrites59.1%
if -9.0000000000000002e-110 < t < 3.30000000000000009e93Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
associate-*l*N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6461.9
Applied rewrites61.9%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 -8e+66)
(- (* (fma -18.0 (* (* z y) t) (* i 4.0)) x))
(if (<= x 1.65e+56)
(fma (* -27.0 j) k (fma (* a t) -4.0 (* c b)))
(* (fma (* 18.0 t) (* z y) (* -4.0 i)) x))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 <= -8e+66) {
tmp = -(fma(-18.0, ((z * y) * t), (i * 4.0)) * x);
} else if (x <= 1.65e+56) {
tmp = fma((-27.0 * j), k, fma((a * t), -4.0, (c * b)));
} else {
tmp = fma((18.0 * t), (z * y), (-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]) 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 <= -8e+66) tmp = Float64(-Float64(fma(-18.0, Float64(Float64(z * y) * t), Float64(i * 4.0)) * x)); elseif (x <= 1.65e+56) tmp = fma(Float64(-27.0 * j), k, fma(Float64(a * t), -4.0, Float64(c * b))); else tmp = Float64(fma(Float64(18.0 * t), Float64(z * y), 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. 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, -8e+66], (-N[(N[(-18.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(i * 4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), If[LessEqual[x, 1.65e+56], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(a * t), $MachinePrecision] * -4.0 + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $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])\\\\
[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 -8 \cdot 10^{+66}:\\
\;\;\;\;-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot t, i \cdot 4\right) \cdot x\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(a \cdot t, -4, c \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if x < -7.99999999999999956e66Initial program 85.0%
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-*.f6442.4
Applied rewrites42.4%
if -7.99999999999999956e66 < x < 1.65000000000000001e56Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in x around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6462.0
Applied rewrites62.0%
if 1.65000000000000001e56 < x Initial program 85.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
lower-*.f6442.4
Applied rewrites42.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 (- (* c b) (* (* j 27.0) k))))
(if (<= (* b c) -5e+53)
t_1
(if (<= (* b c) 5e+185)
(fma (* -27.0 j) k (* (fma i x (* 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);
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 = (c * b) - ((j * 27.0) * k);
double tmp;
if ((b * c) <= -5e+53) {
tmp = t_1;
} else if ((b * c) <= 5e+185) {
tmp = fma((-27.0 * j), k, (fma(i, x, (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]) 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(c * b) - Float64(Float64(j * 27.0) * k)) tmp = 0.0 if (Float64(b * c) <= -5e+53) tmp = t_1; elseif (Float64(b * c) <= 5e+185) tmp = fma(Float64(-27.0 * j), k, Float64(fma(i, x, 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.
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[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b * c), $MachinePrecision], -5e+53], t$95$1, If[LessEqual[N[(b * c), $MachinePrecision], 5e+185], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(i * x + N[(a * t), $MachinePrecision]), $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])\\\\
[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 := c \cdot b - \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;b \cdot c \leq -5 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \cdot c \leq 5 \cdot 10^{+185}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(i, x, a \cdot t\right) \cdot -4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 b c) < -5.0000000000000004e53 or 4.9999999999999999e185 < (*.f64 b c) Initial program 85.0%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6444.6
Applied rewrites44.6%
if -5.0000000000000004e53 < (*.f64 b c) < 4.9999999999999999e185Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
Taylor expanded in b around 0
*-commutativeN/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-*.f6459.1
Applied rewrites59.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 -8.5e+63)
(- (* (fma -18.0 (* (* z y) t) (* i 4.0)) x))
(if (<= x 0.088)
(- (* c b) (* (* j 27.0) k))
(* (fma (* 18.0 t) (* z y) (* -4.0 i)) x))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 <= -8.5e+63) {
tmp = -(fma(-18.0, ((z * y) * t), (i * 4.0)) * x);
} else if (x <= 0.088) {
tmp = (c * b) - ((j * 27.0) * k);
} else {
tmp = fma((18.0 * t), (z * y), (-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]) 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 <= -8.5e+63) tmp = Float64(-Float64(fma(-18.0, Float64(Float64(z * y) * t), Float64(i * 4.0)) * x)); elseif (x <= 0.088) tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(fma(Float64(18.0 * t), Float64(z * y), 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. 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, -8.5e+63], (-N[(N[(-18.0 * N[(N[(z * y), $MachinePrecision] * t), $MachinePrecision] + N[(i * 4.0), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), If[LessEqual[x, 0.088], N[(N[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(18.0 * t), $MachinePrecision] * N[(z * y), $MachinePrecision] + N[(-4.0 * i), $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])\\\\
[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 -8.5 \cdot 10^{+63}:\\
\;\;\;\;-\mathsf{fma}\left(-18, \left(z \cdot y\right) \cdot t, i \cdot 4\right) \cdot x\\
\mathbf{elif}\;x \leq 0.088:\\
\;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(18 \cdot t, z \cdot y, -4 \cdot i\right) \cdot x\\
\end{array}
\end{array}
if x < -8.5000000000000004e63Initial program 85.0%
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-*.f6442.4
Applied rewrites42.4%
if -8.5000000000000004e63 < x < 0.087999999999999995Initial program 85.0%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6444.6
Applied rewrites44.6%
if 0.087999999999999995 < x Initial program 85.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
lower-*.f6442.4
Applied rewrites42.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 -8.5e+63)
t_1
(if (<= x 0.088) (- (* 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);
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 <= -8.5e+63) {
tmp = t_1;
} else if (x <= 0.088) {
tmp = (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]) 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 <= -8.5e+63) tmp = t_1; elseif (x <= 0.088) tmp = Float64(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.
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, -8.5e+63], t$95$1, If[LessEqual[x, 0.088], N[(N[(c * b), $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])\\\\
[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 -8.5 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 0.088:\\
\;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -8.5000000000000004e63 or 0.087999999999999995 < x Initial program 85.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
lower-*.f6442.4
Applied rewrites42.4%
if -8.5000000000000004e63 < x < 0.087999999999999995Initial program 85.0%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6444.6
Applied rewrites44.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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.2e+243)
(* (* -4.0 i) x)
(if (<= x -1.06e+67)
(- (* (* (* z y) (* t x)) -18.0))
(if (<= x 1e+30)
(- (* c b) (* (* j 27.0) k))
(- (* (* (* (* y x) z) t) -18.0))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 <= -2.2e+243) {
tmp = (-4.0 * i) * x;
} else if (x <= -1.06e+67) {
tmp = -(((z * y) * (t * x)) * -18.0);
} else if (x <= 1e+30) {
tmp = (c * b) - ((j * 27.0) * k);
} else {
tmp = -((((y * x) * z) * t) * -18.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.
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 (x <= (-2.2d+243)) then
tmp = ((-4.0d0) * i) * x
else if (x <= (-1.06d+67)) then
tmp = -(((z * y) * (t * x)) * (-18.0d0))
else if (x <= 1d+30) then
tmp = (c * b) - ((j * 27.0d0) * k)
else
tmp = -((((y * x) * z) * t) * (-18.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;
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 (x <= -2.2e+243) {
tmp = (-4.0 * i) * x;
} else if (x <= -1.06e+67) {
tmp = -(((z * y) * (t * x)) * -18.0);
} else if (x <= 1e+30) {
tmp = (c * b) - ((j * 27.0) * k);
} else {
tmp = -((((y * x) * z) * t) * -18.0);
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) [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 x <= -2.2e+243: tmp = (-4.0 * i) * x elif x <= -1.06e+67: tmp = -(((z * y) * (t * x)) * -18.0) elif x <= 1e+30: tmp = (c * b) - ((j * 27.0) * k) else: tmp = -((((y * x) * z) * t) * -18.0) return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) 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.2e+243) tmp = Float64(Float64(-4.0 * i) * x); elseif (x <= -1.06e+67) tmp = Float64(-Float64(Float64(Float64(z * y) * Float64(t * x)) * -18.0)); elseif (x <= 1e+30) tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(-Float64(Float64(Float64(Float64(y * x) * z) * t) * -18.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])){:}
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 (x <= -2.2e+243)
tmp = (-4.0 * i) * x;
elseif (x <= -1.06e+67)
tmp = -(((z * y) * (t * x)) * -18.0);
elseif (x <= 1e+30)
tmp = (c * b) - ((j * 27.0) * k);
else
tmp = -((((y * x) * z) * t) * -18.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. 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.2e+243], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -1.06e+67], (-N[(N[(N[(z * y), $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision] * -18.0), $MachinePrecision]), If[LessEqual[x, 1e+30], N[(N[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], (-N[(N[(N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] * -18.0), $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])\\\\
[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.2 \cdot 10^{+243}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{+67}:\\
\;\;\;\;-\left(\left(z \cdot y\right) \cdot \left(t \cdot x\right)\right) \cdot -18\\
\mathbf{elif}\;x \leq 10^{+30}:\\
\;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;-\left(\left(\left(y \cdot x\right) \cdot z\right) \cdot t\right) \cdot -18\\
\end{array}
\end{array}
if x < -2.20000000000000009e243Initial program 85.0%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.1
Applied rewrites21.1%
if -2.20000000000000009e243 < x < -1.0599999999999999e67Initial program 85.0%
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-*.f6442.4
Applied rewrites42.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6425.8
Applied rewrites25.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6426.1
Applied rewrites26.1%
if -1.0599999999999999e67 < x < 1e30Initial program 85.0%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6444.6
Applied rewrites44.6%
if 1e30 < x Initial program 85.0%
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-*.f6442.4
Applied rewrites42.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6425.8
Applied rewrites25.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6426.1
Applied rewrites26.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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.2e+243)
(* (* -4.0 i) x)
(if (<= x -1.06e+67)
(- (* (* (* z y) (* t x)) -18.0))
(if (<= x 1e+30)
(- (* c b) (* (* j 27.0) k))
(* (* (* (* z y) x) t) 18.0)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 <= -2.2e+243) {
tmp = (-4.0 * i) * x;
} else if (x <= -1.06e+67) {
tmp = -(((z * y) * (t * x)) * -18.0);
} else if (x <= 1e+30) {
tmp = (c * b) - ((j * 27.0) * k);
} else {
tmp = (((z * y) * x) * t) * 18.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.
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 (x <= (-2.2d+243)) then
tmp = ((-4.0d0) * i) * x
else if (x <= (-1.06d+67)) then
tmp = -(((z * y) * (t * x)) * (-18.0d0))
else if (x <= 1d+30) then
tmp = (c * b) - ((j * 27.0d0) * k)
else
tmp = (((z * y) * x) * t) * 18.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;
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 (x <= -2.2e+243) {
tmp = (-4.0 * i) * x;
} else if (x <= -1.06e+67) {
tmp = -(((z * y) * (t * x)) * -18.0);
} else if (x <= 1e+30) {
tmp = (c * b) - ((j * 27.0) * k);
} else {
tmp = (((z * y) * x) * t) * 18.0;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) [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 x <= -2.2e+243: tmp = (-4.0 * i) * x elif x <= -1.06e+67: tmp = -(((z * y) * (t * x)) * -18.0) elif x <= 1e+30: tmp = (c * b) - ((j * 27.0) * k) else: tmp = (((z * y) * x) * t) * 18.0 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) 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.2e+243) tmp = Float64(Float64(-4.0 * i) * x); elseif (x <= -1.06e+67) tmp = Float64(-Float64(Float64(Float64(z * y) * Float64(t * x)) * -18.0)); elseif (x <= 1e+30) tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k)); else tmp = Float64(Float64(Float64(Float64(z * y) * x) * t) * 18.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])){:}
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 (x <= -2.2e+243)
tmp = (-4.0 * i) * x;
elseif (x <= -1.06e+67)
tmp = -(((z * y) * (t * x)) * -18.0);
elseif (x <= 1e+30)
tmp = (c * b) - ((j * 27.0) * k);
else
tmp = (((z * y) * x) * t) * 18.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. 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.2e+243], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -1.06e+67], (-N[(N[(N[(z * y), $MachinePrecision] * N[(t * x), $MachinePrecision]), $MachinePrecision] * -18.0), $MachinePrecision]), If[LessEqual[x, 1e+30], N[(N[(c * b), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] * t), $MachinePrecision] * 18.0), $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])\\\\
[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.2 \cdot 10^{+243}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{+67}:\\
\;\;\;\;-\left(\left(z \cdot y\right) \cdot \left(t \cdot x\right)\right) \cdot -18\\
\mathbf{elif}\;x \leq 10^{+30}:\\
\;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18\\
\end{array}
\end{array}
if x < -2.20000000000000009e243Initial program 85.0%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.1
Applied rewrites21.1%
if -2.20000000000000009e243 < x < -1.0599999999999999e67Initial program 85.0%
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-*.f6442.4
Applied rewrites42.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6425.8
Applied rewrites25.8%
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lower-*.f6426.1
Applied rewrites26.1%
if -1.0599999999999999e67 < x < 1e30Initial program 85.0%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6444.6
Applied rewrites44.6%
if 1e30 < x Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in t around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6425.8
Applied rewrites25.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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) 18.0)))
(if (<= x -4.2e+190)
(* (* -4.0 i) x)
(if (<= x -1.06e+67)
t_1
(if (<= x 1e+30) (- (* 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);
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) * t) * 18.0;
double tmp;
if (x <= -4.2e+190) {
tmp = (-4.0 * i) * x;
} else if (x <= -1.06e+67) {
tmp = t_1;
} else if (x <= 1e+30) {
tmp = (c * b) - ((j * 27.0) * k);
} 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.
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 = (((z * y) * x) * t) * 18.0d0
if (x <= (-4.2d+190)) then
tmp = ((-4.0d0) * i) * x
else if (x <= (-1.06d+67)) then
tmp = t_1
else if (x <= 1d+30) then
tmp = (c * b) - ((j * 27.0d0) * k)
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;
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 = (((z * y) * x) * t) * 18.0;
double tmp;
if (x <= -4.2e+190) {
tmp = (-4.0 * i) * x;
} else if (x <= -1.06e+67) {
tmp = t_1;
} else if (x <= 1e+30) {
tmp = (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]) [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 = (((z * y) * x) * t) * 18.0 tmp = 0 if x <= -4.2e+190: tmp = (-4.0 * i) * x elif x <= -1.06e+67: tmp = t_1 elif x <= 1e+30: tmp = (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]) 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(Float64(Float64(z * y) * x) * t) * 18.0) tmp = 0.0 if (x <= -4.2e+190) tmp = Float64(Float64(-4.0 * i) * x); elseif (x <= -1.06e+67) tmp = t_1; elseif (x <= 1e+30) tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k)); 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])){:}
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 = (((z * y) * x) * t) * 18.0;
tmp = 0.0;
if (x <= -4.2e+190)
tmp = (-4.0 * i) * x;
elseif (x <= -1.06e+67)
tmp = t_1;
elseif (x <= 1e+30)
tmp = (c * b) - ((j * 27.0) * k);
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.
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[(z * y), $MachinePrecision] * x), $MachinePrecision] * t), $MachinePrecision] * 18.0), $MachinePrecision]}, If[LessEqual[x, -4.2e+190], N[(N[(-4.0 * i), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[x, -1.06e+67], t$95$1, If[LessEqual[x, 1e+30], N[(N[(c * b), $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])\\\\
[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(\left(\left(z \cdot y\right) \cdot x\right) \cdot t\right) \cdot 18\\
\mathbf{if}\;x \leq -4.2 \cdot 10^{+190}:\\
\;\;\;\;\left(-4 \cdot i\right) \cdot x\\
\mathbf{elif}\;x \leq -1.06 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 10^{+30}:\\
\;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.2000000000000001e190Initial program 85.0%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.1
Applied rewrites21.1%
if -4.2000000000000001e190 < x < -1.0599999999999999e67 or 1e30 < x Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in t around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6425.8
Applied rewrites25.8%
if -1.0599999999999999e67 < x < 1e30Initial program 85.0%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6444.6
Applied rewrites44.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 i) x)))
(if (<= i -2e+171)
t_1
(if (<= i 5.8e+130) (- (* 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);
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 * i) * x;
double tmp;
if (i <= -2e+171) {
tmp = t_1;
} else if (i <= 5.8e+130) {
tmp = (c * b) - ((j * 27.0) * k);
} 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.
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) * i) * x
if (i <= (-2d+171)) then
tmp = t_1
else if (i <= 5.8d+130) then
tmp = (c * b) - ((j * 27.0d0) * k)
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;
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 * i) * x;
double tmp;
if (i <= -2e+171) {
tmp = t_1;
} else if (i <= 5.8e+130) {
tmp = (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]) [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 * i) * x tmp = 0 if i <= -2e+171: tmp = t_1 elif i <= 5.8e+130: tmp = (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]) 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(-4.0 * i) * x) tmp = 0.0 if (i <= -2e+171) tmp = t_1; elseif (i <= 5.8e+130) tmp = Float64(Float64(c * b) - Float64(Float64(j * 27.0) * k)); 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])){:}
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 * i) * x;
tmp = 0.0;
if (i <= -2e+171)
tmp = t_1;
elseif (i <= 5.8e+130)
tmp = (c * b) - ((j * 27.0) * k);
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.
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 * i), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[i, -2e+171], t$95$1, If[LessEqual[i, 5.8e+130], N[(N[(c * b), $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])\\\\
[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(-4 \cdot i\right) \cdot x\\
\mathbf{if}\;i \leq -2 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 5.8 \cdot 10^{+130}:\\
\;\;\;\;c \cdot b - \left(j \cdot 27\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -1.99999999999999991e171 or 5.7999999999999998e130 < i Initial program 85.0%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.1
Applied rewrites21.1%
if -1.99999999999999991e171 < i < 5.7999999999999998e130Initial program 85.0%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6461.1
Applied rewrites61.1%
Taylor expanded in x around 0
*-commutativeN/A
lift-*.f6444.6
Applied rewrites44.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 i) x)))
(if (<= i -7.8e+170)
t_1
(if (<= i -1.25e-14)
(* (* -27.0 j) k)
(if (<= i -1.9e-307)
(* c b)
(if (<= i 2.5e+118) (* (- t) (* 4.0 a)) t_1))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 t_1 = (-4.0 * i) * x;
double tmp;
if (i <= -7.8e+170) {
tmp = t_1;
} else if (i <= -1.25e-14) {
tmp = (-27.0 * j) * k;
} else if (i <= -1.9e-307) {
tmp = c * b;
} else if (i <= 2.5e+118) {
tmp = -t * (4.0 * a);
} 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.
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) * i) * x
if (i <= (-7.8d+170)) then
tmp = t_1
else if (i <= (-1.25d-14)) then
tmp = ((-27.0d0) * j) * k
else if (i <= (-1.9d-307)) then
tmp = c * b
else if (i <= 2.5d+118) then
tmp = -t * (4.0d0 * a)
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;
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 * i) * x;
double tmp;
if (i <= -7.8e+170) {
tmp = t_1;
} else if (i <= -1.25e-14) {
tmp = (-27.0 * j) * k;
} else if (i <= -1.9e-307) {
tmp = c * b;
} else if (i <= 2.5e+118) {
tmp = -t * (4.0 * a);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) [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 * i) * x tmp = 0 if i <= -7.8e+170: tmp = t_1 elif i <= -1.25e-14: tmp = (-27.0 * j) * k elif i <= -1.9e-307: tmp = c * b elif i <= 2.5e+118: tmp = -t * (4.0 * a) else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) 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(-4.0 * i) * x) tmp = 0.0 if (i <= -7.8e+170) tmp = t_1; elseif (i <= -1.25e-14) tmp = Float64(Float64(-27.0 * j) * k); elseif (i <= -1.9e-307) tmp = Float64(c * b); elseif (i <= 2.5e+118) tmp = Float64(Float64(-t) * Float64(4.0 * a)); 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])){:}
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 * i) * x;
tmp = 0.0;
if (i <= -7.8e+170)
tmp = t_1;
elseif (i <= -1.25e-14)
tmp = (-27.0 * j) * k;
elseif (i <= -1.9e-307)
tmp = c * b;
elseif (i <= 2.5e+118)
tmp = -t * (4.0 * a);
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.
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 * i), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[i, -7.8e+170], t$95$1, If[LessEqual[i, -1.25e-14], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision], If[LessEqual[i, -1.9e-307], N[(c * b), $MachinePrecision], If[LessEqual[i, 2.5e+118], N[((-t) * N[(4.0 * a), $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])\\\\
[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(-4 \cdot i\right) \cdot x\\
\mathbf{if}\;i \leq -7.8 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -1.25 \cdot 10^{-14}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\mathbf{elif}\;i \leq -1.9 \cdot 10^{-307}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;i \leq 2.5 \cdot 10^{+118}:\\
\;\;\;\;\left(-t\right) \cdot \left(4 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -7.8000000000000005e170 or 2.49999999999999986e118 < i Initial program 85.0%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.1
Applied rewrites21.1%
if -7.8000000000000005e170 < i < -1.25e-14Initial program 85.0%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
if -1.25e-14 < i < -1.89999999999999993e-307Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
if -1.89999999999999993e-307 < i < 2.49999999999999986e118Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in t around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-*.f6442.6
Applied rewrites42.6%
Taylor expanded in x around 0
lift-*.f6421.6
Applied rewrites21.6%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
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 i) x)))
(if (<= i -7.8e+170)
t_1
(if (<= i -1.25e-14)
(* (* -27.0 j) k)
(if (<= i 4.5e+118) (* c b) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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 t_1 = (-4.0 * i) * x;
double tmp;
if (i <= -7.8e+170) {
tmp = t_1;
} else if (i <= -1.25e-14) {
tmp = (-27.0 * j) * k;
} else if (i <= 4.5e+118) {
tmp = c * b;
} 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.
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) * i) * x
if (i <= (-7.8d+170)) then
tmp = t_1
else if (i <= (-1.25d-14)) then
tmp = ((-27.0d0) * j) * k
else if (i <= 4.5d+118) then
tmp = c * b
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;
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 * i) * x;
double tmp;
if (i <= -7.8e+170) {
tmp = t_1;
} else if (i <= -1.25e-14) {
tmp = (-27.0 * j) * k;
} else if (i <= 4.5e+118) {
tmp = c * b;
} 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]) [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 * i) * x tmp = 0 if i <= -7.8e+170: tmp = t_1 elif i <= -1.25e-14: tmp = (-27.0 * j) * k elif i <= 4.5e+118: tmp = c * b 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]) 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(-4.0 * i) * x) tmp = 0.0 if (i <= -7.8e+170) tmp = t_1; elseif (i <= -1.25e-14) tmp = Float64(Float64(-27.0 * j) * k); elseif (i <= 4.5e+118) tmp = Float64(c * b); 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])){:}
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 * i) * x;
tmp = 0.0;
if (i <= -7.8e+170)
tmp = t_1;
elseif (i <= -1.25e-14)
tmp = (-27.0 * j) * k;
elseif (i <= 4.5e+118)
tmp = c * b;
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.
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 * i), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[i, -7.8e+170], t$95$1, If[LessEqual[i, -1.25e-14], N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision], If[LessEqual[i, 4.5e+118], N[(c * b), $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])\\\\
[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(-4 \cdot i\right) \cdot x\\
\mathbf{if}\;i \leq -7.8 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -1.25 \cdot 10^{-14}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\mathbf{elif}\;i \leq 4.5 \cdot 10^{+118}:\\
\;\;\;\;c \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -7.8000000000000005e170 or 4.50000000000000002e118 < i Initial program 85.0%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f6421.1
Applied rewrites21.1%
if -7.8000000000000005e170 < i < -1.25e-14Initial program 85.0%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
if -1.25e-14 < i < 4.50000000000000002e118Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. 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+68) (* c b) (if (<= (* b c) 2e+64) (* (* -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);
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+68) {
tmp = c * b;
} else if ((b * c) <= 2e+64) {
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.
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+68)) then
tmp = c * b
else if ((b * c) <= 2d+64) 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;
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+68) {
tmp = c * b;
} else if ((b * c) <= 2e+64) {
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]) [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+68: tmp = c * b elif (b * c) <= 2e+64: 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]) 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+68) tmp = Float64(c * b); elseif (Float64(b * c) <= 2e+64) tmp = Float64(Float64(-27.0 * 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])){:}
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+68)
tmp = c * b;
elseif ((b * c) <= 2e+64)
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. 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+68], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+64], N[(N[(-27.0 * k), $MachinePrecision] * j), $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])\\\\
[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^{+68}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+64}:\\
\;\;\;\;\left(-27 \cdot k\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -9.99999999999999953e67 or 2.00000000000000004e64 < (*.f64 b c) Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
if -9.99999999999999953e67 < (*.f64 b c) < 2.00000000000000004e64Initial program 85.0%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6423.8
Applied rewrites23.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. 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+68) (* c b) (if (<= (* b c) 2e+64) (* (* -27.0 j) k) (* c b))))
assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < 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+68) {
tmp = c * b;
} else if ((b * c) <= 2e+64) {
tmp = (-27.0 * j) * k;
} 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.
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+68)) then
tmp = c * b
else if ((b * c) <= 2d+64) then
tmp = ((-27.0d0) * j) * k
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;
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+68) {
tmp = c * b;
} else if ((b * c) <= 2e+64) {
tmp = (-27.0 * j) * k;
} 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]) [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+68: tmp = c * b elif (b * c) <= 2e+64: tmp = (-27.0 * j) * k 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]) 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+68) tmp = Float64(c * b); elseif (Float64(b * c) <= 2e+64) tmp = Float64(Float64(-27.0 * j) * k); 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])){:}
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+68)
tmp = c * b;
elseif ((b * c) <= 2e+64)
tmp = (-27.0 * j) * k;
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. 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+68], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+64], N[(N[(-27.0 * j), $MachinePrecision] * k), $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])\\\\
[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^{+68}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+64}:\\
\;\;\;\;\left(-27 \cdot j\right) \cdot k\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -9.99999999999999953e67 or 2.00000000000000004e64 < (*.f64 b c) Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
if -9.99999999999999953e67 < (*.f64 b c) < 2.00000000000000004e64Initial program 85.0%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. 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+68) (* c b) (if (<= (* b c) 2e+64) (* -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);
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+68) {
tmp = c * b;
} else if ((b * c) <= 2e+64) {
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.
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+68)) then
tmp = c * b
else if ((b * c) <= 2d+64) 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;
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+68) {
tmp = c * b;
} else if ((b * c) <= 2e+64) {
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]) [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+68: tmp = c * b elif (b * c) <= 2e+64: 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]) 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+68) tmp = Float64(c * b); elseif (Float64(b * c) <= 2e+64) 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])){:}
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+68)
tmp = c * b;
elseif ((b * c) <= 2e+64)
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. 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+68], N[(c * b), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2e+64], 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])\\\\
[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^{+68}:\\
\;\;\;\;c \cdot b\\
\mathbf{elif}\;b \cdot c \leq 2 \cdot 10^{+64}:\\
\;\;\;\;-27 \cdot \left(k \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot b\\
\end{array}
\end{array}
if (*.f64 b c) < -9.99999999999999953e67 or 2.00000000000000004e64 < (*.f64 b c) Initial program 85.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
if -9.99999999999999953e67 < (*.f64 b c) < 2.00000000000000004e64Initial program 85.0%
Taylor expanded in j around inf
lower-*.f64N/A
*-commutativeN/A
lower-*.f6423.8
Applied rewrites23.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. 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);
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.
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;
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]) [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]) 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])){:}
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. 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])\\\\
[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.0%
Taylor expanded in j around 0
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
associate--l+N/A
associate-*r*N/A
lower-fma.f64N/A
Applied rewrites87.5%
Taylor expanded in y around 0
fp-cancel-sub-sign-invN/A
*-commutativeN/A
metadata-evalN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-*.f6478.8
Applied rewrites78.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f6424.4
Applied rewrites24.4%
herbie shell --seed 2025142
(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)))