
(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]
\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)
Herbie found 13 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]
\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)
(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 (* z (* b (- (/ (* x y) b) c))))))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 = z * (b * (((x * y) / b) - c));
}
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 = z * (b * (((x * y) / b) - c));
}
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 = z * (b * (((x * y) / b) - c)) 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(z * Float64(b * Float64(Float64(Float64(x * y) / b) - c))); 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 = z * (b * (((x * y) / b) - c)); 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[(z * N[(b * N[(N[(N[(x * y), $MachinePrecision] / b), $MachinePrecision] - c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\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}:\\
\;\;\;\;z \cdot \left(b \cdot \left(\frac{x \cdot y}{b} - c\right)\right)\\
\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 74.1%
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 74.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6439.3%
Applied rewrites39.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -1.3e+149)
t_1
(if (<= b 7.5e+164)
(fma j (- (* a c) (* i y)) (* 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 = b * ((i * t) - (c * z));
double tmp;
if (b <= -1.3e+149) {
tmp = t_1;
} else if (b <= 7.5e+164) {
tmp = fma(j, ((a * c) - (i * y)), (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(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -1.3e+149) tmp = t_1; elseif (b <= 7.5e+164) tmp = fma(j, Float64(Float64(a * c) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.3e+149], t$95$1, If[LessEqual[b, 7.5e+164], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -1.3 \cdot 10^{+149}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 7.5 \cdot 10^{+164}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1.29999999999999989e149 or 7.49999999999999976e164 < b Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
if -1.29999999999999989e149 < b < 7.49999999999999976e164Initial program 74.1%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -3.3e+142)
t_1
(if (<= b 7.5e+164) (fma j (- (* a c) (* i y)) (* x (* y 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 = b * ((i * t) - (c * z));
double tmp;
if (b <= -3.3e+142) {
tmp = t_1;
} else if (b <= 7.5e+164) {
tmp = fma(j, ((a * c) - (i * y)), (x * (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -3.3e+142) tmp = t_1; elseif (b <= 7.5e+164) tmp = fma(j, Float64(Float64(a * c) - Float64(i * y)), Float64(x * Float64(y * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.3e+142], t$95$1, If[LessEqual[b, 7.5e+164], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -3.3 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 7.5 \cdot 10^{+164}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c - i \cdot y, x \cdot \left(y \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -3.3000000000000002e142 or 7.49999999999999976e164 < b Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
if -3.3000000000000002e142 < b < 7.49999999999999976e164Initial program 74.1%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6450.1%
Applied rewrites50.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -3.3e+142)
t_1
(if (<= b -3.6e-286)
(* j (- (* a c) (* i y)))
(if (<= b 1.85e+90) (* (- (* 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 = b * ((i * t) - (c * z));
double tmp;
if (b <= -3.3e+142) {
tmp = t_1;
} else if (b <= -3.6e-286) {
tmp = j * ((a * c) - (i * y));
} else if (b <= 1.85e+90) {
tmp = ((z * y) - (a * t)) * x;
} 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 = b * ((i * t) - (c * z))
if (b <= (-3.3d+142)) then
tmp = t_1
else if (b <= (-3.6d-286)) then
tmp = j * ((a * c) - (i * y))
else if (b <= 1.85d+90) then
tmp = ((z * y) - (a * t)) * x
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 = b * ((i * t) - (c * z));
double tmp;
if (b <= -3.3e+142) {
tmp = t_1;
} else if (b <= -3.6e-286) {
tmp = j * ((a * c) - (i * y));
} else if (b <= 1.85e+90) {
tmp = ((z * y) - (a * t)) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * ((i * t) - (c * z)) tmp = 0 if b <= -3.3e+142: tmp = t_1 elif b <= -3.6e-286: tmp = j * ((a * c) - (i * y)) elif b <= 1.85e+90: tmp = ((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(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -3.3e+142) tmp = t_1; elseif (b <= -3.6e-286) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); elseif (b <= 1.85e+90) tmp = Float64(Float64(Float64(z * y) - Float64(a * t)) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * ((i * t) - (c * z)); tmp = 0.0; if (b <= -3.3e+142) tmp = t_1; elseif (b <= -3.6e-286) tmp = j * ((a * c) - (i * y)); elseif (b <= 1.85e+90) tmp = ((z * y) - (a * t)) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.3e+142], t$95$1, If[LessEqual[b, -3.6e-286], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.85e+90], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -3.3 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.6 \cdot 10^{-286}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{elif}\;b \leq 1.85 \cdot 10^{+90}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -3.3000000000000002e142 or 1.85e90 < b Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
if -3.3000000000000002e142 < b < -3.60000000000000013e-286Initial program 74.1%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if -3.60000000000000013e-286 < b < 1.85e90Initial program 74.1%
Applied rewrites75.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.6%
Applied rewrites39.6%
Applied rewrites39.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* a c) (* i y)))))
(if (<= j -3.9e-47)
t_1
(if (<= j 4e-163)
(* z (- (* x y) (* b c)))
(if (<= j 1.08e+24) (* (- (* b i) (* a x)) 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 = j * ((a * c) - (i * y));
double tmp;
if (j <= -3.9e-47) {
tmp = t_1;
} else if (j <= 4e-163) {
tmp = z * ((x * y) - (b * c));
} else if (j <= 1.08e+24) {
tmp = ((b * i) - (a * x)) * 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 = j * ((a * c) - (i * y))
if (j <= (-3.9d-47)) then
tmp = t_1
else if (j <= 4d-163) then
tmp = z * ((x * y) - (b * c))
else if (j <= 1.08d+24) then
tmp = ((b * i) - (a * x)) * 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 = j * ((a * c) - (i * y));
double tmp;
if (j <= -3.9e-47) {
tmp = t_1;
} else if (j <= 4e-163) {
tmp = z * ((x * y) - (b * c));
} else if (j <= 1.08e+24) {
tmp = ((b * i) - (a * x)) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((a * c) - (i * y)) tmp = 0 if j <= -3.9e-47: tmp = t_1 elif j <= 4e-163: tmp = z * ((x * y) - (b * c)) elif j <= 1.08e+24: tmp = ((b * i) - (a * x)) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(a * c) - Float64(i * y))) tmp = 0.0 if (j <= -3.9e-47) tmp = t_1; elseif (j <= 4e-163) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (j <= 1.08e+24) tmp = Float64(Float64(Float64(b * i) - Float64(a * x)) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((a * c) - (i * y)); tmp = 0.0; if (j <= -3.9e-47) tmp = t_1; elseif (j <= 4e-163) tmp = z * ((x * y) - (b * c)); elseif (j <= 1.08e+24) tmp = ((b * i) - (a * x)) * 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[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -3.9e-47], t$95$1, If[LessEqual[j, 4e-163], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.08e+24], N[(N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{if}\;j \leq -3.9 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 4 \cdot 10^{-163}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;j \leq 1.08 \cdot 10^{+24}:\\
\;\;\;\;\left(b \cdot i - a \cdot x\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if j < -3.89999999999999978e-47 or 1.0799999999999999e24 < j Initial program 74.1%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if -3.89999999999999978e-47 < j < 3.99999999999999969e-163Initial program 74.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if 3.99999999999999969e-163 < j < 1.0799999999999999e24Initial program 74.1%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7%
Applied rewrites39.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.7%
Applied rewrites39.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* a c) (* i y)))))
(if (<= j -3.9e-47)
t_1
(if (<= j 1.35e+23) (* z (- (* x y) (* b 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 = j * ((a * c) - (i * y));
double tmp;
if (j <= -3.9e-47) {
tmp = t_1;
} else if (j <= 1.35e+23) {
tmp = z * ((x * y) - (b * c));
} 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 = j * ((a * c) - (i * y))
if (j <= (-3.9d-47)) then
tmp = t_1
else if (j <= 1.35d+23) then
tmp = z * ((x * y) - (b * c))
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 = j * ((a * c) - (i * y));
double tmp;
if (j <= -3.9e-47) {
tmp = t_1;
} else if (j <= 1.35e+23) {
tmp = z * ((x * y) - (b * c));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((a * c) - (i * y)) tmp = 0 if j <= -3.9e-47: tmp = t_1 elif j <= 1.35e+23: tmp = z * ((x * y) - (b * c)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(a * c) - Float64(i * y))) tmp = 0.0 if (j <= -3.9e-47) tmp = t_1; elseif (j <= 1.35e+23) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((a * c) - (i * y)); tmp = 0.0; if (j <= -3.9e-47) tmp = t_1; elseif (j <= 1.35e+23) tmp = z * ((x * y) - (b * c)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -3.9e-47], t$95$1, If[LessEqual[j, 1.35e+23], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{if}\;j \leq -3.9 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.35 \cdot 10^{+23}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if j < -3.89999999999999978e-47 or 1.3499999999999999e23 < j Initial program 74.1%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if -3.89999999999999978e-47 < j < 1.3499999999999999e23Initial program 74.1%
Taylor expanded in z around inf
lower-*.f64N/A
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 (* b (- (* i t) (* c z)))))
(if (<= b -3.3e+142)
t_1
(if (<= b 6.6e-49)
(* j (- (* a c) (* i y)))
(if (<= b 2.8e+89) (* a (* -1.0 (* 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 = b * ((i * t) - (c * z));
double tmp;
if (b <= -3.3e+142) {
tmp = t_1;
} else if (b <= 6.6e-49) {
tmp = j * ((a * c) - (i * y));
} else if (b <= 2.8e+89) {
tmp = a * (-1.0 * (t * x));
} 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 = b * ((i * t) - (c * z))
if (b <= (-3.3d+142)) then
tmp = t_1
else if (b <= 6.6d-49) then
tmp = j * ((a * c) - (i * y))
else if (b <= 2.8d+89) then
tmp = a * ((-1.0d0) * (t * x))
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 = b * ((i * t) - (c * z));
double tmp;
if (b <= -3.3e+142) {
tmp = t_1;
} else if (b <= 6.6e-49) {
tmp = j * ((a * c) - (i * y));
} else if (b <= 2.8e+89) {
tmp = a * (-1.0 * (t * x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * ((i * t) - (c * z)) tmp = 0 if b <= -3.3e+142: tmp = t_1 elif b <= 6.6e-49: tmp = j * ((a * c) - (i * y)) elif b <= 2.8e+89: tmp = a * (-1.0 * (t * x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -3.3e+142) tmp = t_1; elseif (b <= 6.6e-49) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); elseif (b <= 2.8e+89) tmp = Float64(a * Float64(-1.0 * Float64(t * x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * ((i * t) - (c * z)); tmp = 0.0; if (b <= -3.3e+142) tmp = t_1; elseif (b <= 6.6e-49) tmp = j * ((a * c) - (i * y)); elseif (b <= 2.8e+89) tmp = a * (-1.0 * (t * x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.3e+142], t$95$1, If[LessEqual[b, 6.6e-49], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.8e+89], N[(a * N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -3.3 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.6 \cdot 10^{-49}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+89}:\\
\;\;\;\;a \cdot \left(-1 \cdot \left(t \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -3.3000000000000002e142 or 2.7999999999999998e89 < b Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
if -3.3000000000000002e142 < b < 6.6e-49Initial program 74.1%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if 6.6e-49 < b < 2.7999999999999998e89Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.8%
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* a c) (* i y)))))
(if (<= j -3.3e-47)
t_1
(if (<= j -1.02e-168)
(* a (* -1.0 (* t x)))
(if (<= j 3.3e-93) (* b (* -1.0 (* c 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 = j * ((a * c) - (i * y));
double tmp;
if (j <= -3.3e-47) {
tmp = t_1;
} else if (j <= -1.02e-168) {
tmp = a * (-1.0 * (t * x));
} else if (j <= 3.3e-93) {
tmp = b * (-1.0 * (c * z));
} 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 = j * ((a * c) - (i * y))
if (j <= (-3.3d-47)) then
tmp = t_1
else if (j <= (-1.02d-168)) then
tmp = a * ((-1.0d0) * (t * x))
else if (j <= 3.3d-93) then
tmp = b * ((-1.0d0) * (c * z))
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 = j * ((a * c) - (i * y));
double tmp;
if (j <= -3.3e-47) {
tmp = t_1;
} else if (j <= -1.02e-168) {
tmp = a * (-1.0 * (t * x));
} else if (j <= 3.3e-93) {
tmp = b * (-1.0 * (c * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((a * c) - (i * y)) tmp = 0 if j <= -3.3e-47: tmp = t_1 elif j <= -1.02e-168: tmp = a * (-1.0 * (t * x)) elif j <= 3.3e-93: tmp = b * (-1.0 * (c * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(a * c) - Float64(i * y))) tmp = 0.0 if (j <= -3.3e-47) tmp = t_1; elseif (j <= -1.02e-168) tmp = Float64(a * Float64(-1.0 * Float64(t * x))); elseif (j <= 3.3e-93) tmp = Float64(b * Float64(-1.0 * Float64(c * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((a * c) - (i * y)); tmp = 0.0; if (j <= -3.3e-47) tmp = t_1; elseif (j <= -1.02e-168) tmp = a * (-1.0 * (t * x)); elseif (j <= 3.3e-93) tmp = b * (-1.0 * (c * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -3.3e-47], t$95$1, If[LessEqual[j, -1.02e-168], N[(a * N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.3e-93], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{if}\;j \leq -3.3 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -1.02 \cdot 10^{-168}:\\
\;\;\;\;a \cdot \left(-1 \cdot \left(t \cdot x\right)\right)\\
\mathbf{elif}\;j \leq 3.3 \cdot 10^{-93}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if j < -3.30000000000000004e-47 or 3.3000000000000001e-93 < j Initial program 74.1%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6461.4%
Applied rewrites61.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if -3.30000000000000004e-47 < j < -1.01999999999999999e-168Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.8%
Applied rewrites22.8%
if -1.01999999999999999e-168 < j < 3.3000000000000001e-93Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
Taylor expanded in z 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 (* b (* i t))))
(if (<= b -1.26e+262)
t_1
(if (<= b -3e+19)
(* b (* -1.0 (* c z)))
(if (<= b -1.85e-270)
(* a (* c j))
(if (<= b 1.8e+90)
(* a (* -1.0 (* t x)))
(if (<= b 4.6e+137) t_1 (* z (* -1.0 (* b c))))))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * (i * t);
double tmp;
if (b <= -1.26e+262) {
tmp = t_1;
} else if (b <= -3e+19) {
tmp = b * (-1.0 * (c * z));
} else if (b <= -1.85e-270) {
tmp = a * (c * j);
} else if (b <= 1.8e+90) {
tmp = a * (-1.0 * (t * x));
} else if (b <= 4.6e+137) {
tmp = t_1;
} else {
tmp = z * (-1.0 * (b * c));
}
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 = b * (i * t)
if (b <= (-1.26d+262)) then
tmp = t_1
else if (b <= (-3d+19)) then
tmp = b * ((-1.0d0) * (c * z))
else if (b <= (-1.85d-270)) then
tmp = a * (c * j)
else if (b <= 1.8d+90) then
tmp = a * ((-1.0d0) * (t * x))
else if (b <= 4.6d+137) then
tmp = t_1
else
tmp = z * ((-1.0d0) * (b * c))
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 = b * (i * t);
double tmp;
if (b <= -1.26e+262) {
tmp = t_1;
} else if (b <= -3e+19) {
tmp = b * (-1.0 * (c * z));
} else if (b <= -1.85e-270) {
tmp = a * (c * j);
} else if (b <= 1.8e+90) {
tmp = a * (-1.0 * (t * x));
} else if (b <= 4.6e+137) {
tmp = t_1;
} else {
tmp = z * (-1.0 * (b * c));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * (i * t) tmp = 0 if b <= -1.26e+262: tmp = t_1 elif b <= -3e+19: tmp = b * (-1.0 * (c * z)) elif b <= -1.85e-270: tmp = a * (c * j) elif b <= 1.8e+90: tmp = a * (-1.0 * (t * x)) elif b <= 4.6e+137: tmp = t_1 else: tmp = z * (-1.0 * (b * c)) return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(i * t)) tmp = 0.0 if (b <= -1.26e+262) tmp = t_1; elseif (b <= -3e+19) tmp = Float64(b * Float64(-1.0 * Float64(c * z))); elseif (b <= -1.85e-270) tmp = Float64(a * Float64(c * j)); elseif (b <= 1.8e+90) tmp = Float64(a * Float64(-1.0 * Float64(t * x))); elseif (b <= 4.6e+137) tmp = t_1; else tmp = Float64(z * Float64(-1.0 * Float64(b * c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * (i * t); tmp = 0.0; if (b <= -1.26e+262) tmp = t_1; elseif (b <= -3e+19) tmp = b * (-1.0 * (c * z)); elseif (b <= -1.85e-270) tmp = a * (c * j); elseif (b <= 1.8e+90) tmp = a * (-1.0 * (t * x)); elseif (b <= 4.6e+137) tmp = t_1; else tmp = z * (-1.0 * (b * c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.26e+262], t$95$1, If[LessEqual[b, -3e+19], N[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.85e-270], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e+90], N[(a * N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.6e+137], t$95$1, N[(z * N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t\right)\\
\mathbf{if}\;b \leq -1.26 \cdot 10^{+262}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3 \cdot 10^{+19}:\\
\;\;\;\;b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
\mathbf{elif}\;b \leq -1.85 \cdot 10^{-270}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+90}:\\
\;\;\;\;a \cdot \left(-1 \cdot \left(t \cdot x\right)\right)\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{+137}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(-1 \cdot \left(b \cdot c\right)\right)\\
\end{array}
if b < -1.26000000000000004e262 or 1.8e90 < b < 4.59999999999999999e137Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
Taylor expanded in z around 0
lower-*.f6421.7%
Applied rewrites21.7%
if -1.26000000000000004e262 < b < -3e19Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.1%
Applied rewrites22.1%
if -3e19 < b < -1.8500000000000001e-270Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around 0
lower-*.f6422.5%
Applied rewrites22.5%
if -1.8500000000000001e-270 < b < 1.8e90Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.8%
Applied rewrites22.8%
if 4.59999999999999999e137 < b Initial program 74.1%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.9%
Applied rewrites21.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (* -1.0 (* c z)))) (t_2 (* b (* i t))))
(if (<= b -1.26e+262)
t_2
(if (<= b -3e+19)
t_1
(if (<= b -1.85e-270)
(* a (* c j))
(if (<= b 1.8e+90)
(* a (* -1.0 (* t x)))
(if (<= b 7.8e+142) 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 = b * (-1.0 * (c * z));
double t_2 = b * (i * t);
double tmp;
if (b <= -1.26e+262) {
tmp = t_2;
} else if (b <= -3e+19) {
tmp = t_1;
} else if (b <= -1.85e-270) {
tmp = a * (c * j);
} else if (b <= 1.8e+90) {
tmp = a * (-1.0 * (t * x));
} else if (b <= 7.8e+142) {
tmp = 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 = b * ((-1.0d0) * (c * z))
t_2 = b * (i * t)
if (b <= (-1.26d+262)) then
tmp = t_2
else if (b <= (-3d+19)) then
tmp = t_1
else if (b <= (-1.85d-270)) then
tmp = a * (c * j)
else if (b <= 1.8d+90) then
tmp = a * ((-1.0d0) * (t * x))
else if (b <= 7.8d+142) then
tmp = 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 = b * (-1.0 * (c * z));
double t_2 = b * (i * t);
double tmp;
if (b <= -1.26e+262) {
tmp = t_2;
} else if (b <= -3e+19) {
tmp = t_1;
} else if (b <= -1.85e-270) {
tmp = a * (c * j);
} else if (b <= 1.8e+90) {
tmp = a * (-1.0 * (t * x));
} else if (b <= 7.8e+142) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * (-1.0 * (c * z)) t_2 = b * (i * t) tmp = 0 if b <= -1.26e+262: tmp = t_2 elif b <= -3e+19: tmp = t_1 elif b <= -1.85e-270: tmp = a * (c * j) elif b <= 1.8e+90: tmp = a * (-1.0 * (t * x)) elif b <= 7.8e+142: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(-1.0 * Float64(c * z))) t_2 = Float64(b * Float64(i * t)) tmp = 0.0 if (b <= -1.26e+262) tmp = t_2; elseif (b <= -3e+19) tmp = t_1; elseif (b <= -1.85e-270) tmp = Float64(a * Float64(c * j)); elseif (b <= 1.8e+90) tmp = Float64(a * Float64(-1.0 * Float64(t * x))); elseif (b <= 7.8e+142) tmp = 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 = b * (-1.0 * (c * z)); t_2 = b * (i * t); tmp = 0.0; if (b <= -1.26e+262) tmp = t_2; elseif (b <= -3e+19) tmp = t_1; elseif (b <= -1.85e-270) tmp = a * (c * j); elseif (b <= 1.8e+90) tmp = a * (-1.0 * (t * x)); elseif (b <= 7.8e+142) tmp = 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[(b * N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.26e+262], t$95$2, If[LessEqual[b, -3e+19], t$95$1, If[LessEqual[b, -1.85e-270], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e+90], N[(a * N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.8e+142], t$95$2, t$95$1]]]]]]]
\begin{array}{l}
t_1 := b \cdot \left(-1 \cdot \left(c \cdot z\right)\right)\\
t_2 := b \cdot \left(i \cdot t\right)\\
\mathbf{if}\;b \leq -1.26 \cdot 10^{+262}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -3 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.85 \cdot 10^{-270}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+90}:\\
\;\;\;\;a \cdot \left(-1 \cdot \left(t \cdot x\right)\right)\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{+142}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1.26000000000000004e262 or 1.8e90 < b < 7.8000000000000001e142Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
Taylor expanded in z around 0
lower-*.f6421.7%
Applied rewrites21.7%
if -1.26000000000000004e262 < b < -3e19 or 7.8000000000000001e142 < b Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.1%
Applied rewrites22.1%
if -3e19 < b < -1.8500000000000001e-270Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around 0
lower-*.f6422.5%
Applied rewrites22.5%
if -1.8500000000000001e-270 < b < 1.8e90Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.8%
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (* i t))))
(if (<= b -1.65e+194)
t_1
(if (<= b -1.85e-270)
(* a (* c j))
(if (<= b 1.8e+90) (* a (* -1.0 (* 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 = b * (i * t);
double tmp;
if (b <= -1.65e+194) {
tmp = t_1;
} else if (b <= -1.85e-270) {
tmp = a * (c * j);
} else if (b <= 1.8e+90) {
tmp = a * (-1.0 * (t * x));
} 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 = b * (i * t)
if (b <= (-1.65d+194)) then
tmp = t_1
else if (b <= (-1.85d-270)) then
tmp = a * (c * j)
else if (b <= 1.8d+90) then
tmp = a * ((-1.0d0) * (t * x))
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 = b * (i * t);
double tmp;
if (b <= -1.65e+194) {
tmp = t_1;
} else if (b <= -1.85e-270) {
tmp = a * (c * j);
} else if (b <= 1.8e+90) {
tmp = a * (-1.0 * (t * x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * (i * t) tmp = 0 if b <= -1.65e+194: tmp = t_1 elif b <= -1.85e-270: tmp = a * (c * j) elif b <= 1.8e+90: tmp = a * (-1.0 * (t * x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(i * t)) tmp = 0.0 if (b <= -1.65e+194) tmp = t_1; elseif (b <= -1.85e-270) tmp = Float64(a * Float64(c * j)); elseif (b <= 1.8e+90) tmp = Float64(a * Float64(-1.0 * Float64(t * x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * (i * t); tmp = 0.0; if (b <= -1.65e+194) tmp = t_1; elseif (b <= -1.85e-270) tmp = a * (c * j); elseif (b <= 1.8e+90) tmp = a * (-1.0 * (t * x)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.65e+194], t$95$1, If[LessEqual[b, -1.85e-270], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e+90], N[(a * N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t\right)\\
\mathbf{if}\;b \leq -1.65 \cdot 10^{+194}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.85 \cdot 10^{-270}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+90}:\\
\;\;\;\;a \cdot \left(-1 \cdot \left(t \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1.64999999999999992e194 or 1.8e90 < b Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
Taylor expanded in z around 0
lower-*.f6421.7%
Applied rewrites21.7%
if -1.64999999999999992e194 < b < -1.8500000000000001e-270Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around 0
lower-*.f6422.5%
Applied rewrites22.5%
if -1.8500000000000001e-270 < b < 1.8e90Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.8%
Applied rewrites22.8%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* a (* c j)))) (if (<= c -2.3e+16) t_1 (if (<= c 8.3e+18) (* b (* i 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 * j);
double tmp;
if (c <= -2.3e+16) {
tmp = t_1;
} else if (c <= 8.3e+18) {
tmp = b * (i * 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 * j)
if (c <= (-2.3d+16)) then
tmp = t_1
else if (c <= 8.3d+18) then
tmp = b * (i * 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 * j);
double tmp;
if (c <= -2.3e+16) {
tmp = t_1;
} else if (c <= 8.3e+18) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * (c * j) tmp = 0 if c <= -2.3e+16: tmp = t_1 elif c <= 8.3e+18: tmp = b * (i * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(c * j)) tmp = 0.0 if (c <= -2.3e+16) tmp = t_1; elseif (c <= 8.3e+18) tmp = Float64(b * Float64(i * 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 * j); tmp = 0.0; if (c <= -2.3e+16) tmp = t_1; elseif (c <= 8.3e+18) tmp = b * (i * 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[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -2.3e+16], t$95$1, If[LessEqual[c, 8.3e+18], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := a \cdot \left(c \cdot j\right)\\
\mathbf{if}\;c \leq -2.3 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 8.3 \cdot 10^{+18}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if c < -2.3e16 or 8.3e18 < c Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around 0
lower-*.f6422.5%
Applied rewrites22.5%
if -2.3e16 < c < 8.3e18Initial program 74.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.6%
Applied rewrites38.6%
Taylor expanded in z around 0
lower-*.f6421.7%
Applied rewrites21.7%
(FPCore (x y z t a b c i j) :precision binary64 (* a (* c j)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (c * j);
}
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 = a * (c * j)
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 a * (c * j);
}
def code(x, y, z, t, a, b, c, i, j): return a * (c * j)
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(c * j)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * (c * j); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]
a \cdot \left(c \cdot j\right)
Initial program 74.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around 0
lower-*.f6422.5%
Applied rewrites22.5%
herbie shell --seed 2025183
(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)))))