
(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 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j k) :precision binary64 (- (- (+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c)) (* (* x 4.0) i)) (* (* j 27.0) k)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
code = (((((((x * 18.0d0) * y) * z) * t) - ((a * 4.0d0) * t)) + (b * c)) - ((x * 4.0d0) * i)) - ((j * 27.0d0) * k)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k);
}
def code(x, y, z, t, a, b, c, i, j, k): return (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k)
function code(x, y, z, t, a, b, c, i, j, k) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) - Float64(Float64(j * 27.0) * k)) end
function tmp = code(x, y, z, t, a, b, c, i, j, k) tmp = (((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i)) - ((j * 27.0) * k); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] - N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\right) - \left(j \cdot 27\right) \cdot k
\end{array}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))))
(if (<= t_1 (- INFINITY))
(fma
(* -27.0 j)
k
(fma (fma (* (* y 18.0) t) z (* -4.0 i)) x (fma (* -4.0 a) t (* c b))))
(if (<= t_1 INFINITY)
(fma
c
b
(fma
(* i x)
-4.0
(fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (* (* -27.0 j) k))))
(fma
(* k -27.0)
j
(fma b c (* x (fma z (* t (* 18.0 y)) (* i -4.0)))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = ((((((x * 18.0) * y) * z) * t) - ((a * 4.0) * t)) + (b * c)) - ((x * 4.0) * i);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma((-27.0 * j), k, fma(fma(((y * 18.0) * t), z, (-4.0 * i)), x, fma((-4.0 * a), t, (c * b))));
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma(c, b, fma((i * x), -4.0, fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, ((-27.0 * j) * k))));
} else {
tmp = fma((k * -27.0), j, fma(b, c, (x * fma(z, (t * (18.0 * y)), (i * -4.0)))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * 18.0) * y) * z) * t) - Float64(Float64(a * 4.0) * t)) + Float64(b * c)) - Float64(Float64(x * 4.0) * i)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(Float64(-27.0 * j), k, fma(fma(Float64(Float64(y * 18.0) * t), z, Float64(-4.0 * i)), x, fma(Float64(-4.0 * a), t, Float64(c * b)))); elseif (t_1 <= Inf) tmp = fma(c, b, fma(Float64(i * x), -4.0, fma(fma(-4.0, a, Float64(z * Float64(y * Float64(18.0 * x)))), t, Float64(Float64(-27.0 * j) * k)))); else tmp = fma(Float64(k * -27.0), j, fma(b, c, Float64(x * fma(z, Float64(t * Float64(18.0 * y)), Float64(i * -4.0))))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(x * 18.0), $MachinePrecision] * y), $MachinePrecision] * z), $MachinePrecision] * t), $MachinePrecision] - N[(N[(a * 4.0), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision] - N[(N[(x * 4.0), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(N[(N[(N[(y * 18.0), $MachinePrecision] * t), $MachinePrecision] * z + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision] * x + N[(N[(-4.0 * a), $MachinePrecision] * t + N[(c * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(c * b + N[(N[(i * x), $MachinePrecision] * -4.0 + N[(N[(-4.0 * a + N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c + N[(x * N[(z * N[(t * N[(18.0 * y), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(\left(x \cdot 18\right) \cdot y\right) \cdot z\right) \cdot t - \left(a \cdot 4\right) \cdot t\right) + b \cdot c\right) - \left(x \cdot 4\right) \cdot i\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(\mathsf{fma}\left(\left(y \cdot 18\right) \cdot t, z, -4 \cdot i\right), x, \mathsf{fma}\left(-4 \cdot a, t, c \cdot b\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(i \cdot x, -4, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right), t, \left(-27 \cdot j\right) \cdot k\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(z, t \cdot \left(18 \cdot y\right), i \cdot -4\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) < -inf.0Initial program 85.6%
Applied rewrites89.7%
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)) < +inf.0Initial program 85.6%
Applied rewrites89.0%
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.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<=
(-
(-
(+ (- (* (* (* (* x 18.0) y) z) t) (* (* a 4.0) t)) (* b c))
(* (* x 4.0) i))
(* (* j 27.0) k))
INFINITY)
(fma
c
b
(fma
(* i x)
-4.0
(fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (* (* -27.0 j) k))))
(fma (* k -27.0) j (fma b c (* x (fma (* (* z 18.0) t) y (* -4.0 i)))))))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)) - ((j * 27.0) * k)) <= ((double) INFINITY)) {
tmp = fma(c, b, fma((i * x), -4.0, fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, ((-27.0 * j) * k))));
} else {
tmp = fma((k * -27.0), j, fma(b, c, (x * fma(((z * 18.0) * t), y, (-4.0 * i)))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(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)) <= Inf) tmp = fma(c, b, fma(Float64(i * x), -4.0, fma(fma(-4.0, a, Float64(z * Float64(y * Float64(18.0 * x)))), t, Float64(Float64(-27.0 * j) * k)))); else tmp = fma(Float64(k * -27.0), j, fma(b, c, Float64(x * fma(Float64(Float64(z * 18.0) * t), y, Float64(-4.0 * i))))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[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], Infinity], N[(c * b + N[(N[(i * x), $MachinePrecision] * -4.0 + N[(N[(-4.0 * a + N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(N[(-27.0 * j), $MachinePrecision] * k), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c + N[(x * N[(N[(N[(z * 18.0), $MachinePrecision] * t), $MachinePrecision] * y + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;\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 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(i \cdot x, -4, \mathsf{fma}\left(\mathsf{fma}\left(-4, a, z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right), t, \left(-27 \cdot j\right) \cdot k\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(\left(z \cdot 18\right) \cdot t, y, -4 \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) < +inf.0Initial program 85.6%
Applied rewrites89.0%
if +inf.0 < (-.f64 (-.f64 (+.f64 (-.f64 (*.f64 (*.f64 (*.f64 (*.f64 x #s(literal 18 binary64)) y) z) t) (*.f64 (*.f64 a #s(literal 4 binary64)) t)) (*.f64 b c)) (*.f64 (*.f64 x #s(literal 4 binary64)) i)) (*.f64 (*.f64 j #s(literal 27 binary64)) k)) Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
distribute-lft-neg-inN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
lift-*.f64N/A
lower-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.8
Applied rewrites79.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -2.1e-15)
(fma (* k -27.0) j (fma b c (* x (fma (* (* z 18.0) t) y (* -4.0 i)))))
(if (<= x 1.3e-70)
(fma (fma -4.0 a (* z (* y (* 18.0 x)))) t (fma -27.0 (* j k) (* b c)))
(fma (* k -27.0) j (fma b c (* x (fma z (* t (* 18.0 y)) (* i -4.0))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -2.1e-15) {
tmp = fma((k * -27.0), j, fma(b, c, (x * fma(((z * 18.0) * t), y, (-4.0 * i)))));
} else if (x <= 1.3e-70) {
tmp = fma(fma(-4.0, a, (z * (y * (18.0 * x)))), t, fma(-27.0, (j * k), (b * c)));
} else {
tmp = fma((k * -27.0), j, fma(b, c, (x * fma(z, (t * (18.0 * y)), (i * -4.0)))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -2.1e-15) tmp = fma(Float64(k * -27.0), j, fma(b, c, Float64(x * fma(Float64(Float64(z * 18.0) * t), y, Float64(-4.0 * i))))); elseif (x <= 1.3e-70) tmp = fma(fma(-4.0, a, Float64(z * Float64(y * Float64(18.0 * x)))), t, fma(-27.0, Float64(j * k), Float64(b * c))); else tmp = fma(Float64(k * -27.0), j, fma(b, c, Float64(x * fma(z, Float64(t * Float64(18.0 * y)), Float64(i * -4.0))))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -2.1e-15], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c + N[(x * N[(N[(N[(z * 18.0), $MachinePrecision] * t), $MachinePrecision] * y + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e-70], N[(N[(-4.0 * a + N[(z * N[(y * N[(18.0 * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(-27.0 * N[(j * k), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c + N[(x * N[(z * N[(t * N[(18.0 * y), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.1 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(\left(z \cdot 18\right) \cdot t, y, -4 \cdot i\right)\right)\right)\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{-70}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-4, a, z \cdot \left(y \cdot \left(18 \cdot x\right)\right)\right), t, \mathsf{fma}\left(-27, j \cdot k, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(z, t \cdot \left(18 \cdot y\right), i \cdot -4\right)\right)\right)\\
\end{array}
\end{array}
if x < -2.09999999999999981e-15Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
distribute-lft-neg-inN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
lift-*.f64N/A
lower-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.8
Applied rewrites79.8%
if -2.09999999999999981e-15 < x < 1.30000000000000001e-70Initial program 85.6%
Applied rewrites88.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6477.9
Applied rewrites77.9%
if 1.30000000000000001e-70 < x Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= x -1.85e-15)
(fma (* k -27.0) j (fma b c (* x (fma (* (* z 18.0) t) y (* -4.0 i)))))
(if (<= x 1.1e-94)
(fma (* -27.0 j) k (fma -4.0 (* a t) (* b c)))
(fma (* k -27.0) j (fma b c (* x (fma z (* t (* 18.0 y)) (* i -4.0))))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if (x <= -1.85e-15) {
tmp = fma((k * -27.0), j, fma(b, c, (x * fma(((z * 18.0) * t), y, (-4.0 * i)))));
} else if (x <= 1.1e-94) {
tmp = fma((-27.0 * j), k, fma(-4.0, (a * t), (b * c)));
} else {
tmp = fma((k * -27.0), j, fma(b, c, (x * fma(z, (t * (18.0 * y)), (i * -4.0)))));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (x <= -1.85e-15) tmp = fma(Float64(k * -27.0), j, fma(b, c, Float64(x * fma(Float64(Float64(z * 18.0) * t), y, Float64(-4.0 * i))))); elseif (x <= 1.1e-94) tmp = fma(Float64(-27.0 * j), k, fma(-4.0, Float64(a * t), Float64(b * c))); else tmp = fma(Float64(k * -27.0), j, fma(b, c, Float64(x * fma(z, Float64(t * Float64(18.0 * y)), Float64(i * -4.0))))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[x, -1.85e-15], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c + N[(x * N[(N[(N[(z * 18.0), $MachinePrecision] * t), $MachinePrecision] * y + N[(-4.0 * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.1e-94], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c + N[(x * N[(z * N[(t * N[(18.0 * y), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.85 \cdot 10^{-15}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(\left(z \cdot 18\right) \cdot t, y, -4 \cdot i\right)\right)\right)\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-94}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(-4, a \cdot t, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(z, t \cdot \left(18 \cdot y\right), i \cdot -4\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.85000000000000008e-15Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
associate-*r*N/A
distribute-lft-neg-inN/A
distribute-rgt-neg-outN/A
metadata-evalN/A
lift-*.f64N/A
lower-fma.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6479.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6479.8
Applied rewrites79.8%
if -1.85000000000000008e-15 < x < 1.10000000000000001e-94Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6461.2
Applied rewrites61.2%
if 1.10000000000000001e-94 < x Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1
(fma
(* k -27.0)
j
(fma b c (* x (fma z (* t (* 18.0 y)) (* i -4.0)))))))
(if (<= x -1.85e-15)
t_1
(if (<= x 1.1e-94) (fma (* -27.0 j) k (fma -4.0 (* a t) (* b c))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma((k * -27.0), j, fma(b, c, (x * fma(z, (t * (18.0 * y)), (i * -4.0)))));
double tmp;
if (x <= -1.85e-15) {
tmp = t_1;
} else if (x <= 1.1e-94) {
tmp = fma((-27.0 * j), k, fma(-4.0, (a * t), (b * c)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(k * -27.0), j, fma(b, c, Float64(x * fma(z, Float64(t * Float64(18.0 * y)), Float64(i * -4.0))))) tmp = 0.0 if (x <= -1.85e-15) tmp = t_1; elseif (x <= 1.1e-94) tmp = fma(Float64(-27.0 * j), k, fma(-4.0, Float64(a * t), Float64(b * c))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c + N[(x * N[(z * N[(t * N[(18.0 * y), $MachinePrecision]), $MachinePrecision] + N[(i * -4.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.85e-15], t$95$1, If[LessEqual[x, 1.1e-94], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(z, t \cdot \left(18 \cdot y\right), i \cdot -4\right)\right)\right)\\
\mathbf{if}\;x \leq -1.85 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{-94}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(-4, a \cdot t, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.85000000000000008e-15 or 1.10000000000000001e-94 < x Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
if -1.85000000000000008e-15 < x < 1.10000000000000001e-94Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6461.2
Applied rewrites61.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* 18.0 (* t (* y z)))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -5e+133)
(fma (* j -27.0) k (fma (* x -4.0) i (* b c)))
(if (<= t_2 3e+227)
(fma -4.0 (* a t) (fma b c (* x (fma -4.0 i t_1))))
(fma (* k -27.0) j (fma b c (* x t_1)))))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = 18.0 * (t * (y * z));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+133) {
tmp = fma((j * -27.0), k, fma((x * -4.0), i, (b * c)));
} else if (t_2 <= 3e+227) {
tmp = fma(-4.0, (a * t), fma(b, c, (x * fma(-4.0, i, t_1))));
} else {
tmp = fma((k * -27.0), j, fma(b, c, (x * t_1)));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(18.0 * Float64(t * Float64(y * z))) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -5e+133) tmp = fma(Float64(j * -27.0), k, fma(Float64(x * -4.0), i, Float64(b * c))); elseif (t_2 <= 3e+227) tmp = fma(-4.0, Float64(a * t), fma(b, c, Float64(x * fma(-4.0, i, t_1)))); else tmp = fma(Float64(k * -27.0), j, fma(b, c, Float64(x * t_1))); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+133], N[(N[(j * -27.0), $MachinePrecision] * k + N[(N[(x * -4.0), $MachinePrecision] * i + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 3e+227], N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b * c + N[(x * N[(-4.0 * i + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c + N[(x * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+133}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot -27, k, \mathsf{fma}\left(x \cdot -4, i, b \cdot c\right)\right)\\
\mathbf{elif}\;t\_2 \leq 3 \cdot 10^{+227}:\\
\;\;\;\;\mathsf{fma}\left(-4, a \cdot t, \mathsf{fma}\left(b, c, x \cdot \mathsf{fma}\left(-4, i, t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, \mathsf{fma}\left(b, c, x \cdot t\_1\right)\right)\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999961e133Initial program 85.6%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites61.9%
if -4.99999999999999961e133 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 2.99999999999999986e227Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.8
Applied rewrites42.8%
Taylor expanded in x around 0
lower-*.f6421.1
Applied rewrites21.1%
Taylor expanded in j around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.4
Applied rewrites72.4%
if 2.99999999999999986e227 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6463.0
Applied rewrites63.0%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma -27.0 (* j k) (* x (fma -4.0 i (* 18.0 (* t (* y z))))))))
(if (<= x -1.75e+64)
t_1
(if (<= x 1.25e+56) (fma (* -27.0 j) k (fma -4.0 (* a t) (* b c))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma(-27.0, (j * k), (x * fma(-4.0, i, (18.0 * (t * (y * z))))));
double tmp;
if (x <= -1.75e+64) {
tmp = t_1;
} else if (x <= 1.25e+56) {
tmp = fma((-27.0 * j), k, fma(-4.0, (a * t), (b * c)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(-27.0, Float64(j * k), Float64(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z)))))) tmp = 0.0 if (x <= -1.75e+64) tmp = t_1; elseif (x <= 1.25e+56) tmp = fma(Float64(-27.0 * j), k, fma(-4.0, Float64(a * t), Float64(b * c))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision] + N[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.75e+64], t$95$1, If[LessEqual[x, 1.25e+56], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-27, j \cdot k, x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\right)\\
\mathbf{if}\;x \leq -1.75 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.25 \cdot 10^{+56}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(-4, a \cdot t, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.7499999999999999e64 or 1.25000000000000006e56 < x Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
if -1.7499999999999999e64 < x < 1.25000000000000006e56Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6461.2
Applied rewrites61.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (fma -4.0 i (* 18.0 (* t (* y z)))))))
(if (<= x -4.9e+58)
t_1
(if (<= x 1.38e+75) (fma (* -27.0 j) k (fma -4.0 (* a t) (* b c))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * fma(-4.0, i, (18.0 * (t * (y * z))));
double tmp;
if (x <= -4.9e+58) {
tmp = t_1;
} else if (x <= 1.38e+75) {
tmp = fma((-27.0 * j), k, fma(-4.0, (a * t), (b * c)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z))))) tmp = 0.0 if (x <= -4.9e+58) tmp = t_1; elseif (x <= 1.38e+75) tmp = fma(Float64(-27.0 * j), k, fma(-4.0, Float64(a * t), Float64(b * c))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e+58], t$95$1, If[LessEqual[x, 1.38e+75], N[(N[(-27.0 * j), $MachinePrecision] * k + N[(-4.0 * N[(a * t), $MachinePrecision] + N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;x \leq -4.9 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.38 \cdot 10^{+75}:\\
\;\;\;\;\mathsf{fma}\left(-27 \cdot j, k, \mathsf{fma}\left(-4, a \cdot t, b \cdot c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.90000000000000018e58 or 1.3799999999999999e75 < x Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6443.0
Applied rewrites43.0%
if -4.90000000000000018e58 < x < 1.3799999999999999e75Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6461.2
Applied rewrites61.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (fma (* (* z x) 18.0) y (* -4.0 a)))))
(if (<= t -9.5e+127)
t_1
(if (<= t 1.45e-63) (fma c b (fma (* x -4.0) i (* (* k j) -27.0))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * fma(((z * x) * 18.0), y, (-4.0 * a));
double tmp;
if (t <= -9.5e+127) {
tmp = t_1;
} else if (t <= 1.45e-63) {
tmp = fma(c, b, fma((x * -4.0), i, ((k * j) * -27.0)));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(Float64(Float64(z * x) * 18.0), y, Float64(-4.0 * a))) tmp = 0.0 if (t <= -9.5e+127) tmp = t_1; elseif (t <= 1.45e-63) tmp = fma(c, b, fma(Float64(x * -4.0), i, Float64(Float64(k * j) * -27.0))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(N[(N[(z * x), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -9.5e+127], t$95$1, If[LessEqual[t, 1.45e-63], N[(c * b + N[(N[(x * -4.0), $MachinePrecision] * i + N[(N[(k * j), $MachinePrecision] * -27.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(\left(z \cdot x\right) \cdot 18, y, -4 \cdot a\right)\\
\mathbf{if}\;t \leq -9.5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.45 \cdot 10^{-63}:\\
\;\;\;\;\mathsf{fma}\left(c, b, \mathsf{fma}\left(x \cdot -4, i, \left(k \cdot j\right) \cdot -27\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.49999999999999975e127 or 1.44999999999999987e-63 < t Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.8
Applied rewrites42.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6443.4
Applied rewrites43.4%
if -9.49999999999999975e127 < t < 1.44999999999999987e-63Initial program 85.6%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
sub-negateN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
Applied rewrites61.8%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (fma (* (* z x) 18.0) y (* -4.0 a)))))
(if (<= t -1.18e-48)
t_1
(if (<= t 9.5e-249)
(fma -27.0 (* j k) (* -4.0 (* i x)))
(if (<= t 5.4e-64) (- (* b c) (* 4.0 (* i x))) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * fma(((z * x) * 18.0), y, (-4.0 * a));
double tmp;
if (t <= -1.18e-48) {
tmp = t_1;
} else if (t <= 9.5e-249) {
tmp = fma(-27.0, (j * k), (-4.0 * (i * x)));
} else if (t <= 5.4e-64) {
tmp = (b * c) - (4.0 * (i * x));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(Float64(Float64(z * x) * 18.0), y, Float64(-4.0 * a))) tmp = 0.0 if (t <= -1.18e-48) tmp = t_1; elseif (t <= 9.5e-249) tmp = fma(-27.0, Float64(j * k), Float64(-4.0 * Float64(i * x))); elseif (t <= 5.4e-64) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(N[(N[(z * x), $MachinePrecision] * 18.0), $MachinePrecision] * y + N[(-4.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.18e-48], t$95$1, If[LessEqual[t, 9.5e-249], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e-64], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(\left(z \cdot x\right) \cdot 18, y, -4 \cdot a\right)\\
\mathbf{if}\;t \leq -1.18 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-249}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, -4 \cdot \left(i \cdot x\right)\right)\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-64}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.18000000000000007e-48 or 5.39999999999999971e-64 < t Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.8
Applied rewrites42.8%
lift-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6443.4
Applied rewrites43.4%
if -1.18000000000000007e-48 < t < 9.4999999999999997e-249Initial program 85.6%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites61.9%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
if 9.4999999999999997e-249 < t < 5.39999999999999971e-64Initial program 85.6%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.4
Applied rewrites41.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* t (fma -4.0 a (* 18.0 (* x (* y z)))))))
(if (<= t -1.05e-55)
t_1
(if (<= t 9.5e-249)
(fma -27.0 (* j k) (* -4.0 (* i x)))
(if (<= t 1650.0) (- (* b c) (* 4.0 (* i x))) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = t * fma(-4.0, a, (18.0 * (x * (y * z))));
double tmp;
if (t <= -1.05e-55) {
tmp = t_1;
} else if (t <= 9.5e-249) {
tmp = fma(-27.0, (j * k), (-4.0 * (i * x)));
} else if (t <= 1650.0) {
tmp = (b * c) - (4.0 * (i * x));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(t * fma(-4.0, a, Float64(18.0 * Float64(x * Float64(y * z))))) tmp = 0.0 if (t <= -1.05e-55) tmp = t_1; elseif (t <= 9.5e-249) tmp = fma(-27.0, Float64(j * k), Float64(-4.0 * Float64(i * x))); elseif (t <= 1650.0) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(t * N[(-4.0 * a + N[(18.0 * N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.05e-55], t$95$1, If[LessEqual[t, 9.5e-249], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1650.0], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := t \cdot \mathsf{fma}\left(-4, a, 18 \cdot \left(x \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;t \leq -1.05 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.5 \cdot 10^{-249}:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, -4 \cdot \left(i \cdot x\right)\right)\\
\mathbf{elif}\;t \leq 1650:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.0500000000000001e-55 or 1650 < t Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.8
Applied rewrites42.8%
if -1.0500000000000001e-55 < t < 9.4999999999999997e-249Initial program 85.6%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites61.9%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
if 9.4999999999999997e-249 < t < 1650Initial program 85.6%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.4
Applied rewrites41.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* x (fma -4.0 i (* 18.0 (* t (* y z)))))))
(if (<= x -4.9e+58)
t_1
(if (<= x 4.4e+74) (fma (* k -27.0) j (* b c)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = x * fma(-4.0, i, (18.0 * (t * (y * z))));
double tmp;
if (x <= -4.9e+58) {
tmp = t_1;
} else if (x <= 4.4e+74) {
tmp = fma((k * -27.0), j, (b * c));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(x * fma(-4.0, i, Float64(18.0 * Float64(t * Float64(y * z))))) tmp = 0.0 if (x <= -4.9e+58) tmp = t_1; elseif (x <= 4.4e+74) tmp = fma(Float64(k * -27.0), j, Float64(b * c)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(x * N[(-4.0 * i + N[(18.0 * N[(t * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.9e+58], t$95$1, If[LessEqual[x, 4.4e+74], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := x \cdot \mathsf{fma}\left(-4, i, 18 \cdot \left(t \cdot \left(y \cdot z\right)\right)\right)\\
\mathbf{if}\;x \leq -4.9 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.4 \cdot 10^{+74}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.90000000000000018e58 or 4.4000000000000002e74 < x Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6443.0
Applied rewrites43.0%
if -4.90000000000000018e58 < x < 4.4000000000000002e74Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
Taylor expanded in x around 0
lower-*.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.
(FPCore (x y z t a b c i j k)
:precision binary64
(if (<= (* b c) -7e+169)
(- (* b c) (* 4.0 (* i x)))
(if (<= (* b c) 2050.0)
(fma -27.0 (* j k) (* -4.0 (* i x)))
(fma (* k -27.0) j (* b c)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double tmp;
if ((b * c) <= -7e+169) {
tmp = (b * c) - (4.0 * (i * x));
} else if ((b * c) <= 2050.0) {
tmp = fma(-27.0, (j * k), (-4.0 * (i * x)));
} else {
tmp = fma((k * -27.0), j, (b * c));
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) tmp = 0.0 if (Float64(b * c) <= -7e+169) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); elseif (Float64(b * c) <= 2050.0) tmp = fma(-27.0, Float64(j * k), Float64(-4.0 * Float64(i * x))); else tmp = fma(Float64(k * -27.0), j, Float64(b * c)); end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := If[LessEqual[N[(b * c), $MachinePrecision], -7e+169], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b * c), $MachinePrecision], 2050.0], N[(-27.0 * N[(j * k), $MachinePrecision] + N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot c \leq -7 \cdot 10^{+169}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\mathbf{elif}\;b \cdot c \leq 2050:\\
\;\;\;\;\mathsf{fma}\left(-27, j \cdot k, -4 \cdot \left(i \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\
\end{array}
\end{array}
if (*.f64 b c) < -7.00000000000000038e169Initial program 85.6%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.4
Applied rewrites41.4%
if -7.00000000000000038e169 < (*.f64 b c) < 2050Initial program 85.6%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-fma.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
metadata-evalN/A
lift-*.f64N/A
associate-*l*N/A
lift-*.f64N/A
+-commutativeN/A
Applied rewrites61.9%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6441.7
Applied rewrites41.7%
if 2050 < (*.f64 b c) Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
Taylor expanded in x around 0
lower-*.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.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (fma (* k -27.0) j (* b c))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -5e-16)
t_1
(if (<= t_2 1e+190) (- (* b c) (* 4.0 (* i x))) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = fma((k * -27.0), j, (b * c));
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e-16) {
tmp = t_1;
} else if (t_2 <= 1e+190) {
tmp = (b * c) - (4.0 * (i * x));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = fma(Float64(k * -27.0), j, Float64(b * c)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -5e-16) tmp = t_1; elseif (t_2 <= 1e+190) tmp = Float64(Float64(b * c) - Float64(4.0 * Float64(i * x))); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-16], t$95$1, If[LessEqual[t$95$2, 1e+190], N[(N[(b * c), $MachinePrecision] - N[(4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+190}:\\
\;\;\;\;b \cdot c - 4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -5.0000000000000004e-16 or 1.0000000000000001e190 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
Taylor expanded in x around 0
lower-*.f6444.6
Applied rewrites44.6%
if -5.0000000000000004e-16 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 1.0000000000000001e190Initial program 85.6%
Taylor expanded in t around 0
lower--.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6460.8
Applied rewrites60.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6441.4
Applied rewrites41.4%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -4.0 (* i x))))
(if (<= x -4.8e+167)
t_1
(if (<= x 1.42e+78) (fma (* k -27.0) j (* b c)) t_1))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -4.0 * (i * x);
double tmp;
if (x <= -4.8e+167) {
tmp = t_1;
} else if (x <= 1.42e+78) {
tmp = fma((k * -27.0), j, (b * c));
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-4.0 * Float64(i * x)) tmp = 0.0 if (x <= -4.8e+167) tmp = t_1; elseif (x <= 1.42e+78) tmp = fma(Float64(k * -27.0), j, Float64(b * c)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.8e+167], t$95$1, If[LessEqual[x, 1.42e+78], N[(N[(k * -27.0), $MachinePrecision] * j + N[(b * c), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -4 \cdot \left(i \cdot x\right)\\
\mathbf{if}\;x \leq -4.8 \cdot 10^{+167}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.42 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(k \cdot -27, j, b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.79999999999999998e167 or 1.42e78 < x Initial program 85.6%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.2
Applied rewrites21.2%
if -4.79999999999999998e167 < x < 1.42e78Initial program 85.6%
Taylor expanded in a around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6472.9
Applied rewrites72.9%
Applied rewrites79.2%
Taylor expanded in x around 0
lower-*.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.
(FPCore (x y z t a b c i j k)
:precision binary64
(let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k)))
(if (<= t_2 -5e+133)
t_1
(if (<= t_2 1e-234)
(* t (* -4.0 a))
(if (<= t_2 5e+193) (* -4.0 (* i x)) t_1)))))assert(x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+133) {
tmp = t_1;
} else if (t_2 <= 1e-234) {
tmp = t * (-4.0 * a);
} else if (t_2 <= 5e+193) {
tmp = -4.0 * (i * x);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-5d+133)) then
tmp = t_1
else if (t_2 <= 1d-234) then
tmp = t * ((-4.0d0) * a)
else if (t_2 <= 5d+193) then
tmp = (-4.0d0) * (i * x)
else
tmp = t_1
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+133) {
tmp = t_1;
} else if (t_2 <= 1e-234) {
tmp = t * (-4.0 * a);
} else if (t_2 <= 5e+193) {
tmp = -4.0 * (i * x);
} else {
tmp = t_1;
}
return tmp;
}
[x, y, z, t, a, b, c, i, j, k] = sort([x, y, z, t, a, b, c, i, j, k]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -5e+133: tmp = t_1 elif t_2 <= 1e-234: tmp = t * (-4.0 * a) elif t_2 <= 5e+193: tmp = -4.0 * (i * x) else: tmp = t_1 return tmp
x, y, z, t, a, b, c, i, j, k = sort([x, y, z, t, a, b, c, i, j, k]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -5e+133) tmp = t_1; elseif (t_2 <= 1e-234) tmp = Float64(t * Float64(-4.0 * a)); elseif (t_2 <= 5e+193) tmp = Float64(-4.0 * Float64(i * x)); else tmp = t_1; end return tmp end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -5e+133)
tmp = t_1;
elseif (t_2 <= 1e-234)
tmp = t * (-4.0 * a);
elseif (t_2 <= 5e+193)
tmp = -4.0 * (i * x);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+133], t$95$1, If[LessEqual[t$95$2, 1e-234], N[(t * N[(-4.0 * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+193], N[(-4.0 * N[(i * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
[x, y, z, t, a, b, c, i, j, k] = \mathsf{sort}([x, y, z, t, a, b, c, i, j, k])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-234}:\\
\;\;\;\;t \cdot \left(-4 \cdot a\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+193}:\\
\;\;\;\;-4 \cdot \left(i \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999961e133 or 4.99999999999999972e193 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.0
Applied rewrites24.0%
if -4.99999999999999961e133 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 9.9999999999999996e-235Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.8
Applied rewrites42.8%
Taylor expanded in x around 0
lower-*.f6421.1
Applied rewrites21.1%
if 9.9999999999999996e-235 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.99999999999999972e193Initial program 85.6%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6421.2
Applied rewrites21.2%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (let* ((t_1 (* -27.0 (* j k))) (t_2 (* (* j 27.0) k))) (if (<= t_2 -5e+133) t_1 (if (<= t_2 5e+227) (* 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);
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+133) {
tmp = t_1;
} else if (t_2 <= 5e+227) {
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.
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j, k)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8), intent (in) :: k
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-27.0d0) * (j * k)
t_2 = (j * 27.0d0) * k
if (t_2 <= (-5d+133)) then
tmp = t_1
else if (t_2 <= 5d+227) 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;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
double t_1 = -27.0 * (j * k);
double t_2 = (j * 27.0) * k;
double tmp;
if (t_2 <= -5e+133) {
tmp = t_1;
} else if (t_2 <= 5e+227) {
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]) def code(x, y, z, t, a, b, c, i, j, k): t_1 = -27.0 * (j * k) t_2 = (j * 27.0) * k tmp = 0 if t_2 <= -5e+133: tmp = t_1 elif t_2 <= 5e+227: 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]) function code(x, y, z, t, a, b, c, i, j, k) t_1 = Float64(-27.0 * Float64(j * k)) t_2 = Float64(Float64(j * 27.0) * k) tmp = 0.0 if (t_2 <= -5e+133) tmp = t_1; elseif (t_2 <= 5e+227) tmp = 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])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i, j, k)
t_1 = -27.0 * (j * k);
t_2 = (j * 27.0) * k;
tmp = 0.0;
if (t_2 <= -5e+133)
tmp = t_1;
elseif (t_2 <= 5e+227)
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.
code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := Block[{t$95$1 = N[(-27.0 * N[(j * k), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(j * 27.0), $MachinePrecision] * k), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+133], t$95$1, If[LessEqual[t$95$2, 5e+227], 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])\\
\\
\begin{array}{l}
t_1 := -27 \cdot \left(j \cdot k\right)\\
t_2 := \left(j \cdot 27\right) \cdot k\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+133}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+227}:\\
\;\;\;\;t \cdot \left(-4 \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (*.f64 j #s(literal 27 binary64)) k) < -4.99999999999999961e133 or 4.9999999999999996e227 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) Initial program 85.6%
Taylor expanded in j around inf
lower-*.f64N/A
lower-*.f6424.0
Applied rewrites24.0%
if -4.99999999999999961e133 < (*.f64 (*.f64 j #s(literal 27 binary64)) k) < 4.9999999999999996e227Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.8
Applied rewrites42.8%
Taylor expanded in x around 0
lower-*.f6421.1
Applied rewrites21.1%
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i j k) :precision binary64 (* t (* -4.0 a)))
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 t * (-4.0 * a);
}
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 = t * ((-4.0d0) * a)
end function
assert x < y && y < z && z < t && t < a && a < b && b < c && c < i && i < j && j < k;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j, double k) {
return t * (-4.0 * a);
}
[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 t * (-4.0 * a)
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(t * Float64(-4.0 * a)) end
x, y, z, t, a, b, c, i, j, k = num2cell(sort([x, y, z, t, a, b, c, i, j, k])){:}
function tmp = code(x, y, z, t, a, b, c, i, j, k)
tmp = t * (-4.0 * a);
end
NOTE: x, y, z, t, a, b, c, i, j, and k should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_, j_, k_] := N[(t * N[(-4.0 * a), $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])\\
\\
t \cdot \left(-4 \cdot a\right)
\end{array}
Initial program 85.6%
Applied rewrites89.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6442.8
Applied rewrites42.8%
Taylor expanded in x around 0
lower-*.f6421.1
Applied rewrites21.1%
herbie shell --seed 2025156
(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)))