
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
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)
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
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
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)
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
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* (- t) (- (* a x) (* i b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = -t * ((a * x) - (i * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = -t * ((a * x) - (i * b));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = -t * ((a * x) - (i * b)) return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(-t) * Float64(Float64(a * x) - Float64(i * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = -t * ((a * x) - (i * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[((-t) * N[(N[(a * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x - i \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 73.2%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 73.2%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.7
Applied rewrites38.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))))
(if (<= y -4.5e+231)
(* (fma (- i) j (* z x)) y)
(if (<= y -2.7e-24)
t_1
(if (<= y 6.4e-295)
(fma (* j c) a (- (* i (- (* b t) (* j y))) (* (* c b) z)))
(if (<= y 4.4e-17)
(+
(* (- (fma z y (- (* b (/ (- (* c z) (* i t)) x)))) (* a t)) x)
(* j (* a c)))
t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
double tmp;
if (y <= -4.5e+231) {
tmp = fma(-i, j, (z * x)) * y;
} else if (y <= -2.7e-24) {
tmp = t_1;
} else if (y <= 6.4e-295) {
tmp = fma((j * c), a, ((i * ((b * t) - (j * y))) - ((c * b) * z)));
} else if (y <= 4.4e-17) {
tmp = ((fma(z, y, -(b * (((c * z) - (i * t)) / x))) - (a * t)) * x) + (j * (a * c));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)) tmp = 0.0 if (y <= -4.5e+231) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (y <= -2.7e-24) tmp = t_1; elseif (y <= 6.4e-295) tmp = fma(Float64(j * c), a, Float64(Float64(i * Float64(Float64(b * t) - Float64(j * y))) - Float64(Float64(c * b) * z))); elseif (y <= 4.4e-17) tmp = Float64(Float64(Float64(fma(z, y, Float64(-Float64(b * Float64(Float64(Float64(c * z) - Float64(i * t)) / x)))) - Float64(a * t)) * x) + Float64(j * Float64(a * c))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e+231], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, -2.7e-24], t$95$1, If[LessEqual[y, 6.4e-295], N[(N[(j * c), $MachinePrecision] * a + N[(N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e-17], N[(N[(N[(N[(z * y + (-N[(b * N[(N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision])), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{+231}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{-295}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, i \cdot \left(b \cdot t - j \cdot y\right) - \left(c \cdot b\right) \cdot z\right)\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-17}:\\
\;\;\;\;\left(\mathsf{fma}\left(z, y, -b \cdot \frac{c \cdot z - i \cdot t}{x}\right) - a \cdot t\right) \cdot x + j \cdot \left(a \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.49999999999999991e231Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -4.49999999999999991e231 < y < -2.70000000000000007e-24 or 4.4e-17 < y Initial program 73.2%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
if -2.70000000000000007e-24 < y < 6.4e-295Initial program 73.2%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites74.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6458.6
Applied rewrites58.6%
if 6.4e-295 < y < 4.4e-17Initial program 73.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.0%
Taylor expanded in y around 0
lower-*.f6463.4
Applied rewrites63.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))))
(if (<= y -4.5e+231)
(* (fma (- i) j (* z x)) y)
(if (<= y -9.6e-129)
t_1
(if (<= y 6.8e-105)
(- (fma (- a) (* t x) (* (* j c) a)) (* (- (* c z) (* i t)) b))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
double tmp;
if (y <= -4.5e+231) {
tmp = fma(-i, j, (z * x)) * y;
} else if (y <= -9.6e-129) {
tmp = t_1;
} else if (y <= 6.8e-105) {
tmp = fma(-a, (t * x), ((j * c) * a)) - (((c * z) - (i * t)) * b);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)) tmp = 0.0 if (y <= -4.5e+231) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (y <= -9.6e-129) tmp = t_1; elseif (y <= 6.8e-105) tmp = Float64(fma(Float64(-a), Float64(t * x), Float64(Float64(j * c) * a)) - Float64(Float64(Float64(c * z) - Float64(i * t)) * b)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e+231], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, -9.6e-129], t$95$1, If[LessEqual[y, 6.8e-105], N[(N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{+231}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;y \leq -9.6 \cdot 10^{-129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{-105}:\\
\;\;\;\;\mathsf{fma}\left(-a, t \cdot x, \left(j \cdot c\right) \cdot a\right) - \left(c \cdot z - i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.49999999999999991e231Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -4.49999999999999991e231 < y < -9.59999999999999954e-129 or 6.79999999999999984e-105 < y Initial program 73.2%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
if -9.59999999999999954e-129 < y < 6.79999999999999984e-105Initial program 73.2%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))))
(if (<= y -4.5e+231)
(* (fma (- i) j (* z x)) y)
(if (<= y -2.7e-24)
t_1
(if (<= y 2.5e-106)
(fma (* j c) a (- (* i (- (* b t) (* j y))) (* (* c b) z)))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
double tmp;
if (y <= -4.5e+231) {
tmp = fma(-i, j, (z * x)) * y;
} else if (y <= -2.7e-24) {
tmp = t_1;
} else if (y <= 2.5e-106) {
tmp = fma((j * c), a, ((i * ((b * t) - (j * y))) - ((c * b) * z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)) tmp = 0.0 if (y <= -4.5e+231) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (y <= -2.7e-24) tmp = t_1; elseif (y <= 2.5e-106) tmp = fma(Float64(j * c), a, Float64(Float64(i * Float64(Float64(b * t) - Float64(j * y))) - Float64(Float64(c * b) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.5e+231], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, -2.7e-24], t$95$1, If[LessEqual[y, 2.5e-106], N[(N[(j * c), $MachinePrecision] * a + N[(N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\
\mathbf{if}\;y \leq -4.5 \cdot 10^{+231}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-106}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, i \cdot \left(b \cdot t - j \cdot y\right) - \left(c \cdot b\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.49999999999999991e231Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -4.49999999999999991e231 < y < -2.70000000000000007e-24 or 2.49999999999999991e-106 < y Initial program 73.2%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
if -2.70000000000000007e-24 < y < 2.49999999999999991e-106Initial program 73.2%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites74.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6458.6
Applied rewrites58.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i t) (* c z)) b)))
(if (<= b -5.3e+147)
t_1
(if (<= b 2.25e+184)
(fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) - (c * z)) * b;
double tmp;
if (b <= -5.3e+147) {
tmp = t_1;
} else if (b <= 2.25e+184) {
tmp = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * t) - Float64(c * z)) * b) tmp = 0.0 if (b <= -5.3e+147) tmp = t_1; elseif (b <= 2.25e+184) tmp = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -5.3e+147], t$95$1, If[LessEqual[b, 2.25e+184], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -5.3 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{+184}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.3000000000000002e147 or 2.25000000000000018e184 < b Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
if -5.3000000000000002e147 < b < 2.25000000000000018e184Initial program 73.2%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6459.9
Applied rewrites59.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- t) (- (* a x) (* i b)))) (t_2 (* j (- (* c a) (* y i)))))
(if (<= t -1.6e+71)
t_1
(if (<= t -1.2e-60)
(+ (* (* z y) x) t_2)
(if (<= t 9e+43) (+ (- (* (* c b) z)) t_2) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -t * ((a * x) - (i * b));
double t_2 = j * ((c * a) - (y * i));
double tmp;
if (t <= -1.6e+71) {
tmp = t_1;
} else if (t <= -1.2e-60) {
tmp = ((z * y) * x) + t_2;
} else if (t <= 9e+43) {
tmp = -((c * b) * z) + t_2;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -t * ((a * x) - (i * b))
t_2 = j * ((c * a) - (y * i))
if (t <= (-1.6d+71)) then
tmp = t_1
else if (t <= (-1.2d-60)) then
tmp = ((z * y) * x) + t_2
else if (t <= 9d+43) then
tmp = -((c * b) * z) + t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -t * ((a * x) - (i * b));
double t_2 = j * ((c * a) - (y * i));
double tmp;
if (t <= -1.6e+71) {
tmp = t_1;
} else if (t <= -1.2e-60) {
tmp = ((z * y) * x) + t_2;
} else if (t <= 9e+43) {
tmp = -((c * b) * z) + t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -t * ((a * x) - (i * b)) t_2 = j * ((c * a) - (y * i)) tmp = 0 if t <= -1.6e+71: tmp = t_1 elif t <= -1.2e-60: tmp = ((z * y) * x) + t_2 elif t <= 9e+43: tmp = -((c * b) * z) + t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-t) * Float64(Float64(a * x) - Float64(i * b))) t_2 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) tmp = 0.0 if (t <= -1.6e+71) tmp = t_1; elseif (t <= -1.2e-60) tmp = Float64(Float64(Float64(z * y) * x) + t_2); elseif (t <= 9e+43) tmp = Float64(Float64(-Float64(Float64(c * b) * z)) + t_2); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -t * ((a * x) - (i * b)); t_2 = j * ((c * a) - (y * i)); tmp = 0.0; if (t <= -1.6e+71) tmp = t_1; elseif (t <= -1.2e-60) tmp = ((z * y) * x) + t_2; elseif (t <= 9e+43) tmp = -((c * b) * z) + t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-t) * N[(N[(a * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e+71], t$95$1, If[LessEqual[t, -1.2e-60], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[t, 9e+43], N[((-N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]) + t$95$2), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot \left(a \cdot x - i \cdot b\right)\\
t_2 := j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-60}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + t\_2\\
\mathbf{elif}\;t \leq 9 \cdot 10^{+43}:\\
\;\;\;\;\left(-\left(c \cdot b\right) \cdot z\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.60000000000000012e71 or 9e43 < t Initial program 73.2%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.7
Applied rewrites38.7%
if -1.60000000000000012e71 < t < -1.20000000000000005e-60Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6448.8
Applied rewrites48.8%
if -1.20000000000000005e-60 < t < 9e43Initial program 73.2%
Taylor expanded in c around inf
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.4
Applied rewrites49.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- t) (- (* a x) (* i b)))))
(if (<= t -1.6e+71)
t_1
(if (<= t 1.32e+32) (+ (* (* z y) x) (* j (- (* c a) (* y i)))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -t * ((a * x) - (i * b));
double tmp;
if (t <= -1.6e+71) {
tmp = t_1;
} else if (t <= 1.32e+32) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = -t * ((a * x) - (i * b))
if (t <= (-1.6d+71)) then
tmp = t_1
else if (t <= 1.32d+32) then
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -t * ((a * x) - (i * b));
double tmp;
if (t <= -1.6e+71) {
tmp = t_1;
} else if (t <= 1.32e+32) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -t * ((a * x) - (i * b)) tmp = 0 if t <= -1.6e+71: tmp = t_1 elif t <= 1.32e+32: tmp = ((z * y) * x) + (j * ((c * a) - (y * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-t) * Float64(Float64(a * x) - Float64(i * b))) tmp = 0.0 if (t <= -1.6e+71) tmp = t_1; elseif (t <= 1.32e+32) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -t * ((a * x) - (i * b)); tmp = 0.0; if (t <= -1.6e+71) tmp = t_1; elseif (t <= 1.32e+32) tmp = ((z * y) * x) + (j * ((c * a) - (y * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-t) * N[(N[(a * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.6e+71], t$95$1, If[LessEqual[t, 1.32e+32], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-t\right) \cdot \left(a \cdot x - i \cdot b\right)\\
\mathbf{if}\;t \leq -1.6 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.32 \cdot 10^{+32}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.60000000000000012e71 or 1.31999999999999997e32 < t Initial program 73.2%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.7
Applied rewrites38.7%
if -1.60000000000000012e71 < t < 1.31999999999999997e32Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -2.1e-145)
t_1
(if (<= y 7e-294)
(* (- (* i t) (* c z)) b)
(if (<= y 8.5e-203)
(* (fma (- t) x (* j c)) a)
(if (<= y 7.2e+80) (* (- (* j a) (* b z)) c) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -2.1e-145) {
tmp = t_1;
} else if (y <= 7e-294) {
tmp = ((i * t) - (c * z)) * b;
} else if (y <= 8.5e-203) {
tmp = fma(-t, x, (j * c)) * a;
} else if (y <= 7.2e+80) {
tmp = ((j * a) - (b * z)) * c;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -2.1e-145) tmp = t_1; elseif (y <= 7e-294) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); elseif (y <= 8.5e-203) tmp = Float64(fma(Float64(-t), x, Float64(j * c)) * a); elseif (y <= 7.2e+80) tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.1e-145], t$95$1, If[LessEqual[y, 7e-294], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[y, 8.5e-203], N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[y, 7.2e+80], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-294}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{elif}\;y \leq 8.5 \cdot 10^{-203}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+80}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.09999999999999991e-145 or 7.1999999999999999e80 < y Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -2.09999999999999991e-145 < y < 7.00000000000000064e-294Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
if 7.00000000000000064e-294 < y < 8.50000000000000031e-203Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
if 8.50000000000000031e-203 < y < 7.1999999999999999e80Initial program 73.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6440.1
Applied rewrites40.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -2.1e-145)
t_1
(if (<= y 2e-293)
(* (- (* i t) (* c z)) b)
(if (<= y 5.8e-203)
(* x (- (* y z) (* a t)))
(if (<= y 7.2e+80) (* (- (* j a) (* b z)) c) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -2.1e-145) {
tmp = t_1;
} else if (y <= 2e-293) {
tmp = ((i * t) - (c * z)) * b;
} else if (y <= 5.8e-203) {
tmp = x * ((y * z) - (a * t));
} else if (y <= 7.2e+80) {
tmp = ((j * a) - (b * z)) * c;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -2.1e-145) tmp = t_1; elseif (y <= 2e-293) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); elseif (y <= 5.8e-203) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); elseif (y <= 7.2e+80) tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.1e-145], t$95$1, If[LessEqual[y, 2e-293], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[y, 5.8e-203], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+80], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-145}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-293}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-203}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+80}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.09999999999999991e-145 or 7.1999999999999999e80 < y Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -2.09999999999999991e-145 < y < 2.0000000000000001e-293Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
if 2.0000000000000001e-293 < y < 5.7999999999999998e-203Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
if 5.7999999999999998e-203 < y < 7.1999999999999999e80Initial program 73.2%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6440.1
Applied rewrites40.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* y x) (* c b)) z))) (if (<= z -4.4e-28) t_1 (if (<= z 6.8e+46) (* (- (* a c) (* i y)) j) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((y * x) - (c * b)) * z;
double tmp;
if (z <= -4.4e-28) {
tmp = t_1;
} else if (z <= 6.8e+46) {
tmp = ((a * c) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = ((y * x) - (c * b)) * z
if (z <= (-4.4d-28)) then
tmp = t_1
else if (z <= 6.8d+46) then
tmp = ((a * c) - (i * y)) * j
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((y * x) - (c * b)) * z;
double tmp;
if (z <= -4.4e-28) {
tmp = t_1;
} else if (z <= 6.8e+46) {
tmp = ((a * c) - (i * y)) * j;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((y * x) - (c * b)) * z tmp = 0 if z <= -4.4e-28: tmp = t_1 elif z <= 6.8e+46: tmp = ((a * c) - (i * y)) * j else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(y * x) - Float64(c * b)) * z) tmp = 0.0 if (z <= -4.4e-28) tmp = t_1; elseif (z <= 6.8e+46) tmp = Float64(Float64(Float64(a * c) - Float64(i * y)) * j); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((y * x) - (c * b)) * z; tmp = 0.0; if (z <= -4.4e-28) tmp = t_1; elseif (z <= 6.8e+46) tmp = ((a * c) - (i * y)) * j; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -4.4e-28], t$95$1, If[LessEqual[z, 6.8e+46], N[(N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{if}\;z \leq -4.4 \cdot 10^{-28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+46}:\\
\;\;\;\;\left(a \cdot c - i \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.39999999999999992e-28 or 6.7999999999999996e46 < z Initial program 73.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
if -4.39999999999999992e-28 < z < 6.7999999999999996e46Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6435.7
Applied rewrites35.7%
Taylor expanded in j around inf
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* a c) (* i y)) j)))
(if (<= j -2.4e+51)
t_1
(if (<= j -9.2e-233)
(* (- (* i t) (* c z)) b)
(if (<= j 1.2e+171) (* x (- (* y z) (* a t))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((a * c) - (i * y)) * j;
double tmp;
if (j <= -2.4e+51) {
tmp = t_1;
} else if (j <= -9.2e-233) {
tmp = ((i * t) - (c * z)) * b;
} else if (j <= 1.2e+171) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = ((a * c) - (i * y)) * j
if (j <= (-2.4d+51)) then
tmp = t_1
else if (j <= (-9.2d-233)) then
tmp = ((i * t) - (c * z)) * b
else if (j <= 1.2d+171) then
tmp = x * ((y * z) - (a * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((a * c) - (i * y)) * j;
double tmp;
if (j <= -2.4e+51) {
tmp = t_1;
} else if (j <= -9.2e-233) {
tmp = ((i * t) - (c * z)) * b;
} else if (j <= 1.2e+171) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((a * c) - (i * y)) * j tmp = 0 if j <= -2.4e+51: tmp = t_1 elif j <= -9.2e-233: tmp = ((i * t) - (c * z)) * b elif j <= 1.2e+171: tmp = x * ((y * z) - (a * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(a * c) - Float64(i * y)) * j) tmp = 0.0 if (j <= -2.4e+51) tmp = t_1; elseif (j <= -9.2e-233) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); elseif (j <= 1.2e+171) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((a * c) - (i * y)) * j; tmp = 0.0; if (j <= -2.4e+51) tmp = t_1; elseif (j <= -9.2e-233) tmp = ((i * t) - (c * z)) * b; elseif (j <= 1.2e+171) tmp = x * ((y * z) - (a * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -2.4e+51], t$95$1, If[LessEqual[j, -9.2e-233], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, 1.2e+171], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot c - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -2.4 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -9.2 \cdot 10^{-233}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{elif}\;j \leq 1.2 \cdot 10^{+171}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.3999999999999999e51 or 1.19999999999999999e171 < j Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6435.7
Applied rewrites35.7%
Taylor expanded in j around inf
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
if -2.3999999999999999e51 < j < -9.2000000000000007e-233Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
if -9.2000000000000007e-233 < j < 1.19999999999999999e171Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* a c) (* i y)) j)))
(if (<= j -4.7e-32)
t_1
(if (<= j 1.2e+171) (* x (- (* y z) (* a t))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((a * c) - (i * y)) * j;
double tmp;
if (j <= -4.7e-32) {
tmp = t_1;
} else if (j <= 1.2e+171) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = ((a * c) - (i * y)) * j
if (j <= (-4.7d-32)) then
tmp = t_1
else if (j <= 1.2d+171) then
tmp = x * ((y * z) - (a * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((a * c) - (i * y)) * j;
double tmp;
if (j <= -4.7e-32) {
tmp = t_1;
} else if (j <= 1.2e+171) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((a * c) - (i * y)) * j tmp = 0 if j <= -4.7e-32: tmp = t_1 elif j <= 1.2e+171: tmp = x * ((y * z) - (a * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(a * c) - Float64(i * y)) * j) tmp = 0.0 if (j <= -4.7e-32) tmp = t_1; elseif (j <= 1.2e+171) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((a * c) - (i * y)) * j; tmp = 0.0; if (j <= -4.7e-32) tmp = t_1; elseif (j <= 1.2e+171) tmp = x * ((y * z) - (a * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -4.7e-32], t$95$1, If[LessEqual[j, 1.2e+171], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a \cdot c - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -4.7 \cdot 10^{-32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.2 \cdot 10^{+171}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -4.70000000000000019e-32 or 1.19999999999999999e171 < j Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6435.7
Applied rewrites35.7%
Taylor expanded in j around inf
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5
Applied rewrites38.5%
if -4.70000000000000019e-32 < j < 1.19999999999999999e171Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -3.3e-15)
t_1
(if (<= x -2.7e-186)
(* (* c j) a)
(if (<= x 9.8e-139) (* (- t) (* -1.0 (* b i))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -3.3e-15) {
tmp = t_1;
} else if (x <= -2.7e-186) {
tmp = (c * j) * a;
} else if (x <= 9.8e-139) {
tmp = -t * (-1.0 * (b * i));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = x * ((y * z) - (a * t))
if (x <= (-3.3d-15)) then
tmp = t_1
else if (x <= (-2.7d-186)) then
tmp = (c * j) * a
else if (x <= 9.8d-139) then
tmp = -t * ((-1.0d0) * (b * i))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -3.3e-15) {
tmp = t_1;
} else if (x <= -2.7e-186) {
tmp = (c * j) * a;
} else if (x <= 9.8e-139) {
tmp = -t * (-1.0 * (b * i));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * ((y * z) - (a * t)) tmp = 0 if x <= -3.3e-15: tmp = t_1 elif x <= -2.7e-186: tmp = (c * j) * a elif x <= 9.8e-139: tmp = -t * (-1.0 * (b * i)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -3.3e-15) tmp = t_1; elseif (x <= -2.7e-186) tmp = Float64(Float64(c * j) * a); elseif (x <= 9.8e-139) tmp = Float64(Float64(-t) * Float64(-1.0 * Float64(b * i))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * ((y * z) - (a * t)); tmp = 0.0; if (x <= -3.3e-15) tmp = t_1; elseif (x <= -2.7e-186) tmp = (c * j) * a; elseif (x <= 9.8e-139) tmp = -t * (-1.0 * (b * i)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.3e-15], t$95$1, If[LessEqual[x, -2.7e-186], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[x, 9.8e-139], N[((-t) * N[(-1.0 * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -3.3 \cdot 10^{-15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.7 \cdot 10^{-186}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{elif}\;x \leq 9.8 \cdot 10^{-139}:\\
\;\;\;\;\left(-t\right) \cdot \left(-1 \cdot \left(b \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.3e-15 or 9.80000000000000063e-139 < x Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
if -3.3e-15 < x < -2.6999999999999999e-186Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around 0
lower-*.f6422.4
Applied rewrites22.4%
if -2.6999999999999999e-186 < x < 9.80000000000000063e-139Initial program 73.2%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.7
Applied rewrites38.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* -1.0 (* t x)) a)))
(if (<= t -1.8e+195)
t_1
(if (<= t -9.2e-60)
(* (- t) (* -1.0 (* b i)))
(if (<= t 1.8e-19) (* (* -1.0 (* c z)) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-1.0 * (t * x)) * a;
double tmp;
if (t <= -1.8e+195) {
tmp = t_1;
} else if (t <= -9.2e-60) {
tmp = -t * (-1.0 * (b * i));
} else if (t <= 1.8e-19) {
tmp = (-1.0 * (c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = ((-1.0d0) * (t * x)) * a
if (t <= (-1.8d+195)) then
tmp = t_1
else if (t <= (-9.2d-60)) then
tmp = -t * ((-1.0d0) * (b * i))
else if (t <= 1.8d-19) then
tmp = ((-1.0d0) * (c * z)) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-1.0 * (t * x)) * a;
double tmp;
if (t <= -1.8e+195) {
tmp = t_1;
} else if (t <= -9.2e-60) {
tmp = -t * (-1.0 * (b * i));
} else if (t <= 1.8e-19) {
tmp = (-1.0 * (c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-1.0 * (t * x)) * a tmp = 0 if t <= -1.8e+195: tmp = t_1 elif t <= -9.2e-60: tmp = -t * (-1.0 * (b * i)) elif t <= 1.8e-19: tmp = (-1.0 * (c * z)) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-1.0 * Float64(t * x)) * a) tmp = 0.0 if (t <= -1.8e+195) tmp = t_1; elseif (t <= -9.2e-60) tmp = Float64(Float64(-t) * Float64(-1.0 * Float64(b * i))); elseif (t <= 1.8e-19) tmp = Float64(Float64(-1.0 * Float64(c * z)) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-1.0 * (t * x)) * a; tmp = 0.0; if (t <= -1.8e+195) tmp = t_1; elseif (t <= -9.2e-60) tmp = -t * (-1.0 * (b * i)); elseif (t <= 1.8e-19) tmp = (-1.0 * (c * z)) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, -1.8e+195], t$95$1, If[LessEqual[t, -9.2e-60], N[((-t) * N[(-1.0 * N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e-19], N[(N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-1 \cdot \left(t \cdot x\right)\right) \cdot a\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+195}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -9.2 \cdot 10^{-60}:\\
\;\;\;\;\left(-t\right) \cdot \left(-1 \cdot \left(b \cdot i\right)\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-19}:\\
\;\;\;\;\left(-1 \cdot \left(c \cdot z\right)\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.7999999999999999e195 or 1.8000000000000001e-19 < t Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.1
Applied rewrites22.1%
if -1.7999999999999999e195 < t < -9.2000000000000005e-60Initial program 73.2%
Taylor expanded in t around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.7
Applied rewrites38.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
if -9.2000000000000005e-60 < t < 1.8000000000000001e-19Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in z around inf
lower-*.f64N/A
lift-*.f6423.0
Applied rewrites23.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= c -1.02e-65)
(* (* c j) a)
(if (<= c 3e-249)
(* (* i t) b)
(if (<= c 9.5e+38) (* (* -1.0 (* t x)) a) (* (* -1.0 (* b c)) z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -1.02e-65) {
tmp = (c * j) * a;
} else if (c <= 3e-249) {
tmp = (i * t) * b;
} else if (c <= 9.5e+38) {
tmp = (-1.0 * (t * x)) * a;
} else {
tmp = (-1.0 * (b * c)) * z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: tmp
if (c <= (-1.02d-65)) then
tmp = (c * j) * a
else if (c <= 3d-249) then
tmp = (i * t) * b
else if (c <= 9.5d+38) then
tmp = ((-1.0d0) * (t * x)) * a
else
tmp = ((-1.0d0) * (b * c)) * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -1.02e-65) {
tmp = (c * j) * a;
} else if (c <= 3e-249) {
tmp = (i * t) * b;
} else if (c <= 9.5e+38) {
tmp = (-1.0 * (t * x)) * a;
} else {
tmp = (-1.0 * (b * c)) * z;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if c <= -1.02e-65: tmp = (c * j) * a elif c <= 3e-249: tmp = (i * t) * b elif c <= 9.5e+38: tmp = (-1.0 * (t * x)) * a else: tmp = (-1.0 * (b * c)) * z return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (c <= -1.02e-65) tmp = Float64(Float64(c * j) * a); elseif (c <= 3e-249) tmp = Float64(Float64(i * t) * b); elseif (c <= 9.5e+38) tmp = Float64(Float64(-1.0 * Float64(t * x)) * a); else tmp = Float64(Float64(-1.0 * Float64(b * c)) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (c <= -1.02e-65) tmp = (c * j) * a; elseif (c <= 3e-249) tmp = (i * t) * b; elseif (c <= 9.5e+38) tmp = (-1.0 * (t * x)) * a; else tmp = (-1.0 * (b * c)) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -1.02e-65], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[c, 3e-249], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[c, 9.5e+38], N[(N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], N[(N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -1.02 \cdot 10^{-65}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{elif}\;c \leq 3 \cdot 10^{-249}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;c \leq 9.5 \cdot 10^{+38}:\\
\;\;\;\;\left(-1 \cdot \left(t \cdot x\right)\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(-1 \cdot \left(b \cdot c\right)\right) \cdot z\\
\end{array}
\end{array}
if c < -1.02000000000000004e-65Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around 0
lower-*.f6422.4
Applied rewrites22.4%
if -1.02000000000000004e-65 < c < 3.00000000000000004e-249Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in z around 0
lift-*.f6422.4
Applied rewrites22.4%
if 3.00000000000000004e-249 < c < 9.4999999999999995e38Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.1
Applied rewrites22.1%
if 9.4999999999999995e38 < c Initial program 73.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.8
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* -1.0 (* t x)) a)))
(if (<= t -2.4e+129)
t_1
(if (<= t -6.4e-59)
(* x (* y z))
(if (<= t 1.8e-19) (* (* -1.0 (* c z)) b) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-1.0 * (t * x)) * a;
double tmp;
if (t <= -2.4e+129) {
tmp = t_1;
} else if (t <= -6.4e-59) {
tmp = x * (y * z);
} else if (t <= 1.8e-19) {
tmp = (-1.0 * (c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = ((-1.0d0) * (t * x)) * a
if (t <= (-2.4d+129)) then
tmp = t_1
else if (t <= (-6.4d-59)) then
tmp = x * (y * z)
else if (t <= 1.8d-19) then
tmp = ((-1.0d0) * (c * z)) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-1.0 * (t * x)) * a;
double tmp;
if (t <= -2.4e+129) {
tmp = t_1;
} else if (t <= -6.4e-59) {
tmp = x * (y * z);
} else if (t <= 1.8e-19) {
tmp = (-1.0 * (c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-1.0 * (t * x)) * a tmp = 0 if t <= -2.4e+129: tmp = t_1 elif t <= -6.4e-59: tmp = x * (y * z) elif t <= 1.8e-19: tmp = (-1.0 * (c * z)) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-1.0 * Float64(t * x)) * a) tmp = 0.0 if (t <= -2.4e+129) tmp = t_1; elseif (t <= -6.4e-59) tmp = Float64(x * Float64(y * z)); elseif (t <= 1.8e-19) tmp = Float64(Float64(-1.0 * Float64(c * z)) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-1.0 * (t * x)) * a; tmp = 0.0; if (t <= -2.4e+129) tmp = t_1; elseif (t <= -6.4e-59) tmp = x * (y * z); elseif (t <= 1.8e-19) tmp = (-1.0 * (c * z)) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, -2.4e+129], t$95$1, If[LessEqual[t, -6.4e-59], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.8e-19], N[(N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-1 \cdot \left(t \cdot x\right)\right) \cdot a\\
\mathbf{if}\;t \leq -2.4 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -6.4 \cdot 10^{-59}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-19}:\\
\;\;\;\;\left(-1 \cdot \left(c \cdot z\right)\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.3999999999999999e129 or 1.8000000000000001e-19 < t Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.1
Applied rewrites22.1%
if -2.3999999999999999e129 < t < -6.3999999999999998e-59Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
Taylor expanded in y around inf
lower-*.f64N/A
lift-*.f6422.2
Applied rewrites22.2%
if -6.3999999999999998e-59 < t < 1.8000000000000001e-19Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in z around inf
lower-*.f64N/A
lift-*.f6423.0
Applied rewrites23.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* i t) b)))
(if (<= i -1.6e+53)
t_1
(if (<= i -7.5e-117)
(* x (* -1.0 (* a t)))
(if (<= i -8.5e-288)
(* x (* y z))
(if (<= i 1.56e-27) (* (* c j) a) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * t) * b;
double tmp;
if (i <= -1.6e+53) {
tmp = t_1;
} else if (i <= -7.5e-117) {
tmp = x * (-1.0 * (a * t));
} else if (i <= -8.5e-288) {
tmp = x * (y * z);
} else if (i <= 1.56e-27) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = (i * t) * b
if (i <= (-1.6d+53)) then
tmp = t_1
else if (i <= (-7.5d-117)) then
tmp = x * ((-1.0d0) * (a * t))
else if (i <= (-8.5d-288)) then
tmp = x * (y * z)
else if (i <= 1.56d-27) then
tmp = (c * j) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * t) * b;
double tmp;
if (i <= -1.6e+53) {
tmp = t_1;
} else if (i <= -7.5e-117) {
tmp = x * (-1.0 * (a * t));
} else if (i <= -8.5e-288) {
tmp = x * (y * z);
} else if (i <= 1.56e-27) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (i * t) * b tmp = 0 if i <= -1.6e+53: tmp = t_1 elif i <= -7.5e-117: tmp = x * (-1.0 * (a * t)) elif i <= -8.5e-288: tmp = x * (y * z) elif i <= 1.56e-27: tmp = (c * j) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * t) * b) tmp = 0.0 if (i <= -1.6e+53) tmp = t_1; elseif (i <= -7.5e-117) tmp = Float64(x * Float64(-1.0 * Float64(a * t))); elseif (i <= -8.5e-288) tmp = Float64(x * Float64(y * z)); elseif (i <= 1.56e-27) tmp = Float64(Float64(c * j) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (i * t) * b; tmp = 0.0; if (i <= -1.6e+53) tmp = t_1; elseif (i <= -7.5e-117) tmp = x * (-1.0 * (a * t)); elseif (i <= -8.5e-288) tmp = x * (y * z); elseif (i <= 1.56e-27) tmp = (c * j) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[i, -1.6e+53], t$95$1, If[LessEqual[i, -7.5e-117], N[(x * N[(-1.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, -8.5e-288], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.56e-27], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t\right) \cdot b\\
\mathbf{if}\;i \leq -1.6 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -7.5 \cdot 10^{-117}:\\
\;\;\;\;x \cdot \left(-1 \cdot \left(a \cdot t\right)\right)\\
\mathbf{elif}\;i \leq -8.5 \cdot 10^{-288}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;i \leq 1.56 \cdot 10^{-27}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -1.6e53 or 1.56e-27 < i Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in z around 0
lift-*.f6422.4
Applied rewrites22.4%
if -1.6e53 < i < -7.50000000000000066e-117Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
Taylor expanded in y around 0
lower-*.f64N/A
lift-*.f6421.8
Applied rewrites21.8%
if -7.50000000000000066e-117 < i < -8.4999999999999997e-288Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
Taylor expanded in y around inf
lower-*.f64N/A
lift-*.f6422.2
Applied rewrites22.2%
if -8.4999999999999997e-288 < i < 1.56e-27Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around 0
lower-*.f6422.4
Applied rewrites22.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* c j) a)))
(if (<= c -1.02e-65)
t_1
(if (<= c 3e-249)
(* (* i t) b)
(if (<= c 4.2e+52) (* (* -1.0 (* t x)) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * a;
double tmp;
if (c <= -1.02e-65) {
tmp = t_1;
} else if (c <= 3e-249) {
tmp = (i * t) * b;
} else if (c <= 4.2e+52) {
tmp = (-1.0 * (t * x)) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = (c * j) * a
if (c <= (-1.02d-65)) then
tmp = t_1
else if (c <= 3d-249) then
tmp = (i * t) * b
else if (c <= 4.2d+52) then
tmp = ((-1.0d0) * (t * x)) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * a;
double tmp;
if (c <= -1.02e-65) {
tmp = t_1;
} else if (c <= 3e-249) {
tmp = (i * t) * b;
} else if (c <= 4.2e+52) {
tmp = (-1.0 * (t * x)) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (c * j) * a tmp = 0 if c <= -1.02e-65: tmp = t_1 elif c <= 3e-249: tmp = (i * t) * b elif c <= 4.2e+52: tmp = (-1.0 * (t * x)) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * j) * a) tmp = 0.0 if (c <= -1.02e-65) tmp = t_1; elseif (c <= 3e-249) tmp = Float64(Float64(i * t) * b); elseif (c <= 4.2e+52) tmp = Float64(Float64(-1.0 * Float64(t * x)) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (c * j) * a; tmp = 0.0; if (c <= -1.02e-65) tmp = t_1; elseif (c <= 3e-249) tmp = (i * t) * b; elseif (c <= 4.2e+52) tmp = (-1.0 * (t * x)) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[c, -1.02e-65], t$95$1, If[LessEqual[c, 3e-249], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[c, 4.2e+52], N[(N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot j\right) \cdot a\\
\mathbf{if}\;c \leq -1.02 \cdot 10^{-65}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 3 \cdot 10^{-249}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;c \leq 4.2 \cdot 10^{+52}:\\
\;\;\;\;\left(-1 \cdot \left(t \cdot x\right)\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.02000000000000004e-65 or 4.2e52 < c Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around 0
lower-*.f6422.4
Applied rewrites22.4%
if -1.02000000000000004e-65 < c < 3.00000000000000004e-249Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in z around 0
lift-*.f6422.4
Applied rewrites22.4%
if 3.00000000000000004e-249 < c < 4.2e52Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* i t) b)))
(if (<= i -1.05e+52)
t_1
(if (<= i -8.5e-288)
(* x (* y z))
(if (<= i 1.56e-27) (* (* c j) a) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * t) * b;
double tmp;
if (i <= -1.05e+52) {
tmp = t_1;
} else if (i <= -8.5e-288) {
tmp = x * (y * z);
} else if (i <= 1.56e-27) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = (i * t) * b
if (i <= (-1.05d+52)) then
tmp = t_1
else if (i <= (-8.5d-288)) then
tmp = x * (y * z)
else if (i <= 1.56d-27) then
tmp = (c * j) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * t) * b;
double tmp;
if (i <= -1.05e+52) {
tmp = t_1;
} else if (i <= -8.5e-288) {
tmp = x * (y * z);
} else if (i <= 1.56e-27) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (i * t) * b tmp = 0 if i <= -1.05e+52: tmp = t_1 elif i <= -8.5e-288: tmp = x * (y * z) elif i <= 1.56e-27: tmp = (c * j) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * t) * b) tmp = 0.0 if (i <= -1.05e+52) tmp = t_1; elseif (i <= -8.5e-288) tmp = Float64(x * Float64(y * z)); elseif (i <= 1.56e-27) tmp = Float64(Float64(c * j) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (i * t) * b; tmp = 0.0; if (i <= -1.05e+52) tmp = t_1; elseif (i <= -8.5e-288) tmp = x * (y * z); elseif (i <= 1.56e-27) tmp = (c * j) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[i, -1.05e+52], t$95$1, If[LessEqual[i, -8.5e-288], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.56e-27], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t\right) \cdot b\\
\mathbf{if}\;i \leq -1.05 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -8.5 \cdot 10^{-288}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;i \leq 1.56 \cdot 10^{-27}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -1.05e52 or 1.56e-27 < i Initial program 73.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.9
Applied rewrites39.9%
Taylor expanded in z around 0
lift-*.f6422.4
Applied rewrites22.4%
if -1.05e52 < i < -8.4999999999999997e-288Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
Taylor expanded in y around inf
lower-*.f64N/A
lift-*.f6422.2
Applied rewrites22.2%
if -8.4999999999999997e-288 < i < 1.56e-27Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around 0
lower-*.f6422.4
Applied rewrites22.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* x (* y z)))) (if (<= z -1.4e-47) t_1 (if (<= z 5.6e+118) (* (* c j) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * (y * z);
double tmp;
if (z <= -1.4e-47) {
tmp = t_1;
} else if (z <= 5.6e+118) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
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) :: t_1
real(8) :: tmp
t_1 = x * (y * z)
if (z <= (-1.4d-47)) then
tmp = t_1
else if (z <= 5.6d+118) then
tmp = (c * j) * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * (y * z);
double tmp;
if (z <= -1.4e-47) {
tmp = t_1;
} else if (z <= 5.6e+118) {
tmp = (c * j) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * (y * z) tmp = 0 if z <= -1.4e-47: tmp = t_1 elif z <= 5.6e+118: tmp = (c * j) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (z <= -1.4e-47) tmp = t_1; elseif (z <= 5.6e+118) tmp = Float64(Float64(c * j) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * (y * z); tmp = 0.0; if (z <= -1.4e-47) tmp = t_1; elseif (z <= 5.6e+118) tmp = (c * j) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.4e-47], t$95$1, If[LessEqual[z, 5.6e+118], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.4 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+118}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.39999999999999996e-47 or 5.59999999999999972e118 < z Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
Taylor expanded in y around inf
lower-*.f64N/A
lift-*.f6422.2
Applied rewrites22.2%
if -1.39999999999999996e-47 < z < 5.59999999999999972e118Initial program 73.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
Taylor expanded in x around 0
lower-*.f6422.4
Applied rewrites22.4%
(FPCore (x y z t a b c i j) :precision binary64 (* x (* y z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return x * (y * z);
}
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)
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
code = x * (y * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return x * (y * z);
}
def code(x, y, z, t, a, b, c, i, j): return x * (y * z)
function code(x, y, z, t, a, b, c, i, j) return Float64(x * Float64(y * z)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = x * (y * z); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(y \cdot z\right)
\end{array}
Initial program 73.2%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites67.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6438.4
Applied rewrites38.4%
Taylor expanded in y around inf
lower-*.f64N/A
lift-*.f6422.2
Applied rewrites22.2%
herbie shell --seed 2025139
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))