
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* c z) (* t i)))) (t_2 (* j (- (* c a) (* y i)))))
(if (<= (+ (- (* x (- (* y z) (* t a))) t_1) t_2) INFINITY)
(+ (- (* x (fma z y (* (- t) a))) t_1) t_2)
(fma -1.0 (* i (* j y)) (* x (- (* y z) (* a t)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((c * z) - (t * i));
double t_2 = j * ((c * a) - (y * i));
double tmp;
if ((((x * ((y * z) - (t * a))) - t_1) + t_2) <= ((double) INFINITY)) {
tmp = ((x * fma(z, y, (-t * a))) - t_1) + t_2;
} else {
tmp = fma(-1.0, (i * (j * y)), (x * ((y * z) - (a * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(c * z) - Float64(t * i))) t_2 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - t_1) + t_2) <= Inf) tmp = Float64(Float64(Float64(x * fma(z, y, Float64(Float64(-t) * a))) - t_1) + t_2); else tmp = fma(-1.0, Float64(i * Float64(j * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], Infinity], N[(N[(N[(x * N[(z * y + N[((-t) * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(c \cdot z - t \cdot i\right)\\
t_2 := j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - t\_1\right) + t\_2 \leq \infty:\\
\;\;\;\;\left(x \cdot \mathsf{fma}\left(z, y, \left(-t\right) \cdot a\right) - t\_1\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, i \cdot \left(j \cdot y\right), x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 73.4%
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
fp-cancel-sub-sign-invN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-rgt-neg-inN/A
remove-double-negN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6473.6
Applied rewrites73.6%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6459.0
Applied rewrites59.0%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
(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
(fma -1.0 (* i (* j y)) (* x (- (* y z) (* a t)))))))
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 = fma(-1.0, (i * (j * y)), (x * ((y * z) - (a * t))));
}
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 = fma(-1.0, Float64(i * Float64(j * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); 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[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $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}:\\
\;\;\;\;\mathsf{fma}\left(-1, i \cdot \left(j \cdot y\right), x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 73.4%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6459.0
Applied rewrites59.0%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
(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 (* c z))) t_2)
(fma -1.0 (* i (* j y)) (* x (- (* y z) (* a t)))))))
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 * (c * z))) + t_2;
} else {
tmp = fma(-1.0, (i * (j * y)), (x * ((y * z) - (a * t))));
}
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 * Float64(c * z))) + t_2); else tmp = fma(-1.0, Float64(i * Float64(j * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); 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[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $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 \left(c \cdot z\right)\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, i \cdot \left(j \cdot y\right), x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 73.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6466.6
Applied rewrites66.6%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in j around inf
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6459.0
Applied rewrites59.0%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -2.25e+109)
t_1
(if (<= b 8.2e+173)
(fma j (- (* a c) (* i y)) (* x (- (* y z) (* a t))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((i * t) - (c * z));
double tmp;
if (b <= -2.25e+109) {
tmp = t_1;
} else if (b <= 8.2e+173) {
tmp = fma(j, ((a * c) - (i * y)), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -2.25e+109) tmp = t_1; elseif (b <= 8.2e+173) tmp = fma(j, Float64(Float64(a * c) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.25e+109], t$95$1, If[LessEqual[b, 8.2e+173], 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 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -2.25 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 8.2 \cdot 10^{+173}:\\
\;\;\;\;\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 b < -2.2499999999999998e109 or 8.19999999999999951e173 < b Initial program 73.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -2.2499999999999998e109 < b < 8.19999999999999951e173Initial program 73.4%
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.5
Applied rewrites60.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b i) (* x a)) t)))
(if (<= t -3.4e+108)
t_1
(if (<= t -5.4e-77)
(* z (- (* x y) (* b c)))
(if (<= t 9.6e-242)
(+ (* x (* y z)) (* j (- (* c a) (* y i))))
(if (<= t 2e+37)
(fma -1.0 (* a (* t x)) (* 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 * i) - (x * a)) * t;
double tmp;
if (t <= -3.4e+108) {
tmp = t_1;
} else if (t <= -5.4e-77) {
tmp = z * ((x * y) - (b * c));
} else if (t <= 9.6e-242) {
tmp = (x * (y * z)) + (j * ((c * a) - (y * i)));
} else if (t <= 2e+37) {
tmp = fma(-1.0, (a * (t * x)), (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 * i) - Float64(x * a)) * t) tmp = 0.0 if (t <= -3.4e+108) tmp = t_1; elseif (t <= -5.4e-77) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (t <= 9.6e-242) tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (t <= 2e+37) tmp = fma(-1.0, Float64(a * Float64(t * x)), Float64(j * Float64(Float64(a * c) - Float64(i * y)))); 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 * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3.4e+108], t$95$1, If[LessEqual[t, -5.4e-77], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 9.6e-242], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+37], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot i - x \cdot a\right) \cdot t\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5.4 \cdot 10^{-77}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;t \leq 9.6 \cdot 10^{-242}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(-1, a \cdot \left(t \cdot x\right), j \cdot \left(a \cdot c - i \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.39999999999999996e108 or 1.99999999999999991e37 < t Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
if -3.39999999999999996e108 < t < -5.4000000000000001e-77Initial program 73.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
if -5.4000000000000001e-77 < t < 9.6000000000000004e-242Initial program 73.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6448.9
Applied rewrites48.9%
if 9.6000000000000004e-242 < t < 1.99999999999999991e37Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b i) (* x a)) t)))
(if (<= t -3.5e+127)
t_1
(if (<= t 1.12e-174)
(+ (* -1.0 (* b (* c z))) (* j (- (* c a) (* y i))))
(if (<= t 2e+37)
(fma -1.0 (* a (* t x)) (* 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 * i) - (x * a)) * t;
double tmp;
if (t <= -3.5e+127) {
tmp = t_1;
} else if (t <= 1.12e-174) {
tmp = (-1.0 * (b * (c * z))) + (j * ((c * a) - (y * i)));
} else if (t <= 2e+37) {
tmp = fma(-1.0, (a * (t * x)), (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 * i) - Float64(x * a)) * t) tmp = 0.0 if (t <= -3.5e+127) tmp = t_1; elseif (t <= 1.12e-174) tmp = Float64(Float64(-1.0 * Float64(b * Float64(c * z))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (t <= 2e+37) tmp = fma(-1.0, Float64(a * Float64(t * x)), Float64(j * Float64(Float64(a * c) - Float64(i * y)))); 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 * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3.5e+127], t$95$1, If[LessEqual[t, 1.12e-174], N[(N[(-1.0 * N[(b * N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2e+37], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot i - x \cdot a\right) \cdot t\\
\mathbf{if}\;t \leq -3.5 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-174}:\\
\;\;\;\;-1 \cdot \left(b \cdot \left(c \cdot z\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{fma}\left(-1, a \cdot \left(t \cdot x\right), j \cdot \left(a \cdot c - i \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.49999999999999978e127 or 1.99999999999999991e37 < t Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
if -3.49999999999999978e127 < t < 1.12e-174Initial program 73.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6449.3
Applied rewrites49.3%
if 1.12e-174 < t < 1.99999999999999991e37Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b i) (* x a)) t)))
(if (<= t -3.4e+108)
t_1
(if (<= t -5.4e-77)
(* z (- (* x y) (* b c)))
(if (<= t 1.95e+37) (+ (* x (* y z)) (* j (- (* c a) (* y i)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * i) - (x * a)) * t;
double tmp;
if (t <= -3.4e+108) {
tmp = t_1;
} else if (t <= -5.4e-77) {
tmp = z * ((x * y) - (b * c));
} else if (t <= 1.95e+37) {
tmp = (x * (y * z)) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((b * i) - (x * a)) * t
if (t <= (-3.4d+108)) then
tmp = t_1
else if (t <= (-5.4d-77)) then
tmp = z * ((x * y) - (b * c))
else if (t <= 1.95d+37) then
tmp = (x * (y * z)) + (j * ((c * a) - (y * i)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * i) - (x * a)) * t;
double tmp;
if (t <= -3.4e+108) {
tmp = t_1;
} else if (t <= -5.4e-77) {
tmp = z * ((x * y) - (b * c));
} else if (t <= 1.95e+37) {
tmp = (x * (y * z)) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((b * i) - (x * a)) * t tmp = 0 if t <= -3.4e+108: tmp = t_1 elif t <= -5.4e-77: tmp = z * ((x * y) - (b * c)) elif t <= 1.95e+37: tmp = (x * (y * z)) + (j * ((c * a) - (y * i))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(b * i) - Float64(x * a)) * t) tmp = 0.0 if (t <= -3.4e+108) tmp = t_1; elseif (t <= -5.4e-77) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (t <= 1.95e+37) tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((b * i) - (x * a)) * t; tmp = 0.0; if (t <= -3.4e+108) tmp = t_1; elseif (t <= -5.4e-77) tmp = z * ((x * y) - (b * c)); elseif (t <= 1.95e+37) tmp = (x * (y * z)) + (j * ((c * a) - (y * i))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(b * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3.4e+108], t$95$1, If[LessEqual[t, -5.4e-77], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+37], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot i - x \cdot a\right) \cdot t\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -5.4 \cdot 10^{-77}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+37}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.39999999999999996e108 or 1.9499999999999999e37 < t Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
if -3.39999999999999996e108 < t < -5.4000000000000001e-77Initial program 73.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
if -5.4000000000000001e-77 < t < 1.9499999999999999e37Initial program 73.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6448.9
Applied rewrites48.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -3.2e+88)
t_1
(if (<= b -1.2e-28)
(* (- (* b i) (* x a)) t)
(if (<= b 2.95e+171) (fma j (* a c) (* x (- (* y z) (* a t)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((i * t) - (c * z));
double tmp;
if (b <= -3.2e+88) {
tmp = t_1;
} else if (b <= -1.2e-28) {
tmp = ((b * i) - (x * a)) * t;
} else if (b <= 2.95e+171) {
tmp = fma(j, (a * c), (x * ((y * z) - (a * t))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -3.2e+88) tmp = t_1; elseif (b <= -1.2e-28) tmp = Float64(Float64(Float64(b * i) - Float64(x * a)) * t); elseif (b <= 2.95e+171) tmp = fma(j, Float64(a * c), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.2e+88], t$95$1, If[LessEqual[b, -1.2e-28], N[(N[(N[(b * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, 2.95e+171], N[(j * N[(a * c), $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 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -3.2 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.2 \cdot 10^{-28}:\\
\;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t\\
\mathbf{elif}\;b \leq 2.95 \cdot 10^{+171}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.1999999999999999e88 or 2.95000000000000018e171 < b Initial program 73.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -3.1999999999999999e88 < b < -1.2000000000000001e-28Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
if -1.2000000000000001e-28 < b < 2.95000000000000018e171Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in y around 0
lower-*.f6450.5
Applied rewrites50.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b i) (* x a)) t)))
(if (<= t -3.4e+108)
t_1
(if (<= t -3e-78)
(* z (- (* x y) (* b c)))
(if (<= t 1.95e+37) (* 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 * i) - (x * a)) * t;
double tmp;
if (t <= -3.4e+108) {
tmp = t_1;
} else if (t <= -3e-78) {
tmp = z * ((x * y) - (b * c));
} else if (t <= 1.95e+37) {
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 * i) - (x * a)) * t
if (t <= (-3.4d+108)) then
tmp = t_1
else if (t <= (-3d-78)) then
tmp = z * ((x * y) - (b * c))
else if (t <= 1.95d+37) 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 * i) - (x * a)) * t;
double tmp;
if (t <= -3.4e+108) {
tmp = t_1;
} else if (t <= -3e-78) {
tmp = z * ((x * y) - (b * c));
} else if (t <= 1.95e+37) {
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 * i) - (x * a)) * t tmp = 0 if t <= -3.4e+108: tmp = t_1 elif t <= -3e-78: tmp = z * ((x * y) - (b * c)) elif t <= 1.95e+37: 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 * i) - Float64(x * a)) * t) tmp = 0.0 if (t <= -3.4e+108) tmp = t_1; elseif (t <= -3e-78) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (t <= 1.95e+37) 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 * i) - (x * a)) * t; tmp = 0.0; if (t <= -3.4e+108) tmp = t_1; elseif (t <= -3e-78) tmp = z * ((x * y) - (b * c)); elseif (t <= 1.95e+37) 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 * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3.4e+108], t$95$1, If[LessEqual[t, -3e-78], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+37], 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 i - x \cdot a\right) \cdot t\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -3 \cdot 10^{-78}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+37}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.39999999999999996e108 or 1.9499999999999999e37 < t Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
if -3.39999999999999996e108 < t < -2.99999999999999988e-78Initial program 73.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
if -2.99999999999999988e-78 < t < 1.9499999999999999e37Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* a c) (* i y)))))
(if (<= j -4.45e+136)
t_1
(if (<= j 2e-202)
(* x (- (* y z) (* a t)))
(if (<= j 3e-62) (* 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 <= -4.45e+136) {
tmp = t_1;
} else if (j <= 2e-202) {
tmp = x * ((y * z) - (a * t));
} else if (j <= 3e-62) {
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 <= (-4.45d+136)) then
tmp = t_1
else if (j <= 2d-202) then
tmp = x * ((y * z) - (a * t))
else if (j <= 3d-62) 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 <= -4.45e+136) {
tmp = t_1;
} else if (j <= 2e-202) {
tmp = x * ((y * z) - (a * t));
} else if (j <= 3e-62) {
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 <= -4.45e+136: tmp = t_1 elif j <= 2e-202: tmp = x * ((y * z) - (a * t)) elif j <= 3e-62: 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 <= -4.45e+136) tmp = t_1; elseif (j <= 2e-202) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); elseif (j <= 3e-62) 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 <= -4.45e+136) tmp = t_1; elseif (j <= 2e-202) tmp = x * ((y * z) - (a * t)); elseif (j <= 3e-62) 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, -4.45e+136], t$95$1, If[LessEqual[j, 2e-202], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3e-62], 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 -4.45 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 2 \cdot 10^{-202}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{elif}\;j \leq 3 \cdot 10^{-62}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -4.44999999999999992e136 or 3.0000000000000001e-62 < j Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
if -4.44999999999999992e136 < j < 2.0000000000000001e-202Initial program 73.4%
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.5
Applied rewrites60.5%
Applied rewrites59.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
if 2.0000000000000001e-202 < j < 3.0000000000000001e-62Initial program 73.4%
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 -4.45e+136)
t_1
(if (<= j 4.5e-60) (* 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 = j * ((a * c) - (i * y));
double tmp;
if (j <= -4.45e+136) {
tmp = t_1;
} else if (j <= 4.5e-60) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = j * ((a * c) - (i * y))
if (j <= (-4.45d+136)) then
tmp = t_1
else if (j <= 4.5d-60) then
tmp = x * ((y * z) - (a * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((a * c) - (i * y));
double tmp;
if (j <= -4.45e+136) {
tmp = t_1;
} else if (j <= 4.5e-60) {
tmp = x * ((y * z) - (a * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((a * c) - (i * y)) tmp = 0 if j <= -4.45e+136: tmp = t_1 elif j <= 4.5e-60: tmp = x * ((y * z) - (a * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(a * c) - Float64(i * y))) tmp = 0.0 if (j <= -4.45e+136) tmp = t_1; elseif (j <= 4.5e-60) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((a * c) - (i * y)); tmp = 0.0; if (j <= -4.45e+136) tmp = t_1; elseif (j <= 4.5e-60) tmp = x * ((y * z) - (a * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -4.45e+136], t$95$1, If[LessEqual[j, 4.5e-60], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $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 -4.45 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 4.5 \cdot 10^{-60}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -4.44999999999999992e136 or 4.50000000000000001e-60 < j Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
if -4.44999999999999992e136 < j < 4.50000000000000001e-60Initial program 73.4%
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.5
Applied rewrites60.5%
Applied rewrites59.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.7
Applied rewrites39.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -2.25e+109)
t_1
(if (<= b -6.8e-223)
(* j (- (* a c) (* i y)))
(if (<= b 1.15e-130)
(* y (- (* z x) (* j i)))
(if (<= b 3.8e+151) (* c (- (* a j) (* b z))) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((i * t) - (c * z));
double tmp;
if (b <= -2.25e+109) {
tmp = t_1;
} else if (b <= -6.8e-223) {
tmp = j * ((a * c) - (i * y));
} else if (b <= 1.15e-130) {
tmp = y * ((z * x) - (j * i));
} else if (b <= 3.8e+151) {
tmp = c * ((a * j) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = b * ((i * t) - (c * z))
if (b <= (-2.25d+109)) then
tmp = t_1
else if (b <= (-6.8d-223)) then
tmp = j * ((a * c) - (i * y))
else if (b <= 1.15d-130) then
tmp = y * ((z * x) - (j * i))
else if (b <= 3.8d+151) then
tmp = c * ((a * j) - (b * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * ((i * t) - (c * z));
double tmp;
if (b <= -2.25e+109) {
tmp = t_1;
} else if (b <= -6.8e-223) {
tmp = j * ((a * c) - (i * y));
} else if (b <= 1.15e-130) {
tmp = y * ((z * x) - (j * i));
} else if (b <= 3.8e+151) {
tmp = c * ((a * j) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * ((i * t) - (c * z)) tmp = 0 if b <= -2.25e+109: tmp = t_1 elif b <= -6.8e-223: tmp = j * ((a * c) - (i * y)) elif b <= 1.15e-130: tmp = y * ((z * x) - (j * i)) elif b <= 3.8e+151: tmp = c * ((a * j) - (b * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(Float64(i * t) - Float64(c * z))) tmp = 0.0 if (b <= -2.25e+109) tmp = t_1; elseif (b <= -6.8e-223) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); elseif (b <= 1.15e-130) tmp = Float64(y * Float64(Float64(z * x) - Float64(j * i))); elseif (b <= 3.8e+151) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * ((i * t) - (c * z)); tmp = 0.0; if (b <= -2.25e+109) tmp = t_1; elseif (b <= -6.8e-223) tmp = j * ((a * c) - (i * y)); elseif (b <= 1.15e-130) tmp = y * ((z * x) - (j * i)); elseif (b <= 3.8e+151) tmp = c * ((a * j) - (b * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.25e+109], t$95$1, If[LessEqual[b, -6.8e-223], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e-130], N[(y * N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.8e+151], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -2.25 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -6.8 \cdot 10^{-223}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-130}:\\
\;\;\;\;y \cdot \left(z \cdot x - j \cdot i\right)\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+151}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.2499999999999998e109 or 3.8e151 < b Initial program 73.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
if -2.2499999999999998e109 < b < -6.7999999999999996e-223Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
if -6.7999999999999996e-223 < b < 1.1500000000000001e-130Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if 1.1500000000000001e-130 < b < 3.8e151Initial program 73.4%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.7
Applied rewrites38.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* a c) (* i y)))))
(if (<= j -4.15e+136)
t_1
(if (<= j 1.55e-30) (* 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 <= -4.15e+136) {
tmp = t_1;
} else if (j <= 1.55e-30) {
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 <= (-4.15d+136)) then
tmp = t_1
else if (j <= 1.55d-30) 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 <= -4.15e+136) {
tmp = t_1;
} else if (j <= 1.55e-30) {
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 <= -4.15e+136: tmp = t_1 elif j <= 1.55e-30: 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 <= -4.15e+136) tmp = t_1; elseif (j <= 1.55e-30) 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 <= -4.15e+136) tmp = t_1; elseif (j <= 1.55e-30) 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, -4.15e+136], t$95$1, If[LessEqual[j, 1.55e-30], 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 -4.15 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.55 \cdot 10^{-30}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -4.14999999999999979e136 or 1.54999999999999995e-30 < j Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
if -4.14999999999999979e136 < j < 1.54999999999999995e-30Initial program 73.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= a -2.5e-118) (* j (- (* a c) (* i y))) (if (<= a 7.8e+59) (* y (- (* z x) (* j i))) (* (* -1.0 (* a x)) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -2.5e-118) {
tmp = j * ((a * c) - (i * y));
} else if (a <= 7.8e+59) {
tmp = y * ((z * x) - (j * i));
} else {
tmp = (-1.0 * (a * x)) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (a <= (-2.5d-118)) then
tmp = j * ((a * c) - (i * y))
else if (a <= 7.8d+59) then
tmp = y * ((z * x) - (j * i))
else
tmp = ((-1.0d0) * (a * x)) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -2.5e-118) {
tmp = j * ((a * c) - (i * y));
} else if (a <= 7.8e+59) {
tmp = y * ((z * x) - (j * i));
} else {
tmp = (-1.0 * (a * x)) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if a <= -2.5e-118: tmp = j * ((a * c) - (i * y)) elif a <= 7.8e+59: tmp = y * ((z * x) - (j * i)) else: tmp = (-1.0 * (a * x)) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -2.5e-118) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); elseif (a <= 7.8e+59) tmp = Float64(y * Float64(Float64(z * x) - Float64(j * i))); else tmp = Float64(Float64(-1.0 * Float64(a * x)) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (a <= -2.5e-118) tmp = j * ((a * c) - (i * y)); elseif (a <= 7.8e+59) tmp = y * ((z * x) - (j * i)); else tmp = (-1.0 * (a * x)) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -2.5e-118], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.8e+59], N[(y * N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{-118}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{elif}\;a \leq 7.8 \cdot 10^{+59}:\\
\;\;\;\;y \cdot \left(z \cdot x - j \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-1 \cdot \left(a \cdot x\right)\right) \cdot t\\
\end{array}
\end{array}
if a < -2.50000000000000007e-118Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
if -2.50000000000000007e-118 < a < 7.80000000000000043e59Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6434.6
Applied rewrites34.6%
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
distribute-rgt-out--N/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.1
Applied rewrites39.1%
if 7.80000000000000043e59 < a Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.8
Applied rewrites22.8%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* j (- (* a c) (* i y))))) (if (<= j -6.3e+109) t_1 (if (<= j 1.8e-62) (* (* -1.0 (* a x)) t) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((a * c) - (i * y));
double tmp;
if (j <= -6.3e+109) {
tmp = t_1;
} else if (j <= 1.8e-62) {
tmp = (-1.0 * (a * x)) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = j * ((a * c) - (i * y))
if (j <= (-6.3d+109)) then
tmp = t_1
else if (j <= 1.8d-62) then
tmp = ((-1.0d0) * (a * x)) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * ((a * c) - (i * y));
double tmp;
if (j <= -6.3e+109) {
tmp = t_1;
} else if (j <= 1.8e-62) {
tmp = (-1.0 * (a * x)) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((a * c) - (i * y)) tmp = 0 if j <= -6.3e+109: tmp = t_1 elif j <= 1.8e-62: tmp = (-1.0 * (a * x)) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(a * c) - Float64(i * y))) tmp = 0.0 if (j <= -6.3e+109) tmp = t_1; elseif (j <= 1.8e-62) tmp = Float64(Float64(-1.0 * Float64(a * x)) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * ((a * c) - (i * y)); tmp = 0.0; if (j <= -6.3e+109) tmp = t_1; elseif (j <= 1.8e-62) tmp = (-1.0 * (a * x)) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -6.3e+109], t$95$1, If[LessEqual[j, 1.8e-62], N[(N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $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 -6.3 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.8 \cdot 10^{-62}:\\
\;\;\;\;\left(-1 \cdot \left(a \cdot x\right)\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -6.29999999999999961e109 or 1.8e-62 < j Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.1
Applied rewrites38.1%
if -6.29999999999999961e109 < j < 1.8e-62Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.8
Applied rewrites22.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- x) t) a)))
(if (<= t -7e+107)
t_1
(if (<= t -1.55e-91)
(* (* (- z) c) b)
(if (<= t 1e-298)
(* a (* c j))
(if (<= t 1.95e+37)
(* -1.0 (* i (* j y)))
(if (<= t 3.8e+154) (* (* b i) t) t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-x * t) * a;
double tmp;
if (t <= -7e+107) {
tmp = t_1;
} else if (t <= -1.55e-91) {
tmp = (-z * c) * b;
} else if (t <= 1e-298) {
tmp = a * (c * j);
} else if (t <= 1.95e+37) {
tmp = -1.0 * (i * (j * y));
} else if (t <= 3.8e+154) {
tmp = (b * i) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (-x * t) * a
if (t <= (-7d+107)) then
tmp = t_1
else if (t <= (-1.55d-91)) then
tmp = (-z * c) * b
else if (t <= 1d-298) then
tmp = a * (c * j)
else if (t <= 1.95d+37) then
tmp = (-1.0d0) * (i * (j * y))
else if (t <= 3.8d+154) then
tmp = (b * i) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-x * t) * a;
double tmp;
if (t <= -7e+107) {
tmp = t_1;
} else if (t <= -1.55e-91) {
tmp = (-z * c) * b;
} else if (t <= 1e-298) {
tmp = a * (c * j);
} else if (t <= 1.95e+37) {
tmp = -1.0 * (i * (j * y));
} else if (t <= 3.8e+154) {
tmp = (b * i) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-x * t) * a tmp = 0 if t <= -7e+107: tmp = t_1 elif t <= -1.55e-91: tmp = (-z * c) * b elif t <= 1e-298: tmp = a * (c * j) elif t <= 1.95e+37: tmp = -1.0 * (i * (j * y)) elif t <= 3.8e+154: tmp = (b * i) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-x) * t) * a) tmp = 0.0 if (t <= -7e+107) tmp = t_1; elseif (t <= -1.55e-91) tmp = Float64(Float64(Float64(-z) * c) * b); elseif (t <= 1e-298) tmp = Float64(a * Float64(c * j)); elseif (t <= 1.95e+37) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); elseif (t <= 3.8e+154) tmp = Float64(Float64(b * i) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-x * t) * a; tmp = 0.0; if (t <= -7e+107) tmp = t_1; elseif (t <= -1.55e-91) tmp = (-z * c) * b; elseif (t <= 1e-298) tmp = a * (c * j); elseif (t <= 1.95e+37) tmp = -1.0 * (i * (j * y)); elseif (t <= 3.8e+154) tmp = (b * i) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-x) * t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, -7e+107], t$95$1, If[LessEqual[t, -1.55e-91], N[(N[((-z) * c), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[t, 1e-298], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.95e+37], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+154], N[(N[(b * i), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-x\right) \cdot t\right) \cdot a\\
\mathbf{if}\;t \leq -7 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.55 \cdot 10^{-91}:\\
\;\;\;\;\left(\left(-z\right) \cdot c\right) \cdot b\\
\mathbf{elif}\;t \leq 10^{-298}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+37}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+154}:\\
\;\;\;\;\left(b \cdot i\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -6.9999999999999995e107 or 3.7999999999999998e154 < t Initial program 73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.9
Applied rewrites22.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.9
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lower-*.f6422.9
Applied rewrites22.9%
if -6.9999999999999995e107 < t < -1.5499999999999999e-91Initial program 73.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.7
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6422.7
Applied rewrites22.7%
if -1.5499999999999999e-91 < t < 9.99999999999999912e-299Initial program 73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around 0
lower-*.f6422.1
Applied rewrites22.1%
if 9.99999999999999912e-299 < t < 1.9499999999999999e37Initial program 73.4%
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.5
Applied rewrites60.5%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.0
Applied rewrites22.0%
if 1.9499999999999999e37 < t < 3.7999999999999998e154Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f6421.8
Applied rewrites21.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* a (* c j))) (t_2 (* (* (- z) c) b)))
(if (<= b -1.75e+204)
t_2
(if (<= b -1.45e+128)
(* (* b i) t)
(if (<= b -7.8e+92)
t_1
(if (<= b 1.4e-179)
(* (* (- x) t) a)
(if (<= b 5.2e+151) 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 = a * (c * j);
double t_2 = (-z * c) * b;
double tmp;
if (b <= -1.75e+204) {
tmp = t_2;
} else if (b <= -1.45e+128) {
tmp = (b * i) * t;
} else if (b <= -7.8e+92) {
tmp = t_1;
} else if (b <= 1.4e-179) {
tmp = (-x * t) * a;
} else if (b <= 5.2e+151) {
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 = a * (c * j)
t_2 = (-z * c) * b
if (b <= (-1.75d+204)) then
tmp = t_2
else if (b <= (-1.45d+128)) then
tmp = (b * i) * t
else if (b <= (-7.8d+92)) then
tmp = t_1
else if (b <= 1.4d-179) then
tmp = (-x * t) * a
else if (b <= 5.2d+151) 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 = a * (c * j);
double t_2 = (-z * c) * b;
double tmp;
if (b <= -1.75e+204) {
tmp = t_2;
} else if (b <= -1.45e+128) {
tmp = (b * i) * t;
} else if (b <= -7.8e+92) {
tmp = t_1;
} else if (b <= 1.4e-179) {
tmp = (-x * t) * a;
} else if (b <= 5.2e+151) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = a * (c * j) t_2 = (-z * c) * b tmp = 0 if b <= -1.75e+204: tmp = t_2 elif b <= -1.45e+128: tmp = (b * i) * t elif b <= -7.8e+92: tmp = t_1 elif b <= 1.4e-179: tmp = (-x * t) * a elif b <= 5.2e+151: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * Float64(c * j)) t_2 = Float64(Float64(Float64(-z) * c) * b) tmp = 0.0 if (b <= -1.75e+204) tmp = t_2; elseif (b <= -1.45e+128) tmp = Float64(Float64(b * i) * t); elseif (b <= -7.8e+92) tmp = t_1; elseif (b <= 1.4e-179) tmp = Float64(Float64(Float64(-x) * t) * a); elseif (b <= 5.2e+151) 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 = a * (c * j); t_2 = (-z * c) * b; tmp = 0.0; if (b <= -1.75e+204) tmp = t_2; elseif (b <= -1.45e+128) tmp = (b * i) * t; elseif (b <= -7.8e+92) tmp = t_1; elseif (b <= 1.4e-179) tmp = (-x * t) * a; elseif (b <= 5.2e+151) 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[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-z) * c), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.75e+204], t$95$2, If[LessEqual[b, -1.45e+128], N[(N[(b * i), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[b, -7.8e+92], t$95$1, If[LessEqual[b, 1.4e-179], N[(N[((-x) * t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[b, 5.2e+151], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(c \cdot j\right)\\
t_2 := \left(\left(-z\right) \cdot c\right) \cdot b\\
\mathbf{if}\;b \leq -1.75 \cdot 10^{+204}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -1.45 \cdot 10^{+128}:\\
\;\;\;\;\left(b \cdot i\right) \cdot t\\
\mathbf{elif}\;b \leq -7.8 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.4 \cdot 10^{-179}:\\
\;\;\;\;\left(\left(-x\right) \cdot t\right) \cdot a\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.74999999999999995e204 or 5.20000000000000026e151 < b Initial program 73.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.7
Applied rewrites22.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.7
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6422.7
Applied rewrites22.7%
if -1.74999999999999995e204 < b < -1.45e128Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f6421.8
Applied rewrites21.8%
if -1.45e128 < b < -7.80000000000000022e92 or 1.4e-179 < b < 5.20000000000000026e151Initial program 73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around 0
lower-*.f6422.1
Applied rewrites22.1%
if -7.80000000000000022e92 < b < 1.4e-179Initial program 73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.9
Applied rewrites22.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.9
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lower-*.f6422.9
Applied rewrites22.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* b i) t)) (t_2 (* (* (- x) t) a)))
(if (<= t -7e+171)
t_2
(if (<= t -2.7e+38)
t_1
(if (<= t 8.5e-10) (* a (* c j)) (if (<= t 3.8e+154) 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 = (b * i) * t;
double t_2 = (-x * t) * a;
double tmp;
if (t <= -7e+171) {
tmp = t_2;
} else if (t <= -2.7e+38) {
tmp = t_1;
} else if (t <= 8.5e-10) {
tmp = a * (c * j);
} else if (t <= 3.8e+154) {
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 = (b * i) * t
t_2 = (-x * t) * a
if (t <= (-7d+171)) then
tmp = t_2
else if (t <= (-2.7d+38)) then
tmp = t_1
else if (t <= 8.5d-10) then
tmp = a * (c * j)
else if (t <= 3.8d+154) 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 = (b * i) * t;
double t_2 = (-x * t) * a;
double tmp;
if (t <= -7e+171) {
tmp = t_2;
} else if (t <= -2.7e+38) {
tmp = t_1;
} else if (t <= 8.5e-10) {
tmp = a * (c * j);
} else if (t <= 3.8e+154) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (b * i) * t t_2 = (-x * t) * a tmp = 0 if t <= -7e+171: tmp = t_2 elif t <= -2.7e+38: tmp = t_1 elif t <= 8.5e-10: tmp = a * (c * j) elif t <= 3.8e+154: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(b * i) * t) t_2 = Float64(Float64(Float64(-x) * t) * a) tmp = 0.0 if (t <= -7e+171) tmp = t_2; elseif (t <= -2.7e+38) tmp = t_1; elseif (t <= 8.5e-10) tmp = Float64(a * Float64(c * j)); elseif (t <= 3.8e+154) 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 = (b * i) * t; t_2 = (-x * t) * a; tmp = 0.0; if (t <= -7e+171) tmp = t_2; elseif (t <= -2.7e+38) tmp = t_1; elseif (t <= 8.5e-10) tmp = a * (c * j); elseif (t <= 3.8e+154) 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[(b * i), $MachinePrecision] * t), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-x) * t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[t, -7e+171], t$95$2, If[LessEqual[t, -2.7e+38], t$95$1, If[LessEqual[t, 8.5e-10], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 3.8e+154], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b \cdot i\right) \cdot t\\
t_2 := \left(\left(-x\right) \cdot t\right) \cdot a\\
\mathbf{if}\;t \leq -7 \cdot 10^{+171}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -2.7 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-10}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{elif}\;t \leq 3.8 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -6.9999999999999999e171 or 3.7999999999999998e154 < t Initial program 73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.9
Applied rewrites22.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.9
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift-neg.f64N/A
lower-*.f6422.9
Applied rewrites22.9%
if -6.9999999999999999e171 < t < -2.69999999999999996e38 or 8.4999999999999996e-10 < t < 3.7999999999999998e154Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f6421.8
Applied rewrites21.8%
if -2.69999999999999996e38 < t < 8.4999999999999996e-10Initial program 73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around 0
lower-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= t -3.6e+38) (* b (* i t)) (if (<= t 8.5e-10) (* a (* c j)) (* (* b i) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -3.6e+38) {
tmp = b * (i * t);
} else if (t <= 8.5e-10) {
tmp = a * (c * j);
} else {
tmp = (b * i) * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (t <= (-3.6d+38)) then
tmp = b * (i * t)
else if (t <= 8.5d-10) then
tmp = a * (c * j)
else
tmp = (b * i) * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (t <= -3.6e+38) {
tmp = b * (i * t);
} else if (t <= 8.5e-10) {
tmp = a * (c * j);
} else {
tmp = (b * i) * t;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if t <= -3.6e+38: tmp = b * (i * t) elif t <= 8.5e-10: tmp = a * (c * j) else: tmp = (b * i) * t return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (t <= -3.6e+38) tmp = Float64(b * Float64(i * t)); elseif (t <= 8.5e-10) tmp = Float64(a * Float64(c * j)); else tmp = Float64(Float64(b * i) * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (t <= -3.6e+38) tmp = b * (i * t); elseif (t <= 8.5e-10) tmp = a * (c * j); else tmp = (b * i) * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[t, -3.6e+38], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.5e-10], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], N[(N[(b * i), $MachinePrecision] * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.6 \cdot 10^{+38}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-10}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot i\right) \cdot t\\
\end{array}
\end{array}
if t < -3.59999999999999969e38Initial program 73.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around 0
lower-*.f6421.7
Applied rewrites21.7%
if -3.59999999999999969e38 < t < 8.4999999999999996e-10Initial program 73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around 0
lower-*.f6422.1
Applied rewrites22.1%
if 8.4999999999999996e-10 < t Initial program 73.4%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
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.4
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f6421.8
Applied rewrites21.8%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* b (* i t)))) (if (<= t -3.6e+38) t_1 (if (<= t 8.5e-10) (* a (* c j)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * (i * t);
double tmp;
if (t <= -3.6e+38) {
tmp = t_1;
} else if (t <= 8.5e-10) {
tmp = a * (c * j);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = b * (i * t)
if (t <= (-3.6d+38)) then
tmp = t_1
else if (t <= 8.5d-10) then
tmp = a * (c * j)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = b * (i * t);
double tmp;
if (t <= -3.6e+38) {
tmp = t_1;
} else if (t <= 8.5e-10) {
tmp = a * (c * j);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = b * (i * t) tmp = 0 if t <= -3.6e+38: tmp = t_1 elif t <= 8.5e-10: tmp = a * (c * j) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(b * Float64(i * t)) tmp = 0.0 if (t <= -3.6e+38) tmp = t_1; elseif (t <= 8.5e-10) tmp = Float64(a * Float64(c * j)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = b * (i * t); tmp = 0.0; if (t <= -3.6e+38) tmp = t_1; elseif (t <= 8.5e-10) tmp = a * (c * j); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.6e+38], t$95$1, If[LessEqual[t, 8.5e-10], N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t\right)\\
\mathbf{if}\;t \leq -3.6 \cdot 10^{+38}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-10}:\\
\;\;\;\;a \cdot \left(c \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.59999999999999969e38 or 8.4999999999999996e-10 < t Initial program 73.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.9
Applied rewrites38.9%
Taylor expanded in z around 0
lower-*.f6421.7
Applied rewrites21.7%
if -3.59999999999999969e38 < t < 8.4999999999999996e-10Initial program 73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around 0
lower-*.f6422.1
Applied rewrites22.1%
(FPCore (x y z t a b c i j) :precision binary64 (* a (* c j)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (c * j);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = a * (c * j)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (c * j);
}
def code(x, y, z, t, a, b, c, i, j): return a * (c * j)
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(c * j)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * (c * j); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(c * j), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(c \cdot j\right)
\end{array}
Initial program 73.4%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
Taylor expanded in x around 0
lower-*.f6422.1
Applied rewrites22.1%
herbie shell --seed 2025149
(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)))))