
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* z (- (* x y) (* b c))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * ((x * y) - (b * c));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * ((x * y) - (b * c));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * ((x * y) - (b * c)) return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * ((x * y) - (b * c)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 73.5%
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.5%
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
(if (<= b -1.05e+101)
(* z (- (* x y) (* b c)))
(if (<= b 6e+122)
(fma j (- (* a c) (* i y)) (* x (- (* y z) (* a t))))
(* b (- (* i t) (* c z))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (b <= -1.05e+101) {
tmp = z * ((x * y) - (b * c));
} else if (b <= 6e+122) {
tmp = fma(j, ((a * c) - (i * y)), (x * ((y * z) - (a * t))));
} else {
tmp = b * ((i * t) - (c * z));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (b <= -1.05e+101) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (b <= 6e+122) tmp = fma(j, Float64(Float64(a * c) - Float64(i * y)), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); else tmp = Float64(b * Float64(Float64(i * t) - Float64(c * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[b, -1.05e+101], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e+122], 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], N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -1.05 \cdot 10^{+101}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+122}:\\
\;\;\;\;\mathsf{fma}\left(j, a \cdot c - i \cdot y, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\end{array}
if b < -1.05e101Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
if -1.05e101 < b < 5.99999999999999972e122Initial program 73.5%
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.7
Applied rewrites60.7%
if 5.99999999999999972e122 < b Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* x (* y z)) (* j (- (* c a) (* y i)))))
(t_2 (* a (fma -1.0 (* t x) (* c j)))))
(if (<= a -2.6e+123)
t_2
(if (<= a -1.2e-60)
t_1
(if (<= a -2e-306)
(* z (- (* x y) (* b c)))
(if (<= a 9.5e-135)
(* i (fma -1.0 (* j y) (* b t)))
(if (<= a 100000000000.0) t_1 t_2)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (x * (y * z)) + (j * ((c * a) - (y * i)));
double t_2 = a * fma(-1.0, (t * x), (c * j));
double tmp;
if (a <= -2.6e+123) {
tmp = t_2;
} else if (a <= -1.2e-60) {
tmp = t_1;
} else if (a <= -2e-306) {
tmp = z * ((x * y) - (b * c));
} else if (a <= 9.5e-135) {
tmp = i * fma(-1.0, (j * y), (b * t));
} else if (a <= 100000000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) t_2 = Float64(a * fma(-1.0, Float64(t * x), Float64(c * j))) tmp = 0.0 if (a <= -2.6e+123) tmp = t_2; elseif (a <= -1.2e-60) tmp = t_1; elseif (a <= -2e-306) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (a <= 9.5e-135) tmp = Float64(i * fma(-1.0, Float64(j * y), Float64(b * t))); elseif (a <= 100000000000.0) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(-1.0 * N[(t * x), $MachinePrecision] + N[(c * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.6e+123], t$95$2, If[LessEqual[a, -1.2e-60], t$95$1, If[LessEqual[a, -2e-306], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.5e-135], N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 100000000000.0], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := a \cdot \mathsf{fma}\left(-1, t \cdot x, c \cdot j\right)\\
\mathbf{if}\;a \leq -2.6 \cdot 10^{+123}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.2 \cdot 10^{-60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-306}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-135}:\\
\;\;\;\;i \cdot \mathsf{fma}\left(-1, j \cdot y, b \cdot t\right)\\
\mathbf{elif}\;a \leq 100000000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if a < -2.59999999999999985e123 or 1e11 < a Initial program 73.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.4
Applied rewrites38.4%
if -2.59999999999999985e123 < a < -1.20000000000000005e-60 or 9.50000000000000007e-135 < a < 1e11Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6449.9
Applied rewrites49.9%
if -1.20000000000000005e-60 < a < -2.00000000000000006e-306Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
if -2.00000000000000006e-306 < a < 9.50000000000000007e-135Initial program 73.5%
Applied rewrites75.6%
Taylor expanded in i around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.6
Applied rewrites39.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* i (fma -1.0 (* j y) (* b t)))))
(if (<= i -1.42e+26)
t_1
(if (<= i 1.15e-299)
(* x (- (* y z) (* a t)))
(if (<= i 6.6e-68)
(* c (- (* a j) (* b z)))
(if (<= i 9e+192) (* y (fma -1.0 (* i j) (* x z))) t_1))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = i * fma(-1.0, (j * y), (b * t));
double tmp;
if (i <= -1.42e+26) {
tmp = t_1;
} else if (i <= 1.15e-299) {
tmp = x * ((y * z) - (a * t));
} else if (i <= 6.6e-68) {
tmp = c * ((a * j) - (b * z));
} else if (i <= 9e+192) {
tmp = y * fma(-1.0, (i * j), (x * z));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(i * fma(-1.0, Float64(j * y), Float64(b * t))) tmp = 0.0 if (i <= -1.42e+26) tmp = t_1; elseif (i <= 1.15e-299) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); elseif (i <= 6.6e-68) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (i <= 9e+192) tmp = Float64(y * fma(-1.0, Float64(i * j), Float64(x * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.42e+26], t$95$1, If[LessEqual[i, 1.15e-299], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 6.6e-68], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 9e+192], N[(y * N[(-1.0 * N[(i * j), $MachinePrecision] + N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := i \cdot \mathsf{fma}\left(-1, j \cdot y, b \cdot t\right)\\
\mathbf{if}\;i \leq -1.42 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.15 \cdot 10^{-299}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{elif}\;i \leq 6.6 \cdot 10^{-68}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;i \leq 9 \cdot 10^{+192}:\\
\;\;\;\;y \cdot \mathsf{fma}\left(-1, i \cdot j, x \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if i < -1.42e26 or 9e192 < i Initial program 73.5%
Applied rewrites75.6%
Taylor expanded in i around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.6
Applied rewrites39.6%
if -1.42e26 < i < 1.15e-299Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if 1.15e-299 < i < 6.5999999999999997e-68Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
if 6.5999999999999997e-68 < i < 9e192Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* i (fma -1.0 (* j y) (* b t)))))
(if (<= i -1.42e+26)
t_1
(if (<= i 1.15e-299)
(* x (- (* y z) (* a t)))
(if (<= i 5e-68)
(* c (- (* a j) (* b z)))
(if (<= i 1.6e+184) (* 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 = i * fma(-1.0, (j * y), (b * t));
double tmp;
if (i <= -1.42e+26) {
tmp = t_1;
} else if (i <= 1.15e-299) {
tmp = x * ((y * z) - (a * t));
} else if (i <= 5e-68) {
tmp = c * ((a * j) - (b * z));
} else if (i <= 1.6e+184) {
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(i * fma(-1.0, Float64(j * y), Float64(b * t))) tmp = 0.0 if (i <= -1.42e+26) tmp = t_1; elseif (i <= 1.15e-299) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); elseif (i <= 5e-68) tmp = Float64(c * Float64(Float64(a * j) - Float64(b * z))); elseif (i <= 1.6e+184) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.42e+26], t$95$1, If[LessEqual[i, 1.15e-299], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 5e-68], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.6e+184], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := i \cdot \mathsf{fma}\left(-1, j \cdot y, b \cdot t\right)\\
\mathbf{if}\;i \leq -1.42 \cdot 10^{+26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.15 \cdot 10^{-299}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{elif}\;i \leq 5 \cdot 10^{-68}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{elif}\;i \leq 1.6 \cdot 10^{+184}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if i < -1.42e26 or 1.59999999999999991e184 < i Initial program 73.5%
Applied rewrites75.6%
Taylor expanded in i around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.6
Applied rewrites39.6%
if -1.42e26 < i < 1.15e-299Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if 1.15e-299 < i < 4.99999999999999971e-68Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
if 4.99999999999999971e-68 < i < 1.59999999999999991e184Initial program 73.5%
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 (* a (fma -1.0 (* t x) (* c j)))))
(if (<= a -4.1e+115)
t_1
(if (<= a -2e-306)
(* z (- (* x y) (* b c)))
(if (<= a 22000000.0) (* i (fma -1.0 (* j y) (* b t))) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = a * fma(-1.0, (t * x), (c * j));
double tmp;
if (a <= -4.1e+115) {
tmp = t_1;
} else if (a <= -2e-306) {
tmp = z * ((x * y) - (b * c));
} else if (a <= 22000000.0) {
tmp = i * fma(-1.0, (j * y), (b * t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(a * fma(-1.0, Float64(t * x), Float64(c * j))) tmp = 0.0 if (a <= -4.1e+115) tmp = t_1; elseif (a <= -2e-306) tmp = Float64(z * Float64(Float64(x * y) - Float64(b * c))); elseif (a <= 22000000.0) tmp = Float64(i * fma(-1.0, Float64(j * y), Float64(b * t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(a * N[(-1.0 * N[(t * x), $MachinePrecision] + N[(c * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.1e+115], t$95$1, If[LessEqual[a, -2e-306], N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 22000000.0], N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := a \cdot \mathsf{fma}\left(-1, t \cdot x, c \cdot j\right)\\
\mathbf{if}\;a \leq -4.1 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2 \cdot 10^{-306}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right)\\
\mathbf{elif}\;a \leq 22000000:\\
\;\;\;\;i \cdot \mathsf{fma}\left(-1, j \cdot y, b \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -4.09999999999999963e115 or 2.2e7 < a Initial program 73.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.4
Applied rewrites38.4%
if -4.09999999999999963e115 < a < -2.00000000000000006e-306Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
if -2.00000000000000006e-306 < a < 2.2e7Initial program 73.5%
Applied rewrites75.6%
Taylor expanded in i around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.6
Applied rewrites39.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* a j) (* b z)))))
(if (<= c -1.14e-23)
t_1
(if (<= c -4.2e-115)
(* b (- (* i t) (* c z)))
(if (<= c 1.55e-136)
(* x (- (* y z) (* a t)))
(if (<= c 3.4e+87) (* (- (* b i) (* a x)) t) t_1))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * ((a * j) - (b * z));
double tmp;
if (c <= -1.14e-23) {
tmp = t_1;
} else if (c <= -4.2e-115) {
tmp = b * ((i * t) - (c * z));
} else if (c <= 1.55e-136) {
tmp = x * ((y * z) - (a * t));
} else if (c <= 3.4e+87) {
tmp = ((b * i) - (a * x)) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = c * ((a * j) - (b * z))
if (c <= (-1.14d-23)) then
tmp = t_1
else if (c <= (-4.2d-115)) then
tmp = b * ((i * t) - (c * z))
else if (c <= 1.55d-136) then
tmp = x * ((y * z) - (a * t))
else if (c <= 3.4d+87) then
tmp = ((b * i) - (a * x)) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * ((a * j) - (b * z));
double tmp;
if (c <= -1.14e-23) {
tmp = t_1;
} else if (c <= -4.2e-115) {
tmp = b * ((i * t) - (c * z));
} else if (c <= 1.55e-136) {
tmp = x * ((y * z) - (a * t));
} else if (c <= 3.4e+87) {
tmp = ((b * i) - (a * x)) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * ((a * j) - (b * z)) tmp = 0 if c <= -1.14e-23: tmp = t_1 elif c <= -4.2e-115: tmp = b * ((i * t) - (c * z)) elif c <= 1.55e-136: tmp = x * ((y * z) - (a * t)) elif c <= 3.4e+87: tmp = ((b * i) - (a * x)) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(a * j) - Float64(b * z))) tmp = 0.0 if (c <= -1.14e-23) tmp = t_1; elseif (c <= -4.2e-115) tmp = Float64(b * Float64(Float64(i * t) - Float64(c * z))); elseif (c <= 1.55e-136) tmp = Float64(x * Float64(Float64(y * z) - Float64(a * t))); elseif (c <= 3.4e+87) tmp = Float64(Float64(Float64(b * i) - Float64(a * x)) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * ((a * j) - (b * z)); tmp = 0.0; if (c <= -1.14e-23) tmp = t_1; elseif (c <= -4.2e-115) tmp = b * ((i * t) - (c * z)); elseif (c <= 1.55e-136) tmp = x * ((y * z) - (a * t)); elseif (c <= 3.4e+87) tmp = ((b * i) - (a * x)) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.14e-23], t$95$1, If[LessEqual[c, -4.2e-115], N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 1.55e-136], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 3.4e+87], N[(N[(N[(b * i), $MachinePrecision] - N[(a * x), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{if}\;c \leq -1.14 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -4.2 \cdot 10^{-115}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{elif}\;c \leq 1.55 \cdot 10^{-136}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{elif}\;c \leq 3.4 \cdot 10^{+87}:\\
\;\;\;\;\left(b \cdot i - a \cdot x\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if c < -1.14e-23 or 3.4000000000000002e87 < c Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
if -1.14e-23 < c < -4.20000000000000003e-115Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if -4.20000000000000003e-115 < c < 1.55e-136Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if 1.55e-136 < c < 3.4000000000000002e87Initial program 73.5%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0
Applied rewrites39.0%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.0
Applied rewrites39.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* a j) (* b z)))))
(if (<= c -1.14e-23)
t_1
(if (<= c -4.2e-115)
(* b (- (* i t) (* c z)))
(if (<= c 6.8e+45) (* 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 = c * ((a * j) - (b * z));
double tmp;
if (c <= -1.14e-23) {
tmp = t_1;
} else if (c <= -4.2e-115) {
tmp = b * ((i * t) - (c * z));
} else if (c <= 6.8e+45) {
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 = c * ((a * j) - (b * z))
if (c <= (-1.14d-23)) then
tmp = t_1
else if (c <= (-4.2d-115)) then
tmp = b * ((i * t) - (c * z))
else if (c <= 6.8d+45) 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 = c * ((a * j) - (b * z));
double tmp;
if (c <= -1.14e-23) {
tmp = t_1;
} else if (c <= -4.2e-115) {
tmp = b * ((i * t) - (c * z));
} else if (c <= 6.8e+45) {
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 = c * ((a * j) - (b * z)) tmp = 0 if c <= -1.14e-23: tmp = t_1 elif c <= -4.2e-115: tmp = b * ((i * t) - (c * z)) elif c <= 6.8e+45: 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(c * Float64(Float64(a * j) - Float64(b * z))) tmp = 0.0 if (c <= -1.14e-23) tmp = t_1; elseif (c <= -4.2e-115) tmp = Float64(b * Float64(Float64(i * t) - Float64(c * z))); elseif (c <= 6.8e+45) 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 = c * ((a * j) - (b * z)); tmp = 0.0; if (c <= -1.14e-23) tmp = t_1; elseif (c <= -4.2e-115) tmp = b * ((i * t) - (c * z)); elseif (c <= 6.8e+45) 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[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.14e-23], t$95$1, If[LessEqual[c, -4.2e-115], N[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[c, 6.8e+45], N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{if}\;c \leq -1.14 \cdot 10^{-23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -4.2 \cdot 10^{-115}:\\
\;\;\;\;b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{elif}\;c \leq 6.8 \cdot 10^{+45}:\\
\;\;\;\;x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if c < -1.14e-23 or 6.8e45 < c Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
if -1.14e-23 < c < -4.20000000000000003e-115Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if -4.20000000000000003e-115 < c < 6.8e45Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= i -1.55e+25)
t_1
(if (<= i 4.4e+195) (* 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 (i <= -1.55e+25) {
tmp = t_1;
} else if (i <= 4.4e+195) {
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 (i <= (-1.55d+25)) then
tmp = t_1
else if (i <= 4.4d+195) 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 (i <= -1.55e+25) {
tmp = t_1;
} else if (i <= 4.4e+195) {
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 i <= -1.55e+25: tmp = t_1 elif i <= 4.4e+195: 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 (i <= -1.55e+25) tmp = t_1; elseif (i <= 4.4e+195) 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 (i <= -1.55e+25) tmp = t_1; elseif (i <= 4.4e+195) 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[i, -1.55e+25], t$95$1, If[LessEqual[i, 4.4e+195], N[(c * N[(N[(a * j), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;i \leq -1.55 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 4.4 \cdot 10^{+195}:\\
\;\;\;\;c \cdot \left(a \cdot j - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if i < -1.5499999999999999e25 or 4.4e195 < i Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if -1.5499999999999999e25 < i < 4.4e195Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* b (- (* i t) (* c z)))))
(if (<= b -2.4e-5)
t_1
(if (<= b -2e-259) (* c (* a j)) (if (<= b 0.2) (* (* (- j) 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 * t) - (c * z));
double tmp;
if (b <= -2.4e-5) {
tmp = t_1;
} else if (b <= -2e-259) {
tmp = c * (a * j);
} else if (b <= 0.2) {
tmp = (-j * 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 * t) - (c * z))
if (b <= (-2.4d-5)) then
tmp = t_1
else if (b <= (-2d-259)) then
tmp = c * (a * j)
else if (b <= 0.2d0) then
tmp = (-j * 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 * t) - (c * z));
double tmp;
if (b <= -2.4e-5) {
tmp = t_1;
} else if (b <= -2e-259) {
tmp = c * (a * j);
} else if (b <= 0.2) {
tmp = (-j * y) * i;
} 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.4e-5: tmp = t_1 elif b <= -2e-259: tmp = c * (a * j) elif b <= 0.2: tmp = (-j * y) * i 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.4e-5) tmp = t_1; elseif (b <= -2e-259) tmp = Float64(c * Float64(a * j)); elseif (b <= 0.2) tmp = Float64(Float64(Float64(-j) * 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 * t) - (c * z)); tmp = 0.0; if (b <= -2.4e-5) tmp = t_1; elseif (b <= -2e-259) tmp = c * (a * j); elseif (b <= 0.2) tmp = (-j * 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[(b * N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.4e-5], t$95$1, If[LessEqual[b, -2e-259], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.2], N[(N[((-j) * y), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := b \cdot \left(i \cdot t - c \cdot z\right)\\
\mathbf{if}\;b \leq -2.4 \cdot 10^{-5}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2 \cdot 10^{-259}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{elif}\;b \leq 0.2:\\
\;\;\;\;\left(\left(-j\right) \cdot y\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -2.4000000000000001e-5 or 0.20000000000000001 < b Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
if -2.4000000000000001e-5 < b < -2.0000000000000001e-259Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Taylor expanded in z around 0
lower-*.f6421.3
Applied rewrites21.3%
if -2.0000000000000001e-259 < b < 0.20000000000000001Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lift-*.f64N/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6422.3
Applied rewrites22.3%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -2.4e-43)
(* c (* -1.0 (* b z)))
(if (<= z -9.5e-202)
(* (* (- i) j) y)
(if (<= z 3.2e-272)
(* b (* i t))
(if (<= z 1.85e+115) (* c (* a j)) (* x (* y z)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -2.4e-43) {
tmp = c * (-1.0 * (b * z));
} else if (z <= -9.5e-202) {
tmp = (-i * j) * y;
} else if (z <= 3.2e-272) {
tmp = b * (i * t);
} else if (z <= 1.85e+115) {
tmp = c * (a * j);
} else {
tmp = x * (y * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (z <= (-2.4d-43)) then
tmp = c * ((-1.0d0) * (b * z))
else if (z <= (-9.5d-202)) then
tmp = (-i * j) * y
else if (z <= 3.2d-272) then
tmp = b * (i * t)
else if (z <= 1.85d+115) then
tmp = c * (a * j)
else
tmp = x * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -2.4e-43) {
tmp = c * (-1.0 * (b * z));
} else if (z <= -9.5e-202) {
tmp = (-i * j) * y;
} else if (z <= 3.2e-272) {
tmp = b * (i * t);
} else if (z <= 1.85e+115) {
tmp = c * (a * j);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -2.4e-43: tmp = c * (-1.0 * (b * z)) elif z <= -9.5e-202: tmp = (-i * j) * y elif z <= 3.2e-272: tmp = b * (i * t) elif z <= 1.85e+115: tmp = c * (a * j) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -2.4e-43) tmp = Float64(c * Float64(-1.0 * Float64(b * z))); elseif (z <= -9.5e-202) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (z <= 3.2e-272) tmp = Float64(b * Float64(i * t)); elseif (z <= 1.85e+115) tmp = Float64(c * Float64(a * j)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -2.4e-43) tmp = c * (-1.0 * (b * z)); elseif (z <= -9.5e-202) tmp = (-i * j) * y; elseif (z <= 3.2e-272) tmp = b * (i * t); elseif (z <= 1.85e+115) tmp = c * (a * j); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -2.4e-43], N[(c * N[(-1.0 * N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -9.5e-202], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 3.2e-272], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+115], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-43}:\\
\;\;\;\;c \cdot \left(-1 \cdot \left(b \cdot z\right)\right)\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-202}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-272}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+115}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
if z < -2.4000000000000002e-43Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.1
Applied rewrites22.1%
if -2.4000000000000002e-43 < z < -9.5000000000000001e-202Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6422.1
Applied rewrites22.1%
if -9.5000000000000001e-202 < z < 3.2e-272Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in z around 0
lower-*.f6422.6
Applied rewrites22.6%
if 3.2e-272 < z < 1.85000000000000003e115Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Taylor expanded in z around 0
lower-*.f6421.3
Applied rewrites21.3%
if 1.85000000000000003e115 < z Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -2.4e-43)
(* (* (- z) c) b)
(if (<= z -9.5e-202)
(* (* (- i) j) y)
(if (<= z 3.2e-272)
(* b (* i t))
(if (<= z 1.85e+115) (* c (* a j)) (* x (* y z)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -2.4e-43) {
tmp = (-z * c) * b;
} else if (z <= -9.5e-202) {
tmp = (-i * j) * y;
} else if (z <= 3.2e-272) {
tmp = b * (i * t);
} else if (z <= 1.85e+115) {
tmp = c * (a * j);
} else {
tmp = x * (y * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (z <= (-2.4d-43)) then
tmp = (-z * c) * b
else if (z <= (-9.5d-202)) then
tmp = (-i * j) * y
else if (z <= 3.2d-272) then
tmp = b * (i * t)
else if (z <= 1.85d+115) then
tmp = c * (a * j)
else
tmp = x * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -2.4e-43) {
tmp = (-z * c) * b;
} else if (z <= -9.5e-202) {
tmp = (-i * j) * y;
} else if (z <= 3.2e-272) {
tmp = b * (i * t);
} else if (z <= 1.85e+115) {
tmp = c * (a * j);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -2.4e-43: tmp = (-z * c) * b elif z <= -9.5e-202: tmp = (-i * j) * y elif z <= 3.2e-272: tmp = b * (i * t) elif z <= 1.85e+115: tmp = c * (a * j) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -2.4e-43) tmp = Float64(Float64(Float64(-z) * c) * b); elseif (z <= -9.5e-202) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (z <= 3.2e-272) tmp = Float64(b * Float64(i * t)); elseif (z <= 1.85e+115) tmp = Float64(c * Float64(a * j)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -2.4e-43) tmp = (-z * c) * b; elseif (z <= -9.5e-202) tmp = (-i * j) * y; elseif (z <= 3.2e-272) tmp = b * (i * t); elseif (z <= 1.85e+115) tmp = c * (a * j); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -2.4e-43], N[(N[((-z) * c), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[z, -9.5e-202], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 3.2e-272], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+115], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -2.4 \cdot 10^{-43}:\\
\;\;\;\;\left(\left(-z\right) \cdot c\right) \cdot b\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-202}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-272}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+115}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
if z < -2.4000000000000002e-43Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6422.3
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6422.3
Applied rewrites22.3%
if -2.4000000000000002e-43 < z < -9.5000000000000001e-202Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6422.1
Applied rewrites22.1%
if -9.5000000000000001e-202 < z < 3.2e-272Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in z around 0
lower-*.f6422.6
Applied rewrites22.6%
if 3.2e-272 < z < 1.85000000000000003e115Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Taylor expanded in z around 0
lower-*.f6421.3
Applied rewrites21.3%
if 1.85000000000000003e115 < z Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -4.3e+18)
(* (* z x) y)
(if (<= z -9.5e-202)
(* (* (- i) j) y)
(if (<= z 3.2e-272)
(* b (* i t))
(if (<= z 1.85e+115) (* c (* a j)) (* x (* y z)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -4.3e+18) {
tmp = (z * x) * y;
} else if (z <= -9.5e-202) {
tmp = (-i * j) * y;
} else if (z <= 3.2e-272) {
tmp = b * (i * t);
} else if (z <= 1.85e+115) {
tmp = c * (a * j);
} else {
tmp = x * (y * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (z <= (-4.3d+18)) then
tmp = (z * x) * y
else if (z <= (-9.5d-202)) then
tmp = (-i * j) * y
else if (z <= 3.2d-272) then
tmp = b * (i * t)
else if (z <= 1.85d+115) then
tmp = c * (a * j)
else
tmp = x * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -4.3e+18) {
tmp = (z * x) * y;
} else if (z <= -9.5e-202) {
tmp = (-i * j) * y;
} else if (z <= 3.2e-272) {
tmp = b * (i * t);
} else if (z <= 1.85e+115) {
tmp = c * (a * j);
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if z <= -4.3e+18: tmp = (z * x) * y elif z <= -9.5e-202: tmp = (-i * j) * y elif z <= 3.2e-272: tmp = b * (i * t) elif z <= 1.85e+115: tmp = c * (a * j) else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -4.3e+18) tmp = Float64(Float64(z * x) * y); elseif (z <= -9.5e-202) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (z <= 3.2e-272) tmp = Float64(b * Float64(i * t)); elseif (z <= 1.85e+115) tmp = Float64(c * Float64(a * j)); else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (z <= -4.3e+18) tmp = (z * x) * y; elseif (z <= -9.5e-202) tmp = (-i * j) * y; elseif (z <= 3.2e-272) tmp = b * (i * t); elseif (z <= 1.85e+115) tmp = c * (a * j); else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -4.3e+18], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, -9.5e-202], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 3.2e-272], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+115], N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;z \leq -4.3 \cdot 10^{+18}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;z \leq -9.5 \cdot 10^{-202}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-272}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+115}:\\
\;\;\;\;c \cdot \left(a \cdot j\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
if z < -4.3e18Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6423.2
Applied rewrites23.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6423.4
Applied rewrites23.4%
if -4.3e18 < z < -9.5000000000000001e-202Initial program 73.5%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6440.0
Applied rewrites40.0%
lift-*.f64N/A
lift-fma.f64N/A
distribute-rgt-inN/A
*-commutativeN/A
mul-1-negN/A
lift-*.f64N/A
distribute-lft-neg-inN/A
associate-*r*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6436.0
lift-*.f64N/A
*-commutativeN/A
lower-*.f6436.0
Applied rewrites36.0%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
associate-*l*N/A
distribute-rgt-neg-inN/A
*-commutativeN/A
lower-*.f64N/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6422.1
Applied rewrites22.1%
if -9.5000000000000001e-202 < z < 3.2e-272Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in z around 0
lower-*.f6422.6
Applied rewrites22.6%
if 3.2e-272 < z < 1.85000000000000003e115Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Taylor expanded in z around 0
lower-*.f6421.3
Applied rewrites21.3%
if 1.85000000000000003e115 < z Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (* a j))))
(if (<= z -1e+91)
(* (* z x) y)
(if (<= z -1.05e-201)
t_1
(if (<= z 3.2e-272)
(* b (* i t))
(if (<= z 1.85e+115) t_1 (* x (* y z))))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (a * j);
double tmp;
if (z <= -1e+91) {
tmp = (z * x) * y;
} else if (z <= -1.05e-201) {
tmp = t_1;
} else if (z <= 3.2e-272) {
tmp = b * (i * t);
} else if (z <= 1.85e+115) {
tmp = t_1;
} else {
tmp = x * (y * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = c * (a * j)
if (z <= (-1d+91)) then
tmp = (z * x) * y
else if (z <= (-1.05d-201)) then
tmp = t_1
else if (z <= 3.2d-272) then
tmp = b * (i * t)
else if (z <= 1.85d+115) then
tmp = t_1
else
tmp = x * (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (a * j);
double tmp;
if (z <= -1e+91) {
tmp = (z * x) * y;
} else if (z <= -1.05e-201) {
tmp = t_1;
} else if (z <= 3.2e-272) {
tmp = b * (i * t);
} else if (z <= 1.85e+115) {
tmp = t_1;
} else {
tmp = x * (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * (a * j) tmp = 0 if z <= -1e+91: tmp = (z * x) * y elif z <= -1.05e-201: tmp = t_1 elif z <= 3.2e-272: tmp = b * (i * t) elif z <= 1.85e+115: tmp = t_1 else: tmp = x * (y * z) return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(a * j)) tmp = 0.0 if (z <= -1e+91) tmp = Float64(Float64(z * x) * y); elseif (z <= -1.05e-201) tmp = t_1; elseif (z <= 3.2e-272) tmp = Float64(b * Float64(i * t)); elseif (z <= 1.85e+115) tmp = t_1; else tmp = Float64(x * Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * (a * j); tmp = 0.0; if (z <= -1e+91) tmp = (z * x) * y; elseif (z <= -1.05e-201) tmp = t_1; elseif (z <= 3.2e-272) tmp = b * (i * t); elseif (z <= 1.85e+115) tmp = t_1; else tmp = x * (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(a * j), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+91], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, -1.05e-201], t$95$1, If[LessEqual[z, 3.2e-272], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.85e+115], t$95$1, N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := c \cdot \left(a \cdot j\right)\\
\mathbf{if}\;z \leq -1 \cdot 10^{+91}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;z \leq -1.05 \cdot 10^{-201}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-272}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{elif}\;z \leq 1.85 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\end{array}
if z < -1.00000000000000008e91Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6423.2
Applied rewrites23.2%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6423.4
Applied rewrites23.4%
if -1.00000000000000008e91 < z < -1.05000000000000006e-201 or 3.2e-272 < z < 1.85000000000000003e115Initial program 73.5%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6437.9
Applied rewrites37.9%
Taylor expanded in z around 0
lower-*.f6421.3
Applied rewrites21.3%
if -1.05000000000000006e-201 < z < 3.2e-272Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in z around 0
lower-*.f6422.6
Applied rewrites22.6%
if 1.85000000000000003e115 < z Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* y x) z))) (if (<= y -5e-37) t_1 (if (<= y 2.75e-39) (* 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 = (y * x) * z;
double tmp;
if (y <= -5e-37) {
tmp = t_1;
} else if (y <= 2.75e-39) {
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 = (y * x) * z
if (y <= (-5d-37)) then
tmp = t_1
else if (y <= 2.75d-39) 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 = (y * x) * z;
double tmp;
if (y <= -5e-37) {
tmp = t_1;
} else if (y <= 2.75e-39) {
tmp = b * (i * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (y * x) * z tmp = 0 if y <= -5e-37: tmp = t_1 elif y <= 2.75e-39: 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(y * x) * z) tmp = 0.0 if (y <= -5e-37) tmp = t_1; elseif (y <= 2.75e-39) tmp = Float64(b * Float64(i * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (y * x) * z; tmp = 0.0; if (y <= -5e-37) tmp = t_1; elseif (y <= 2.75e-39) 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[(y * x), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[y, -5e-37], t$95$1, If[LessEqual[y, 2.75e-39], N[(b * N[(i * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(y \cdot x\right) \cdot z\\
\mathbf{if}\;y \leq -5 \cdot 10^{-37}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{-39}:\\
\;\;\;\;b \cdot \left(i \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.9999999999999997e-37 or 2.75000000000000009e-39 < y Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6423.2
Applied rewrites23.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6423.1
Applied rewrites23.1%
if -4.9999999999999997e-37 < y < 2.75000000000000009e-39Initial program 73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in z around 0
lower-*.f6422.6
Applied rewrites22.6%
(FPCore (x y z t a b c i j) :precision binary64 (* (* y x) z))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (y * x) * z;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = (y * x) * z
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (y * x) * z;
}
def code(x, y, z, t, a, b, c, i, j): return (y * x) * z
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(y * x) * z) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (y * x) * z; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(y * x), $MachinePrecision] * z), $MachinePrecision]
\left(y \cdot x\right) \cdot z
Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6423.2
Applied rewrites23.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6423.1
Applied rewrites23.1%
(FPCore (x y z t a b c i j) :precision binary64 (* x (* y z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return x * (y * z);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = x * (y * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return x * (y * z);
}
def code(x, y, z, t, a, b, c, i, j): return x * (y * z)
function code(x, y, z, t, a, b, c, i, j) return Float64(x * Float64(y * z)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = x * (y * z); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]
x \cdot \left(y \cdot z\right)
Initial program 73.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6423.2
Applied rewrites23.2%
herbie shell --seed 2025172
(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)))))