
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
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) - (i * a)))) + (j * ((c * t) - (i * y)));
}
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) - (i * a)))) + (j * ((c * t) - (i * y)))
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) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
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(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); 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[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
Herbie found 23 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))
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) - (i * a)))) + (j * ((c * t) - (i * y)));
}
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) - (i * a)))) + (j * ((c * t) - (i * y)))
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) - (i * a)))) + (j * ((c * t) - (i * y)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y)))
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(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * ((c * t) - (i * y))); 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[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 5e+292)
t_1
(if (<= t_1 INFINITY)
(-
(fma (- a) (* t x) (fma (* j c) t (* (fma (- i) j (* z x)) y)))
(* (fma (- a) i (* c z)) b))
(* (* (fma x (/ z j) (- i)) j) y)))))
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) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= 5e+292) {
tmp = t_1;
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma(-a, (t * x), fma((j * c), t, (fma(-i, j, (z * x)) * y))) - (fma(-a, i, (c * z)) * b);
} else {
tmp = (fma(x, (z / j), -i) * j) * y;
}
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(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= 5e+292) tmp = t_1; elseif (t_1 <= Inf) tmp = Float64(fma(Float64(-a), Float64(t * x), fma(Float64(j * c), t, Float64(fma(Float64(-i), j, Float64(z * x)) * y))) - Float64(fma(Float64(-a), i, Float64(c * z)) * b)); else tmp = Float64(Float64(fma(x, Float64(z / j), Float64(-i)) * j) * y); 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[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+292], t$95$1, If[LessEqual[t$95$1, Infinity], N[(N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(j * c), $MachinePrecision] * t + N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[((-a) * i + N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * N[(z / j), $MachinePrecision] + (-i)), $MachinePrecision] * j), $MachinePrecision] * y), $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 - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(-a, t \cdot x, \mathsf{fma}\left(j \cdot c, t, \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\right)\right) - \mathsf{fma}\left(-a, i, c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(x, \frac{z}{j}, -i\right) \cdot j\right) \cdot y\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < 4.9999999999999996e292Initial program 93.5%
if 4.9999999999999996e292 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 86.3%
Taylor expanded in y around 0
lower--.f64N/A
Applied rewrites83.0%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 0.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6442.1
Applied rewrites42.1%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lift-neg.f6445.1
Applied rewrites45.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j (- (* c t) (* i y))))))
(if (<= t_1 INFINITY) t_1 (* (* (fma x (/ z j) (- i)) j) y))))
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) - (i * a)))) + (j * ((c * t) - (i * y)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (fma(x, (z / j), -i) * j) * y;
}
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(i * a)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(fma(x, Float64(z / j), Float64(-i)) * j) * y); 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[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(N[(x * N[(z / j), $MachinePrecision] + (-i)), $MachinePrecision] * j), $MachinePrecision] * y), $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 - i \cdot a\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(x, \frac{z}{j}, -i\right) \cdot j\right) \cdot y\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) < +inf.0Initial program 91.4%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 i a)))) (*.f64 j (-.f64 (*.f64 c t) (*.f64 i y)))) Initial program 0.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6442.1
Applied rewrites42.1%
Taylor expanded in j around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lift-neg.f6445.1
Applied rewrites45.1%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -9.2e+249)
(* (- i) (- (* j y) (* a b)))
(if (<= i 1.35e+34)
(-
(fma (- a) (* t x) (fma (* j c) t (* (fma (- i) j (* z x)) y)))
(* (* c z) b))
(* (- i) (fma j y (* (- a) b))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -9.2e+249) {
tmp = -i * ((j * y) - (a * b));
} else if (i <= 1.35e+34) {
tmp = fma(-a, (t * x), fma((j * c), t, (fma(-i, j, (z * x)) * y))) - ((c * z) * b);
} else {
tmp = -i * fma(j, y, (-a * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -9.2e+249) tmp = Float64(Float64(-i) * Float64(Float64(j * y) - Float64(a * b))); elseif (i <= 1.35e+34) tmp = Float64(fma(Float64(-a), Float64(t * x), fma(Float64(j * c), t, Float64(fma(Float64(-i), j, Float64(z * x)) * y))) - Float64(Float64(c * z) * b)); else tmp = Float64(Float64(-i) * fma(j, y, Float64(Float64(-a) * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -9.2e+249], N[((-i) * N[(N[(j * y), $MachinePrecision] - N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.35e+34], N[(N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(j * c), $MachinePrecision] * t + N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[((-i) * N[(j * y + N[((-a) * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -9.2 \cdot 10^{+249}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y - a \cdot b\right)\\
\mathbf{elif}\;i \leq 1.35 \cdot 10^{+34}:\\
\;\;\;\;\mathsf{fma}\left(-a, t \cdot x, \mathsf{fma}\left(j \cdot c, t, \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\right)\right) - \left(c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(-i\right) \cdot \mathsf{fma}\left(j, y, \left(-a\right) \cdot b\right)\\
\end{array}
\end{array}
if i < -9.1999999999999993e249Initial program 53.3%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6477.6
Applied rewrites77.6%
lift-fma.f64N/A
lift-neg.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6477.1
Applied rewrites77.1%
if -9.1999999999999993e249 < i < 1.35e34Initial program 76.2%
Taylor expanded in y around 0
lower--.f64N/A
Applied rewrites77.3%
Taylor expanded in z around inf
lift-*.f6470.1
Applied rewrites70.1%
if 1.35e34 < i Initial program 65.3%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6461.9
Applied rewrites61.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- a) (fma t x (* (- b) i)))))
(if (<= a -1.3e+105)
t_1
(if (<= a 2.35e-138)
(- (fma (* j c) t (* (- i) (* j y))) (* (* c z) b))
(if (<= a 9.6e+88) (+ (* (* z y) x) (* j (- (* c t) (* 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 = -a * fma(t, x, (-b * i));
double tmp;
if (a <= -1.3e+105) {
tmp = t_1;
} else if (a <= 2.35e-138) {
tmp = fma((j * c), t, (-i * (j * y))) - ((c * z) * b);
} else if (a <= 9.6e+88) {
tmp = ((z * y) * x) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-a) * fma(t, x, Float64(Float64(-b) * i))) tmp = 0.0 if (a <= -1.3e+105) tmp = t_1; elseif (a <= 2.35e-138) tmp = Float64(fma(Float64(j * c), t, Float64(Float64(-i) * Float64(j * y))) - Float64(Float64(c * z) * b)); elseif (a <= 9.6e+88) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * t) - 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[((-a) * N[(t * x + N[((-b) * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.3e+105], t$95$1, If[LessEqual[a, 2.35e-138], N[(N[(N[(j * c), $MachinePrecision] * t + N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 9.6e+88], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(-b\right) \cdot i\right)\\
\mathbf{if}\;a \leq -1.3 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.35 \cdot 10^{-138}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, t, \left(-i\right) \cdot \left(j \cdot y\right)\right) - \left(c \cdot z\right) \cdot b\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{+88}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.3000000000000001e105 or 9.5999999999999996e88 < a Initial program 61.4%
Taylor expanded in a around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6468.6
Applied rewrites68.6%
if -1.3000000000000001e105 < a < 2.3500000000000001e-138Initial program 78.8%
Taylor expanded in y around 0
lower--.f64N/A
Applied rewrites76.1%
Taylor expanded in z around inf
lift-*.f6470.2
Applied rewrites70.2%
Taylor expanded in x around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f6454.4
Applied rewrites54.4%
if 2.3500000000000001e-138 < a < 9.5999999999999996e88Initial program 78.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6452.7
Applied rewrites52.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- a) (fma t x (* (- b) i)))))
(if (<= a -1.4e+105)
t_1
(if (<= a 9.6e+88) (+ (* (* z y) x) (* j (- (* c t) (* 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 = -a * fma(t, x, (-b * i));
double tmp;
if (a <= -1.4e+105) {
tmp = t_1;
} else if (a <= 9.6e+88) {
tmp = ((z * y) * x) + (j * ((c * t) - (i * y)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-a) * fma(t, x, Float64(Float64(-b) * i))) tmp = 0.0 if (a <= -1.4e+105) tmp = t_1; elseif (a <= 9.6e+88) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * t) - 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[((-a) * N[(t * x + N[((-b) * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.4e+105], t$95$1, If[LessEqual[a, 9.6e+88], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot \mathsf{fma}\left(t, x, \left(-b\right) \cdot i\right)\\
\mathbf{if}\;a \leq -1.4 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 9.6 \cdot 10^{+88}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.4000000000000001e105 or 9.5999999999999996e88 < a Initial program 61.4%
Taylor expanded in a around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6468.6
Applied rewrites68.6%
if -1.4000000000000001e105 < a < 9.5999999999999996e88Initial program 78.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6456.6
Applied rewrites56.6%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* -1.0 (* a (* t x)))) (t_2 (* (* (- i) j) y)))
(if (<= i -1.82e-35)
t_2
(if (<= i -7.8e-287)
t_1
(if (<= i 7.5e-263)
(* (* (- b) z) c)
(if (<= i 9.5e-148) t_1 (if (<= i 1.25e+101) t_2 (* (* b a) i))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -1.0 * (a * (t * x));
double t_2 = (-i * j) * y;
double tmp;
if (i <= -1.82e-35) {
tmp = t_2;
} else if (i <= -7.8e-287) {
tmp = t_1;
} else if (i <= 7.5e-263) {
tmp = (-b * z) * c;
} else if (i <= 9.5e-148) {
tmp = t_1;
} else if (i <= 1.25e+101) {
tmp = t_2;
} else {
tmp = (b * a) * i;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (-1.0d0) * (a * (t * x))
t_2 = (-i * j) * y
if (i <= (-1.82d-35)) then
tmp = t_2
else if (i <= (-7.8d-287)) then
tmp = t_1
else if (i <= 7.5d-263) then
tmp = (-b * z) * c
else if (i <= 9.5d-148) then
tmp = t_1
else if (i <= 1.25d+101) then
tmp = t_2
else
tmp = (b * a) * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = -1.0 * (a * (t * x));
double t_2 = (-i * j) * y;
double tmp;
if (i <= -1.82e-35) {
tmp = t_2;
} else if (i <= -7.8e-287) {
tmp = t_1;
} else if (i <= 7.5e-263) {
tmp = (-b * z) * c;
} else if (i <= 9.5e-148) {
tmp = t_1;
} else if (i <= 1.25e+101) {
tmp = t_2;
} else {
tmp = (b * a) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = -1.0 * (a * (t * x)) t_2 = (-i * j) * y tmp = 0 if i <= -1.82e-35: tmp = t_2 elif i <= -7.8e-287: tmp = t_1 elif i <= 7.5e-263: tmp = (-b * z) * c elif i <= 9.5e-148: tmp = t_1 elif i <= 1.25e+101: tmp = t_2 else: tmp = (b * a) * i return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(-1.0 * Float64(a * Float64(t * x))) t_2 = Float64(Float64(Float64(-i) * j) * y) tmp = 0.0 if (i <= -1.82e-35) tmp = t_2; elseif (i <= -7.8e-287) tmp = t_1; elseif (i <= 7.5e-263) tmp = Float64(Float64(Float64(-b) * z) * c); elseif (i <= 9.5e-148) tmp = t_1; elseif (i <= 1.25e+101) tmp = t_2; else tmp = Float64(Float64(b * a) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = -1.0 * (a * (t * x)); t_2 = (-i * j) * y; tmp = 0.0; if (i <= -1.82e-35) tmp = t_2; elseif (i <= -7.8e-287) tmp = t_1; elseif (i <= 7.5e-263) tmp = (-b * z) * c; elseif (i <= 9.5e-148) tmp = t_1; elseif (i <= 1.25e+101) tmp = t_2; else tmp = (b * a) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[i, -1.82e-35], t$95$2, If[LessEqual[i, -7.8e-287], t$95$1, If[LessEqual[i, 7.5e-263], N[(N[((-b) * z), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[i, 9.5e-148], t$95$1, If[LessEqual[i, 1.25e+101], t$95$2, N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
t_2 := \left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{if}\;i \leq -1.82 \cdot 10^{-35}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq -7.8 \cdot 10^{-287}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 7.5 \cdot 10^{-263}:\\
\;\;\;\;\left(\left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;i \leq 9.5 \cdot 10^{-148}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 1.25 \cdot 10^{+101}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\end{array}
\end{array}
if i < -1.82000000000000003e-35 or 9.50000000000000069e-148 < i < 1.24999999999999997e101Initial program 70.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f6426.0
Applied rewrites26.0%
if -1.82000000000000003e-35 < i < -7.7999999999999999e-287 or 7.50000000000000044e-263 < i < 9.50000000000000069e-148Initial program 81.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6448.0
Applied rewrites48.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lift-*.f6427.1
Applied rewrites27.1%
if -7.7999999999999999e-287 < i < 7.50000000000000044e-263Initial program 79.6%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6448.4
Applied rewrites48.4%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
lift-neg.f6426.0
Applied rewrites26.0%
if 1.24999999999999997e101 < i Initial program 62.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.2
Applied rewrites49.2%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6439.3
Applied rewrites39.3%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.7
Applied rewrites39.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -2.9e+72)
(* (* c j) t)
(if (<= j -7.4e-9)
(* (* (- i) j) y)
(if (<= j 6e-309)
(* (* z y) x)
(if (<= j 3.5e-232)
(* (* b a) i)
(if (<= j 3.4e-66) (* (* z x) y) (* (- i) (* j y))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -2.9e+72) {
tmp = (c * j) * t;
} else if (j <= -7.4e-9) {
tmp = (-i * j) * y;
} else if (j <= 6e-309) {
tmp = (z * y) * x;
} else if (j <= 3.5e-232) {
tmp = (b * a) * i;
} else if (j <= 3.4e-66) {
tmp = (z * x) * y;
} else {
tmp = -i * (j * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-2.9d+72)) then
tmp = (c * j) * t
else if (j <= (-7.4d-9)) then
tmp = (-i * j) * y
else if (j <= 6d-309) then
tmp = (z * y) * x
else if (j <= 3.5d-232) then
tmp = (b * a) * i
else if (j <= 3.4d-66) then
tmp = (z * x) * y
else
tmp = -i * (j * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -2.9e+72) {
tmp = (c * j) * t;
} else if (j <= -7.4e-9) {
tmp = (-i * j) * y;
} else if (j <= 6e-309) {
tmp = (z * y) * x;
} else if (j <= 3.5e-232) {
tmp = (b * a) * i;
} else if (j <= 3.4e-66) {
tmp = (z * x) * y;
} else {
tmp = -i * (j * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -2.9e+72: tmp = (c * j) * t elif j <= -7.4e-9: tmp = (-i * j) * y elif j <= 6e-309: tmp = (z * y) * x elif j <= 3.5e-232: tmp = (b * a) * i elif j <= 3.4e-66: tmp = (z * x) * y else: tmp = -i * (j * y) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -2.9e+72) tmp = Float64(Float64(c * j) * t); elseif (j <= -7.4e-9) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (j <= 6e-309) tmp = Float64(Float64(z * y) * x); elseif (j <= 3.5e-232) tmp = Float64(Float64(b * a) * i); elseif (j <= 3.4e-66) tmp = Float64(Float64(z * x) * y); else tmp = Float64(Float64(-i) * Float64(j * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -2.9e+72) tmp = (c * j) * t; elseif (j <= -7.4e-9) tmp = (-i * j) * y; elseif (j <= 6e-309) tmp = (z * y) * x; elseif (j <= 3.5e-232) tmp = (b * a) * i; elseif (j <= 3.4e-66) tmp = (z * x) * y; else tmp = -i * (j * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -2.9e+72], N[(N[(c * j), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[j, -7.4e-9], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[j, 6e-309], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 3.5e-232], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[j, 3.4e-66], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -2.9 \cdot 10^{+72}:\\
\;\;\;\;\left(c \cdot j\right) \cdot t\\
\mathbf{elif}\;j \leq -7.4 \cdot 10^{-9}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;j \leq 6 \cdot 10^{-309}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{-232}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;j \leq 3.4 \cdot 10^{-66}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\end{array}
\end{array}
if j < -2.90000000000000017e72Initial program 70.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
Taylor expanded in x around 0
lower-*.f6438.8
Applied rewrites38.8%
if -2.90000000000000017e72 < j < -7.4e-9Initial program 76.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6441.9
Applied rewrites41.9%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f6423.9
Applied rewrites23.9%
if -7.4e-9 < j < 6.000000000000001e-309Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6433.0
Applied rewrites33.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6426.0
Applied rewrites26.0%
if 6.000000000000001e-309 < j < 3.4999999999999998e-232Initial program 70.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.0
Applied rewrites49.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6429.2
Applied rewrites29.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.6
Applied rewrites31.6%
if 3.4999999999999998e-232 < j < 3.39999999999999997e-66Initial program 72.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6434.4
Applied rewrites34.4%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6428.0
Applied rewrites28.0%
if 3.39999999999999997e-66 < j Initial program 73.4%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6444.6
Applied rewrites44.6%
Taylor expanded in y around inf
lower-*.f6431.2
Applied rewrites31.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* (- i) j) y)))
(if (<= j -2.9e+72)
(* (* c j) t)
(if (<= j -7.4e-9)
t_1
(if (<= j 6e-309)
(* (* z y) x)
(if (<= j 3.5e-232)
(* (* b a) i)
(if (<= j 3.4e-66) (* (* z x) y) t_1)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-i * j) * y;
double tmp;
if (j <= -2.9e+72) {
tmp = (c * j) * t;
} else if (j <= -7.4e-9) {
tmp = t_1;
} else if (j <= 6e-309) {
tmp = (z * y) * x;
} else if (j <= 3.5e-232) {
tmp = (b * a) * i;
} else if (j <= 3.4e-66) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (-i * j) * y
if (j <= (-2.9d+72)) then
tmp = (c * j) * t
else if (j <= (-7.4d-9)) then
tmp = t_1
else if (j <= 6d-309) then
tmp = (z * y) * x
else if (j <= 3.5d-232) then
tmp = (b * a) * i
else if (j <= 3.4d-66) then
tmp = (z * x) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (-i * j) * y;
double tmp;
if (j <= -2.9e+72) {
tmp = (c * j) * t;
} else if (j <= -7.4e-9) {
tmp = t_1;
} else if (j <= 6e-309) {
tmp = (z * y) * x;
} else if (j <= 3.5e-232) {
tmp = (b * a) * i;
} else if (j <= 3.4e-66) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (-i * j) * y tmp = 0 if j <= -2.9e+72: tmp = (c * j) * t elif j <= -7.4e-9: tmp = t_1 elif j <= 6e-309: tmp = (z * y) * x elif j <= 3.5e-232: tmp = (b * a) * i elif j <= 3.4e-66: tmp = (z * x) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(-i) * j) * y) tmp = 0.0 if (j <= -2.9e+72) tmp = Float64(Float64(c * j) * t); elseif (j <= -7.4e-9) tmp = t_1; elseif (j <= 6e-309) tmp = Float64(Float64(z * y) * x); elseif (j <= 3.5e-232) tmp = Float64(Float64(b * a) * i); elseif (j <= 3.4e-66) tmp = Float64(Float64(z * x) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (-i * j) * y; tmp = 0.0; if (j <= -2.9e+72) tmp = (c * j) * t; elseif (j <= -7.4e-9) tmp = t_1; elseif (j <= 6e-309) tmp = (z * y) * x; elseif (j <= 3.5e-232) tmp = (b * a) * i; elseif (j <= 3.4e-66) tmp = (z * x) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[j, -2.9e+72], N[(N[(c * j), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[j, -7.4e-9], t$95$1, If[LessEqual[j, 6e-309], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 3.5e-232], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[j, 3.4e-66], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{if}\;j \leq -2.9 \cdot 10^{+72}:\\
\;\;\;\;\left(c \cdot j\right) \cdot t\\
\mathbf{elif}\;j \leq -7.4 \cdot 10^{-9}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 6 \cdot 10^{-309}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{-232}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;j \leq 3.4 \cdot 10^{-66}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.90000000000000017e72Initial program 70.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
Taylor expanded in x around 0
lower-*.f6438.8
Applied rewrites38.8%
if -2.90000000000000017e72 < j < -7.4e-9 or 3.39999999999999997e-66 < j Initial program 74.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6443.3
Applied rewrites43.3%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f6429.9
Applied rewrites29.9%
if -7.4e-9 < j < 6.000000000000001e-309Initial program 73.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6433.0
Applied rewrites33.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6426.0
Applied rewrites26.0%
if 6.000000000000001e-309 < j < 3.4999999999999998e-232Initial program 70.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.0
Applied rewrites49.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6429.2
Applied rewrites29.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.6
Applied rewrites31.6%
if 3.4999999999999998e-232 < j < 3.39999999999999997e-66Initial program 72.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6434.4
Applied rewrites34.4%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6428.0
Applied rewrites28.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -3.1e+72)
(* (* c j) t)
(if (<= j 1.5e-236)
(* (fma i a (* (- c) z)) b)
(if (<= j 2.05e+174) (* (fma y x (* (- b) c)) z) (* (- i) (* j y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -3.1e+72) {
tmp = (c * j) * t;
} else if (j <= 1.5e-236) {
tmp = fma(i, a, (-c * z)) * b;
} else if (j <= 2.05e+174) {
tmp = fma(y, x, (-b * c)) * z;
} else {
tmp = -i * (j * y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -3.1e+72) tmp = Float64(Float64(c * j) * t); elseif (j <= 1.5e-236) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); elseif (j <= 2.05e+174) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); else tmp = Float64(Float64(-i) * Float64(j * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -3.1e+72], N[(N[(c * j), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[j, 1.5e-236], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[j, 2.05e+174], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -3.1 \cdot 10^{+72}:\\
\;\;\;\;\left(c \cdot j\right) \cdot t\\
\mathbf{elif}\;j \leq 1.5 \cdot 10^{-236}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;j \leq 2.05 \cdot 10^{+174}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\end{array}
\end{array}
if j < -3.09999999999999988e72Initial program 70.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
Taylor expanded in x around 0
lower-*.f6438.8
Applied rewrites38.8%
if -3.09999999999999988e72 < j < 1.50000000000000007e-236Initial program 73.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6445.3
Applied rewrites45.3%
if 1.50000000000000007e-236 < j < 2.05000000000000015e174Initial program 73.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6440.6
Applied rewrites40.6%
if 2.05000000000000015e174 < j Initial program 69.9%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6450.1
Applied rewrites50.1%
Taylor expanded in y around inf
lower-*.f6442.7
Applied rewrites42.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* c j) t)))
(if (<= j -24000000000.0)
t_1
(if (<= j 6e-309)
(* (* z y) x)
(if (<= j 3.5e-232)
(* (* b a) i)
(if (<= j 3.6e-66) (* (* z x) y) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (j <= -24000000000.0) {
tmp = t_1;
} else if (j <= 6e-309) {
tmp = (z * y) * x;
} else if (j <= 3.5e-232) {
tmp = (b * a) * i;
} else if (j <= 3.6e-66) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (c * j) * t
if (j <= (-24000000000.0d0)) then
tmp = t_1
else if (j <= 6d-309) then
tmp = (z * y) * x
else if (j <= 3.5d-232) then
tmp = (b * a) * i
else if (j <= 3.6d-66) then
tmp = (z * x) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (j <= -24000000000.0) {
tmp = t_1;
} else if (j <= 6e-309) {
tmp = (z * y) * x;
} else if (j <= 3.5e-232) {
tmp = (b * a) * i;
} else if (j <= 3.6e-66) {
tmp = (z * x) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (c * j) * t tmp = 0 if j <= -24000000000.0: tmp = t_1 elif j <= 6e-309: tmp = (z * y) * x elif j <= 3.5e-232: tmp = (b * a) * i elif j <= 3.6e-66: tmp = (z * x) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * j) * t) tmp = 0.0 if (j <= -24000000000.0) tmp = t_1; elseif (j <= 6e-309) tmp = Float64(Float64(z * y) * x); elseif (j <= 3.5e-232) tmp = Float64(Float64(b * a) * i); elseif (j <= 3.6e-66) tmp = Float64(Float64(z * x) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (c * j) * t; tmp = 0.0; if (j <= -24000000000.0) tmp = t_1; elseif (j <= 6e-309) tmp = (z * y) * x; elseif (j <= 3.5e-232) tmp = (b * a) * i; elseif (j <= 3.6e-66) tmp = (z * x) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * j), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[j, -24000000000.0], t$95$1, If[LessEqual[j, 6e-309], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[j, 3.5e-232], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[j, 3.6e-66], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot j\right) \cdot t\\
\mathbf{if}\;j \leq -24000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 6 \cdot 10^{-309}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{-232}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\mathbf{elif}\;j \leq 3.6 \cdot 10^{-66}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.4e10 or 3.60000000000000012e-66 < j Initial program 72.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6445.4
Applied rewrites45.4%
Taylor expanded in x around 0
lower-*.f6433.0
Applied rewrites33.0%
if -2.4e10 < j < 6.000000000000001e-309Initial program 73.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6433.3
Applied rewrites33.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.7
Applied rewrites25.7%
if 6.000000000000001e-309 < j < 3.4999999999999998e-232Initial program 70.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.0
Applied rewrites49.0%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6429.2
Applied rewrites29.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6431.6
Applied rewrites31.6%
if 3.4999999999999998e-232 < j < 3.60000000000000012e-66Initial program 72.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6434.4
Applied rewrites34.4%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6428.0
Applied rewrites28.0%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -3.1e-12)
t_1
(if (<= t 1.3e-42) (* (fma (- i) j (* z x)) y) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-a, x, (j * c)) * t;
double tmp;
if (t <= -3.1e-12) {
tmp = t_1;
} else if (t <= 1.3e-42) {
tmp = fma(-i, j, (z * x)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -3.1e-12) tmp = t_1; elseif (t <= 1.3e-42) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * 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[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -3.1e-12], t$95$1, If[LessEqual[t, 1.3e-42], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -3.1 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.3 \cdot 10^{-42}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.1000000000000001e-12 or 1.3e-42 < t Initial program 66.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6457.1
Applied rewrites57.1%
if -3.1000000000000001e-12 < t < 1.3e-42Initial program 80.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.2
Applied rewrites46.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- a) x (* j c)) t)))
(if (<= t -4.3e-12)
t_1
(if (<= t 8.5e-31) (* (fma y x (* (- b) 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 = fma(-a, x, (j * c)) * t;
double tmp;
if (t <= -4.3e-12) {
tmp = t_1;
} else if (t <= 8.5e-31) {
tmp = fma(y, x, (-b * c)) * z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-a), x, Float64(j * c)) * t) tmp = 0.0 if (t <= -4.3e-12) tmp = t_1; elseif (t <= 8.5e-31) tmp = Float64(fma(y, x, Float64(Float64(-b) * c)) * z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-a) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -4.3e-12], t$95$1, If[LessEqual[t, 8.5e-31], N[(N[(y * x + N[((-b) * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, x, j \cdot c\right) \cdot t\\
\mathbf{if}\;t \leq -4.3 \cdot 10^{-12}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(y, x, \left(-b\right) \cdot c\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -4.29999999999999985e-12 or 8.5000000000000007e-31 < t Initial program 66.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6457.5
Applied rewrites57.5%
if -4.29999999999999985e-12 < t < 8.5000000000000007e-31Initial program 80.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6446.8
Applied rewrites46.8%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (fma j t (* (- b) z)) c))) (if (<= c -9e+79) t_1 (if (<= c 7.6e-33) (* (fma (- a) t (* z y)) x) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(j, t, (-b * z)) * c;
double tmp;
if (c <= -9e+79) {
tmp = t_1;
} else if (c <= 7.6e-33) {
tmp = fma(-a, t, (z * y)) * x;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(j, t, Float64(Float64(-b) * z)) * c) tmp = 0.0 if (c <= -9e+79) tmp = t_1; elseif (c <= 7.6e-33) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision]}, If[LessEqual[c, -9e+79], t$95$1, If[LessEqual[c, 7.6e-33], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{if}\;c \leq -9 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq 7.6 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -8.99999999999999987e79 or 7.59999999999999988e-33 < c Initial program 65.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6461.0
Applied rewrites61.0%
if -8.99999999999999987e79 < c < 7.59999999999999988e-33Initial program 79.2%
Taylor expanded in x around inf
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6446.0
Applied rewrites46.0%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= i -4.4e+117)
(* (* (- i) j) y)
(if (<= i 265000000000.0)
(* (fma j t (* (- b) z)) c)
(* (fma i a (* (- c) z)) b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -4.4e+117) {
tmp = (-i * j) * y;
} else if (i <= 265000000000.0) {
tmp = fma(j, t, (-b * z)) * c;
} else {
tmp = fma(i, a, (-c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -4.4e+117) tmp = Float64(Float64(Float64(-i) * j) * y); elseif (i <= 265000000000.0) tmp = Float64(fma(j, t, Float64(Float64(-b) * z)) * c); else tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -4.4e+117], N[(N[((-i) * j), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[i, 265000000000.0], N[(N[(j * t + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -4.4 \cdot 10^{+117}:\\
\;\;\;\;\left(\left(-i\right) \cdot j\right) \cdot y\\
\mathbf{elif}\;i \leq 265000000000:\\
\;\;\;\;\mathsf{fma}\left(j, t, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\end{array}
\end{array}
if i < -4.40000000000000028e117Initial program 58.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6447.7
Applied rewrites47.7%
Taylor expanded in x around 0
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f6440.3
Applied rewrites40.3%
if -4.40000000000000028e117 < i < 2.65e11Initial program 78.9%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6444.4
Applied rewrites44.4%
if 2.65e11 < i Initial program 66.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6445.0
Applied rewrites45.0%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= j -3.1e+72) (* (* c j) t) (if (<= j 2.8e+144) (* (fma i a (* (- c) z)) b) (* (- i) (* j y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -3.1e+72) {
tmp = (c * j) * t;
} else if (j <= 2.8e+144) {
tmp = fma(i, a, (-c * z)) * b;
} else {
tmp = -i * (j * y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -3.1e+72) tmp = Float64(Float64(c * j) * t); elseif (j <= 2.8e+144) tmp = Float64(fma(i, a, Float64(Float64(-c) * z)) * b); else tmp = Float64(Float64(-i) * Float64(j * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -3.1e+72], N[(N[(c * j), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[j, 2.8e+144], N[(N[(i * a + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -3.1 \cdot 10^{+72}:\\
\;\;\;\;\left(c \cdot j\right) \cdot t\\
\mathbf{elif}\;j \leq 2.8 \cdot 10^{+144}:\\
\;\;\;\;\mathsf{fma}\left(i, a, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\end{array}
\end{array}
if j < -3.09999999999999988e72Initial program 70.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6449.0
Applied rewrites49.0%
Taylor expanded in x around 0
lower-*.f6438.8
Applied rewrites38.8%
if -3.09999999999999988e72 < j < 2.80000000000000007e144Initial program 73.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6443.6
Applied rewrites43.6%
if 2.80000000000000007e144 < j Initial program 70.4%
Taylor expanded in i around -inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f64N/A
fp-cancel-sub-sign-invN/A
mul-1-negN/A
associate-*r*N/A
lower-fma.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6448.5
Applied rewrites48.5%
Taylor expanded in y around inf
lower-*.f6440.4
Applied rewrites40.4%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* c j) t))) (if (<= j -2.2e+45) t_1 (if (<= j 3.25e+100) (* (* (- b) z) 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 = (c * j) * t;
double tmp;
if (j <= -2.2e+45) {
tmp = t_1;
} else if (j <= 3.25e+100) {
tmp = (-b * z) * 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 = (c * j) * t
if (j <= (-2.2d+45)) then
tmp = t_1
else if (j <= 3.25d+100) then
tmp = (-b * z) * 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 = (c * j) * t;
double tmp;
if (j <= -2.2e+45) {
tmp = t_1;
} else if (j <= 3.25e+100) {
tmp = (-b * z) * c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (c * j) * t tmp = 0 if j <= -2.2e+45: tmp = t_1 elif j <= 3.25e+100: tmp = (-b * z) * c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * j) * t) tmp = 0.0 if (j <= -2.2e+45) tmp = t_1; elseif (j <= 3.25e+100) tmp = Float64(Float64(Float64(-b) * z) * c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (c * j) * t; tmp = 0.0; if (j <= -2.2e+45) tmp = t_1; elseif (j <= 3.25e+100) tmp = (-b * z) * 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[(N[(c * j), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[j, -2.2e+45], t$95$1, If[LessEqual[j, 3.25e+100], N[(N[((-b) * z), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot j\right) \cdot t\\
\mathbf{if}\;j \leq -2.2 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.25 \cdot 10^{+100}:\\
\;\;\;\;\left(\left(-b\right) \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.2e45 or 3.25e100 < j Initial program 71.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6448.2
Applied rewrites48.2%
Taylor expanded in x around 0
lower-*.f6438.1
Applied rewrites38.1%
if -2.2e45 < j < 3.25e100Initial program 73.5%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6433.4
Applied rewrites33.4%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
lift-neg.f6424.5
Applied rewrites24.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* c j) t))) (if (<= j -2.2e+45) t_1 (if (<= j 2.1e+90) (* (* (- c) z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (j <= -2.2e+45) {
tmp = t_1;
} else if (j <= 2.1e+90) {
tmp = (-c * z) * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (c * j) * t
if (j <= (-2.2d+45)) then
tmp = t_1
else if (j <= 2.1d+90) then
tmp = (-c * z) * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (j <= -2.2e+45) {
tmp = t_1;
} else if (j <= 2.1e+90) {
tmp = (-c * z) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (c * j) * t tmp = 0 if j <= -2.2e+45: tmp = t_1 elif j <= 2.1e+90: tmp = (-c * z) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * j) * t) tmp = 0.0 if (j <= -2.2e+45) tmp = t_1; elseif (j <= 2.1e+90) tmp = Float64(Float64(Float64(-c) * z) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (c * j) * t; tmp = 0.0; if (j <= -2.2e+45) tmp = t_1; elseif (j <= 2.1e+90) tmp = (-c * z) * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * j), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[j, -2.2e+45], t$95$1, If[LessEqual[j, 2.1e+90], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot j\right) \cdot t\\
\mathbf{if}\;j \leq -2.2 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 2.1 \cdot 10^{+90}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.2e45 or 2.09999999999999981e90 < j Initial program 71.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6448.2
Applied rewrites48.2%
Taylor expanded in x around 0
lower-*.f6437.9
Applied rewrites37.9%
if -2.2e45 < j < 2.09999999999999981e90Initial program 73.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6444.6
Applied rewrites44.6%
Taylor expanded in z around inf
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6423.8
Applied rewrites23.8%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* c j) t))) (if (<= j -2.55e+45) t_1 (if (<= j 3.4e+100) (- (* (* c b) z)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (j <= -2.55e+45) {
tmp = t_1;
} else if (j <= 3.4e+100) {
tmp = -((c * b) * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (c * j) * t
if (j <= (-2.55d+45)) then
tmp = t_1
else if (j <= 3.4d+100) then
tmp = -((c * b) * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (j <= -2.55e+45) {
tmp = t_1;
} else if (j <= 3.4e+100) {
tmp = -((c * b) * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (c * j) * t tmp = 0 if j <= -2.55e+45: tmp = t_1 elif j <= 3.4e+100: tmp = -((c * b) * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * j) * t) tmp = 0.0 if (j <= -2.55e+45) tmp = t_1; elseif (j <= 3.4e+100) tmp = Float64(-Float64(Float64(c * b) * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (c * j) * t; tmp = 0.0; if (j <= -2.55e+45) tmp = t_1; elseif (j <= 3.4e+100) tmp = -((c * b) * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * j), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[j, -2.55e+45], t$95$1, If[LessEqual[j, 3.4e+100], (-N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot j\right) \cdot t\\
\mathbf{if}\;j \leq -2.55 \cdot 10^{+45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.4 \cdot 10^{+100}:\\
\;\;\;\;-\left(c \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.5499999999999999e45 or 3.39999999999999994e100 < j Initial program 71.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6448.2
Applied rewrites48.2%
Taylor expanded in x around 0
lower-*.f6438.1
Applied rewrites38.1%
if -2.5499999999999999e45 < j < 3.39999999999999994e100Initial program 73.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6444.4
Applied rewrites44.4%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6425.5
Applied rewrites25.5%
Taylor expanded in z around inf
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6424.0
Applied rewrites24.0%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* (* c j) t))) (if (<= j -24000000000.0) t_1 (if (<= j 1.18e+100) (* (* z y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (j <= -24000000000.0) {
tmp = t_1;
} else if (j <= 1.18e+100) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = (c * j) * t
if (j <= (-24000000000.0d0)) then
tmp = t_1
else if (j <= 1.18d+100) then
tmp = (z * y) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * j) * t;
double tmp;
if (j <= -24000000000.0) {
tmp = t_1;
} else if (j <= 1.18e+100) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (c * j) * t tmp = 0 if j <= -24000000000.0: tmp = t_1 elif j <= 1.18e+100: tmp = (z * y) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * j) * t) tmp = 0.0 if (j <= -24000000000.0) tmp = t_1; elseif (j <= 1.18e+100) tmp = Float64(Float64(z * y) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = (c * j) * t; tmp = 0.0; if (j <= -24000000000.0) tmp = t_1; elseif (j <= 1.18e+100) tmp = (z * y) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * j), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[j, -24000000000.0], t$95$1, If[LessEqual[j, 1.18e+100], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot j\right) \cdot t\\
\mathbf{if}\;j \leq -24000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.18 \cdot 10^{+100}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.4e10 or 1.18e100 < j Initial program 71.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6447.4
Applied rewrites47.4%
Taylor expanded in x around 0
lower-*.f6436.8
Applied rewrites36.8%
if -2.4e10 < j < 1.18e100Initial program 73.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6434.4
Applied rewrites34.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.2
Applied rewrites25.2%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* c (* j t)))) (if (<= j -24000000000.0) t_1 (if (<= j 2.95e+99) (* (* z y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (j * t);
double tmp;
if (j <= -24000000000.0) {
tmp = t_1;
} else if (j <= 2.95e+99) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = c * (j * t)
if (j <= (-24000000000.0d0)) then
tmp = t_1
else if (j <= 2.95d+99) then
tmp = (z * y) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = c * (j * t);
double tmp;
if (j <= -24000000000.0) {
tmp = t_1;
} else if (j <= 2.95e+99) {
tmp = (z * y) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * (j * t) tmp = 0 if j <= -24000000000.0: tmp = t_1 elif j <= 2.95e+99: tmp = (z * y) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(j * t)) tmp = 0.0 if (j <= -24000000000.0) tmp = t_1; elseif (j <= 2.95e+99) tmp = Float64(Float64(z * y) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = c * (j * t); tmp = 0.0; if (j <= -24000000000.0) tmp = t_1; elseif (j <= 2.95e+99) tmp = (z * y) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -24000000000.0], t$95$1, If[LessEqual[j, 2.95e+99], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t\right)\\
\mathbf{if}\;j \leq -24000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 2.95 \cdot 10^{+99}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if j < -2.4e10 or 2.9499999999999999e99 < j Initial program 71.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6447.4
Applied rewrites47.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6436.7
Applied rewrites36.7%
if -2.4e10 < j < 2.9499999999999999e99Initial program 73.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6434.4
Applied rewrites34.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6425.3
Applied rewrites25.3%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= i -5.2e+87) (* a (* b i)) (if (<= i 4e+100) (* c (* j t)) (* (* b a) i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -5.2e+87) {
tmp = a * (b * i);
} else if (i <= 4e+100) {
tmp = c * (j * t);
} else {
tmp = (b * a) * i;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (i <= (-5.2d+87)) then
tmp = a * (b * i)
else if (i <= 4d+100) then
tmp = c * (j * t)
else
tmp = (b * a) * i
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (i <= -5.2e+87) {
tmp = a * (b * i);
} else if (i <= 4e+100) {
tmp = c * (j * t);
} else {
tmp = (b * a) * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if i <= -5.2e+87: tmp = a * (b * i) elif i <= 4e+100: tmp = c * (j * t) else: tmp = (b * a) * i return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (i <= -5.2e+87) tmp = Float64(a * Float64(b * i)); elseif (i <= 4e+100) tmp = Float64(c * Float64(j * t)); else tmp = Float64(Float64(b * a) * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (i <= -5.2e+87) tmp = a * (b * i); elseif (i <= 4e+100) tmp = c * (j * t); else tmp = (b * a) * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[i, -5.2e+87], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 4e+100], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision], N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -5.2 \cdot 10^{+87}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;i \leq 4 \cdot 10^{+100}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i\\
\end{array}
\end{array}
if i < -5.19999999999999997e87Initial program 60.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6451.4
Applied rewrites51.4%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6441.3
Applied rewrites41.3%
if -5.19999999999999997e87 < i < 4.00000000000000006e100Initial program 78.7%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6444.3
Applied rewrites44.3%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6424.9
Applied rewrites24.9%
if 4.00000000000000006e100 < i Initial program 62.3%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6449.3
Applied rewrites49.3%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.8
Applied rewrites39.8%
(FPCore (x y z t a b c i j) :precision binary64 (* (* b a) i))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (b * a) * 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 = (b * a) * 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 (b * a) * i;
}
def code(x, y, z, t, a, b, c, i, j): return (b * a) * i
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(b * a) * i) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (b * a) * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision]
\begin{array}{l}
\\
\left(b \cdot a\right) \cdot i
\end{array}
Initial program 72.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6438.9
Applied rewrites38.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6422.7
Applied rewrites22.7%
(FPCore (x y z t a b c i j) :precision binary64 (* a (* b i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return a * (b * 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 = a * (b * 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 a * (b * i);
}
def code(x, y, z, t, a, b, c, i, j): return a * (b * i)
function code(x, y, z, t, a, b, c, i, j) return Float64(a * Float64(b * i)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = a * (b * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a \cdot \left(b \cdot i\right)
\end{array}
Initial program 72.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6438.9
Applied rewrites38.9%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6422.2
Applied rewrites22.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(/
(* j (- (pow (* c t) 2.0) (pow (* i y) 2.0)))
(+ (* c t) (* i y)))))
(t_2
(-
(* x (- (* z y) (* a t)))
(- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j)))))
(if (< t -8.120978919195912e-33)
t_2
(if (< t -4.712553818218485e-169)
t_1
(if (< t -7.633533346031584e-308)
t_2
(if (< t 1.0535888557455487e-139) 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) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (pow((c * t), 2.0) - pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ** 2.0d0) - ((i * y) ** 2.0d0))) / ((c * t) + (i * y)))
t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j))
if (t < (-8.120978919195912d-33)) then
tmp = t_2
else if (t < (-4.712553818218485d-169)) then
tmp = t_1
else if (t < (-7.633533346031584d-308)) then
tmp = t_2
else if (t < 1.0535888557455487d-139) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (Math.pow((c * t), 2.0) - Math.pow((i * y), 2.0))) / ((c * t) + (i * y)));
double t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j));
double tmp;
if (t < -8.120978919195912e-33) {
tmp = t_2;
} else if (t < -4.712553818218485e-169) {
tmp = t_1;
} else if (t < -7.633533346031584e-308) {
tmp = t_2;
} else if (t < 1.0535888557455487e-139) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (math.pow((c * t), 2.0) - math.pow((i * y), 2.0))) / ((c * t) + (i * y))) t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)) tmp = 0 if t < -8.120978919195912e-33: tmp = t_2 elif t < -4.712553818218485e-169: tmp = t_1 elif t < -7.633533346031584e-308: tmp = t_2 elif t < 1.0535888557455487e-139: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(Float64(j * Float64((Float64(c * t) ^ 2.0) - (Float64(i * y) ^ 2.0))) / Float64(Float64(c * t) + Float64(i * y)))) t_2 = Float64(Float64(x * Float64(Float64(z * y) - Float64(a * t))) - Float64(Float64(b * Float64(Float64(z * c) - Float64(a * i))) - Float64(Float64(Float64(c * t) - Float64(y * i)) * j))) tmp = 0.0 if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + ((j * (((c * t) ^ 2.0) - ((i * y) ^ 2.0))) / ((c * t) + (i * y))); t_2 = (x * ((z * y) - (a * t))) - ((b * ((z * c) - (a * i))) - (((c * t) - (y * i)) * j)); tmp = 0.0; if (t < -8.120978919195912e-33) tmp = t_2; elseif (t < -4.712553818218485e-169) tmp = t_1; elseif (t < -7.633533346031584e-308) tmp = t_2; elseif (t < 1.0535888557455487e-139) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(j * N[(N[Power[N[(c * t), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(i * y), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[(z * c), $MachinePrecision] - N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(N[(c * t), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -8.120978919195912e-33], t$95$2, If[Less[t, -4.712553818218485e-169], t$95$1, If[Less[t, -7.633533346031584e-308], t$95$2, If[Less[t, 1.0535888557455487e-139], t$95$1, t$95$2]]]]]]
\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 - i \cdot a\right)\right) + \frac{j \cdot \left({\left(c \cdot t\right)}^{2} - {\left(i \cdot y\right)}^{2}\right)}{c \cdot t + i \cdot y}\\
t_2 := x \cdot \left(z \cdot y - a \cdot t\right) - \left(b \cdot \left(z \cdot c - a \cdot i\right) - \left(c \cdot t - y \cdot i\right) \cdot j\right)\\
\mathbf{if}\;t < -8.120978919195912 \cdot 10^{-33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < -4.712553818218485 \cdot 10^{-169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t < -7.633533346031584 \cdot 10^{-308}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 1.0535888557455487 \cdot 10^{-139}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025093
(FPCore (x y z t a b c i j)
:name "Linear.Matrix:det33 from linear-1.19.1.3"
:precision binary64
:alt
(! :herbie-platform default (if (< t -1015122364899489/125000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t -942510763643697/2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (if (< t -238547917063487/3125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))) (if (< t 10535888557455487/100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (/ (* j (- (pow (* c t) 2) (pow (* i y) 2))) (+ (* c t) (* i y)))) (- (* x (- (* z y) (* a t))) (- (* b (- (* z c) (* a i))) (* (- (* c t) (* y i)) j))))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))