
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* t a)))) (t_2 (* j (- (* c a) (* y i)))))
(if (<= (+ (- t_1 (* b (- (* c z) (* t i)))) t_2) INFINITY)
(+ (- t_1 (* b (fma z c (* (- t) i)))) t_2)
(* a (fma -1.0 (* t x) (* c j))))))
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));
double t_2 = j * ((c * a) - (y * i));
double tmp;
if (((t_1 - (b * ((c * z) - (t * i)))) + t_2) <= ((double) INFINITY)) {
tmp = (t_1 - (b * fma(z, c, (-t * i)))) + t_2;
} else {
tmp = a * fma(-1.0, (t * x), (c * j));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(t * a))) t_2 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) tmp = 0.0 if (Float64(Float64(t_1 - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + t_2) <= Inf) tmp = Float64(Float64(t_1 - Float64(b * fma(z, c, Float64(Float64(-t) * i)))) + t_2); else tmp = Float64(a * fma(-1.0, Float64(t * x), Float64(c * j))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(t$95$1 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], Infinity], N[(N[(t$95$1 - N[(b * N[(z * c + N[((-t) * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], N[(a * N[(-1.0 * N[(t * x), $MachinePrecision] + N[(c * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - t \cdot a\right)\\
t_2 := j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;\left(t\_1 - b \cdot \left(c \cdot z - t \cdot i\right)\right) + t\_2 \leq \infty:\\
\;\;\;\;\left(t\_1 - b \cdot \mathsf{fma}\left(z, c, \left(-t\right) \cdot i\right)\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(-1, t \cdot x, c \cdot j\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 72.8%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6473.1
Applied rewrites73.1%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 72.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
(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 (* a (fma -1.0 (* t x) (* c j))))))
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 = a * fma(-1.0, (t * x), (c * j));
}
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(a * fma(-1.0, Float64(t * x), Float64(c * j))); end return 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[(a * N[(-1.0 * N[(t * x), $MachinePrecision] + N[(c * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(-1, t \cdot x, c \cdot j\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 72.8%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 72.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b t) (* j y)) i)))
(if (<= i -2.7e+57)
t_1
(if (<= i 2.65e+76)
(fma j (- (* a c) (* i y)) (* x (- (* y z) (* a t))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * t) - (j * y)) * i;
double tmp;
if (i <= -2.7e+57) {
tmp = t_1;
} else if (i <= 2.65e+76) {
tmp = fma(j, ((a * c) - (i * y)), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(b * t) - Float64(j * y)) * i) tmp = 0.0 if (i <= -2.7e+57) tmp = t_1; elseif (i <= 2.65e+76) tmp = fma(j, Float64(Float64(a * c) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -2.7e+57], t$95$1, If[LessEqual[i, 2.65e+76], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot t - j \cdot y\right) \cdot i\\
\mathbf{if}\;i \leq -2.7 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 2.65 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -2.6999999999999998e57 or 2.65000000000000008e76 < i Initial program 72.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
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--.f6438.9
Applied rewrites38.9%
if -2.6999999999999998e57 < i < 2.65000000000000008e76Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* x (* y z)) (* j (- (* c a) (* y i)))))
(t_2 (* (- (* b t) (* j y)) i)))
(if (<= i -3.6e+23)
t_2
(if (<= i -1.15e-195)
t_1
(if (<= i 2.85e-176)
(* c (- (* a j) (* b z)))
(if (<= i 1.75e+76) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (x * (y * z)) + (j * ((c * a) - (y * i)));
double t_2 = ((b * t) - (j * y)) * i;
double tmp;
if (i <= -3.6e+23) {
tmp = t_2;
} else if (i <= -1.15e-195) {
tmp = t_1;
} else if (i <= 2.85e-176) {
tmp = c * ((a * j) - (b * z));
} else if (i <= 1.75e+76) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x * (y * z)) + (j * ((c * a) - (y * i)))
t_2 = ((b * t) - (j * y)) * i
if (i <= (-3.6d+23)) then
tmp = t_2
else if (i <= (-1.15d-195)) then
tmp = t_1
else if (i <= 2.85d-176) then
tmp = c * ((a * j) - (b * z))
else if (i <= 1.75d+76) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (x * (y * z)) + (j * ((c * a) - (y * i)));
double t_2 = ((b * t) - (j * y)) * i;
double tmp;
if (i <= -3.6e+23) {
tmp = t_2;
} else if (i <= -1.15e-195) {
tmp = t_1;
} else if (i <= 2.85e-176) {
tmp = c * ((a * j) - (b * z));
} else if (i <= 1.75e+76) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (x * (y * z)) + (j * ((c * a) - (y * i))) t_2 = ((b * t) - (j * y)) * i tmp = 0 if i <= -3.6e+23: tmp = t_2 elif i <= -1.15e-195: tmp = t_1 elif i <= 2.85e-176: tmp = c * ((a * j) - (b * z)) elif i <= 1.75e+76: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) t_2 = Float64(Float64(Float64(b * t) - Float64(j * y)) * i) tmp = 0.0 if (i <= -3.6e+23) tmp = t_2; elseif (i <= -1.15e-195) tmp = t_1; elseif (i <= 2.85e-176) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (i <= 1.75e+76) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (x * (y * z)) + (j * ((c * a) - (y * i))); t_2 = ((b * t) - (j * y)) * i; tmp = 0.0; if (i <= -3.6e+23) tmp = t_2; elseif (i <= -1.15e-195) tmp = t_1; elseif (i <= 2.85e-176) tmp = c * ((a * j) - (b * z)); elseif (i <= 1.75e+76) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -3.6e+23], t$95$2, If[LessEqual[i, -1.15e-195], t$95$1, If[LessEqual[i, 2.85e-176], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.75e+76], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := \left(b \cdot t - j \cdot y\right) \cdot i\\
\mathbf{if}\;i \leq -3.6 \cdot 10^{+23}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq -1.15 \cdot 10^{-195}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 2.85 \cdot 10^{-176}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;i \leq 1.75 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if i < -3.5999999999999998e23 or 1.75e76 < i Initial program 72.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
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--.f6438.9
Applied rewrites38.9%
if -3.5999999999999998e23 < i < -1.1500000000000001e-195 or 2.84999999999999992e-176 < i < 1.75e76Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6449.5
Applied rewrites49.5%
if -1.1500000000000001e-195 < i < 2.84999999999999992e-176Initial program 72.8%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b t) (* j y)) i)))
(if (<= i -3.6e+23)
t_1
(if (<= i -2.6e-190)
(* (- (* z x) (* j i)) y)
(if (<= i 7.6e-285)
(* c (- (* a j) (* b z)))
(if (<= i 7.8e-61)
(* z (- (* x y) (* b c)))
(if (<= i 4.3e+71) (* 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 = ((b * t) - (j * y)) * i;
double tmp;
if (i <= -3.6e+23) {
tmp = t_1;
} else if (i <= -2.6e-190) {
tmp = ((z * x) - (j * i)) * y;
} else if (i <= 7.6e-285) {
tmp = c * ((a * j) - (b * z));
} else if (i <= 7.8e-61) {
tmp = z * ((x * y) - (b * c));
} else if (i <= 4.3e+71) {
tmp = j * ((a * c) - (i * y));
} 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 <= (-3.6d+23)) then
tmp = t_1
else if (i <= (-2.6d-190)) then
tmp = ((z * x) - (j * i)) * y
else if (i <= 7.6d-285) then
tmp = c * ((a * j) - (b * z))
else if (i <= 7.8d-61) then
tmp = z * ((x * y) - (b * c))
else if (i <= 4.3d+71) then
tmp = j * ((a * c) - (i * y))
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 <= -3.6e+23) {
tmp = t_1;
} else if (i <= -2.6e-190) {
tmp = ((z * x) - (j * i)) * y;
} else if (i <= 7.6e-285) {
tmp = c * ((a * j) - (b * z));
} else if (i <= 7.8e-61) {
tmp = z * ((x * y) - (b * c));
} else if (i <= 4.3e+71) {
tmp = j * ((a * c) - (i * y));
} 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 <= -3.6e+23: tmp = t_1 elif i <= -2.6e-190: tmp = ((z * x) - (j * i)) * y elif i <= 7.6e-285: tmp = c * ((a * j) - (b * z)) elif i <= 7.8e-61: tmp = z * ((x * y) - (b * c)) elif i <= 4.3e+71: tmp = j * ((a * c) - (i * y)) 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 <= -3.6e+23) tmp = t_1; elseif (i <= -2.6e-190) tmp = Float64(Float64(Float64(z * x) - Float64(j * i)) * y); elseif (i <= 7.6e-285) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (i <= 7.8e-61) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (i <= 4.3e+71) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); 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 <= -3.6e+23) tmp = t_1; elseif (i <= -2.6e-190) tmp = ((z * x) - (j * i)) * y; elseif (i <= 7.6e-285) tmp = c * ((a * j) - (b * z)); elseif (i <= 7.8e-61) tmp = z * ((x * y) - (b * c)); elseif (i <= 4.3e+71) tmp = j * ((a * c) - (i * y)); 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, -3.6e+23], t$95$1, If[LessEqual[i, -2.6e-190], N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[i, 7.6e-285], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 7.8e-61], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 4.3e+71], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot t - j \cdot y\right) \cdot i\\
\mathbf{if}\;i \leq -3.6 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -2.6 \cdot 10^{-190}:\\
\;\;\;\;\left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{elif}\;i \leq 7.6 \cdot 10^{-285}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;i \leq 7.8 \cdot 10^{-61}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;i \leq 4.3 \cdot 10^{+71}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -3.5999999999999998e23 or 4.29999999999999984e71 < i Initial program 72.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
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--.f6438.9
Applied rewrites38.9%
if -3.5999999999999998e23 < i < -2.5999999999999998e-190Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
lift-fma.f64N/A
+-commutativeN/A
add-flipN/A
lower--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-neg-outN/A
metadata-evalN/A
*-lft-identity39.1
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if -2.5999999999999998e-190 < i < 7.6000000000000003e-285Initial program 72.8%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
if 7.6000000000000003e-285 < i < 7.80000000000000065e-61Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
if 7.80000000000000065e-61 < i < 4.29999999999999984e71Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in x around 0
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 -4e+58)
t_1
(if (<= i 7.8e-61)
(* z (- (* x y) (* b c)))
(if (<= i 4.3e+71) (* 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 = ((b * t) - (j * y)) * i;
double tmp;
if (i <= -4e+58) {
tmp = t_1;
} else if (i <= 7.8e-61) {
tmp = z * ((x * y) - (b * c));
} else if (i <= 4.3e+71) {
tmp = j * ((a * c) - (i * y));
} 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 <= (-4d+58)) then
tmp = t_1
else if (i <= 7.8d-61) then
tmp = z * ((x * y) - (b * c))
else if (i <= 4.3d+71) then
tmp = j * ((a * c) - (i * y))
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 <= -4e+58) {
tmp = t_1;
} else if (i <= 7.8e-61) {
tmp = z * ((x * y) - (b * c));
} else if (i <= 4.3e+71) {
tmp = j * ((a * c) - (i * y));
} 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 <= -4e+58: tmp = t_1 elif i <= 7.8e-61: tmp = z * ((x * y) - (b * c)) elif i <= 4.3e+71: tmp = j * ((a * c) - (i * y)) 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 <= -4e+58) tmp = t_1; elseif (i <= 7.8e-61) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (i <= 4.3e+71) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); 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 <= -4e+58) tmp = t_1; elseif (i <= 7.8e-61) tmp = z * ((x * y) - (b * c)); elseif (i <= 4.3e+71) tmp = j * ((a * c) - (i * y)); 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, -4e+58], t$95$1, If[LessEqual[i, 7.8e-61], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 4.3e+71], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot t - j \cdot y\right) \cdot i\\
\mathbf{if}\;i \leq -4 \cdot 10^{+58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 7.8 \cdot 10^{-61}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;i \leq 4.3 \cdot 10^{+71}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -3.99999999999999978e58 or 4.29999999999999984e71 < i Initial program 72.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
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--.f6438.9
Applied rewrites38.9%
if -3.99999999999999978e58 < i < 7.80000000000000065e-61Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
if 7.80000000000000065e-61 < i < 4.29999999999999984e71Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in x around 0
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 (* j (- (* a c) (* i y)))))
(if (<= j -1.15e-34)
t_1
(if (<= j 1.95e+109) (* z (- (* x y) (* b c))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((a * c) - (i * y));
double tmp;
if (j <= -1.15e-34) {
tmp = t_1;
} else if (j <= 1.95e+109) {
tmp = z * ((x * y) - (b * c));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = j * ((a * c) - (i * y))
if (j <= (-1.15d-34)) then
tmp = t_1
else if (j <= 1.95d+109) then
tmp = z * ((x * y) - (b * c))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((a * c) - (i * y));
double tmp;
if (j <= -1.15e-34) {
tmp = t_1;
} else if (j <= 1.95e+109) {
tmp = z * ((x * y) - (b * c));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((a * c) - (i * y)) tmp = 0 if j <= -1.15e-34: tmp = t_1 elif j <= 1.95e+109: tmp = z * ((x * y) - (b * c)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(a * c) - Float64(i * y))) tmp = 0.0 if (j <= -1.15e-34) tmp = t_1; elseif (j <= 1.95e+109) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((a * c) - (i * y)); tmp = 0.0; if (j <= -1.15e-34) tmp = t_1; elseif (j <= 1.95e+109) tmp = z * ((x * y) - (b * c)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.15e-34], t$95$1, If[LessEqual[j, 1.95e+109], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{if}\;j \leq -1.15 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.95 \cdot 10^{+109}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.15000000000000006e-34 or 1.95000000000000008e109 < j Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -1.15000000000000006e-34 < j < 1.95000000000000008e109Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* a c) (* i y)))))
(if (<= j -1.35e-34)
t_1
(if (<= j 4.6e+87) (* b (- (* i t) (* c z))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((a * c) - (i * y));
double tmp;
if (j <= -1.35e-34) {
tmp = t_1;
} else if (j <= 4.6e+87) {
tmp = b * ((i * t) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = j * ((a * c) - (i * y))
if (j <= (-1.35d-34)) then
tmp = t_1
else if (j <= 4.6d+87) then
tmp = b * ((i * t) - (c * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((a * c) - (i * y));
double tmp;
if (j <= -1.35e-34) {
tmp = t_1;
} else if (j <= 4.6e+87) {
tmp = b * ((i * t) - (c * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((a * c) - (i * y)) tmp = 0 if j <= -1.35e-34: tmp = t_1 elif j <= 4.6e+87: tmp = b * ((i * t) - (c * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(a * c) - Float64(i * y))) tmp = 0.0 if (j <= -1.35e-34) tmp = t_1; elseif (j <= 4.6e+87) tmp = Float64(b * Float64(Float64(i * t) - Float64(c * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((a * c) - (i * y)); tmp = 0.0; if (j <= -1.35e-34) tmp = t_1; elseif (j <= 4.6e+87) tmp = b * ((i * t) - (c * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.35e-34], t$95$1, If[LessEqual[j, 4.6e+87], N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{if}\;j \leq -1.35 \cdot 10^{-34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 4.6 \cdot 10^{+87}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -1.35000000000000008e-34 or 4.6000000000000003e87 < j Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -1.35000000000000008e-34 < j < 4.6000000000000003e87Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* a c) (* i y)))))
(if (<= j -9.5e-36)
t_1
(if (<= j -2.15e-274)
(* c (* -1.0 (* b z)))
(if (<= j 1.55e-236)
(* b (* i t))
(if (<= j 2.3e+80) (* (* z x) 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 = j * ((a * c) - (i * y));
double tmp;
if (j <= -9.5e-36) {
tmp = t_1;
} else if (j <= -2.15e-274) {
tmp = c * (-1.0 * (b * z));
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 2.3e+80) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = j * ((a * c) - (i * y))
if (j <= (-9.5d-36)) then
tmp = t_1
else if (j <= (-2.15d-274)) then
tmp = c * ((-1.0d0) * (b * z))
else if (j <= 1.55d-236) then
tmp = b * (i * t)
else if (j <= 2.3d+80) then
tmp = (z * x) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((a * c) - (i * y));
double tmp;
if (j <= -9.5e-36) {
tmp = t_1;
} else if (j <= -2.15e-274) {
tmp = c * (-1.0 * (b * z));
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 2.3e+80) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((a * c) - (i * y)) tmp = 0 if j <= -9.5e-36: tmp = t_1 elif j <= -2.15e-274: tmp = c * (-1.0 * (b * z)) elif j <= 1.55e-236: tmp = b * (i * t) elif j <= 2.3e+80: tmp = (z * x) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(a * c) - Float64(i * y))) tmp = 0.0 if (j <= -9.5e-36) tmp = t_1; elseif (j <= -2.15e-274) tmp = Float64(c * Float64(-1.0 * Float64(b * z))); elseif (j <= 1.55e-236) tmp = Float64(b * Float64(i * t)); elseif (j <= 2.3e+80) tmp = Float64(Float64(z * x) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((a * c) - (i * y)); tmp = 0.0; if (j <= -9.5e-36) tmp = t_1; elseif (j <= -2.15e-274) tmp = c * (-1.0 * (b * z)); elseif (j <= 1.55e-236) tmp = b * (i * t); elseif (j <= 2.3e+80) tmp = (z * x) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -9.5e-36], t$95$1, If[LessEqual[j, -2.15e-274], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.55e-236], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 2.3e+80], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{if}\;j \leq -9.5 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -2.15 \cdot 10^{-274}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-236}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;j \leq 2.3 \cdot 10^{+80}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -9.5000000000000003e-36 or 2.30000000000000004e80 < j Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -9.5000000000000003e-36 < j < -2.14999999999999995e-274Initial program 72.8%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.4
Applied rewrites22.4%
if -2.14999999999999995e-274 < j < 1.5499999999999999e-236Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around 0
lower-*.f6422.2
Applied rewrites22.2%
if 1.5499999999999999e-236 < j < 2.30000000000000004e80Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -7.5e-35)
(* (* (- j) i) y)
(if (<= j -7.6e-210)
(* (* (- z) c) b)
(if (<= j -4.2e-277)
(* x (* y z))
(if (<= j 1.55e-236)
(* b (* i t))
(if (<= j 5.3e+45)
(* (* z x) y)
(if (<= j 9.5e+235) (* a (* c j)) (* -1.0 (* i (* j y))))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -7.5e-35) {
tmp = (-j * i) * y;
} else if (j <= -7.6e-210) {
tmp = (-z * c) * b;
} else if (j <= -4.2e-277) {
tmp = x * (y * z);
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 5.3e+45) {
tmp = (z * x) * y;
} else if (j <= 9.5e+235) {
tmp = a * (c * j);
} else {
tmp = -1.0 * (i * (j * y));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-7.5d-35)) then
tmp = (-j * i) * y
else if (j <= (-7.6d-210)) then
tmp = (-z * c) * b
else if (j <= (-4.2d-277)) then
tmp = x * (y * z)
else if (j <= 1.55d-236) then
tmp = b * (i * t)
else if (j <= 5.3d+45) then
tmp = (z * x) * y
else if (j <= 9.5d+235) then
tmp = a * (c * j)
else
tmp = (-1.0d0) * (i * (j * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -7.5e-35) {
tmp = (-j * i) * y;
} else if (j <= -7.6e-210) {
tmp = (-z * c) * b;
} else if (j <= -4.2e-277) {
tmp = x * (y * z);
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 5.3e+45) {
tmp = (z * x) * y;
} else if (j <= 9.5e+235) {
tmp = a * (c * j);
} else {
tmp = -1.0 * (i * (j * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -7.5e-35: tmp = (-j * i) * y elif j <= -7.6e-210: tmp = (-z * c) * b elif j <= -4.2e-277: tmp = x * (y * z) elif j <= 1.55e-236: tmp = b * (i * t) elif j <= 5.3e+45: tmp = (z * x) * y elif j <= 9.5e+235: tmp = a * (c * j) else: tmp = -1.0 * (i * (j * y)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -7.5e-35) tmp = Float64(Float64(Float64(-j) * i) * y); elseif (j <= -7.6e-210) tmp = Float64(Float64(Float64(-z) * c) * b); elseif (j <= -4.2e-277) tmp = Float64(x * Float64(y * z)); elseif (j <= 1.55e-236) tmp = Float64(b * Float64(i * t)); elseif (j <= 5.3e+45) tmp = Float64(Float64(z * x) * y); elseif (j <= 9.5e+235) tmp = Float64(a * Float64(c * j)); else tmp = Float64(-1.0 * Float64(i * Float64(j * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -7.5e-35) tmp = (-j * i) * y; elseif (j <= -7.6e-210) tmp = (-z * c) * b; elseif (j <= -4.2e-277) tmp = x * (y * z); elseif (j <= 1.55e-236) tmp = b * (i * t); elseif (j <= 5.3e+45) tmp = (z * x) * y; elseif (j <= 9.5e+235) tmp = a * (c * j); else tmp = -1.0 * (i * (j * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -7.5e-35], N[(N[((-j) * i), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, -7.6e-210], N[(N[((-z) * c), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, -4.2e-277], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.55e-236], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.3e+45], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, 9.5e+235], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -7.5 \cdot 10^{-35}:\\
\;\;\;\;\left(\left(-j\right) \cdot i\right) \cdot y\\
\mathbf{elif}\;j \leq -7.6 \cdot 10^{-210}:\\
\;\;\;\;\left(\left(-z\right) \cdot c\right) \cdot b\\
\mathbf{elif}\;j \leq -4.2 \cdot 10^{-277}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-236}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;j \leq 5.3 \cdot 10^{+45}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;j \leq 9.5 \cdot 10^{+235}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\end{array}
\end{array}
if j < -7.5e-35Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6421.9
Applied rewrites21.9%
if -7.5e-35 < j < -7.60000000000000006e-210Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6422.6
Applied rewrites22.6%
if -7.60000000000000006e-210 < j < -4.1999999999999999e-277Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
if -4.1999999999999999e-277 < j < 1.5499999999999999e-236Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around 0
lower-*.f6422.2
Applied rewrites22.2%
if 1.5499999999999999e-236 < j < 5.29999999999999991e45Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if 5.29999999999999991e45 < j < 9.49999999999999966e235Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
if 9.49999999999999966e235 < j Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -1.05e-35)
(* (* (- j) i) y)
(if (<= j -2.15e-274)
(* c (* -1.0 (* b z)))
(if (<= j 1.55e-236)
(* b (* i t))
(if (<= j 5.3e+45)
(* (* z x) y)
(if (<= j 9.5e+235) (* a (* c j)) (* -1.0 (* i (* j y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -1.05e-35) {
tmp = (-j * i) * y;
} else if (j <= -2.15e-274) {
tmp = c * (-1.0 * (b * z));
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 5.3e+45) {
tmp = (z * x) * y;
} else if (j <= 9.5e+235) {
tmp = a * (c * j);
} else {
tmp = -1.0 * (i * (j * y));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-1.05d-35)) then
tmp = (-j * i) * y
else if (j <= (-2.15d-274)) then
tmp = c * ((-1.0d0) * (b * z))
else if (j <= 1.55d-236) then
tmp = b * (i * t)
else if (j <= 5.3d+45) then
tmp = (z * x) * y
else if (j <= 9.5d+235) then
tmp = a * (c * j)
else
tmp = (-1.0d0) * (i * (j * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -1.05e-35) {
tmp = (-j * i) * y;
} else if (j <= -2.15e-274) {
tmp = c * (-1.0 * (b * z));
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 5.3e+45) {
tmp = (z * x) * y;
} else if (j <= 9.5e+235) {
tmp = a * (c * j);
} else {
tmp = -1.0 * (i * (j * y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -1.05e-35: tmp = (-j * i) * y elif j <= -2.15e-274: tmp = c * (-1.0 * (b * z)) elif j <= 1.55e-236: tmp = b * (i * t) elif j <= 5.3e+45: tmp = (z * x) * y elif j <= 9.5e+235: tmp = a * (c * j) else: tmp = -1.0 * (i * (j * y)) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -1.05e-35) tmp = Float64(Float64(Float64(-j) * i) * y); elseif (j <= -2.15e-274) tmp = Float64(c * Float64(-1.0 * Float64(b * z))); elseif (j <= 1.55e-236) tmp = Float64(b * Float64(i * t)); elseif (j <= 5.3e+45) tmp = Float64(Float64(z * x) * y); elseif (j <= 9.5e+235) tmp = Float64(a * Float64(c * j)); else tmp = Float64(-1.0 * Float64(i * Float64(j * y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -1.05e-35) tmp = (-j * i) * y; elseif (j <= -2.15e-274) tmp = c * (-1.0 * (b * z)); elseif (j <= 1.55e-236) tmp = b * (i * t); elseif (j <= 5.3e+45) tmp = (z * x) * y; elseif (j <= 9.5e+235) tmp = a * (c * j); else tmp = -1.0 * (i * (j * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -1.05e-35], N[(N[((-j) * i), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, -2.15e-274], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.55e-236], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.3e+45], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, 9.5e+235], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.05 \cdot 10^{-35}:\\
\;\;\;\;\left(\left(-j\right) \cdot i\right) \cdot y\\
\mathbf{elif}\;j \leq -2.15 \cdot 10^{-274}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-236}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;j \leq 5.3 \cdot 10^{+45}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;j \leq 9.5 \cdot 10^{+235}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\end{array}
\end{array}
if j < -1.05e-35Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6421.9
Applied rewrites21.9%
if -1.05e-35 < j < -2.14999999999999995e-274Initial program 72.8%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.4
Applied rewrites22.4%
if -2.14999999999999995e-274 < j < 1.5499999999999999e-236Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around 0
lower-*.f6422.2
Applied rewrites22.2%
if 1.5499999999999999e-236 < j < 5.29999999999999991e45Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if 5.29999999999999991e45 < j < 9.49999999999999966e235Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
if 9.49999999999999966e235 < j Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -7.5e-35)
(* (* (- j) i) y)
(if (<= j -7.6e-210)
(* (* (- z) c) b)
(if (<= j -4.2e-277)
(* x (* y z))
(if (<= j 1.55e-236)
(* b (* i t))
(if (<= j 5.3e+45) (* (* z x) y) (* a (* c j))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -7.5e-35) {
tmp = (-j * i) * y;
} else if (j <= -7.6e-210) {
tmp = (-z * c) * b;
} else if (j <= -4.2e-277) {
tmp = x * (y * z);
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 5.3e+45) {
tmp = (z * x) * y;
} else {
tmp = a * (c * j);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-7.5d-35)) then
tmp = (-j * i) * y
else if (j <= (-7.6d-210)) then
tmp = (-z * c) * b
else if (j <= (-4.2d-277)) then
tmp = x * (y * z)
else if (j <= 1.55d-236) then
tmp = b * (i * t)
else if (j <= 5.3d+45) then
tmp = (z * x) * y
else
tmp = a * (c * j)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -7.5e-35) {
tmp = (-j * i) * y;
} else if (j <= -7.6e-210) {
tmp = (-z * c) * b;
} else if (j <= -4.2e-277) {
tmp = x * (y * z);
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 5.3e+45) {
tmp = (z * x) * y;
} else {
tmp = a * (c * j);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -7.5e-35: tmp = (-j * i) * y elif j <= -7.6e-210: tmp = (-z * c) * b elif j <= -4.2e-277: tmp = x * (y * z) elif j <= 1.55e-236: tmp = b * (i * t) elif j <= 5.3e+45: tmp = (z * x) * y else: tmp = a * (c * j) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -7.5e-35) tmp = Float64(Float64(Float64(-j) * i) * y); elseif (j <= -7.6e-210) tmp = Float64(Float64(Float64(-z) * c) * b); elseif (j <= -4.2e-277) tmp = Float64(x * Float64(y * z)); elseif (j <= 1.55e-236) tmp = Float64(b * Float64(i * t)); elseif (j <= 5.3e+45) tmp = Float64(Float64(z * x) * y); else tmp = Float64(a * Float64(c * j)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -7.5e-35) tmp = (-j * i) * y; elseif (j <= -7.6e-210) tmp = (-z * c) * b; elseif (j <= -4.2e-277) tmp = x * (y * z); elseif (j <= 1.55e-236) tmp = b * (i * t); elseif (j <= 5.3e+45) tmp = (z * x) * y; else tmp = a * (c * j); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -7.5e-35], N[(N[((-j) * i), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, -7.6e-210], N[(N[((-z) * c), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, -4.2e-277], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.55e-236], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.3e+45], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -7.5 \cdot 10^{-35}:\\
\;\;\;\;\left(\left(-j\right) \cdot i\right) \cdot y\\
\mathbf{elif}\;j \leq -7.6 \cdot 10^{-210}:\\
\;\;\;\;\left(\left(-z\right) \cdot c\right) \cdot b\\
\mathbf{elif}\;j \leq -4.2 \cdot 10^{-277}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-236}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;j \leq 5.3 \cdot 10^{+45}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\end{array}
\end{array}
if j < -7.5e-35Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6421.9
Applied rewrites21.9%
if -7.5e-35 < j < -7.60000000000000006e-210Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.6
Applied rewrites22.6%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6422.6
Applied rewrites22.6%
if -7.60000000000000006e-210 < j < -4.1999999999999999e-277Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
if -4.1999999999999999e-277 < j < 1.5499999999999999e-236Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around 0
lower-*.f6422.2
Applied rewrites22.2%
if 1.5499999999999999e-236 < j < 5.29999999999999991e45Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if 5.29999999999999991e45 < j Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in c 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 (* (* (- j) i) y)))
(if (<= i -4e+197)
t_1
(if (<= i -1.6e+23)
(* (* b i) t)
(if (<= i 6.8e-38) (* (* z x) 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 = (-j * i) * y;
double tmp;
if (i <= -4e+197) {
tmp = t_1;
} else if (i <= -1.6e+23) {
tmp = (b * i) * t;
} else if (i <= 6.8e-38) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (-j * i) * y
if (i <= (-4d+197)) then
tmp = t_1
else if (i <= (-1.6d+23)) then
tmp = (b * i) * t
else if (i <= 6.8d-38) then
tmp = (z * x) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-j * i) * y;
double tmp;
if (i <= -4e+197) {
tmp = t_1;
} else if (i <= -1.6e+23) {
tmp = (b * i) * t;
} else if (i <= 6.8e-38) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-j * i) * y tmp = 0 if i <= -4e+197: tmp = t_1 elif i <= -1.6e+23: tmp = (b * i) * t elif i <= 6.8e-38: tmp = (z * x) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-j) * i) * y) tmp = 0.0 if (i <= -4e+197) tmp = t_1; elseif (i <= -1.6e+23) tmp = Float64(Float64(b * i) * t); elseif (i <= 6.8e-38) tmp = Float64(Float64(z * x) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-j * i) * y; tmp = 0.0; if (i <= -4e+197) tmp = t_1; elseif (i <= -1.6e+23) tmp = (b * i) * t; elseif (i <= 6.8e-38) tmp = (z * x) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-j) * i), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[i, -4e+197], t$95$1, If[LessEqual[i, -1.6e+23], N[(N[(b * i), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[i, 6.8e-38], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-j\right) \cdot i\right) \cdot y\\
\mathbf{if}\;i \leq -4 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -1.6 \cdot 10^{+23}:\\
\;\;\;\;\left(b \cdot i\right) \cdot t\\
\mathbf{elif}\;i \leq 6.8 \cdot 10^{-38}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if i < -3.9999999999999998e197 or 6.8000000000000004e-38 < i Initial program 72.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1
Applied rewrites39.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.9
Applied rewrites21.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6421.9
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6421.9
Applied rewrites21.9%
if -3.9999999999999998e197 < i < -1.6e23Initial program 72.8%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.0
Applied rewrites39.0%
Taylor expanded in x around 0
lower-*.f6422.6
Applied rewrites22.6%
if -1.6e23 < i < 6.8000000000000004e-38Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -3.3e+78)
(* c (* a j))
(if (<= j -4.2e-277)
(* x (* y z))
(if (<= j 1.55e-236)
(* b (* i t))
(if (<= j 5.3e+45) (* (* z x) y) (* a (* c j)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -3.3e+78) {
tmp = c * (a * j);
} else if (j <= -4.2e-277) {
tmp = x * (y * z);
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 5.3e+45) {
tmp = (z * x) * y;
} else {
tmp = a * (c * j);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-3.3d+78)) then
tmp = c * (a * j)
else if (j <= (-4.2d-277)) then
tmp = x * (y * z)
else if (j <= 1.55d-236) then
tmp = b * (i * t)
else if (j <= 5.3d+45) then
tmp = (z * x) * y
else
tmp = a * (c * j)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -3.3e+78) {
tmp = c * (a * j);
} else if (j <= -4.2e-277) {
tmp = x * (y * z);
} else if (j <= 1.55e-236) {
tmp = b * (i * t);
} else if (j <= 5.3e+45) {
tmp = (z * x) * y;
} else {
tmp = a * (c * j);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -3.3e+78: tmp = c * (a * j) elif j <= -4.2e-277: tmp = x * (y * z) elif j <= 1.55e-236: tmp = b * (i * t) elif j <= 5.3e+45: tmp = (z * x) * y else: tmp = a * (c * j) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -3.3e+78) tmp = Float64(c * Float64(a * j)); elseif (j <= -4.2e-277) tmp = Float64(x * Float64(y * z)); elseif (j <= 1.55e-236) tmp = Float64(b * Float64(i * t)); elseif (j <= 5.3e+45) tmp = Float64(Float64(z * x) * y); else tmp = Float64(a * Float64(c * j)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -3.3e+78) tmp = c * (a * j); elseif (j <= -4.2e-277) tmp = x * (y * z); elseif (j <= 1.55e-236) tmp = b * (i * t); elseif (j <= 5.3e+45) tmp = (z * x) * y; else tmp = a * (c * j); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -3.3e+78], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, -4.2e-277], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.55e-236], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 5.3e+45], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -3.3 \cdot 10^{+78}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{elif}\;j \leq -4.2 \cdot 10^{-277}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-236}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;j \leq 5.3 \cdot 10^{+45}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\end{array}
\end{array}
if j < -3.3e78Initial program 72.8%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around 0
lower-*.f6422.6
Applied rewrites22.6%
if -3.3e78 < j < -4.1999999999999999e-277Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
if -4.1999999999999999e-277 < j < 1.5499999999999999e-236Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around 0
lower-*.f6422.2
Applied rewrites22.2%
if 1.5499999999999999e-236 < j < 5.29999999999999991e45Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
if 5.29999999999999991e45 < j Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in c 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 (* b (* i t))))
(if (<= z -1.3e-36)
(* x (* y z))
(if (<= z -3.2e-260)
t_1
(if (<= z 7.8e-294)
(* a (* c j))
(if (<= z 2.8e+120) t_1 (* (* z x) y)))))))
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 (z <= -1.3e-36) {
tmp = x * (y * z);
} else if (z <= -3.2e-260) {
tmp = t_1;
} else if (z <= 7.8e-294) {
tmp = a * (c * j);
} else if (z <= 2.8e+120) {
tmp = t_1;
} else {
tmp = (z * x) * y;
}
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 (z <= (-1.3d-36)) then
tmp = x * (y * z)
else if (z <= (-3.2d-260)) then
tmp = t_1
else if (z <= 7.8d-294) then
tmp = a * (c * j)
else if (z <= 2.8d+120) then
tmp = t_1
else
tmp = (z * x) * y
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 (z <= -1.3e-36) {
tmp = x * (y * z);
} else if (z <= -3.2e-260) {
tmp = t_1;
} else if (z <= 7.8e-294) {
tmp = a * (c * j);
} else if (z <= 2.8e+120) {
tmp = t_1;
} else {
tmp = (z * x) * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * (i * t) tmp = 0 if z <= -1.3e-36: tmp = x * (y * z) elif z <= -3.2e-260: tmp = t_1 elif z <= 7.8e-294: tmp = a * (c * j) elif z <= 2.8e+120: tmp = t_1 else: tmp = (z * x) * y return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(i * t)) tmp = 0.0 if (z <= -1.3e-36) tmp = Float64(x * Float64(y * z)); elseif (z <= -3.2e-260) tmp = t_1; elseif (z <= 7.8e-294) tmp = Float64(a * Float64(c * j)); elseif (z <= 2.8e+120) tmp = t_1; else tmp = Float64(Float64(z * x) * y); 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 (z <= -1.3e-36) tmp = x * (y * z); elseif (z <= -3.2e-260) tmp = t_1; elseif (z <= 7.8e-294) tmp = a * (c * j); elseif (z <= 2.8e+120) tmp = t_1; else tmp = (z * x) * y; 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[z, -1.3e-36], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.2e-260], t$95$1, If[LessEqual[z, 7.8e-294], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e+120], t$95$1, N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t\right)\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{-36}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-260}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{-294}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\end{array}
\end{array}
if z < -1.3e-36Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
if -1.3e-36 < z < -3.19999999999999995e-260 or 7.8000000000000005e-294 < z < 2.8000000000000001e120Initial program 72.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in z around 0
lower-*.f6422.2
Applied rewrites22.2%
if -3.19999999999999995e-260 < z < 7.8000000000000005e-294Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
if 2.8000000000000001e120 < z Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.5
Applied rewrites22.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* a (* c j)))) (if (<= j -3.3e+78) t_1 (if (<= j 3.5e+44) (* x (* y z)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * (c * j);
double tmp;
if (j <= -3.3e+78) {
tmp = t_1;
} else if (j <= 3.5e+44) {
tmp = x * (y * 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 = a * (c * j)
if (j <= (-3.3d+78)) then
tmp = t_1
else if (j <= 3.5d+44) then
tmp = x * (y * 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 = a * (c * j);
double tmp;
if (j <= -3.3e+78) {
tmp = t_1;
} else if (j <= 3.5e+44) {
tmp = x * (y * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * (c * j) tmp = 0 if j <= -3.3e+78: tmp = t_1 elif j <= 3.5e+44: tmp = x * (y * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(c * j)) tmp = 0.0 if (j <= -3.3e+78) tmp = t_1; elseif (j <= 3.5e+44) tmp = Float64(x * Float64(y * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = a * (c * j); tmp = 0.0; if (j <= -3.3e+78) tmp = t_1; elseif (j <= 3.5e+44) tmp = x * (y * 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[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -3.3e+78], t$95$1, If[LessEqual[j, 3.5e+44], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(c \cdot j\right)\\
\mathbf{if}\;j \leq -3.3 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{+44}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -3.3e78 or 3.4999999999999999e44 < j Initial program 72.8%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.9
Applied rewrites60.9%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f6422.5
Applied rewrites22.5%
if -3.3e78 < j < 3.4999999999999999e44Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= x -1e-141) (* (* y x) z) (* 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 (x <= -1e-141) {
tmp = (y * x) * z;
} 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 (x <= (-1d-141)) then
tmp = (y * x) * z
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 (x <= -1e-141) {
tmp = (y * x) * z;
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -1e-141: tmp = (y * x) * z else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -1e-141) tmp = Float64(Float64(y * x) * z); 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 (x <= -1e-141) tmp = (y * x) * z; else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -1e-141], N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-141}:\\
\;\;\;\;\left(y \cdot x\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
\end{array}
if x < -1e-141Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.6
Applied rewrites22.6%
if -1e-141 < x Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
(FPCore (x y z t a b c i j) :precision binary64 (* x (* y z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return x * (y * z);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = x * (y * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return x * (y * z);
}
def code(x, y, z, t, a, b, c, i, j): return x * (y * z)
function code(x, y, z, t, a, b, c, i, j) return Float64(x * Float64(y * z)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = x * (y * z); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(y \cdot z\right)
\end{array}
Initial program 72.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
herbie shell --seed 2025162
(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)))))