
(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 28 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 (* (- (* z y) (* a t)) x))
(t_2 (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))))
(t_3 (+ t_2 (* j (- (* c a) (* y i))))))
(if (<= t_3 1e+300)
(fma (- (* i t) (* c z)) b (fma (- (* c a) (* i y)) j t_1))
(if (<= t_3 INFINITY)
(+ t_2 (* (fma (- i) j (/ (* (* j c) a) y)) y))
(* (- (fma i t (/ t_1 b)) (* c z)) b)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((z * y) - (a * t)) * x;
double t_2 = (x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)));
double t_3 = t_2 + (j * ((c * a) - (y * i)));
double tmp;
if (t_3 <= 1e+300) {
tmp = fma(((i * t) - (c * z)), b, fma(((c * a) - (i * y)), j, t_1));
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2 + (fma(-i, j, (((j * c) * a) / y)) * y);
} else {
tmp = (fma(i, t, (t_1 / b)) - (c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) t_2 = Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) t_3 = Float64(t_2 + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_3 <= 1e+300) tmp = fma(Float64(Float64(i * t) - Float64(c * z)), b, fma(Float64(Float64(c * a) - Float64(i * y)), j, t_1)); elseif (t_3 <= Inf) tmp = Float64(t_2 + Float64(fma(Float64(-i), j, Float64(Float64(Float64(j * c) * a) / y)) * y)); else tmp = Float64(Float64(fma(i, t, Float64(t_1 / b)) - Float64(c * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = 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]}, Block[{t$95$3 = N[(t$95$2 + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 1e+300], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(t$95$2 + N[(N[((-i) * j + N[(N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * t + N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y - a \cdot t\right) \cdot x\\
t_2 := x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\\
t_3 := t\_2 + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_3 \leq 10^{+300}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - i \cdot y, j, t\_1\right)\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;t\_2 + \mathsf{fma}\left(-i, j, \frac{\left(j \cdot c\right) \cdot a}{y}\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(i, t, \frac{t\_1}{b}\right) - c \cdot z\right) \cdot b\\
\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)))) < 1.0000000000000001e300Initial program 74.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.7%
if 1.0000000000000001e300 < (+.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.0%
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
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6469.8
Applied rewrites69.8%
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.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6458.9
Applied rewrites58.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* z y) (* a t)) x)))
(if (<=
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))
INFINITY)
(fma (- (* i t) (* c z)) b (fma (- (* c a) (* i y)) j t_1))
(* (- (fma i t (/ t_1 b)) (* c z)) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((z * y) - (a * t)) * x;
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))) <= ((double) INFINITY)) {
tmp = fma(((i * t) - (c * z)), b, fma(((c * a) - (i * y)), j, t_1));
} else {
tmp = (fma(i, t, (t_1 / b)) - (c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (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)))) <= Inf) tmp = fma(Float64(Float64(i * t) - Float64(c * z)), b, fma(Float64(Float64(c * a) - Float64(i * y)), j, t_1)); else tmp = Float64(Float64(fma(i, t, Float64(t_1 / b)) - Float64(c * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(N[(i * t + N[(t$95$1 / b), $MachinePrecision]), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;\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) \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(i \cdot t - c \cdot z, b, \mathsf{fma}\left(c \cdot a - i \cdot y, j, t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(i, t, \frac{t\_1}{b}\right) - c \cdot z\right) \cdot b\\
\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 74.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.7%
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.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f6458.9
Applied rewrites58.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c z) (* i t)))
(t_2 (- (* (- (* c a) (* i y)) j) (* t_1 b))))
(if (<= j -2.8e-21)
t_2
(if (<= j 3.8e-12)
(fma (- (* z y) (* a t)) x (* (- t_1) b))
(if (<= j 1.05e+135)
t_2
(+ (* (* z y) x) (* 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) {
double t_1 = (c * z) - (i * t);
double t_2 = (((c * a) - (i * y)) * j) - (t_1 * b);
double tmp;
if (j <= -2.8e-21) {
tmp = t_2;
} else if (j <= 3.8e-12) {
tmp = fma(((z * y) - (a * t)), x, (-t_1 * b));
} else if (j <= 1.05e+135) {
tmp = t_2;
} else {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * z) - Float64(i * t)) t_2 = Float64(Float64(Float64(Float64(c * a) - Float64(i * y)) * j) - Float64(t_1 * b)) tmp = 0.0 if (j <= -2.8e-21) tmp = t_2; elseif (j <= 3.8e-12) tmp = fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(-t_1) * b)); elseif (j <= 1.05e+135) tmp = t_2; else tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision] - N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -2.8e-21], t$95$2, If[LessEqual[j, 3.8e-12], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[((-t$95$1) * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.05e+135], t$95$2, N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot z - i \cdot t\\
t_2 := \left(c \cdot a - i \cdot y\right) \cdot j - t\_1 \cdot b\\
\mathbf{if}\;j \leq -2.8 \cdot 10^{-21}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;j \leq 3.8 \cdot 10^{-12}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(-t\_1\right) \cdot b\right)\\
\mathbf{elif}\;j \leq 1.05 \cdot 10^{+135}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\end{array}
\end{array}
if j < -2.80000000000000004e-21 or 3.79999999999999996e-12 < j < 1.05000000000000005e135Initial program 74.0%
Taylor expanded in x around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.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
lift-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
if -2.80000000000000004e-21 < j < 3.79999999999999996e-12Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
Applied rewrites60.9%
if 1.05000000000000005e135 < j Initial program 74.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* (- (* c a) (* i y)) j) (* (- (* c z) (* i t)) b))))
(if (<= j -2.8e-21)
t_1
(if (<= j 3.8e-12)
(- (* (- (* z y) (* a t)) x) (* (fma z c (* (- t) i)) b))
(if (<= j 1.05e+135)
t_1
(+ (* (* z y) x) (* 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) {
double t_1 = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * b);
double tmp;
if (j <= -2.8e-21) {
tmp = t_1;
} else if (j <= 3.8e-12) {
tmp = (((z * y) - (a * t)) * x) - (fma(z, c, (-t * i)) * b);
} else if (j <= 1.05e+135) {
tmp = t_1;
} else {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(Float64(c * a) - Float64(i * y)) * j) - Float64(Float64(Float64(c * z) - Float64(i * t)) * b)) tmp = 0.0 if (j <= -2.8e-21) tmp = t_1; elseif (j <= 3.8e-12) tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(fma(z, c, Float64(Float64(-t) * i)) * b)); elseif (j <= 1.05e+135) tmp = t_1; else tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision] - N[(N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -2.8e-21], t$95$1, If[LessEqual[j, 3.8e-12], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(z * c + N[((-t) * i), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.05e+135], t$95$1, N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a - i \cdot y\right) \cdot j - \left(c \cdot z - i \cdot t\right) \cdot b\\
\mathbf{if}\;j \leq -2.8 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.8 \cdot 10^{-12}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \mathsf{fma}\left(z, c, \left(-t\right) \cdot i\right) \cdot b\\
\mathbf{elif}\;j \leq 1.05 \cdot 10^{+135}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\end{array}
\end{array}
if j < -2.80000000000000004e-21 or 3.79999999999999996e-12 < j < 1.05000000000000005e135Initial program 74.0%
Taylor expanded in x around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.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
lift-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
if -2.80000000000000004e-21 < j < 3.79999999999999996e-12Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6459.8
Applied rewrites59.8%
if 1.05000000000000005e135 < j Initial program 74.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* c z) (* i t)) b))
(t_2 (- (* (- (* c a) (* i y)) j) t_1)))
(if (<= j -2.8e-21)
t_2
(if (<= j 3.8e-12)
(- (* (- (* z y) (* a t)) x) t_1)
(if (<= j 1.05e+135)
t_2
(+ (* (* z y) x) (* 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) {
double t_1 = ((c * z) - (i * t)) * b;
double t_2 = (((c * a) - (i * y)) * j) - t_1;
double tmp;
if (j <= -2.8e-21) {
tmp = t_2;
} else if (j <= 3.8e-12) {
tmp = (((z * y) - (a * t)) * x) - t_1;
} else if (j <= 1.05e+135) {
tmp = t_2;
} else {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
}
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 = ((c * z) - (i * t)) * b
t_2 = (((c * a) - (i * y)) * j) - t_1
if (j <= (-2.8d-21)) then
tmp = t_2
else if (j <= 3.8d-12) then
tmp = (((z * y) - (a * t)) * x) - t_1
else if (j <= 1.05d+135) then
tmp = t_2
else
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)))
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 * z) - (i * t)) * b;
double t_2 = (((c * a) - (i * y)) * j) - t_1;
double tmp;
if (j <= -2.8e-21) {
tmp = t_2;
} else if (j <= 3.8e-12) {
tmp = (((z * y) - (a * t)) * x) - t_1;
} else if (j <= 1.05e+135) {
tmp = t_2;
} else {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((c * z) - (i * t)) * b t_2 = (((c * a) - (i * y)) * j) - t_1 tmp = 0 if j <= -2.8e-21: tmp = t_2 elif j <= 3.8e-12: tmp = (((z * y) - (a * t)) * x) - t_1 elif j <= 1.05e+135: tmp = t_2 else: tmp = ((z * y) * x) + (j * ((c * a) - (y * i))) return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(c * z) - Float64(i * t)) * b) t_2 = Float64(Float64(Float64(Float64(c * a) - Float64(i * y)) * j) - t_1) tmp = 0.0 if (j <= -2.8e-21) tmp = t_2; elseif (j <= 3.8e-12) tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - t_1); elseif (j <= 1.05e+135) tmp = t_2; else tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((c * z) - (i * t)) * b; t_2 = (((c * a) - (i * y)) * j) - t_1; tmp = 0.0; if (j <= -2.8e-21) tmp = t_2; elseif (j <= 3.8e-12) tmp = (((z * y) - (a * t)) * x) - t_1; elseif (j <= 1.05e+135) tmp = t_2; else tmp = ((z * y) * x) + (j * ((c * a) - (y * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[j, -2.8e-21], t$95$2, If[LessEqual[j, 3.8e-12], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[j, 1.05e+135], t$95$2, N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot z - i \cdot t\right) \cdot b\\
t_2 := \left(c \cdot a - i \cdot y\right) \cdot j - t\_1\\
\mathbf{if}\;j \leq -2.8 \cdot 10^{-21}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;j \leq 3.8 \cdot 10^{-12}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - t\_1\\
\mathbf{elif}\;j \leq 1.05 \cdot 10^{+135}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\end{array}
\end{array}
if j < -2.80000000000000004e-21 or 3.79999999999999996e-12 < j < 1.05000000000000005e135Initial program 74.0%
Taylor expanded in x around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.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
lift-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
if -2.80000000000000004e-21 < j < 3.79999999999999996e-12Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
if 1.05000000000000005e135 < j Initial program 74.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c z) (* i t))))
(if (<= j -2.8e-21)
(- (* (- (* c a) (* i y)) j) (* t_1 b))
(if (<= j 5.5e-13)
(fma (- (* z y) (* a t)) x (* (- t_1) b))
(+ (* (- t) (- (* a x) (* i b))) (* 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) {
double t_1 = (c * z) - (i * t);
double tmp;
if (j <= -2.8e-21) {
tmp = (((c * a) - (i * y)) * j) - (t_1 * b);
} else if (j <= 5.5e-13) {
tmp = fma(((z * y) - (a * t)), x, (-t_1 * b));
} else {
tmp = (-t * ((a * x) - (i * b))) + (j * ((c * a) - (y * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * z) - Float64(i * t)) tmp = 0.0 if (j <= -2.8e-21) tmp = Float64(Float64(Float64(Float64(c * a) - Float64(i * y)) * j) - Float64(t_1 * b)); elseif (j <= 5.5e-13) tmp = fma(Float64(Float64(z * y) - Float64(a * t)), x, Float64(Float64(-t_1) * b)); else tmp = Float64(Float64(Float64(-t) * Float64(Float64(a * x) - Float64(i * b))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -2.8e-21], N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision] - N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.5e-13], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x + N[((-t$95$1) * b), $MachinePrecision]), $MachinePrecision], N[(N[((-t) * N[(N[(a * x), $MachinePrecision] - N[(i * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot z - i \cdot t\\
\mathbf{if}\;j \leq -2.8 \cdot 10^{-21}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j - t\_1 \cdot b\\
\mathbf{elif}\;j \leq 5.5 \cdot 10^{-13}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot y - a \cdot t, x, \left(-t\_1\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x - i \cdot b\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\end{array}
\end{array}
if j < -2.80000000000000004e-21Initial program 74.0%
Taylor expanded in x around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.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
lift-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
if -2.80000000000000004e-21 < j < 5.49999999999999979e-13Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift--.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
Applied rewrites60.9%
if 5.49999999999999979e-13 < j Initial program 74.0%
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-*.f6458.7
Applied rewrites58.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* z y) (* a t)) x)))
(if (<= x -5.2e+82)
(- t_1 (* (* c z) b))
(if (<= x 6.2e+121)
(- (* (- (* c a) (* i y)) j) (* (- (* 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 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -5.2e+82) {
tmp = t_1 - ((c * z) * b);
} else if (x <= 6.2e+121) {
tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * 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 = ((z * y) - (a * t)) * x
if (x <= (-5.2d+82)) then
tmp = t_1 - ((c * z) * b)
else if (x <= 6.2d+121) then
tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * 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 = ((z * y) - (a * t)) * x;
double tmp;
if (x <= -5.2e+82) {
tmp = t_1 - ((c * z) * b);
} else if (x <= 6.2e+121) {
tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((z * y) - (a * t)) * x tmp = 0 if x <= -5.2e+82: tmp = t_1 - ((c * z) * b) elif x <= 6.2e+121: tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (x <= -5.2e+82) tmp = Float64(t_1 - Float64(Float64(c * z) * b)); elseif (x <= 6.2e+121) tmp = Float64(Float64(Float64(Float64(c * a) - Float64(i * y)) * j) - Float64(Float64(Float64(c * z) - Float64(i * t)) * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((z * y) - (a * t)) * x; tmp = 0.0; if (x <= -5.2e+82) tmp = t_1 - ((c * z) * b); elseif (x <= 6.2e+121) tmp = (((c * a) - (i * y)) * j) - (((c * z) - (i * t)) * 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[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -5.2e+82], N[(t$95$1 - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 6.2e+121], N[(N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $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 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+82}:\\
\;\;\;\;t\_1 - \left(c \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 6.2 \cdot 10^{+121}:\\
\;\;\;\;\left(c \cdot a - i \cdot y\right) \cdot j - \left(c \cdot z - i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.1999999999999997e82Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6449.2
Applied rewrites49.2%
if -5.1999999999999997e82 < x < 6.20000000000000016e121Initial program 74.0%
Taylor expanded in x around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.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
lift-*.f64N/A
lower-*.f6460.0
Applied rewrites60.0%
if 6.20000000000000016e121 < x Initial program 74.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= t -0.0018)
(* (fma (- a) x (* i b)) t)
(if (<= t 1.6e-235)
(+ (* (* z y) x) (* j (- (* c a) (* y i))))
(if (<= t 9e-24)
(- (* (- (* z y) (* a t)) x) (* (* c z) b))
(if (<= t 1.02e+203)
(* (- i) (- (* j y) (* b t)))
(* (- a) (fma (- c) j (* t x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -0.0018) {
tmp = fma(-a, x, (i * b)) * t;
} else if (t <= 1.6e-235) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (t <= 9e-24) {
tmp = (((z * y) - (a * t)) * x) - ((c * z) * b);
} else if (t <= 1.02e+203) {
tmp = -i * ((j * y) - (b * t));
} else {
tmp = -a * fma(-c, j, (t * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -0.0018) tmp = Float64(fma(Float64(-a), x, Float64(i * b)) * t); elseif (t <= 1.6e-235) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (t <= 9e-24) tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(Float64(c * z) * b)); elseif (t <= 1.02e+203) tmp = Float64(Float64(-i) * Float64(Float64(j * y) - Float64(b * t))); else tmp = Float64(Float64(-a) * fma(Float64(-c), j, Float64(t * x))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -0.0018], N[(N[((-a) * x + N[(i * b), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, 1.6e-235], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9e-24], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.02e+203], N[((-i) * N[(N[(j * y), $MachinePrecision] - N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-a) * N[((-c) * j + N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.0018:\\
\;\;\;\;\mathsf{fma}\left(-a, x, i \cdot b\right) \cdot t\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{-235}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;t \leq 9 \cdot 10^{-24}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z\right) \cdot b\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{+203}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y - b \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(-c, j, t \cdot x\right)\\
\end{array}
\end{array}
if t < -0.0018Initial program 74.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
fp-cancel-sign-sub-invN/A
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f6438.6
Applied rewrites38.6%
if -0.0018 < t < 1.6000000000000001e-235Initial program 74.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
if 1.6000000000000001e-235 < t < 8.9999999999999995e-24Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6449.2
Applied rewrites49.2%
if 8.9999999999999995e-24 < t < 1.02e203Initial program 74.0%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if 1.02e203 < t Initial program 74.0%
Taylor expanded in a around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* i t) (* c z))))
(if (<= b -3e+103)
(fma t_1 b (* (- i) (* j y)))
(if (<= b 1.8e-246)
(+ (* (* z y) x) (* j (- (* c a) (* y i))))
(if (<= b 9e+68)
(- (* (- (* z y) (* a t)) x) (* (* c z) b))
(fma t_1 b (* (* j c) a)))))))
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);
double tmp;
if (b <= -3e+103) {
tmp = fma(t_1, b, (-i * (j * y)));
} else if (b <= 1.8e-246) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (b <= 9e+68) {
tmp = (((z * y) - (a * t)) * x) - ((c * z) * b);
} else {
tmp = fma(t_1, b, ((j * c) * a));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * t) - Float64(c * z)) tmp = 0.0 if (b <= -3e+103) tmp = fma(t_1, b, Float64(Float64(-i) * Float64(j * y))); elseif (b <= 1.8e-246) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (b <= 9e+68) tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(Float64(c * z) * b)); else tmp = fma(t_1, b, Float64(Float64(j * c) * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3e+103], N[(t$95$1 * b + N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.8e-246], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9e+68], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot t - c \cdot z\\
\mathbf{if}\;b \leq -3 \cdot 10^{+103}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \left(-i\right) \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{-246}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;b \leq 9 \cdot 10^{+68}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \left(j \cdot c\right) \cdot a\right)\\
\end{array}
\end{array}
if b < -3e103Initial program 74.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.7%
Taylor expanded in i around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lift-*.f6451.9
Applied rewrites51.9%
if -3e103 < b < 1.8000000000000001e-246Initial program 74.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
if 1.8000000000000001e-246 < b < 9.0000000000000007e68Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6449.2
Applied rewrites49.2%
if 9.0000000000000007e68 < b Initial program 74.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.7%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.3
Applied rewrites51.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* (* i t) b) (* j (- (* c a) (* y i))))))
(if (<= j -1.16e-21)
t_1
(if (<= j 7.8e-12) (- (* (- (* z y) (* a t)) x) (* (* 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 = ((i * t) * b) + (j * ((c * a) - (y * i)));
double tmp;
if (j <= -1.16e-21) {
tmp = t_1;
} else if (j <= 7.8e-12) {
tmp = (((z * y) - (a * t)) * x) - ((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 = ((i * t) * b) + (j * ((c * a) - (y * i)))
if (j <= (-1.16d-21)) then
tmp = t_1
else if (j <= 7.8d-12) then
tmp = (((z * y) - (a * t)) * x) - ((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 = ((i * t) * b) + (j * ((c * a) - (y * i)));
double tmp;
if (j <= -1.16e-21) {
tmp = t_1;
} else if (j <= 7.8e-12) {
tmp = (((z * y) - (a * t)) * x) - ((c * z) * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * t) * b) + (j * ((c * a) - (y * i))) tmp = 0 if j <= -1.16e-21: tmp = t_1 elif j <= 7.8e-12: tmp = (((z * y) - (a * t)) * x) - ((c * z) * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * t) * b) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (j <= -1.16e-21) tmp = t_1; elseif (j <= 7.8e-12) tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(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 = ((i * t) * b) + (j * ((c * a) - (y * i))); tmp = 0.0; if (j <= -1.16e-21) tmp = t_1; elseif (j <= 7.8e-12) tmp = (((z * y) - (a * t)) * x) - ((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[(N[(i * t), $MachinePrecision] * b), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.16e-21], t$95$1, If[LessEqual[j, 7.8e-12], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t\right) \cdot b + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;j \leq -1.16 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 7.8 \cdot 10^{-12}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.1600000000000001e-21 or 7.79999999999999988e-12 < j Initial program 74.0%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lower-*.f6449.6
Applied rewrites49.6%
if -1.1600000000000001e-21 < j < 7.79999999999999988e-12Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6449.2
Applied rewrites49.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* c a) (* i y)) j)))
(if (<= j -2.6e-19)
t_1
(if (<= j 8.8e-12) (- (* (- (* z y) (* a t)) x) (* (* 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 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -2.6e-19) {
tmp = t_1;
} else if (j <= 8.8e-12) {
tmp = (((z * y) - (a * t)) * x) - ((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 = ((c * a) - (i * y)) * j
if (j <= (-2.6d-19)) then
tmp = t_1
else if (j <= 8.8d-12) then
tmp = (((z * y) - (a * t)) * x) - ((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 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -2.6e-19) {
tmp = t_1;
} else if (j <= 8.8e-12) {
tmp = (((z * y) - (a * t)) * x) - ((c * z) * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((c * a) - (i * y)) * j tmp = 0 if j <= -2.6e-19: tmp = t_1 elif j <= 8.8e-12: tmp = (((z * y) - (a * t)) * x) - ((c * z) * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(c * a) - Float64(i * y)) * j) tmp = 0.0 if (j <= -2.6e-19) tmp = t_1; elseif (j <= 8.8e-12) tmp = Float64(Float64(Float64(Float64(z * y) - Float64(a * t)) * x) - Float64(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 = ((c * a) - (i * y)) * j; tmp = 0.0; if (j <= -2.6e-19) tmp = t_1; elseif (j <= 8.8e-12) tmp = (((z * y) - (a * t)) * x) - ((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[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -2.6e-19], t$95$1, If[LessEqual[j, 8.8e-12], N[(N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -2.6 \cdot 10^{-19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 8.8 \cdot 10^{-12}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x - \left(c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.60000000000000013e-19 or 8.79999999999999966e-12 < j Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
if -2.60000000000000013e-19 < j < 8.79999999999999966e-12Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f6449.2
Applied rewrites49.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -1.6e+43)
t_1
(if (<= y 8.2e+23) (fma (- (* i t) (* c z)) b (* (* j c) 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 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -1.6e+43) {
tmp = t_1;
} else if (y <= 8.2e+23) {
tmp = fma(((i * t) - (c * z)), b, ((j * c) * a));
} 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 <= -1.6e+43) tmp = t_1; elseif (y <= 8.2e+23) tmp = fma(Float64(Float64(i * t) - Float64(c * z)), b, Float64(Float64(j * c) * a)); 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, -1.6e+43], t$95$1, If[LessEqual[y, 8.2e+23], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $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 -1.6 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+23}:\\
\;\;\;\;\mathsf{fma}\left(i \cdot t - c \cdot z, b, \left(j \cdot c\right) \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.60000000000000007e43 or 8.19999999999999992e23 < y Initial program 74.0%
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-*.f6438.8
Applied rewrites38.8%
if -1.60000000000000007e43 < y < 8.19999999999999992e23Initial program 74.0%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites76.7%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6451.3
Applied rewrites51.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -9.5e+42)
t_1
(if (<= y 5.4e-64)
(* (- a) (fma (- c) j (* t x)))
(if (<= y 1.2e+31) (* (- (* i t) (* 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 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -9.5e+42) {
tmp = t_1;
} else if (y <= 5.4e-64) {
tmp = -a * fma(-c, j, (t * x));
} else if (y <= 1.2e+31) {
tmp = ((i * t) - (c * z)) * b;
} 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 <= -9.5e+42) tmp = t_1; elseif (y <= 5.4e-64) tmp = Float64(Float64(-a) * fma(Float64(-c), j, Float64(t * x))); elseif (y <= 1.2e+31) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * 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[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -9.5e+42], t$95$1, If[LessEqual[y, 5.4e-64], N[((-a) * N[((-c) * j + N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.2e+31], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $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 -9.5 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-64}:\\
\;\;\;\;\left(-a\right) \cdot \mathsf{fma}\left(-c, j, t \cdot x\right)\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+31}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.50000000000000019e42 or 1.19999999999999991e31 < y Initial program 74.0%
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-*.f6438.8
Applied rewrites38.8%
if -9.50000000000000019e42 < y < 5.39999999999999971e-64Initial program 74.0%
Taylor expanded in a around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
if 5.39999999999999971e-64 < y < 1.19999999999999991e31Initial program 74.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.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 -9.5e+42)
t_1
(if (<= y 5.4e-64)
(* (fma (- t) x (* j c)) a)
(if (<= y 1.2e+31) (* (- (* i t) (* 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 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -9.5e+42) {
tmp = t_1;
} else if (y <= 5.4e-64) {
tmp = fma(-t, x, (j * c)) * a;
} else if (y <= 1.2e+31) {
tmp = ((i * t) - (c * z)) * b;
} 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 <= -9.5e+42) tmp = t_1; elseif (y <= 5.4e-64) tmp = Float64(fma(Float64(-t), x, Float64(j * c)) * a); elseif (y <= 1.2e+31) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * 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[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -9.5e+42], t$95$1, If[LessEqual[y, 5.4e-64], N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[y, 1.2e+31], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $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 -9.5 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-64}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+31}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.50000000000000019e42 or 1.19999999999999991e31 < y Initial program 74.0%
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-*.f6438.8
Applied rewrites38.8%
if -9.50000000000000019e42 < y < 5.39999999999999971e-64Initial program 74.0%
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.1
Applied rewrites39.1%
if 5.39999999999999971e-64 < y < 1.19999999999999991e31Initial program 74.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6440.1
Applied rewrites40.1%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* c a) (* i y)) j))) (if (<= j -8.8e-22) t_1 (if (<= j 7.1e-12) (* (- (* 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 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -8.8e-22) {
tmp = t_1;
} else if (j <= 7.1e-12) {
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 = ((c * a) - (i * y)) * j
if (j <= (-8.8d-22)) then
tmp = t_1
else if (j <= 7.1d-12) 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 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -8.8e-22) {
tmp = t_1;
} else if (j <= 7.1e-12) {
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 = ((c * a) - (i * y)) * j tmp = 0 if j <= -8.8e-22: tmp = t_1 elif j <= 7.1e-12: 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(Float64(Float64(c * a) - Float64(i * y)) * j) tmp = 0.0 if (j <= -8.8e-22) tmp = t_1; elseif (j <= 7.1e-12) 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 = ((c * a) - (i * y)) * j; tmp = 0.0; if (j <= -8.8e-22) tmp = t_1; elseif (j <= 7.1e-12) 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[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -8.8e-22], t$95$1, If[LessEqual[j, 7.1e-12], N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -8.8 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 7.1 \cdot 10^{-12}:\\
\;\;\;\;\left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -8.8000000000000002e-22 or 7.1e-12 < j Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
if -8.8000000000000002e-22 < j < 7.1e-12Initial program 74.0%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6438.0
Applied rewrites38.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i t) (* c z)) b)) (t_2 (* (- (* c a) (* i y)) j)))
(if (<= j -2.7e+64)
t_2
(if (<= j -5.3e-267)
t_1
(if (<= j 3.5e-163) (* (* z y) x) (if (<= j 7.8e-12) t_1 t_2))))))
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 t_2 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -2.7e+64) {
tmp = t_2;
} else if (j <= -5.3e-267) {
tmp = t_1;
} else if (j <= 3.5e-163) {
tmp = (z * y) * x;
} else if (j <= 7.8e-12) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = ((i * t) - (c * z)) * b
t_2 = ((c * a) - (i * y)) * j
if (j <= (-2.7d+64)) then
tmp = t_2
else if (j <= (-5.3d-267)) then
tmp = t_1
else if (j <= 3.5d-163) then
tmp = (z * y) * x
else if (j <= 7.8d-12) then
tmp = t_1
else
tmp = t_2
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) - (c * z)) * b;
double t_2 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -2.7e+64) {
tmp = t_2;
} else if (j <= -5.3e-267) {
tmp = t_1;
} else if (j <= 3.5e-163) {
tmp = (z * y) * x;
} else if (j <= 7.8e-12) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * t) - (c * z)) * b t_2 = ((c * a) - (i * y)) * j tmp = 0 if j <= -2.7e+64: tmp = t_2 elif j <= -5.3e-267: tmp = t_1 elif j <= 3.5e-163: tmp = (z * y) * x elif j <= 7.8e-12: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * t) - Float64(c * z)) * b) t_2 = Float64(Float64(Float64(c * a) - Float64(i * y)) * j) tmp = 0.0 if (j <= -2.7e+64) tmp = t_2; elseif (j <= -5.3e-267) tmp = t_1; elseif (j <= 3.5e-163) tmp = Float64(Float64(z * y) * x); elseif (j <= 7.8e-12) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((i * t) - (c * z)) * b; t_2 = ((c * a) - (i * y)) * j; tmp = 0.0; if (j <= -2.7e+64) tmp = t_2; elseif (j <= -5.3e-267) tmp = t_1; elseif (j <= 3.5e-163) tmp = (z * y) * x; elseif (j <= 7.8e-12) tmp = t_1; else tmp = t_2; end tmp_2 = 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]}, Block[{t$95$2 = N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -2.7e+64], t$95$2, If[LessEqual[j, -5.3e-267], t$95$1, If[LessEqual[j, 3.5e-163], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 7.8e-12], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t - c \cdot z\right) \cdot b\\
t_2 := \left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -2.7 \cdot 10^{+64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;j \leq -5.3 \cdot 10^{-267}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{-163}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 7.8 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if j < -2.7e64 or 7.79999999999999988e-12 < j Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
if -2.7e64 < j < -5.2999999999999996e-267 or 3.50000000000000027e-163 < j < 7.79999999999999988e-12Initial program 74.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6440.1
Applied rewrites40.1%
if -5.2999999999999996e-267 < j < 3.50000000000000027e-163Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* c a) (* i y)) j))) (if (<= j -8.8e+35) t_1 (if (<= j 7.2e-48) (* (- (* y x) (* 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 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -8.8e+35) {
tmp = t_1;
} else if (j <= 7.2e-48) {
tmp = ((y * x) - (c * b)) * 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 = ((c * a) - (i * y)) * j
if (j <= (-8.8d+35)) then
tmp = t_1
else if (j <= 7.2d-48) then
tmp = ((y * x) - (c * b)) * 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 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -8.8e+35) {
tmp = t_1;
} else if (j <= 7.2e-48) {
tmp = ((y * x) - (c * b)) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((c * a) - (i * y)) * j tmp = 0 if j <= -8.8e+35: tmp = t_1 elif j <= 7.2e-48: tmp = ((y * x) - (c * b)) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(c * a) - Float64(i * y)) * j) tmp = 0.0 if (j <= -8.8e+35) tmp = t_1; elseif (j <= 7.2e-48) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((c * a) - (i * y)) * j; tmp = 0.0; if (j <= -8.8e+35) tmp = t_1; elseif (j <= 7.2e-48) tmp = ((y * x) - (c * b)) * 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[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -8.8e+35], t$95$1, If[LessEqual[j, 7.2e-48], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -8.8 \cdot 10^{+35}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 7.2 \cdot 10^{-48}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -8.7999999999999994e35 or 7.2000000000000003e-48 < j Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
if -8.7999999999999994e35 < j < 7.2000000000000003e-48Initial program 74.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.3
Applied rewrites39.3%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (- (* c a) (* i y)) j))) (if (<= j -7e-22) t_1 (if (<= j 4.8e-28) (* (* z y) 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 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -7e-22) {
tmp = t_1;
} else if (j <= 4.8e-28) {
tmp = (z * y) * 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 = ((c * a) - (i * y)) * j
if (j <= (-7d-22)) then
tmp = t_1
else if (j <= 4.8d-28) then
tmp = (z * y) * 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 = ((c * a) - (i * y)) * j;
double tmp;
if (j <= -7e-22) {
tmp = t_1;
} else if (j <= 4.8e-28) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((c * a) - (i * y)) * j tmp = 0 if j <= -7e-22: tmp = t_1 elif j <= 4.8e-28: tmp = (z * y) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(c * a) - Float64(i * y)) * j) tmp = 0.0 if (j <= -7e-22) tmp = t_1; elseif (j <= 4.8e-28) tmp = Float64(Float64(z * y) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((c * a) - (i * y)) * j; tmp = 0.0; if (j <= -7e-22) tmp = t_1; elseif (j <= 4.8e-28) tmp = (z * y) * 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[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[j, -7e-22], t$95$1, If[LessEqual[j, 4.8e-28], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a - i \cdot y\right) \cdot j\\
\mathbf{if}\;j \leq -7 \cdot 10^{-22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 4.8 \cdot 10^{-28}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -7.00000000000000011e-22 or 4.8000000000000004e-28 < j Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
if -7.00000000000000011e-22 < j < 4.8000000000000004e-28Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= a -75000.0)
(* (* c a) j)
(if (<= a -2.7e-213)
(* (- i) (* (- b) t))
(if (<= a -2.3e-297)
(* (* z y) x)
(if (<= a 1.55e+66) (* (* (- i) y) j) (* (- a) (* t x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -75000.0) {
tmp = (c * a) * j;
} else if (a <= -2.7e-213) {
tmp = -i * (-b * t);
} else if (a <= -2.3e-297) {
tmp = (z * y) * x;
} else if (a <= 1.55e+66) {
tmp = (-i * y) * j;
} else {
tmp = -a * (t * x);
}
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 (a <= (-75000.0d0)) then
tmp = (c * a) * j
else if (a <= (-2.7d-213)) then
tmp = -i * (-b * t)
else if (a <= (-2.3d-297)) then
tmp = (z * y) * x
else if (a <= 1.55d+66) then
tmp = (-i * y) * j
else
tmp = -a * (t * x)
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 (a <= -75000.0) {
tmp = (c * a) * j;
} else if (a <= -2.7e-213) {
tmp = -i * (-b * t);
} else if (a <= -2.3e-297) {
tmp = (z * y) * x;
} else if (a <= 1.55e+66) {
tmp = (-i * y) * j;
} else {
tmp = -a * (t * x);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if a <= -75000.0: tmp = (c * a) * j elif a <= -2.7e-213: tmp = -i * (-b * t) elif a <= -2.3e-297: tmp = (z * y) * x elif a <= 1.55e+66: tmp = (-i * y) * j else: tmp = -a * (t * x) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -75000.0) tmp = Float64(Float64(c * a) * j); elseif (a <= -2.7e-213) tmp = Float64(Float64(-i) * Float64(Float64(-b) * t)); elseif (a <= -2.3e-297) tmp = Float64(Float64(z * y) * x); elseif (a <= 1.55e+66) tmp = Float64(Float64(Float64(-i) * y) * j); else tmp = Float64(Float64(-a) * Float64(t * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (a <= -75000.0) tmp = (c * a) * j; elseif (a <= -2.7e-213) tmp = -i * (-b * t); elseif (a <= -2.3e-297) tmp = (z * y) * x; elseif (a <= 1.55e+66) tmp = (-i * y) * j; else tmp = -a * (t * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -75000.0], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[a, -2.7e-213], N[((-i) * N[((-b) * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.3e-297], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[a, 1.55e+66], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -75000:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{-213}:\\
\;\;\;\;\left(-i\right) \cdot \left(\left(-b\right) \cdot t\right)\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{-297}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+66}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\end{array}
\end{array}
if a < -75000Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f6422.4
Applied rewrites22.4%
if -75000 < a < -2.7000000000000001e-213Initial program 74.0%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in y around 0
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6422.3
Applied rewrites22.3%
if -2.7000000000000001e-213 < a < -2.2999999999999999e-297Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
if -2.2999999999999999e-297 < a < 1.55000000000000009e66Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f6421.5
Applied rewrites21.5%
if 1.55000000000000009e66 < a Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in a around inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lower-*.f6421.3
Applied rewrites21.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= a -9000.0)
(* (* c a) j)
(if (<= a -2.3e-297)
(* (* z y) x)
(if (<= a 1.55e+66) (* (* (- i) y) j) (* (- a) (* t x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -9000.0) {
tmp = (c * a) * j;
} else if (a <= -2.3e-297) {
tmp = (z * y) * x;
} else if (a <= 1.55e+66) {
tmp = (-i * y) * j;
} else {
tmp = -a * (t * x);
}
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 (a <= (-9000.0d0)) then
tmp = (c * a) * j
else if (a <= (-2.3d-297)) then
tmp = (z * y) * x
else if (a <= 1.55d+66) then
tmp = (-i * y) * j
else
tmp = -a * (t * x)
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 (a <= -9000.0) {
tmp = (c * a) * j;
} else if (a <= -2.3e-297) {
tmp = (z * y) * x;
} else if (a <= 1.55e+66) {
tmp = (-i * y) * j;
} else {
tmp = -a * (t * x);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if a <= -9000.0: tmp = (c * a) * j elif a <= -2.3e-297: tmp = (z * y) * x elif a <= 1.55e+66: tmp = (-i * y) * j else: tmp = -a * (t * x) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -9000.0) tmp = Float64(Float64(c * a) * j); elseif (a <= -2.3e-297) tmp = Float64(Float64(z * y) * x); elseif (a <= 1.55e+66) tmp = Float64(Float64(Float64(-i) * y) * j); else tmp = Float64(Float64(-a) * Float64(t * x)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (a <= -9000.0) tmp = (c * a) * j; elseif (a <= -2.3e-297) tmp = (z * y) * x; elseif (a <= 1.55e+66) tmp = (-i * y) * j; else tmp = -a * (t * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -9000.0], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[a, -2.3e-297], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[a, 1.55e+66], N[(N[((-i) * y), $MachinePrecision] * j), $MachinePrecision], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -9000:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{-297}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;a \leq 1.55 \cdot 10^{+66}:\\
\;\;\;\;\left(\left(-i\right) \cdot y\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\end{array}
\end{array}
if a < -9e3Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f6422.4
Applied rewrites22.4%
if -9e3 < a < -2.2999999999999999e-297Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
if -2.2999999999999999e-297 < a < 1.55000000000000009e66Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around inf
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f6421.5
Applied rewrites21.5%
if 1.55000000000000009e66 < a Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in a around inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lower-*.f6421.3
Applied rewrites21.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- b) (* c z))))
(if (<= b -1.45e+85)
t_1
(if (<= b 1.1e-246)
(* (* j c) a)
(if (<= b 1.15e-17)
(* (- a) (* t x))
(if (<= b 2.5e+191) t_1 (* (* i t) b)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -b * (c * z);
double tmp;
if (b <= -1.45e+85) {
tmp = t_1;
} else if (b <= 1.1e-246) {
tmp = (j * c) * a;
} else if (b <= 1.15e-17) {
tmp = -a * (t * x);
} else if (b <= 2.5e+191) {
tmp = t_1;
} else {
tmp = (i * t) * b;
}
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 * (c * z)
if (b <= (-1.45d+85)) then
tmp = t_1
else if (b <= 1.1d-246) then
tmp = (j * c) * a
else if (b <= 1.15d-17) then
tmp = -a * (t * x)
else if (b <= 2.5d+191) then
tmp = t_1
else
tmp = (i * t) * b
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 * (c * z);
double tmp;
if (b <= -1.45e+85) {
tmp = t_1;
} else if (b <= 1.1e-246) {
tmp = (j * c) * a;
} else if (b <= 1.15e-17) {
tmp = -a * (t * x);
} else if (b <= 2.5e+191) {
tmp = t_1;
} else {
tmp = (i * t) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -b * (c * z) tmp = 0 if b <= -1.45e+85: tmp = t_1 elif b <= 1.1e-246: tmp = (j * c) * a elif b <= 1.15e-17: tmp = -a * (t * x) elif b <= 2.5e+191: tmp = t_1 else: tmp = (i * t) * b return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-b) * Float64(c * z)) tmp = 0.0 if (b <= -1.45e+85) tmp = t_1; elseif (b <= 1.1e-246) tmp = Float64(Float64(j * c) * a); elseif (b <= 1.15e-17) tmp = Float64(Float64(-a) * Float64(t * x)); elseif (b <= 2.5e+191) tmp = t_1; else tmp = Float64(Float64(i * t) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -b * (c * z); tmp = 0.0; if (b <= -1.45e+85) tmp = t_1; elseif (b <= 1.1e-246) tmp = (j * c) * a; elseif (b <= 1.15e-17) tmp = -a * (t * x); elseif (b <= 2.5e+191) tmp = t_1; else tmp = (i * t) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[((-b) * N[(c * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.45e+85], t$95$1, If[LessEqual[b, 1.1e-246], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, 1.15e-17], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.5e+191], t$95$1, N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-b\right) \cdot \left(c \cdot z\right)\\
\mathbf{if}\;b \leq -1.45 \cdot 10^{+85}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{-246}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-17}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;b \leq 2.5 \cdot 10^{+191}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\end{array}
\end{array}
if b < -1.44999999999999999e85 or 1.15000000000000004e-17 < b < 2.5000000000000001e191Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in c around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-*.f6422.9
Applied rewrites22.9%
if -1.44999999999999999e85 < b < 1.09999999999999999e-246Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
Applied rewrites22.6%
if 1.09999999999999999e-246 < b < 1.15000000000000004e-17Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in a around inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lower-*.f6421.3
Applied rewrites21.3%
if 2.5000000000000001e191 < b Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6422.4
Applied rewrites22.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= y -1.55e+43)
(* (* y x) z)
(if (<= y -2.9e-121)
(* (* j a) c)
(if (<= y 4.9e-273)
(* (- a) (* t x))
(if (<= y 2.55e+68) (* (* j c) a) (* (* z y) x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (y <= -1.55e+43) {
tmp = (y * x) * z;
} else if (y <= -2.9e-121) {
tmp = (j * a) * c;
} else if (y <= 4.9e-273) {
tmp = -a * (t * x);
} else if (y <= 2.55e+68) {
tmp = (j * c) * a;
} else {
tmp = (z * y) * x;
}
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 (y <= (-1.55d+43)) then
tmp = (y * x) * z
else if (y <= (-2.9d-121)) then
tmp = (j * a) * c
else if (y <= 4.9d-273) then
tmp = -a * (t * x)
else if (y <= 2.55d+68) then
tmp = (j * c) * a
else
tmp = (z * y) * x
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 (y <= -1.55e+43) {
tmp = (y * x) * z;
} else if (y <= -2.9e-121) {
tmp = (j * a) * c;
} else if (y <= 4.9e-273) {
tmp = -a * (t * x);
} else if (y <= 2.55e+68) {
tmp = (j * c) * a;
} else {
tmp = (z * y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if y <= -1.55e+43: tmp = (y * x) * z elif y <= -2.9e-121: tmp = (j * a) * c elif y <= 4.9e-273: tmp = -a * (t * x) elif y <= 2.55e+68: tmp = (j * c) * a else: tmp = (z * y) * x return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -1.55e+43) tmp = Float64(Float64(y * x) * z); elseif (y <= -2.9e-121) tmp = Float64(Float64(j * a) * c); elseif (y <= 4.9e-273) tmp = Float64(Float64(-a) * Float64(t * x)); elseif (y <= 2.55e+68) tmp = Float64(Float64(j * c) * a); else tmp = Float64(Float64(z * y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (y <= -1.55e+43) tmp = (y * x) * z; elseif (y <= -2.9e-121) tmp = (j * a) * c; elseif (y <= 4.9e-273) tmp = -a * (t * x); elseif (y <= 2.55e+68) tmp = (j * c) * a; else tmp = (z * y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -1.55e+43], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[y, -2.9e-121], N[(N[(j * a), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[y, 4.9e-273], N[((-a) * N[(t * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.55e+68], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+43}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-121}:\\
\;\;\;\;\left(j \cdot a\right) \cdot c\\
\mathbf{elif}\;y \leq 4.9 \cdot 10^{-273}:\\
\;\;\;\;\left(-a\right) \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{+68}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if y < -1.5500000000000001e43Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
if -1.5500000000000001e43 < y < -2.9e-121Initial program 74.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6422.6
Applied rewrites22.6%
if -2.9e-121 < y < 4.89999999999999964e-273Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in a around inf
associate-*r*N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lower-*.f6421.3
Applied rewrites21.3%
if 4.89999999999999964e-273 < y < 2.55e68Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
Applied rewrites22.6%
if 2.55e68 < y Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= j -15000000000000.0) (* (* j a) c) (if (<= j 1.12e-11) (* (* z y) x) (* (* j c) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -15000000000000.0) {
tmp = (j * a) * c;
} else if (j <= 1.12e-11) {
tmp = (z * y) * x;
} else {
tmp = (j * c) * a;
}
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 (j <= (-15000000000000.0d0)) then
tmp = (j * a) * c
else if (j <= 1.12d-11) then
tmp = (z * y) * x
else
tmp = (j * c) * a
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 (j <= -15000000000000.0) {
tmp = (j * a) * c;
} else if (j <= 1.12e-11) {
tmp = (z * y) * x;
} else {
tmp = (j * c) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -15000000000000.0: tmp = (j * a) * c elif j <= 1.12e-11: tmp = (z * y) * x else: tmp = (j * c) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -15000000000000.0) tmp = Float64(Float64(j * a) * c); elseif (j <= 1.12e-11) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(j * c) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -15000000000000.0) tmp = (j * a) * c; elseif (j <= 1.12e-11) tmp = (z * y) * x; else tmp = (j * c) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -15000000000000.0], N[(N[(j * a), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[j, 1.12e-11], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -15000000000000:\\
\;\;\;\;\left(j \cdot a\right) \cdot c\\
\mathbf{elif}\;j \leq 1.12 \cdot 10^{-11}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\end{array}
\end{array}
if j < -1.5e13Initial program 74.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in z around 0
*-commutativeN/A
lift-*.f6422.6
Applied rewrites22.6%
if -1.5e13 < j < 1.1200000000000001e-11Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
if 1.1200000000000001e-11 < j Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
Applied rewrites22.6%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= j -15000000000000.0) (* (* c a) j) (if (<= j 1.12e-11) (* (* z y) x) (* (* j c) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -15000000000000.0) {
tmp = (c * a) * j;
} else if (j <= 1.12e-11) {
tmp = (z * y) * x;
} else {
tmp = (j * c) * a;
}
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 (j <= (-15000000000000.0d0)) then
tmp = (c * a) * j
else if (j <= 1.12d-11) then
tmp = (z * y) * x
else
tmp = (j * c) * a
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 (j <= -15000000000000.0) {
tmp = (c * a) * j;
} else if (j <= 1.12e-11) {
tmp = (z * y) * x;
} else {
tmp = (j * c) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -15000000000000.0: tmp = (c * a) * j elif j <= 1.12e-11: tmp = (z * y) * x else: tmp = (j * c) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -15000000000000.0) tmp = Float64(Float64(c * a) * j); elseif (j <= 1.12e-11) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(j * c) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -15000000000000.0) tmp = (c * a) * j; elseif (j <= 1.12e-11) tmp = (z * y) * x; else tmp = (j * c) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -15000000000000.0], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[j, 1.12e-11], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -15000000000000:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\mathbf{elif}\;j \leq 1.12 \cdot 10^{-11}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\end{array}
\end{array}
if j < -1.5e13Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
lift-*.f6422.4
Applied rewrites22.4%
if -1.5e13 < j < 1.1200000000000001e-11Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
if 1.1200000000000001e-11 < j Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
Applied rewrites22.6%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= y -7.2e+39) (* (* y x) z) (if (<= y 2.55e+68) (* (* j c) a) (* (* z y) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (y <= -7.2e+39) {
tmp = (y * x) * z;
} else if (y <= 2.55e+68) {
tmp = (j * c) * a;
} else {
tmp = (z * y) * x;
}
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 (y <= (-7.2d+39)) then
tmp = (y * x) * z
else if (y <= 2.55d+68) then
tmp = (j * c) * a
else
tmp = (z * y) * x
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 (y <= -7.2e+39) {
tmp = (y * x) * z;
} else if (y <= 2.55e+68) {
tmp = (j * c) * a;
} else {
tmp = (z * y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if y <= -7.2e+39: tmp = (y * x) * z elif y <= 2.55e+68: tmp = (j * c) * a else: tmp = (z * y) * x return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (y <= -7.2e+39) tmp = Float64(Float64(y * x) * z); elseif (y <= 2.55e+68) tmp = Float64(Float64(j * c) * a); else tmp = Float64(Float64(z * y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (y <= -7.2e+39) tmp = (y * x) * z; elseif (y <= 2.55e+68) tmp = (j * c) * a; else tmp = (z * y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[y, -7.2e+39], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[y, 2.55e+68], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.2 \cdot 10^{+39}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{+68}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if y < -7.19999999999999969e39Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
if -7.19999999999999969e39 < y < 2.55e68Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
Applied rewrites22.6%
if 2.55e68 < y Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* j c) a))) (if (<= j -11200000000000.0) t_1 (if (<= j 7.2e-12) (* (* y x) 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 * c) * a;
double tmp;
if (j <= -11200000000000.0) {
tmp = t_1;
} else if (j <= 7.2e-12) {
tmp = (y * x) * 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 * c) * a
if (j <= (-11200000000000.0d0)) then
tmp = t_1
else if (j <= 7.2d-12) then
tmp = (y * x) * 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 * c) * a;
double tmp;
if (j <= -11200000000000.0) {
tmp = t_1;
} else if (j <= 7.2e-12) {
tmp = (y * x) * z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (j * c) * a tmp = 0 if j <= -11200000000000.0: tmp = t_1 elif j <= 7.2e-12: tmp = (y * x) * z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(j * c) * a) tmp = 0.0 if (j <= -11200000000000.0) tmp = t_1; elseif (j <= 7.2e-12) tmp = Float64(Float64(y * x) * 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 * c) * a; tmp = 0.0; if (j <= -11200000000000.0) tmp = t_1; elseif (j <= 7.2e-12) tmp = (y * x) * 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[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[j, -11200000000000.0], t$95$1, If[LessEqual[j, 7.2e-12], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(j \cdot c\right) \cdot a\\
\mathbf{if}\;j \leq -11200000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 7.2 \cdot 10^{-12}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.12e13 or 7.2e-12 < j Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
Applied rewrites22.6%
if -1.12e13 < j < 7.2e-12Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lift-*.f6422.0
Applied rewrites22.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
Applied rewrites21.9%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* i t) b))) (if (<= b -3.7e+83) t_1 (if (<= b 8.5e+113) (* (* j c) 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 (b <= -3.7e+83) {
tmp = t_1;
} else if (b <= 8.5e+113) {
tmp = (j * c) * 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 (b <= (-3.7d+83)) then
tmp = t_1
else if (b <= 8.5d+113) then
tmp = (j * c) * 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 (b <= -3.7e+83) {
tmp = t_1;
} else if (b <= 8.5e+113) {
tmp = (j * c) * 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 b <= -3.7e+83: tmp = t_1 elif b <= 8.5e+113: tmp = (j * c) * 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 (b <= -3.7e+83) tmp = t_1; elseif (b <= 8.5e+113) tmp = Float64(Float64(j * c) * 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 (b <= -3.7e+83) tmp = t_1; elseif (b <= 8.5e+113) tmp = (j * c) * 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[b, -3.7e+83], t$95$1, If[LessEqual[b, 8.5e+113], N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t\right) \cdot b\\
\mathbf{if}\;b \leq -3.7 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 8.5 \cdot 10^{+113}:\\
\;\;\;\;\left(j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.7000000000000002e83 or 8.5000000000000001e113 < b Initial program 74.0%
Taylor expanded in j around 0
lower--.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower--.f64N/A
lift-*.f64N/A
lower-*.f6459.6
Applied rewrites59.6%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
lift-*.f6422.4
Applied rewrites22.4%
if -3.7000000000000002e83 < b < 8.5000000000000001e113Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
Applied rewrites22.6%
(FPCore (x y z t a b c i j) :precision binary64 (* (* j c) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (j * c) * a;
}
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 = (j * c) * a
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 (j * c) * a;
}
def code(x, y, z, t, a, b, c, i, j): return (j * c) * a
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(j * c) * a) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (j * c) * a; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]
\begin{array}{l}
\\
\left(j \cdot c\right) \cdot a
\end{array}
Initial program 74.0%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6438.5
Applied rewrites38.5%
Taylor expanded in y around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
Applied rewrites22.6%
herbie shell --seed 2025123
(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)))))