
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY) t_1 (* (fma (- t) x (* j c)) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(-t, x, (j * c)) * a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(fma(Float64(-t), x, Float64(j * c)) * a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 89.2%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 0.0%
Taylor expanded in a 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-*.f6454.7
Applied rewrites54.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i t (* (- c) z)) b)))
(if (<= b -2.9e+108)
t_1
(if (<= b -2.9e-86)
(- (* (- c) (* (fma t (/ x c) (- j)) a)) (* (* c z) b))
(if (<= b -1.2e-226)
(+ (* (* z y) x) (* j (- (* c a) (* y i))))
(if (<= b 2.3e+185)
(- (fma (fma (- a) t (* z y)) x (* (* j c) a)) (* (* 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 = fma(i, t, (-c * z)) * b;
double tmp;
if (b <= -2.9e+108) {
tmp = t_1;
} else if (b <= -2.9e-86) {
tmp = (-c * (fma(t, (x / c), -j) * a)) - ((c * z) * b);
} else if (b <= -1.2e-226) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (b <= 2.3e+185) {
tmp = fma(fma(-a, t, (z * y)), x, ((j * c) * a)) - ((c * b) * z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, t, Float64(Float64(-c) * z)) * b) tmp = 0.0 if (b <= -2.9e+108) tmp = t_1; elseif (b <= -2.9e-86) tmp = Float64(Float64(Float64(-c) * Float64(fma(t, Float64(x / c), Float64(-j)) * a)) - Float64(Float64(c * z) * b)); elseif (b <= -1.2e-226) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (b <= 2.3e+185) tmp = Float64(fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(j * c) * a)) - Float64(Float64(c * b) * 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[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.9e+108], t$95$1, If[LessEqual[b, -2.9e-86], N[(N[((-c) * N[(N[(t * N[(x / c), $MachinePrecision] + (-j)), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.2e-226], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e+185], N[(N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -2.9 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-86}:\\
\;\;\;\;\left(-c\right) \cdot \left(\mathsf{fma}\left(t, \frac{x}{c}, -j\right) \cdot a\right) - \left(c \cdot z\right) \cdot b\\
\mathbf{elif}\;b \leq -1.2 \cdot 10^{-226}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{+185}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(j \cdot c\right) \cdot a\right) - \left(c \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.90000000000000007e108 or 2.3000000000000001e185 < b Initial program 77.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6483.6
Applied rewrites83.6%
if -2.90000000000000007e108 < b < -2.8999999999999999e-86Initial program 62.1%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites55.6%
Taylor expanded in c around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6457.6
Applied rewrites57.6%
Taylor expanded in z around inf
lift-*.f6451.7
Applied rewrites51.7%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
mul-1-negN/A
lower-neg.f6456.2
Applied rewrites56.2%
if -2.8999999999999999e-86 < b < -1.2e-226Initial program 89.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6482.9
Applied rewrites82.9%
if -1.2e-226 < b < 2.3000000000000001e185Initial program 67.9%
Taylor expanded in i around 0
lower--.f64N/A
Applied rewrites64.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i t (* (- c) z)) b)))
(if (<= b -2.45e+92)
t_1
(if (<= b -3e-17)
(- (* (fma (- t) x (* j c)) a) (* (* c z) b))
(if (<= b -1.2e-226)
(+ (* (* z y) x) (* j (- (* c a) (* y i))))
(if (<= b 2.3e+185)
(- (fma (fma (- a) t (* z y)) x (* (* j c) a)) (* (* 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 = fma(i, t, (-c * z)) * b;
double tmp;
if (b <= -2.45e+92) {
tmp = t_1;
} else if (b <= -3e-17) {
tmp = (fma(-t, x, (j * c)) * a) - ((c * z) * b);
} else if (b <= -1.2e-226) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (b <= 2.3e+185) {
tmp = fma(fma(-a, t, (z * y)), x, ((j * c) * a)) - ((c * b) * z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, t, Float64(Float64(-c) * z)) * b) tmp = 0.0 if (b <= -2.45e+92) tmp = t_1; elseif (b <= -3e-17) tmp = Float64(Float64(fma(Float64(-t), x, Float64(j * c)) * a) - Float64(Float64(c * z) * b)); elseif (b <= -1.2e-226) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (b <= 2.3e+185) tmp = Float64(fma(fma(Float64(-a), t, Float64(z * y)), x, Float64(Float64(j * c) * a)) - Float64(Float64(c * b) * 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[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.45e+92], t$95$1, If[LessEqual[b, -3e-17], N[(N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, -1.2e-226], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e+185], N[(N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -2.45 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a - \left(c \cdot z\right) \cdot b\\
\mathbf{elif}\;b \leq -1.2 \cdot 10^{-226}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{+185}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(-a, t, z \cdot y\right), x, \left(j \cdot c\right) \cdot a\right) - \left(c \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.4500000000000001e92 or 2.3000000000000001e185 < b Initial program 75.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6482.9
Applied rewrites82.9%
if -2.4500000000000001e92 < b < -3.00000000000000006e-17Initial program 62.2%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites61.0%
Taylor expanded in c around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6461.0
Applied rewrites61.0%
Taylor expanded in z around inf
lift-*.f6453.8
Applied rewrites53.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f6457.7
Applied rewrites57.7%
if -3.00000000000000006e-17 < b < -1.2e-226Initial program 80.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6470.5
Applied rewrites70.5%
if -1.2e-226 < b < 2.3000000000000001e185Initial program 67.9%
Taylor expanded in i around 0
lower--.f64N/A
Applied rewrites64.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* c z) b)) (t_2 (* (fma i t (* (- c) z)) b)))
(if (<= b -2.45e+92)
t_2
(if (<= b -3e-17)
(- (* (fma (- t) x (* j c)) a) t_1)
(if (<= b 1.7e-183)
(+ (* (* z y) x) (* j (- (* c a) (* y i))))
(if (<= b 2.3e+185)
(- (fma (- a) (* t x) (* (* j c) a)) 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 = (c * z) * b;
double t_2 = fma(i, t, (-c * z)) * b;
double tmp;
if (b <= -2.45e+92) {
tmp = t_2;
} else if (b <= -3e-17) {
tmp = (fma(-t, x, (j * c)) * a) - t_1;
} else if (b <= 1.7e-183) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (b <= 2.3e+185) {
tmp = fma(-a, (t * x), ((j * c) * a)) - t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * z) * b) t_2 = Float64(fma(i, t, Float64(Float64(-c) * z)) * b) tmp = 0.0 if (b <= -2.45e+92) tmp = t_2; elseif (b <= -3e-17) tmp = Float64(Float64(fma(Float64(-t), x, Float64(j * c)) * a) - t_1); elseif (b <= 1.7e-183) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (b <= 2.3e+185) tmp = Float64(fma(Float64(-a), Float64(t * x), Float64(Float64(j * c) * a)) - t_1); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.45e+92], t$95$2, If[LessEqual[b, -3e-17], N[(N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] - t$95$1), $MachinePrecision], If[LessEqual[b, 1.7e-183], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e+185], N[(N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot z\right) \cdot b\\
t_2 := \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -2.45 \cdot 10^{+92}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -3 \cdot 10^{-17}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a - t\_1\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{-183}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{+185}:\\
\;\;\;\;\mathsf{fma}\left(-a, t \cdot x, \left(j \cdot c\right) \cdot a\right) - t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -2.4500000000000001e92 or 2.3000000000000001e185 < b Initial program 75.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6482.9
Applied rewrites82.9%
if -2.4500000000000001e92 < b < -3.00000000000000006e-17Initial program 62.2%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites61.0%
Taylor expanded in c around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6461.0
Applied rewrites61.0%
Taylor expanded in z around inf
lift-*.f6453.8
Applied rewrites53.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f6457.7
Applied rewrites57.7%
if -3.00000000000000006e-17 < b < 1.70000000000000007e-183Initial program 67.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6465.7
Applied rewrites65.7%
if 1.70000000000000007e-183 < b < 2.3000000000000001e185Initial program 77.4%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.3%
Taylor expanded in z around inf
lift-*.f6460.4
Applied rewrites60.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -7.2e+75)
t_1
(if (<= y 1.7e-34)
(- (fma (- a) (* t x) (* (* j c) a)) (* (fma (- i) t (* c z)) b))
(if (<= y 2.5e+130) (+ (* (* z y) x) (* j (- (* c a) (* y i)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -7.2e+75) {
tmp = t_1;
} else if (y <= 1.7e-34) {
tmp = fma(-a, (t * x), ((j * c) * a)) - (fma(-i, t, (c * z)) * b);
} else if (y <= 2.5e+130) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -7.2e+75) tmp = t_1; elseif (y <= 1.7e-34) tmp = Float64(fma(Float64(-a), Float64(t * x), Float64(Float64(j * c) * a)) - Float64(fma(Float64(-i), t, Float64(c * z)) * b)); elseif (y <= 2.5e+130) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -7.2e+75], t$95$1, If[LessEqual[y, 1.7e-34], N[(N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(j * c), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(N[((-i) * t + N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.5e+130], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(-a, t \cdot x, \left(j \cdot c\right) \cdot a\right) - \mathsf{fma}\left(-i, t, c \cdot z\right) \cdot b\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{+130}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.2e75 or 2.4999999999999998e130 < y Initial program 61.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-*.f6472.2
Applied rewrites72.2%
if -7.2e75 < y < 1.7e-34Initial program 73.6%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.6%
if 1.7e-34 < y < 2.4999999999999998e130Initial program 88.4%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6471.8
Applied rewrites71.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* (fma (- t) x (* j c)) a) (* (* c z) b)))
(t_2 (* (fma i t (* (- c) z)) b)))
(if (<= b -2.45e+92)
t_2
(if (<= b -3e-17)
t_1
(if (<= b 5e-184)
(+ (* (* z y) x) (* j (- (* c a) (* y i))))
(if (<= b 2.3e+185) 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 = (fma(-t, x, (j * c)) * a) - ((c * z) * b);
double t_2 = fma(i, t, (-c * z)) * b;
double tmp;
if (b <= -2.45e+92) {
tmp = t_2;
} else if (b <= -3e-17) {
tmp = t_1;
} else if (b <= 5e-184) {
tmp = ((z * y) * x) + (j * ((c * a) - (y * i)));
} else if (b <= 2.3e+185) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(fma(Float64(-t), x, Float64(j * c)) * a) - Float64(Float64(c * z) * b)) t_2 = Float64(fma(i, t, Float64(Float64(-c) * z)) * b) tmp = 0.0 if (b <= -2.45e+92) tmp = t_2; elseif (b <= -3e-17) tmp = t_1; elseif (b <= 5e-184) tmp = Float64(Float64(Float64(z * y) * x) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))); elseif (b <= 2.3e+185) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -2.45e+92], t$95$2, If[LessEqual[b, -3e-17], t$95$1, If[LessEqual[b, 5e-184], N[(N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e+185], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a - \left(c \cdot z\right) \cdot b\\
t_2 := \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -2.45 \cdot 10^{+92}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -3 \cdot 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-184}:\\
\;\;\;\;\left(z \cdot y\right) \cdot x + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{+185}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -2.4500000000000001e92 or 2.3000000000000001e185 < b Initial program 75.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6482.9
Applied rewrites82.9%
if -2.4500000000000001e92 < b < -3.00000000000000006e-17 or 5.00000000000000003e-184 < b < 2.3000000000000001e185Initial program 73.1%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.4%
Taylor expanded in c around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6465.3
Applied rewrites65.3%
Taylor expanded in z around inf
lift-*.f6456.4
Applied rewrites56.4%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f6459.6
Applied rewrites59.6%
if -3.00000000000000006e-17 < b < 5.00000000000000003e-184Initial program 67.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6465.7
Applied rewrites65.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -2.05e+76)
t_1
(if (<= y 2.8e-105)
(- (* (fma (- t) x (* j c)) a) (* (* c z) b))
(if (<= y 6.4e+35) (* (fma i t (* (- 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 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -2.05e+76) {
tmp = t_1;
} else if (y <= 2.8e-105) {
tmp = (fma(-t, x, (j * c)) * a) - ((c * z) * b);
} else if (y <= 6.4e+35) {
tmp = fma(i, t, (-c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -2.05e+76) tmp = t_1; elseif (y <= 2.8e-105) tmp = Float64(Float64(fma(Float64(-t), x, Float64(j * c)) * a) - Float64(Float64(c * z) * b)); elseif (y <= 6.4e+35) tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.05e+76], t$95$1, If[LessEqual[y, 2.8e-105], N[(N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] - N[(N[(c * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.4e+35], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -2.05 \cdot 10^{+76}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-105}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a - \left(c \cdot z\right) \cdot b\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.0499999999999999e76 or 6.39999999999999965e35 < y Initial program 66.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-*.f6469.9
Applied rewrites69.9%
if -2.0499999999999999e76 < y < 2.8e-105Initial program 74.5%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.3%
Taylor expanded in c around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f6468.4
Applied rewrites68.4%
Taylor expanded in z around inf
lift-*.f6460.8
Applied rewrites60.8%
Taylor expanded in a around 0
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lift-neg.f64N/A
*-commutativeN/A
lift-*.f6461.6
Applied rewrites61.6%
if 2.8e-105 < y < 6.39999999999999965e35Initial program 75.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6465.5
Applied rewrites65.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i t (* (- c) z)) b)))
(if (<= b -3.2e+90)
t_1
(if (<= b -8.6e-203)
(* (fma (- i) y (* c a)) j)
(if (<= b -1.2e-285)
(* (fma (- a) t (* z y)) x)
(if (<= b 1.05e+38) (* (fma (- t) x (* j c)) a) 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(i, t, (-c * z)) * b;
double tmp;
if (b <= -3.2e+90) {
tmp = t_1;
} else if (b <= -8.6e-203) {
tmp = fma(-i, y, (c * a)) * j;
} else if (b <= -1.2e-285) {
tmp = fma(-a, t, (z * y)) * x;
} else if (b <= 1.05e+38) {
tmp = fma(-t, x, (j * c)) * a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, t, Float64(Float64(-c) * z)) * b) tmp = 0.0 if (b <= -3.2e+90) tmp = t_1; elseif (b <= -8.6e-203) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); elseif (b <= -1.2e-285) tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); elseif (b <= 1.05e+38) tmp = Float64(fma(Float64(-t), x, Float64(j * c)) * a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -3.2e+90], t$95$1, If[LessEqual[b, -8.6e-203], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[b, -1.2e-285], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[b, 1.05e+38], N[(N[((-t) * x + N[(j * c), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -3.2 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -8.6 \cdot 10^{-203}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{elif}\;b \leq -1.2 \cdot 10^{-285}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(-t, x, j \cdot c\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.19999999999999998e90 or 1.05e38 < b Initial program 76.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6472.9
Applied rewrites72.9%
if -3.19999999999999998e90 < b < -8.60000000000000054e-203Initial program 71.2%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/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
lift-*.f6451.5
Applied rewrites51.5%
if -8.60000000000000054e-203 < b < -1.2e-285Initial program 77.6%
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-*.f6469.5
Applied rewrites69.5%
if -1.2e-285 < b < 1.05e38Initial program 62.2%
Taylor expanded in a 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-*.f6455.2
Applied rewrites55.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i t (* (- c) z)) b)))
(if (<= b -9e-20)
t_1
(if (<= b -3.7e-179)
(* (- i) (* j y))
(if (<= b 2.25e-297)
(* (* z x) y)
(if (<= b 7.2e+36) (* (- t) (* a 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(i, t, (-c * z)) * b;
double tmp;
if (b <= -9e-20) {
tmp = t_1;
} else if (b <= -3.7e-179) {
tmp = -i * (j * y);
} else if (b <= 2.25e-297) {
tmp = (z * x) * y;
} else if (b <= 7.2e+36) {
tmp = -t * (a * x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(i, t, Float64(Float64(-c) * z)) * b) tmp = 0.0 if (b <= -9e-20) tmp = t_1; elseif (b <= -3.7e-179) tmp = Float64(Float64(-i) * Float64(j * y)); elseif (b <= 2.25e-297) tmp = Float64(Float64(z * x) * y); elseif (b <= 7.2e+36) tmp = Float64(Float64(-t) * Float64(a * 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[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -9e-20], t$95$1, If[LessEqual[b, -3.7e-179], N[((-i) * N[(j * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.25e-297], N[(N[(z * x), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[b, 7.2e+36], N[((-t) * N[(a * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -9 \cdot 10^{-20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.7 \cdot 10^{-179}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y\right)\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{-297}:\\
\;\;\;\;\left(z \cdot x\right) \cdot y\\
\mathbf{elif}\;b \leq 7.2 \cdot 10^{+36}:\\
\;\;\;\;\left(-t\right) \cdot \left(a \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.0000000000000003e-20 or 7.1999999999999995e36 < b Initial program 73.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6465.5
Applied rewrites65.5%
if -9.0000000000000003e-20 < b < -3.6999999999999999e-179Initial program 74.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
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6448.4
Applied rewrites48.4%
Taylor expanded in y around inf
lower-*.f6441.2
Applied rewrites41.2%
if -3.6999999999999999e-179 < b < 2.24999999999999988e-297Initial program 74.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-*.f6459.3
Applied rewrites59.3%
Taylor expanded in x around inf
*-commutativeN/A
lift-*.f6450.0
Applied rewrites50.0%
if 2.24999999999999988e-297 < b < 7.1999999999999995e36Initial program 64.6%
Taylor expanded in t 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.f6444.7
Applied rewrites44.7%
Taylor expanded in x around inf
lower-*.f6439.9
Applied rewrites39.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma i t (* (- c) z)) b)))
(if (<= b -3.2e+90)
t_1
(if (<= b -8.6e-203)
(* (fma (- i) y (* c a)) j)
(if (<= b 1e+38) (* (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(i, t, (-c * z)) * b;
double tmp;
if (b <= -3.2e+90) {
tmp = t_1;
} else if (b <= -8.6e-203) {
tmp = fma(-i, y, (c * a)) * j;
} else if (b <= 1e+38) {
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(i, t, Float64(Float64(-c) * z)) * b) tmp = 0.0 if (b <= -3.2e+90) tmp = t_1; elseif (b <= -8.6e-203) tmp = Float64(fma(Float64(-i), y, Float64(c * a)) * j); elseif (b <= 1e+38) 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[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -3.2e+90], t$95$1, If[LessEqual[b, -8.6e-203], N[(N[((-i) * y + N[(c * a), $MachinePrecision]), $MachinePrecision] * j), $MachinePrecision], If[LessEqual[b, 1e+38], 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(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{if}\;b \leq -3.2 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -8.6 \cdot 10^{-203}:\\
\;\;\;\;\mathsf{fma}\left(-i, y, c \cdot a\right) \cdot j\\
\mathbf{elif}\;b \leq 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.19999999999999998e90 or 9.99999999999999977e37 < b Initial program 76.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6472.9
Applied rewrites72.9%
if -3.19999999999999998e90 < b < -8.60000000000000054e-203Initial program 71.2%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/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
lift-*.f6451.5
Applied rewrites51.5%
if -8.60000000000000054e-203 < b < 9.99999999999999977e37Initial program 66.1%
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-*.f6454.1
Applied rewrites54.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (fma (- i) j (* z x)) y)))
(if (<= y -1.45e+116)
t_1
(if (<= y -7.5e-237)
(* (fma j a (* (- b) z)) c)
(if (<= y 6.4e+35) (* (fma i t (* (- 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 = fma(-i, j, (z * x)) * y;
double tmp;
if (y <= -1.45e+116) {
tmp = t_1;
} else if (y <= -7.5e-237) {
tmp = fma(j, a, (-b * z)) * c;
} else if (y <= 6.4e+35) {
tmp = fma(i, t, (-c * z)) * b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(fma(Float64(-i), j, Float64(z * x)) * y) tmp = 0.0 if (y <= -1.45e+116) tmp = t_1; elseif (y <= -7.5e-237) tmp = Float64(fma(j, a, Float64(Float64(-b) * z)) * c); elseif (y <= 6.4e+35) tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -1.45e+116], t$95$1, If[LessEqual[y, -7.5e-237], N[(N[(j * a + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], If[LessEqual[y, 6.4e+35], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -7.5 \cdot 10^{-237}:\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{elif}\;y \leq 6.4 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.4500000000000001e116 or 6.39999999999999965e35 < y Initial program 69.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-*.f6471.2
Applied rewrites71.2%
if -1.4500000000000001e116 < y < -7.50000000000000034e-237Initial program 73.3%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6453.1
Applied rewrites53.1%
if -7.50000000000000034e-237 < y < 6.39999999999999965e35Initial program 73.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6458.1
Applied rewrites58.1%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= b -70000000.0) (not (<= b 1e+38))) (* (fma i t (* (- c) z)) b) (* (fma (- a) t (* z y)) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((b <= -70000000.0) || !(b <= 1e+38)) {
tmp = fma(i, t, (-c * z)) * b;
} else {
tmp = fma(-a, t, (z * y)) * x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((b <= -70000000.0) || !(b <= 1e+38)) tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b); else tmp = Float64(fma(Float64(-a), t, Float64(z * y)) * x); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[b, -70000000.0], N[Not[LessEqual[b, 1e+38]], $MachinePrecision]], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[(N[((-a) * t + N[(z * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -70000000 \lor \neg \left(b \leq 10^{+38}\right):\\
\;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-a, t, z \cdot y\right) \cdot x\\
\end{array}
\end{array}
if b < -7e7 or 9.99999999999999977e37 < b Initial program 75.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6468.5
Applied rewrites68.5%
if -7e7 < b < 9.99999999999999977e37Initial program 68.8%
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-*.f6449.0
Applied rewrites49.0%
Final simplification58.4%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= j -1.65e+63) (not (<= j 2.25e-39))) (* (fma j a (* (- b) z)) c) (* (fma i t (* (- 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 ((j <= -1.65e+63) || !(j <= 2.25e-39)) {
tmp = fma(j, a, (-b * z)) * c;
} else {
tmp = fma(i, t, (-c * z)) * b;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((j <= -1.65e+63) || !(j <= 2.25e-39)) tmp = Float64(fma(j, a, Float64(Float64(-b) * z)) * c); else tmp = Float64(fma(i, t, Float64(Float64(-c) * z)) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[j, -1.65e+63], N[Not[LessEqual[j, 2.25e-39]], $MachinePrecision]], N[(N[(j * a + N[((-b) * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], N[(N[(i * t + N[((-c) * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.65 \cdot 10^{+63} \lor \neg \left(j \leq 2.25 \cdot 10^{-39}\right):\\
\;\;\;\;\mathsf{fma}\left(j, a, \left(-b\right) \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, t, \left(-c\right) \cdot z\right) \cdot b\\
\end{array}
\end{array}
if j < -1.6500000000000001e63 or 2.25e-39 < j Initial program 68.9%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f6453.2
Applied rewrites53.2%
if -1.6500000000000001e63 < j < 2.25e-39Initial program 74.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6451.7
Applied rewrites51.7%
Final simplification52.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= c -9.5e+159)
(* (* (- c) z) b)
(if (<= c -3.05e-298)
(* (* (- a) t) x)
(if (<= c 3.1e-105) (* (* i t) b) (* (* c a) j)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -9.5e+159) {
tmp = (-c * z) * b;
} else if (c <= -3.05e-298) {
tmp = (-a * t) * x;
} else if (c <= 3.1e-105) {
tmp = (i * t) * b;
} else {
tmp = (c * a) * j;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (c <= (-9.5d+159)) then
tmp = (-c * z) * b
else if (c <= (-3.05d-298)) then
tmp = (-a * t) * x
else if (c <= 3.1d-105) then
tmp = (i * t) * b
else
tmp = (c * a) * j
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (c <= -9.5e+159) {
tmp = (-c * z) * b;
} else if (c <= -3.05e-298) {
tmp = (-a * t) * x;
} else if (c <= 3.1e-105) {
tmp = (i * t) * b;
} else {
tmp = (c * a) * j;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if c <= -9.5e+159: tmp = (-c * z) * b elif c <= -3.05e-298: tmp = (-a * t) * x elif c <= 3.1e-105: tmp = (i * t) * b else: tmp = (c * a) * j return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (c <= -9.5e+159) tmp = Float64(Float64(Float64(-c) * z) * b); elseif (c <= -3.05e-298) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (c <= 3.1e-105) tmp = Float64(Float64(i * t) * b); else tmp = Float64(Float64(c * a) * j); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (c <= -9.5e+159) tmp = (-c * z) * b; elseif (c <= -3.05e-298) tmp = (-a * t) * x; elseif (c <= 3.1e-105) tmp = (i * t) * b; else tmp = (c * a) * j; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[c, -9.5e+159], N[(N[((-c) * z), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[c, -3.05e-298], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[c, 3.1e-105], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;c \leq -9.5 \cdot 10^{+159}:\\
\;\;\;\;\left(\left(-c\right) \cdot z\right) \cdot b\\
\mathbf{elif}\;c \leq -3.05 \cdot 10^{-298}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;c \leq 3.1 \cdot 10^{-105}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\end{array}
\end{array}
if c < -9.5000000000000003e159Initial program 58.9%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6474.0
Applied rewrites74.0%
Taylor expanded in z around inf
mul-1-negN/A
distribute-lft-neg-outN/A
lift-*.f64N/A
lift-neg.f6471.3
Applied rewrites71.3%
if -9.5000000000000003e159 < c < -3.05000000000000006e-298Initial program 75.7%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.9%
Taylor expanded in x around inf
mul-1-negN/A
distribute-lft-neg-outN/A
associate-*r*N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lift-neg.f6438.4
Applied rewrites38.4%
if -3.05000000000000006e-298 < c < 3.10000000000000014e-105Initial program 82.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6442.3
Applied rewrites42.3%
Taylor expanded in z around 0
lift-*.f6433.9
Applied rewrites33.9%
if 3.10000000000000014e-105 < c Initial program 67.3%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.8%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6432.0
Applied rewrites32.0%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6434.2
Applied rewrites34.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (* c a) j)))
(if (<= c -1.1e+197)
t_1
(if (<= c -3.05e-298)
(* (* (- a) t) x)
(if (<= c 3.1e-105) (* (* i t) 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 * a) * j;
double tmp;
if (c <= -1.1e+197) {
tmp = t_1;
} else if (c <= -3.05e-298) {
tmp = (-a * t) * x;
} else if (c <= 3.1e-105) {
tmp = (i * t) * 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 * a) * j
if (c <= (-1.1d+197)) then
tmp = t_1
else if (c <= (-3.05d-298)) then
tmp = (-a * t) * x
else if (c <= 3.1d-105) then
tmp = (i * t) * 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 * a) * j;
double tmp;
if (c <= -1.1e+197) {
tmp = t_1;
} else if (c <= -3.05e-298) {
tmp = (-a * t) * x;
} else if (c <= 3.1e-105) {
tmp = (i * t) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = (c * a) * j tmp = 0 if c <= -1.1e+197: tmp = t_1 elif c <= -3.05e-298: tmp = (-a * t) * x elif c <= 3.1e-105: tmp = (i * t) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * a) * j) tmp = 0.0 if (c <= -1.1e+197) tmp = t_1; elseif (c <= -3.05e-298) tmp = Float64(Float64(Float64(-a) * t) * x); elseif (c <= 3.1e-105) tmp = Float64(Float64(i * t) * 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 * a) * j; tmp = 0.0; if (c <= -1.1e+197) tmp = t_1; elseif (c <= -3.05e-298) tmp = (-a * t) * x; elseif (c <= 3.1e-105) tmp = (i * t) * 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 * a), $MachinePrecision] * j), $MachinePrecision]}, If[LessEqual[c, -1.1e+197], t$95$1, If[LessEqual[c, -3.05e-298], N[(N[((-a) * t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[c, 3.1e-105], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(c \cdot a\right) \cdot j\\
\mathbf{if}\;c \leq -1.1 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;c \leq -3.05 \cdot 10^{-298}:\\
\;\;\;\;\left(\left(-a\right) \cdot t\right) \cdot x\\
\mathbf{elif}\;c \leq 3.1 \cdot 10^{-105}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if c < -1.09999999999999995e197 or 3.10000000000000014e-105 < c Initial program 65.4%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites60.7%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6433.1
Applied rewrites33.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6438.8
Applied rewrites38.8%
if -1.09999999999999995e197 < c < -3.05000000000000006e-298Initial program 74.4%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites59.6%
Taylor expanded in x around inf
mul-1-negN/A
distribute-lft-neg-outN/A
associate-*r*N/A
mul-1-negN/A
associate-*r*N/A
lower-*.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lift-neg.f6438.8
Applied rewrites38.8%
if -3.05000000000000006e-298 < c < 3.10000000000000014e-105Initial program 82.1%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6442.3
Applied rewrites42.3%
Taylor expanded in z around 0
lift-*.f6433.9
Applied rewrites33.9%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= j -1.65e+63) (not (<= j 2.6e-36))) (* (* c a) j) (* (* i t) b)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((j <= -1.65e+63) || !(j <= 2.6e-36)) {
tmp = (c * a) * j;
} else {
tmp = (i * t) * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if ((j <= (-1.65d+63)) .or. (.not. (j <= 2.6d-36))) then
tmp = (c * a) * j
else
tmp = (i * t) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((j <= -1.65e+63) || !(j <= 2.6e-36)) {
tmp = (c * a) * j;
} else {
tmp = (i * t) * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (j <= -1.65e+63) or not (j <= 2.6e-36): tmp = (c * a) * j else: tmp = (i * t) * b return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((j <= -1.65e+63) || !(j <= 2.6e-36)) tmp = Float64(Float64(c * a) * j); else tmp = Float64(Float64(i * t) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((j <= -1.65e+63) || ~((j <= 2.6e-36))) tmp = (c * a) * j; else tmp = (i * t) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[j, -1.65e+63], N[Not[LessEqual[j, 2.6e-36]], $MachinePrecision]], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;j \leq -1.65 \cdot 10^{+63} \lor \neg \left(j \leq 2.6 \cdot 10^{-36}\right):\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\mathbf{else}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\end{array}
\end{array}
if j < -1.6500000000000001e63 or 2.6e-36 < j Initial program 68.9%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites47.5%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6435.9
Applied rewrites35.9%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.2
Applied rewrites39.2%
if -1.6500000000000001e63 < j < 2.6e-36Initial program 74.2%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sub-sign-invN/A
lower-fma.f64N/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6451.7
Applied rewrites51.7%
Taylor expanded in z around 0
lift-*.f6431.8
Applied rewrites31.8%
Final simplification35.1%
(FPCore (x y z t a b c i j) :precision binary64 (if (or (<= y -4e+25) (not (<= y 6.5e-27))) (* (* z y) x) (* (* c a) j)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((y <= -4e+25) || !(y <= 6.5e-27)) {
tmp = (z * y) * x;
} else {
tmp = (c * a) * j;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if ((y <= (-4d+25)) .or. (.not. (y <= 6.5d-27))) then
tmp = (z * y) * x
else
tmp = (c * a) * j
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if ((y <= -4e+25) || !(y <= 6.5e-27)) {
tmp = (z * y) * x;
} else {
tmp = (c * a) * j;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if (y <= -4e+25) or not (y <= 6.5e-27): tmp = (z * y) * x else: tmp = (c * a) * j return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if ((y <= -4e+25) || !(y <= 6.5e-27)) tmp = Float64(Float64(z * y) * x); else tmp = Float64(Float64(c * a) * j); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if ((y <= -4e+25) || ~((y <= 6.5e-27))) tmp = (z * y) * x; else tmp = (c * a) * j; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[Or[LessEqual[y, -4e+25], N[Not[LessEqual[y, 6.5e-27]], $MachinePrecision]], N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision], N[(N[(c * a), $MachinePrecision] * j), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+25} \lor \neg \left(y \leq 6.5 \cdot 10^{-27}\right):\\
\;\;\;\;\left(z \cdot y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(c \cdot a\right) \cdot j\\
\end{array}
\end{array}
if y < -4.00000000000000036e25 or 6.50000000000000025e-27 < y Initial program 68.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-*.f6461.3
Applied rewrites61.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6435.4
Applied rewrites35.4%
if -4.00000000000000036e25 < y < 6.50000000000000025e-27Initial program 74.6%
Taylor expanded in y around 0
lower--.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in j around inf
*-commutativeN/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f6426.7
Applied rewrites26.7%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6430.8
Applied rewrites30.8%
Final simplification32.9%
(FPCore (x y z t a b c i j) :precision binary64 (* (* z y) x))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (z * y) * x;
}
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 = (z * y) * x
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 (z * y) * x;
}
def code(x, y, z, t, a, b, c, i, j): return (z * y) * x
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(z * y) * x) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (z * y) * x; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(z * y), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\left(z \cdot y\right) \cdot x
\end{array}
Initial program 71.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-*.f6437.5
Applied rewrites37.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6420.8
Applied rewrites20.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c a) (* y i))))
(t_2
(+
(-
(* x (- (* y z) (* t a)))
(/
(* b (- (pow (* c z) 2.0) (pow (* t i) 2.0)))
(+ (* c z) (* t i))))
t_1)))
(if (< x -1.469694296777705e-64)
t_2
(if (< x 3.2113527362226803e-147)
(- (* (- (* b i) (* x a)) t) (- (* z (* c b)) 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 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (pow((c * z), 2.0) - pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - 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 = j * ((c * a) - (y * i))
t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ** 2.0d0) - ((t * i) ** 2.0d0))) / ((c * z) + (t * i)))) + t_1
if (x < (-1.469694296777705d-64)) then
tmp = t_2
else if (x < 3.2113527362226803d-147) then
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - 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 = j * ((c * a) - (y * i));
double t_2 = ((x * ((y * z) - (t * a))) - ((b * (Math.pow((c * z), 2.0) - Math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1;
double tmp;
if (x < -1.469694296777705e-64) {
tmp = t_2;
} else if (x < 3.2113527362226803e-147) {
tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * a) - (y * i)) t_2 = ((x * ((y * z) - (t * a))) - ((b * (math.pow((c * z), 2.0) - math.pow((t * i), 2.0))) / ((c * z) + (t * i)))) + t_1 tmp = 0 if x < -1.469694296777705e-64: tmp = t_2 elif x < 3.2113527362226803e-147: tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(Float64(c * a) - Float64(y * i))) t_2 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(Float64(b * Float64((Float64(c * z) ^ 2.0) - (Float64(t * i) ^ 2.0))) / Float64(Float64(c * z) + Float64(t * i)))) + t_1) tmp = 0.0 if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = Float64(Float64(Float64(Float64(b * i) - Float64(x * a)) * t) - Float64(Float64(z * Float64(c * b)) - 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 = j * ((c * a) - (y * i)); t_2 = ((x * ((y * z) - (t * a))) - ((b * (((c * z) ^ 2.0) - ((t * i) ^ 2.0))) / ((c * z) + (t * i)))) + t_1; tmp = 0.0; if (x < -1.469694296777705e-64) tmp = t_2; elseif (x < 3.2113527362226803e-147) tmp = (((b * i) - (x * a)) * t) - ((z * (c * b)) - 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[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * N[(N[Power[N[(c * z), $MachinePrecision], 2.0], $MachinePrecision] - N[Power[N[(t * i), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(c * z), $MachinePrecision] + N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[Less[x, -1.469694296777705e-64], t$95$2, If[Less[x, 3.2113527362226803e-147], N[(N[(N[(N[(b * i), $MachinePrecision] - N[(x * a), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision] - N[(N[(z * N[(c * b), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := j \cdot \left(c \cdot a - y \cdot i\right)\\
t_2 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - \frac{b \cdot \left({\left(c \cdot z\right)}^{2} - {\left(t \cdot i\right)}^{2}\right)}{c \cdot z + t \cdot i}\right) + t\_1\\
\mathbf{if}\;x < -1.469694296777705 \cdot 10^{-64}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x < 3.2113527362226803 \cdot 10^{-147}:\\
\;\;\;\;\left(b \cdot i - x \cdot a\right) \cdot t - \left(z \cdot \left(c \cdot b\right) - t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025064
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
:alt
(! :herbie-platform default (if (< x -293938859355541/2000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))) (if (< x 32113527362226803/10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (- (* (- (* b i) (* x a)) t) (- (* z (* c b)) (* j (- (* c a) (* y i))))) (+ (- (* x (- (* y z) (* t a))) (/ (* b (- (pow (* c z) 2) (pow (* t i) 2))) (+ (* c z) (* t i)))) (* j (- (* c a) (* y i)))))))
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))