
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* -1.0 (* t (- (* a x) (* b i)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = -1.0 * (t * ((a * x) - (b * i)));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = -1.0 * (t * ((a * x) - (b * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = -1.0 * (t * ((a * x) - (b * i))) return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(-1.0 * Float64(t * Float64(Float64(a * x) - Float64(b * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = -1.0 * (t * ((a * x) - (b * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(-1.0 * N[(t * N[(N[(a * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right)\\
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 72.2%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* z x) (* j i)) y))
(t_2 (* j (- (* c a) (* y i)))))
(if (<= y -4.4e+209)
t_1
(if (<= y -1.95e+46)
(+ (* z (- (* x y) (* b c))) t_2)
(if (<= y 80000000000.0)
(+ (* b (- (* i t) (* c z))) t_2)
(if (<= y 2.6e+190)
(+ (* j (- (* a c) (* i y))) (* x (- (* y z) (* a t))))
t_1))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((z * x) - (j * i)) * y;
double t_2 = j * ((c * a) - (y * i));
double tmp;
if (y <= -4.4e+209) {
tmp = t_1;
} else if (y <= -1.95e+46) {
tmp = (z * ((x * y) - (b * c))) + t_2;
} else if (y <= 80000000000.0) {
tmp = (b * ((i * t) - (c * z))) + t_2;
} else if (y <= 2.6e+190) {
tmp = (j * ((a * c) - (i * y))) + (x * ((y * z) - (a * t)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((z * x) - (j * i)) * y
t_2 = j * ((c * a) - (y * i))
if (y <= (-4.4d+209)) then
tmp = t_1
else if (y <= (-1.95d+46)) then
tmp = (z * ((x * y) - (b * c))) + t_2
else if (y <= 80000000000.0d0) then
tmp = (b * ((i * t) - (c * z))) + t_2
else if (y <= 2.6d+190) then
tmp = (j * ((a * c) - (i * y))) + (x * ((y * z) - (a * t)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((z * x) - (j * i)) * y;
double t_2 = j * ((c * a) - (y * i));
double tmp;
if (y <= -4.4e+209) {
tmp = t_1;
} else if (y <= -1.95e+46) {
tmp = (z * ((x * y) - (b * c))) + t_2;
} else if (y <= 80000000000.0) {
tmp = (b * ((i * t) - (c * z))) + t_2;
} else if (y <= 2.6e+190) {
tmp = (j * ((a * c) - (i * y))) + (x * ((y * z) - (a * t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((z * x) - (j * i)) * y t_2 = j * ((c * a) - (y * i)) tmp = 0 if y <= -4.4e+209: tmp = t_1 elif y <= -1.95e+46: tmp = (z * ((x * y) - (b * c))) + t_2 elif y <= 80000000000.0: tmp = (b * ((i * t) - (c * z))) + t_2 elif y <= 2.6e+190: tmp = (j * ((a * c) - (i * y))) + (x * ((y * z) - (a * t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(z * x) - Float64(j * i)) * y) t_2 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) tmp = 0.0 if (y <= -4.4e+209) tmp = t_1; elseif (y <= -1.95e+46) tmp = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + t_2); elseif (y <= 80000000000.0) tmp = Float64(Float64(b * Float64(Float64(i * t) - Float64(c * z))) + t_2); elseif (y <= 2.6e+190) tmp = Float64(Float64(j * Float64(Float64(a * c) - Float64(i * y))) + Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((z * x) - (j * i)) * y; t_2 = j * ((c * a) - (y * i)); tmp = 0.0; if (y <= -4.4e+209) tmp = t_1; elseif (y <= -1.95e+46) tmp = (z * ((x * y) - (b * c))) + t_2; elseif (y <= 80000000000.0) tmp = (b * ((i * t) - (c * z))) + t_2; elseif (y <= 2.6e+190) tmp = (j * ((a * c) - (i * y))) + (x * ((y * z) - (a * t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.4e+209], t$95$1, If[LessEqual[y, -1.95e+46], N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[y, 80000000000.0], N[(N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[y, 2.6e+190], N[(N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
t_1 := \left(z \cdot x - j \cdot i\right) \cdot y\\
t_2 := j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;y \leq -4.4 \cdot 10^{+209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.95 \cdot 10^{+46}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right) + t\_2\\
\mathbf{elif}\;y \leq 80000000000:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right) + t\_2\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+190}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right) + x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.3999999999999997e209 or 2.6000000000000001e190 < y Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
Applied rewrites40.0%
if -4.3999999999999997e209 < y < -1.95e46Initial program 72.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
if -1.95e46 < y < 8e10Initial program 72.2%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
if 8e10 < y < 2.6000000000000001e190Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.2%
Applied rewrites59.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -2.2e-22)
(- (+ (* -1.0 (* i (* j y))) t_1) (* -1.0 (* b (* i t))))
(if (<= x 4.2e+198)
(+ (* b (- (* i t) (* c z))) (* j (- (* c a) (* y i))))
(+ (* j (- (* a c) (* i y))) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -2.2e-22) {
tmp = ((-1.0 * (i * (j * y))) + t_1) - (-1.0 * (b * (i * t)));
} else if (x <= 4.2e+198) {
tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i)));
} else {
tmp = (j * ((a * c) - (i * y))) + t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((y * z) - (a * t))
if (x <= (-2.2d-22)) then
tmp = (((-1.0d0) * (i * (j * y))) + t_1) - ((-1.0d0) * (b * (i * t)))
else if (x <= 4.2d+198) then
tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i)))
else
tmp = (j * ((a * c) - (i * y))) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -2.2e-22) {
tmp = ((-1.0 * (i * (j * y))) + t_1) - (-1.0 * (b * (i * t)));
} else if (x <= 4.2e+198) {
tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i)));
} else {
tmp = (j * ((a * c) - (i * y))) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * ((y * z) - (a * t)) tmp = 0 if x <= -2.2e-22: tmp = ((-1.0 * (i * (j * y))) + t_1) - (-1.0 * (b * (i * t))) elif x <= 4.2e+198: tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i))) else: tmp = (j * ((a * c) - (i * y))) + t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -2.2e-22) tmp = Float64(Float64(Float64(-1.0 * Float64(i * Float64(j * y))) + t_1) - Float64(-1.0 * Float64(b * Float64(i * t)))); elseif (x <= 4.2e+198) tmp = Float64(Float64(b * Float64(Float64(i * t) - Float64(c * z))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = Float64(Float64(j * Float64(Float64(a * c) - Float64(i * y))) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * ((y * z) - (a * t)); tmp = 0.0; if (x <= -2.2e-22) tmp = ((-1.0 * (i * (j * y))) + t_1) - (-1.0 * (b * (i * t))); elseif (x <= 4.2e+198) tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i))); else tmp = (j * ((a * c) - (i * y))) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.2e-22], N[(N[(N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(-1.0 * N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e+198], N[(N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -2.2 \cdot 10^{-22}:\\
\;\;\;\;\left(-1 \cdot \left(i \cdot \left(j \cdot y\right)\right) + t\_1\right) - -1 \cdot \left(b \cdot \left(i \cdot t\right)\right)\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+198}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right) + t\_1\\
\end{array}
if x < -2.2000000000000001e-22Initial program 72.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6469.2%
Applied rewrites69.2%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6468.4%
Applied rewrites68.4%
Taylor expanded in c around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6457.4%
Applied rewrites57.4%
if -2.2000000000000001e-22 < x < 4.2000000000000003e198Initial program 72.2%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
if 4.2000000000000003e198 < x Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.2%
Applied rewrites59.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* z (- (* x y) (* b c))) (* j (* a c)))))
(if (<= z -5.8e+83)
t_1
(if (<= z 0.023)
(+ (* -1.0 (* t (- (* a x) (* b i)))) (* j (- (* c a) (* y i))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * ((x * y) - (b * c))) + (j * (a * c));
double tmp;
if (z <= -5.8e+83) {
tmp = t_1;
} else if (z <= 0.023) {
tmp = (-1.0 * (t * ((a * x) - (b * i)))) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((x * y) - (b * c))) + (j * (a * c))
if (z <= (-5.8d+83)) then
tmp = t_1
else if (z <= 0.023d0) then
tmp = ((-1.0d0) * (t * ((a * x) - (b * i)))) + (j * ((c * a) - (y * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * ((x * y) - (b * c))) + (j * (a * c));
double tmp;
if (z <= -5.8e+83) {
tmp = t_1;
} else if (z <= 0.023) {
tmp = (-1.0 * (t * ((a * x) - (b * i)))) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * ((x * y) - (b * c))) + (j * (a * c)) tmp = 0 if z <= -5.8e+83: tmp = t_1 elif z <= 0.023: tmp = (-1.0 * (t * ((a * x) - (b * i)))) + (j * ((c * a) - (y * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + Float64(j * Float64(a * c))) tmp = 0.0 if (z <= -5.8e+83) tmp = t_1; elseif (z <= 0.023) tmp = Float64(Float64(-1.0 * Float64(t * Float64(Float64(a * x) - Float64(b * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (z * ((x * y) - (b * c))) + (j * (a * c)); tmp = 0.0; if (z <= -5.8e+83) tmp = t_1; elseif (z <= 0.023) tmp = (-1.0 * (t * ((a * x) - (b * i)))) + (j * ((c * a) - (y * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.8e+83], t$95$1, If[LessEqual[z, 0.023], N[(N[(-1.0 * N[(t * N[(N[(a * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \left(a \cdot c\right)\\
\mathbf{if}\;z \leq -5.8 \cdot 10^{+83}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.023:\\
\;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -5.8e83 or 0.023 < z Initial program 72.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
Taylor expanded in y around 0
lower-*.f6448.4%
Applied rewrites48.4%
if -5.8e83 < z < 0.023Initial program 72.2%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.3%
Applied rewrites59.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* z (- (* x y) (* b c))) (* j (* a c)))))
(if (<= z -1.75e+76)
t_1
(if (<= z 1.05e+105)
(+ (* b (- (* i t) (* c z))) (* j (- (* c a) (* y i))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * ((x * y) - (b * c))) + (j * (a * c));
double tmp;
if (z <= -1.75e+76) {
tmp = t_1;
} else if (z <= 1.05e+105) {
tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((x * y) - (b * c))) + (j * (a * c))
if (z <= (-1.75d+76)) then
tmp = t_1
else if (z <= 1.05d+105) then
tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * ((x * y) - (b * c))) + (j * (a * c));
double tmp;
if (z <= -1.75e+76) {
tmp = t_1;
} else if (z <= 1.05e+105) {
tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * ((x * y) - (b * c))) + (j * (a * c)) tmp = 0 if z <= -1.75e+76: tmp = t_1 elif z <= 1.05e+105: tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + Float64(j * Float64(a * c))) tmp = 0.0 if (z <= -1.75e+76) tmp = t_1; elseif (z <= 1.05e+105) tmp = Float64(Float64(b * Float64(Float64(i * t) - Float64(c * z))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (z * ((x * y) - (b * c))) + (j * (a * c)); tmp = 0.0; if (z <= -1.75e+76) tmp = t_1; elseif (z <= 1.05e+105) tmp = (b * ((i * t) - (c * z))) + (j * ((c * a) - (y * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.75e+76], t$95$1, If[LessEqual[z, 1.05e+105], N[(N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \left(a \cdot c\right)\\
\mathbf{if}\;z \leq -1.75 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+105}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.75e76 or 1.05e105 < z Initial program 72.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
Taylor expanded in y around 0
lower-*.f6448.4%
Applied rewrites48.4%
if -1.75e76 < z < 1.05e105Initial program 72.2%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* z (- (* x y) (* b c))) (* j (* a c)))))
(if (<= z -2.15e+76)
t_1
(if (<= z 0.023)
(+ (* (* t b) i) (* j (- (* c a) (* y i))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * ((x * y) - (b * c))) + (j * (a * c));
double tmp;
if (z <= -2.15e+76) {
tmp = t_1;
} else if (z <= 0.023) {
tmp = ((t * b) * i) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((x * y) - (b * c))) + (j * (a * c))
if (z <= (-2.15d+76)) then
tmp = t_1
else if (z <= 0.023d0) then
tmp = ((t * b) * i) + (j * ((c * a) - (y * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * ((x * y) - (b * c))) + (j * (a * c));
double tmp;
if (z <= -2.15e+76) {
tmp = t_1;
} else if (z <= 0.023) {
tmp = ((t * b) * i) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * ((x * y) - (b * c))) + (j * (a * c)) tmp = 0 if z <= -2.15e+76: tmp = t_1 elif z <= 0.023: tmp = ((t * b) * i) + (j * ((c * a) - (y * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + Float64(j * Float64(a * c))) tmp = 0.0 if (z <= -2.15e+76) tmp = t_1; elseif (z <= 0.023) tmp = Float64(Float64(Float64(t * b) * i) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (z * ((x * y) - (b * c))) + (j * (a * c)); tmp = 0.0; if (z <= -2.15e+76) tmp = t_1; elseif (z <= 0.023) tmp = ((t * b) * i) + (j * ((c * a) - (y * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.15e+76], t$95$1, If[LessEqual[z, 0.023], N[(N[(N[(t * b), $MachinePrecision] * i), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \left(a \cdot c\right)\\
\mathbf{if}\;z \leq -2.15 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.023:\\
\;\;\;\;\left(t \cdot b\right) \cdot i + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.1499999999999999e76 or 0.023 < z Initial program 72.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
Taylor expanded in y around 0
lower-*.f6448.4%
Applied rewrites48.4%
if -2.1499999999999999e76 < z < 0.023Initial program 72.2%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6449.7%
Applied rewrites49.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6451.2%
Applied rewrites51.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* z (- (* x y) (* b c))) (* j (* a c)))))
(if (<= z -270000000000.0)
t_1
(if (<= z 0.023)
(+ (* b (* i t)) (* j (- (* c a) (* y i))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * ((x * y) - (b * c))) + (j * (a * c));
double tmp;
if (z <= -270000000000.0) {
tmp = t_1;
} else if (z <= 0.023) {
tmp = (b * (i * t)) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((x * y) - (b * c))) + (j * (a * c))
if (z <= (-270000000000.0d0)) then
tmp = t_1
else if (z <= 0.023d0) then
tmp = (b * (i * t)) + (j * ((c * a) - (y * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (z * ((x * y) - (b * c))) + (j * (a * c));
double tmp;
if (z <= -270000000000.0) {
tmp = t_1;
} else if (z <= 0.023) {
tmp = (b * (i * t)) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (z * ((x * y) - (b * c))) + (j * (a * c)) tmp = 0 if z <= -270000000000.0: tmp = t_1 elif z <= 0.023: tmp = (b * (i * t)) + (j * ((c * a) - (y * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + Float64(j * Float64(a * c))) tmp = 0.0 if (z <= -270000000000.0) tmp = t_1; elseif (z <= 0.023) tmp = Float64(Float64(b * Float64(i * t)) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (z * ((x * y) - (b * c))) + (j * (a * c)); tmp = 0.0; if (z <= -270000000000.0) tmp = t_1; elseif (z <= 0.023) tmp = (b * (i * t)) + (j * ((c * a) - (y * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -270000000000.0], t$95$1, If[LessEqual[z, 0.023], N[(N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := z \cdot \left(x \cdot y - b \cdot c\right) + j \cdot \left(a \cdot c\right)\\
\mathbf{if}\;z \leq -270000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.023:\\
\;\;\;\;b \cdot \left(i \cdot t\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.7e11 or 0.023 < z Initial program 72.2%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.1%
Applied rewrites59.1%
Taylor expanded in y around 0
lower-*.f6448.4%
Applied rewrites48.4%
if -2.7e11 < z < 0.023Initial program 72.2%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6449.7%
Applied rewrites49.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* z x) (* j i)) y)))
(if (<= y -5.4e+66)
t_1
(if (<= y -2.4e-55)
(+ (* b (* i t)) (* j (* a c)))
(if (<= y 6.8e+17)
(* c (- (* a j) (* b z)))
(if (<= y 2.3e+188) (- (* x (* y z)) (* 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 = ((z * x) - (j * i)) * y;
double tmp;
if (y <= -5.4e+66) {
tmp = t_1;
} else if (y <= -2.4e-55) {
tmp = (b * (i * t)) + (j * (a * c));
} else if (y <= 6.8e+17) {
tmp = c * ((a * j) - (b * z));
} else if (y <= 2.3e+188) {
tmp = (x * (y * z)) - (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 = ((z * x) - (j * i)) * y
if (y <= (-5.4d+66)) then
tmp = t_1
else if (y <= (-2.4d-55)) then
tmp = (b * (i * t)) + (j * (a * c))
else if (y <= 6.8d+17) then
tmp = c * ((a * j) - (b * z))
else if (y <= 2.3d+188) then
tmp = (x * (y * z)) - (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 = ((z * x) - (j * i)) * y;
double tmp;
if (y <= -5.4e+66) {
tmp = t_1;
} else if (y <= -2.4e-55) {
tmp = (b * (i * t)) + (j * (a * c));
} else if (y <= 6.8e+17) {
tmp = c * ((a * j) - (b * z));
} else if (y <= 2.3e+188) {
tmp = (x * (y * z)) - (a * (t * x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((z * x) - (j * i)) * y tmp = 0 if y <= -5.4e+66: tmp = t_1 elif y <= -2.4e-55: tmp = (b * (i * t)) + (j * (a * c)) elif y <= 6.8e+17: tmp = c * ((a * j) - (b * z)) elif y <= 2.3e+188: tmp = (x * (y * z)) - (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(z * x) - Float64(j * i)) * y) tmp = 0.0 if (y <= -5.4e+66) tmp = t_1; elseif (y <= -2.4e-55) tmp = Float64(Float64(b * Float64(i * t)) + Float64(j * Float64(a * c))); elseif (y <= 6.8e+17) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (y <= 2.3e+188) tmp = Float64(Float64(x * Float64(y * z)) - Float64(a * Float64(t * x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((z * x) - (j * i)) * y; tmp = 0.0; if (y <= -5.4e+66) tmp = t_1; elseif (y <= -2.4e-55) tmp = (b * (i * t)) + (j * (a * c)); elseif (y <= 6.8e+17) tmp = c * ((a * j) - (b * z)); elseif (y <= 2.3e+188) tmp = (x * (y * z)) - (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[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -5.4e+66], t$95$1, If[LessEqual[y, -2.4e-55], N[(N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision] + N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+17], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+188], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := \left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{if}\;y \leq -5.4 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.4 \cdot 10^{-55}:\\
\;\;\;\;b \cdot \left(i \cdot t\right) + j \cdot \left(a \cdot c\right)\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+17}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+188}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) - a \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -5.3999999999999998e66 or 2.3000000000000001e188 < y Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
Applied rewrites40.0%
if -5.3999999999999998e66 < y < -2.3999999999999999e-55Initial program 72.2%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6449.7%
Applied rewrites49.7%
Taylor expanded in y around 0
lower-*.f6438.2%
Applied rewrites38.2%
if -2.3999999999999999e-55 < y < 6.8e17Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if 6.8e17 < y < 2.3000000000000001e188Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6457.9%
Applied rewrites57.9%
Taylor expanded in j around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* z x) (* j i)) y)))
(if (<= y -2.8e+67)
t_1
(if (<= y -2.9e-55)
(* -1.0 (* t (- (* a x) (* b i))))
(if (<= y 6.8e+17)
(* c (- (* a j) (* b z)))
(if (<= y 2.3e+188) (- (* x (* y z)) (* 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 = ((z * x) - (j * i)) * y;
double tmp;
if (y <= -2.8e+67) {
tmp = t_1;
} else if (y <= -2.9e-55) {
tmp = -1.0 * (t * ((a * x) - (b * i)));
} else if (y <= 6.8e+17) {
tmp = c * ((a * j) - (b * z));
} else if (y <= 2.3e+188) {
tmp = (x * (y * z)) - (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 = ((z * x) - (j * i)) * y
if (y <= (-2.8d+67)) then
tmp = t_1
else if (y <= (-2.9d-55)) then
tmp = (-1.0d0) * (t * ((a * x) - (b * i)))
else if (y <= 6.8d+17) then
tmp = c * ((a * j) - (b * z))
else if (y <= 2.3d+188) then
tmp = (x * (y * z)) - (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 = ((z * x) - (j * i)) * y;
double tmp;
if (y <= -2.8e+67) {
tmp = t_1;
} else if (y <= -2.9e-55) {
tmp = -1.0 * (t * ((a * x) - (b * i)));
} else if (y <= 6.8e+17) {
tmp = c * ((a * j) - (b * z));
} else if (y <= 2.3e+188) {
tmp = (x * (y * z)) - (a * (t * x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((z * x) - (j * i)) * y tmp = 0 if y <= -2.8e+67: tmp = t_1 elif y <= -2.9e-55: tmp = -1.0 * (t * ((a * x) - (b * i))) elif y <= 6.8e+17: tmp = c * ((a * j) - (b * z)) elif y <= 2.3e+188: tmp = (x * (y * z)) - (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(z * x) - Float64(j * i)) * y) tmp = 0.0 if (y <= -2.8e+67) tmp = t_1; elseif (y <= -2.9e-55) tmp = Float64(-1.0 * Float64(t * Float64(Float64(a * x) - Float64(b * i)))); elseif (y <= 6.8e+17) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (y <= 2.3e+188) tmp = Float64(Float64(x * Float64(y * z)) - Float64(a * Float64(t * x))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((z * x) - (j * i)) * y; tmp = 0.0; if (y <= -2.8e+67) tmp = t_1; elseif (y <= -2.9e-55) tmp = -1.0 * (t * ((a * x) - (b * i))); elseif (y <= 6.8e+17) tmp = c * ((a * j) - (b * z)); elseif (y <= 2.3e+188) tmp = (x * (y * z)) - (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[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.8e+67], t$95$1, If[LessEqual[y, -2.9e-55], N[(-1.0 * N[(t * N[(N[(a * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+17], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e+188], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := \left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-55}:\\
\;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right)\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+17}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{+188}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) - a \cdot \left(t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.7999999999999998e67 or 2.3000000000000001e188 < y Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
Applied rewrites40.0%
if -2.7999999999999998e67 < y < -2.9e-55Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if -2.9e-55 < y < 6.8e17Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if 6.8e17 < y < 2.3000000000000001e188Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6457.9%
Applied rewrites57.9%
Taylor expanded in j around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= x -2.7e-8)
(- (* x (* y z)) (* a (* t x)))
(if (<= x 7e+41)
(+ (* b (* i t)) (* j (- (* c a) (* y i))))
(* -1.0 (* t (- (* a x) (* b i)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -2.7e-8) {
tmp = (x * (y * z)) - (a * (t * x));
} else if (x <= 7e+41) {
tmp = (b * (i * t)) + (j * ((c * a) - (y * i)));
} else {
tmp = -1.0 * (t * ((a * x) - (b * 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) :: tmp
if (x <= (-2.7d-8)) then
tmp = (x * (y * z)) - (a * (t * x))
else if (x <= 7d+41) then
tmp = (b * (i * t)) + (j * ((c * a) - (y * i)))
else
tmp = (-1.0d0) * (t * ((a * x) - (b * 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 tmp;
if (x <= -2.7e-8) {
tmp = (x * (y * z)) - (a * (t * x));
} else if (x <= 7e+41) {
tmp = (b * (i * t)) + (j * ((c * a) - (y * i)));
} else {
tmp = -1.0 * (t * ((a * x) - (b * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -2.7e-8: tmp = (x * (y * z)) - (a * (t * x)) elif x <= 7e+41: tmp = (b * (i * t)) + (j * ((c * a) - (y * i))) else: tmp = -1.0 * (t * ((a * x) - (b * i))) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -2.7e-8) tmp = Float64(Float64(x * Float64(y * z)) - Float64(a * Float64(t * x))); elseif (x <= 7e+41) tmp = Float64(Float64(b * Float64(i * t)) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = Float64(-1.0 * Float64(t * Float64(Float64(a * x) - Float64(b * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -2.7e-8) tmp = (x * (y * z)) - (a * (t * x)); elseif (x <= 7e+41) tmp = (b * (i * t)) + (j * ((c * a) - (y * i))); else tmp = -1.0 * (t * ((a * x) - (b * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -2.7e-8], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7e+41], N[(N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(t * N[(N[(a * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{-8}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) - a \cdot \left(t \cdot x\right)\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+41}:\\
\;\;\;\;b \cdot \left(i \cdot t\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right)\\
\end{array}
if x < -2.7e-8Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in b around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6457.9%
Applied rewrites57.9%
Taylor expanded in j around 0
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6436.0%
Applied rewrites36.0%
if -2.7e-8 < x < 6.9999999999999998e41Initial program 72.2%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6449.7%
Applied rewrites49.7%
if 6.9999999999999998e41 < x Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* z x) (* j i)) y)))
(if (<= y -2.8e+67)
t_1
(if (<= y -2.9e-55)
(* -1.0 (* t (- (* a x) (* b i))))
(if (<= y 6.8e+17) (* c (- (* a j) (* 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 = ((z * x) - (j * i)) * y;
double tmp;
if (y <= -2.8e+67) {
tmp = t_1;
} else if (y <= -2.9e-55) {
tmp = -1.0 * (t * ((a * x) - (b * i)));
} else if (y <= 6.8e+17) {
tmp = c * ((a * j) - (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 = ((z * x) - (j * i)) * y
if (y <= (-2.8d+67)) then
tmp = t_1
else if (y <= (-2.9d-55)) then
tmp = (-1.0d0) * (t * ((a * x) - (b * i)))
else if (y <= 6.8d+17) then
tmp = c * ((a * j) - (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 = ((z * x) - (j * i)) * y;
double tmp;
if (y <= -2.8e+67) {
tmp = t_1;
} else if (y <= -2.9e-55) {
tmp = -1.0 * (t * ((a * x) - (b * i)));
} else if (y <= 6.8e+17) {
tmp = c * ((a * j) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((z * x) - (j * i)) * y tmp = 0 if y <= -2.8e+67: tmp = t_1 elif y <= -2.9e-55: tmp = -1.0 * (t * ((a * x) - (b * i))) elif y <= 6.8e+17: tmp = c * ((a * j) - (b * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(z * x) - Float64(j * i)) * y) tmp = 0.0 if (y <= -2.8e+67) tmp = t_1; elseif (y <= -2.9e-55) tmp = Float64(-1.0 * Float64(t * Float64(Float64(a * x) - Float64(b * i)))); elseif (y <= 6.8e+17) tmp = Float64(c * Float64(Float64(a * j) - Float64(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 = ((z * x) - (j * i)) * y; tmp = 0.0; if (y <= -2.8e+67) tmp = t_1; elseif (y <= -2.9e-55) tmp = -1.0 * (t * ((a * x) - (b * i))); elseif (y <= 6.8e+17) tmp = c * ((a * j) - (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[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.8e+67], t$95$1, If[LessEqual[y, -2.9e-55], N[(-1.0 * N[(t * N[(N[(a * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.8e+17], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{if}\;y \leq -2.8 \cdot 10^{+67}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.9 \cdot 10^{-55}:\\
\;\;\;\;-1 \cdot \left(t \cdot \left(a \cdot x - b \cdot i\right)\right)\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+17}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.7999999999999998e67 or 6.8e17 < y Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
Applied rewrites40.0%
if -2.7999999999999998e67 < y < -2.9e-55Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if -2.9e-55 < y < 6.8e17Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* z x) (* j i)) y)))
(if (<= y -5.4e+66)
t_1
(if (<= y -3.8e-55)
(* (- (* b t) (* j y)) i)
(if (<= y 6.8e+17) (* c (- (* a j) (* 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 = ((z * x) - (j * i)) * y;
double tmp;
if (y <= -5.4e+66) {
tmp = t_1;
} else if (y <= -3.8e-55) {
tmp = ((b * t) - (j * y)) * i;
} else if (y <= 6.8e+17) {
tmp = c * ((a * j) - (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 = ((z * x) - (j * i)) * y
if (y <= (-5.4d+66)) then
tmp = t_1
else if (y <= (-3.8d-55)) then
tmp = ((b * t) - (j * y)) * i
else if (y <= 6.8d+17) then
tmp = c * ((a * j) - (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 = ((z * x) - (j * i)) * y;
double tmp;
if (y <= -5.4e+66) {
tmp = t_1;
} else if (y <= -3.8e-55) {
tmp = ((b * t) - (j * y)) * i;
} else if (y <= 6.8e+17) {
tmp = c * ((a * j) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((z * x) - (j * i)) * y tmp = 0 if y <= -5.4e+66: tmp = t_1 elif y <= -3.8e-55: tmp = ((b * t) - (j * y)) * i elif y <= 6.8e+17: tmp = c * ((a * j) - (b * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(z * x) - Float64(j * i)) * y) tmp = 0.0 if (y <= -5.4e+66) tmp = t_1; elseif (y <= -3.8e-55) tmp = Float64(Float64(Float64(b * t) - Float64(j * y)) * i); elseif (y <= 6.8e+17) tmp = Float64(c * Float64(Float64(a * j) - Float64(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 = ((z * x) - (j * i)) * y; tmp = 0.0; if (y <= -5.4e+66) tmp = t_1; elseif (y <= -3.8e-55) tmp = ((b * t) - (j * y)) * i; elseif (y <= 6.8e+17) tmp = c * ((a * j) - (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[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -5.4e+66], t$95$1, If[LessEqual[y, -3.8e-55], N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[y, 6.8e+17], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{if}\;y \leq -5.4 \cdot 10^{+66}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.8 \cdot 10^{-55}:\\
\;\;\;\;\left(b \cdot t - j \cdot y\right) \cdot i\\
\mathbf{elif}\;y \leq 6.8 \cdot 10^{+17}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -5.3999999999999998e66 or 6.8e17 < y Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6440.0%
Applied rewrites40.0%
if -5.3999999999999998e66 < y < -3.7999999999999997e-55Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6440.5%
Applied rewrites40.5%
if -3.7999999999999997e-55 < y < 6.8e17Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b t) (* j y)) i)))
(if (<= i -1.9e+37)
t_1
(if (<= i -8.2e-143)
(* a (- (* c j) (* t x)))
(if (<= i 1660000000000.0) (* c (- (* a j) (* 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 = ((b * t) - (j * y)) * i;
double tmp;
if (i <= -1.9e+37) {
tmp = t_1;
} else if (i <= -8.2e-143) {
tmp = a * ((c * j) - (t * x));
} else if (i <= 1660000000000.0) {
tmp = c * ((a * j) - (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 = ((b * t) - (j * y)) * i
if (i <= (-1.9d+37)) then
tmp = t_1
else if (i <= (-8.2d-143)) then
tmp = a * ((c * j) - (t * x))
else if (i <= 1660000000000.0d0) then
tmp = c * ((a * j) - (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 = ((b * t) - (j * y)) * i;
double tmp;
if (i <= -1.9e+37) {
tmp = t_1;
} else if (i <= -8.2e-143) {
tmp = a * ((c * j) - (t * x));
} else if (i <= 1660000000000.0) {
tmp = c * ((a * j) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((b * t) - (j * y)) * i tmp = 0 if i <= -1.9e+37: tmp = t_1 elif i <= -8.2e-143: tmp = a * ((c * j) - (t * x)) elif i <= 1660000000000.0: tmp = c * ((a * j) - (b * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(b * t) - Float64(j * y)) * i) tmp = 0.0 if (i <= -1.9e+37) tmp = t_1; elseif (i <= -8.2e-143) tmp = Float64(a * Float64(Float64(c * j) - Float64(t * x))); elseif (i <= 1660000000000.0) tmp = Float64(c * Float64(Float64(a * j) - Float64(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 = ((b * t) - (j * y)) * i; tmp = 0.0; if (i <= -1.9e+37) tmp = t_1; elseif (i <= -8.2e-143) tmp = a * ((c * j) - (t * x)); elseif (i <= 1660000000000.0) tmp = c * ((a * j) - (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[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -1.9e+37], t$95$1, If[LessEqual[i, -8.2e-143], N[(a * N[(N[(c * j), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1660000000000.0], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(b \cdot t - j \cdot y\right) \cdot i\\
\mathbf{if}\;i \leq -1.9 \cdot 10^{+37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -8.2 \cdot 10^{-143}:\\
\;\;\;\;a \cdot \left(c \cdot j - t \cdot x\right)\\
\mathbf{elif}\;i \leq 1660000000000:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if i < -1.8999999999999999e37 or 1.66e12 < i Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6440.5%
Applied rewrites40.5%
if -1.8999999999999999e37 < i < -8.2e-143Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
if -8.2e-143 < i < 1.66e12Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= b -2.3e-235) (* c (- (* a j) (* b z))) (if (<= b 6.5e+140) (* a (- (* c j) (* t x))) (* (* i b) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -2.3e-235) {
tmp = c * ((a * j) - (b * z));
} else if (b <= 6.5e+140) {
tmp = a * ((c * j) - (t * x));
} else {
tmp = (i * b) * t;
}
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 (b <= (-2.3d-235)) then
tmp = c * ((a * j) - (b * z))
else if (b <= 6.5d+140) then
tmp = a * ((c * j) - (t * x))
else
tmp = (i * b) * t
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 (b <= -2.3e-235) {
tmp = c * ((a * j) - (b * z));
} else if (b <= 6.5e+140) {
tmp = a * ((c * j) - (t * x));
} else {
tmp = (i * b) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if b <= -2.3e-235: tmp = c * ((a * j) - (b * z)) elif b <= 6.5e+140: tmp = a * ((c * j) - (t * x)) else: tmp = (i * b) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -2.3e-235) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (b <= 6.5e+140) tmp = Float64(a * Float64(Float64(c * j) - Float64(t * x))); else tmp = Float64(Float64(i * b) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (b <= -2.3e-235) tmp = c * ((a * j) - (b * z)); elseif (b <= 6.5e+140) tmp = a * ((c * j) - (t * x)); else tmp = (i * b) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -2.3e-235], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6.5e+140], N[(a * N[(N[(c * j), $MachinePrecision] - N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * b), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -2.3 \cdot 10^{-235}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;b \leq 6.5 \cdot 10^{+140}:\\
\;\;\;\;a \cdot \left(c \cdot j - t \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot b\right) \cdot t\\
\end{array}
if b < -2.3e-235Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
if -2.3e-235 < b < 6.4999999999999999e140Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
if 6.4999999999999999e140 < b Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.4%
Applied rewrites22.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (* i t))))
(if (<= i -9e+121)
t_1
(if (<= i 2.4e+64) (* c (- (* a j) (* 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 = b * (i * t);
double tmp;
if (i <= -9e+121) {
tmp = t_1;
} else if (i <= 2.4e+64) {
tmp = c * ((a * j) - (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 = b * (i * t)
if (i <= (-9d+121)) then
tmp = t_1
else if (i <= 2.4d+64) then
tmp = c * ((a * j) - (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 = b * (i * t);
double tmp;
if (i <= -9e+121) {
tmp = t_1;
} else if (i <= 2.4e+64) {
tmp = c * ((a * j) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * (i * t) tmp = 0 if i <= -9e+121: tmp = t_1 elif i <= 2.4e+64: tmp = c * ((a * j) - (b * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(i * t)) tmp = 0.0 if (i <= -9e+121) tmp = t_1; elseif (i <= 2.4e+64) tmp = Float64(c * Float64(Float64(a * j) - Float64(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 = b * (i * t); tmp = 0.0; if (i <= -9e+121) tmp = t_1; elseif (i <= 2.4e+64) tmp = c * ((a * j) - (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[(b * N[(i * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -9e+121], t$95$1, If[LessEqual[i, 2.4e+64], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t\right)\\
\mathbf{if}\;i \leq -9 \cdot 10^{+121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 2.4 \cdot 10^{+64}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if i < -9.0000000000000007e121 or 2.4e64 < i Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
if -9.0000000000000007e121 < i < 2.4e64Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -1.7e+28)
(* c (* -1.0 (* b z)))
(if (<= z -1.2e-98)
(* c (* a j))
(if (<= z 7.6e+84) (* b (* i t)) (* x (* y z))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -1.7e+28) {
tmp = c * (-1.0 * (b * z));
} else if (z <= -1.2e-98) {
tmp = c * (a * j);
} else if (z <= 7.6e+84) {
tmp = b * (i * t);
} else {
tmp = x * (y * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (z <= (-1.7d+28)) then
tmp = c * ((-1.0d0) * (b * z))
else if (z <= (-1.2d-98)) then
tmp = c * (a * j)
else if (z <= 7.6d+84) then
tmp = b * (i * t)
else
tmp = x * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -1.7e+28) {
tmp = c * (-1.0 * (b * z));
} else if (z <= -1.2e-98) {
tmp = c * (a * j);
} else if (z <= 7.6e+84) {
tmp = b * (i * t);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -1.7e+28: tmp = c * (-1.0 * (b * z)) elif z <= -1.2e-98: tmp = c * (a * j) elif z <= 7.6e+84: tmp = b * (i * t) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -1.7e+28) tmp = Float64(c * Float64(-1.0 * Float64(b * z))); elseif (z <= -1.2e-98) tmp = Float64(c * Float64(a * j)); elseif (z <= 7.6e+84) tmp = Float64(b * Float64(i * t)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -1.7e+28) tmp = c * (-1.0 * (b * z)); elseif (z <= -1.2e-98) tmp = c * (a * j); elseif (z <= 7.6e+84) tmp = b * (i * t); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -1.7e+28], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.2e-98], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e+84], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.7 \cdot 10^{+28}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-98}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+84}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
if z < -1.7e28Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.1%
Applied rewrites22.1%
if -1.7e28 < z < -1.2e-98Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in z around 0
lower-*.f6422.2%
Applied rewrites22.2%
if -1.2e-98 < z < 7.6000000000000002e84Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
if 7.6000000000000002e84 < z Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= z -1.05e+25)
t_1
(if (<= z -1.2e-98)
(* c (* a j))
(if (<= z 7.6e+84) (* b (* i t)) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * (y * z);
double tmp;
if (z <= -1.05e+25) {
tmp = t_1;
} else if (z <= -1.2e-98) {
tmp = c * (a * j);
} else if (z <= 7.6e+84) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = x * (y * z)
if (z <= (-1.05d+25)) then
tmp = t_1
else if (z <= (-1.2d-98)) then
tmp = c * (a * j)
else if (z <= 7.6d+84) then
tmp = b * (i * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * (y * z);
double tmp;
if (z <= -1.05e+25) {
tmp = t_1;
} else if (z <= -1.2e-98) {
tmp = c * (a * j);
} else if (z <= 7.6e+84) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * (y * z) tmp = 0 if z <= -1.05e+25: tmp = t_1 elif z <= -1.2e-98: tmp = c * (a * j) elif z <= 7.6e+84: tmp = b * (i * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (z <= -1.05e+25) tmp = t_1; elseif (z <= -1.2e-98) tmp = Float64(c * Float64(a * j)); elseif (z <= 7.6e+84) tmp = Float64(b * Float64(i * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * (y * z); tmp = 0.0; if (z <= -1.05e+25) tmp = t_1; elseif (z <= -1.2e-98) tmp = c * (a * j); elseif (z <= 7.6e+84) tmp = b * (i * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+25], t$95$1, If[LessEqual[z, -1.2e-98], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.6e+84], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{-98}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{elif}\;z \leq 7.6 \cdot 10^{+84}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -1.05e25 or 7.6000000000000002e84 < z Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6440.0%
Applied rewrites40.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if -1.05e25 < z < -1.2e-98Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in z around 0
lower-*.f6422.2%
Applied rewrites22.2%
if -1.2e-98 < z < 7.6000000000000002e84Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* b (* i t)))) (if (<= i -1.06e+36) t_1 (if (<= i 1.18e+64) (* c (* a j)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * (i * t);
double tmp;
if (i <= -1.06e+36) {
tmp = t_1;
} else if (i <= 1.18e+64) {
tmp = c * (a * j);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = b * (i * t)
if (i <= (-1.06d+36)) then
tmp = t_1
else if (i <= 1.18d+64) then
tmp = c * (a * j)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * (i * t);
double tmp;
if (i <= -1.06e+36) {
tmp = t_1;
} else if (i <= 1.18e+64) {
tmp = c * (a * j);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * (i * t) tmp = 0 if i <= -1.06e+36: tmp = t_1 elif i <= 1.18e+64: tmp = c * (a * j) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(i * t)) tmp = 0.0 if (i <= -1.06e+36) tmp = t_1; elseif (i <= 1.18e+64) tmp = Float64(c * Float64(a * j)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * (i * t); tmp = 0.0; if (i <= -1.06e+36) tmp = t_1; elseif (i <= 1.18e+64) tmp = c * (a * j); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.06e+36], t$95$1, If[LessEqual[i, 1.18e+64], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t\right)\\
\mathbf{if}\;i \leq -1.06 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.18 \cdot 10^{+64}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if i < -1.06e36 or 1.1800000000000001e64 < i Initial program 72.2%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-rgt-inN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
fp-cancel-sub-signN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6471.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6471.2%
Applied rewrites71.2%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6440.5%
Applied rewrites40.5%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
if -1.06e36 < i < 1.1800000000000001e64Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in z around 0
lower-*.f6422.2%
Applied rewrites22.2%
(FPCore (x y z t a b c i j) :precision binary64 (* c (* a j)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return c * (a * j);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = c * (a * j)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return c * (a * j);
}
def code(x, y, z, t, a, b, c, i, j): return c * (a * j)
function code(x, y, z, t, a, b, c, i, j) return Float64(c * Float64(a * j)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = c * (a * j); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision]
c \cdot \left(a \cdot j\right)
Initial program 72.2%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9%
Applied rewrites38.9%
Taylor expanded in z around 0
lower-*.f6422.2%
Applied rewrites22.2%
herbie shell --seed 2025258
(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)))))