
(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]
\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)
Herbie found 29 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]
\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)
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* i a) (* c z)))
(t_2 (- (* c t) (* i y)))
(t_3
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j t_2)))
(t_4 (* (- (* z y) (* a t)) x)))
(if (<= t_3 (- INFINITY))
(fma (* j t) c (fma (* j (- y)) i (fma t_1 b t_4)))
(if (<= t_3 INFINITY)
(fma t_1 b (fma t_2 j t_4))
(+ (* x (* y z)) (* c (* j t)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (i * a) - (c * z);
double t_2 = (c * t) - (i * y);
double t_3 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * t_2);
double t_4 = ((z * y) - (a * t)) * x;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = fma((j * t), c, fma((j * -y), i, fma(t_1, b, t_4)));
} else if (t_3 <= ((double) INFINITY)) {
tmp = fma(t_1, b, fma(t_2, j, t_4));
} else {
tmp = (x * (y * z)) + (c * (j * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(i * a) - Float64(c * z)) t_2 = Float64(Float64(c * t) - Float64(i * y)) t_3 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * t_2)) t_4 = Float64(Float64(Float64(z * y) - Float64(a * t)) * x) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = fma(Float64(j * t), c, fma(Float64(j * Float64(-y)), i, fma(t_1, b, t_4))); elseif (t_3 <= Inf) tmp = fma(t_1, b, fma(t_2, j, t_4)); else tmp = Float64(Float64(x * Float64(y * z)) + Float64(c * Float64(j * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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 * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(j * t), $MachinePrecision] * c + N[(N[(j * (-y)), $MachinePrecision] * i + N[(t$95$1 * b + t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, Infinity], N[(t$95$1 * b + N[(t$95$2 * j + t$95$4), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := i \cdot a - c \cdot z\\
t_2 := c \cdot t - i \cdot y\\
t_3 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot t\_2\\
t_4 := \left(z \cdot y - a \cdot t\right) \cdot x\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(j \cdot t, c, \mathsf{fma}\left(j \cdot \left(-y\right), i, \mathsf{fma}\left(t\_1, b, t\_4\right)\right)\right)\\
\mathbf{elif}\;t\_3 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, \mathsf{fma}\left(t\_2, j, t\_4\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + c \cdot \left(j \cdot t\right)\\
\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 73.0%
Applied rewrites75.8%
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)))) < +inf.0Initial program 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
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 73.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.0%
Applied rewrites59.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6450.9%
Applied rewrites50.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))))
(if (<=
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a))))
(* j t_1))
INFINITY)
(fma (- (* i a) (* c z)) b (fma t_1 j (* (- (* z y) (* a t)) x)))
(+ (* x (* y z)) (* c (* j t))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * t) - (i * y);
double tmp;
if ((((x * ((y * z) - (t * a))) - (b * ((c * z) - (i * a)))) + (j * t_1)) <= ((double) INFINITY)) {
tmp = fma(((i * a) - (c * z)), b, fma(t_1, j, (((z * y) - (a * t)) * x)));
} else {
tmp = (x * (y * z)) + (c * (j * t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) tmp = 0.0 if (Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + Float64(j * t_1)) <= Inf) tmp = fma(Float64(Float64(i * a) - Float64(c * z)), b, fma(t_1, j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x))); else tmp = Float64(Float64(x * Float64(y * z)) + Float64(c * Float64(j * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[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 * t$95$1), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(i * a), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b + N[(t$95$1 * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
\mathbf{if}\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - i \cdot a\right)\right) + j \cdot t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(i \cdot a - c \cdot z, b, \mathsf{fma}\left(t\_1, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + c \cdot \left(j \cdot t\right)\\
\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 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
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 73.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.0%
Applied rewrites59.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6450.9%
Applied rewrites50.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))) (t_2 (* j t_1)) (t_3 (* j (* c t))))
(if (<= x -1.45e-7)
(+ (- (* x (- (* y z) (* t a))) (* b (* -1.0 (* a i)))) t_3)
(if (<= x 2e-170)
(+ (* -1.0 (* a (- (* t x) (* b i)))) t_2)
(if (<= x 7.2e-33)
(+ (- (* x (* -1.0 (* a t))) (* b (fma z c (* (- i) a)))) t_3)
(if (<= x 2.05e+96)
(+ (* z (- (* x y) (* b c))) t_2)
(fma j t_1 (* x (- (* y z) (* a t))))))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * t) - (i * y);
double t_2 = j * t_1;
double t_3 = j * (c * t);
double tmp;
if (x <= -1.45e-7) {
tmp = ((x * ((y * z) - (t * a))) - (b * (-1.0 * (a * i)))) + t_3;
} else if (x <= 2e-170) {
tmp = (-1.0 * (a * ((t * x) - (b * i)))) + t_2;
} else if (x <= 7.2e-33) {
tmp = ((x * (-1.0 * (a * t))) - (b * fma(z, c, (-i * a)))) + t_3;
} else if (x <= 2.05e+96) {
tmp = (z * ((x * y) - (b * c))) + t_2;
} else {
tmp = fma(j, t_1, (x * ((y * z) - (a * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) t_2 = Float64(j * t_1) t_3 = Float64(j * Float64(c * t)) tmp = 0.0 if (x <= -1.45e-7) tmp = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(-1.0 * Float64(a * i)))) + t_3); elseif (x <= 2e-170) tmp = Float64(Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))) + t_2); elseif (x <= 7.2e-33) tmp = Float64(Float64(Float64(x * Float64(-1.0 * Float64(a * t))) - Float64(b * fma(z, c, Float64(Float64(-i) * a)))) + t_3); elseif (x <= 2.05e+96) tmp = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + t_2); else tmp = fma(j, t_1, Float64(x * Float64(Float64(y * z) - Float64(a * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e-7], N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(-1.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], If[LessEqual[x, 2e-170], N[(N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[x, 7.2e-33], N[(N[(N[(x * N[(-1.0 * N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(z * c + N[((-i) * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision], If[LessEqual[x, 2.05e+96], N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], N[(j * t$95$1 + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
t_2 := j \cdot t\_1\\
t_3 := j \cdot \left(c \cdot t\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-7}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(-1 \cdot \left(a \cdot i\right)\right)\right) + t\_3\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-170}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right) + t\_2\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-33}:\\
\;\;\;\;\left(x \cdot \left(-1 \cdot \left(a \cdot t\right)\right) - b \cdot \mathsf{fma}\left(z, c, \left(-i\right) \cdot a\right)\right) + t\_3\\
\mathbf{elif}\;x \leq 2.05 \cdot 10^{+96}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_1, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\end{array}
if x < -1.4499999999999999e-7Initial program 73.0%
Taylor expanded in y around 0
lower-*.f6466.1%
Applied rewrites66.1%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6459.2%
Applied rewrites59.2%
if -1.4499999999999999e-7 < x < 2e-170Initial program 73.0%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6458.7%
Applied rewrites58.7%
if 2e-170 < x < 7.2000000000000007e-33Initial program 73.0%
Taylor expanded in y around 0
lower-*.f6466.1%
Applied rewrites66.1%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6466.4%
Applied rewrites66.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6456.7%
Applied rewrites56.7%
if 7.2000000000000007e-33 < x < 2.05e96Initial program 73.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.0%
Applied rewrites59.0%
if 2.05e96 < x Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.5%
Applied rewrites60.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (* c t))) (t_2 (* x (- (* y z) (* t a)))))
(if (<= x -4800000.0)
(+ (- t_2 (* b (fma z c (* (- i) a)))) t_1)
(if (<= x 2e-170)
(+ (* -1.0 (* a (- (* t x) (* b i)))) (* j (- (* c t) (* i y))))
(+ (- t_2 (* b (- (* c z) (* i 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 = j * (c * t);
double t_2 = x * ((y * z) - (t * a));
double tmp;
if (x <= -4800000.0) {
tmp = (t_2 - (b * fma(z, c, (-i * a)))) + t_1;
} else if (x <= 2e-170) {
tmp = (-1.0 * (a * ((t * x) - (b * i)))) + (j * ((c * t) - (i * y)));
} else {
tmp = (t_2 - (b * ((c * z) - (i * a)))) + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(c * t)) t_2 = Float64(x * Float64(Float64(y * z) - Float64(t * a))) tmp = 0.0 if (x <= -4800000.0) tmp = Float64(Float64(t_2 - Float64(b * fma(z, c, Float64(Float64(-i) * a)))) + t_1); elseif (x <= 2e-170) tmp = Float64(Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = Float64(Float64(t_2 - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4800000.0], N[(N[(t$95$2 - N[(b * N[(z * c + N[((-i) * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 2e-170], N[(N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t\right)\\
t_2 := x \cdot \left(y \cdot z - t \cdot a\right)\\
\mathbf{if}\;x \leq -4800000:\\
\;\;\;\;\left(t\_2 - b \cdot \mathsf{fma}\left(z, c, \left(-i\right) \cdot a\right)\right) + t\_1\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-170}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - b \cdot \left(c \cdot z - i \cdot a\right)\right) + t\_1\\
\end{array}
if x < -4.8e6Initial program 73.0%
Taylor expanded in y around 0
lower-*.f6466.1%
Applied rewrites66.1%
lift--.f64N/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6466.4%
Applied rewrites66.4%
if -4.8e6 < x < 2e-170Initial program 73.0%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6458.7%
Applied rewrites58.7%
if 2e-170 < x Initial program 73.0%
Taylor expanded in y around 0
lower-*.f6466.1%
Applied rewrites66.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))))
(if (<= x -1.45e-7)
(+
(- (* x (- (* y z) (* t a))) (* b (* -1.0 (* a i))))
(* j (* c t)))
(if (<= x 3.8e-35)
(+ (* -1.0 (* a (- (* t x) (* b i)))) (* j t_1))
(if (<= x 2.9e+94)
(+ (* z (- (* x y) (* b c))) (* c (* j t)))
(fma j t_1 (* x (- (* y z) (* a t)))))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * t) - (i * y);
double tmp;
if (x <= -1.45e-7) {
tmp = ((x * ((y * z) - (t * a))) - (b * (-1.0 * (a * i)))) + (j * (c * t));
} else if (x <= 3.8e-35) {
tmp = (-1.0 * (a * ((t * x) - (b * i)))) + (j * t_1);
} else if (x <= 2.9e+94) {
tmp = (z * ((x * y) - (b * c))) + (c * (j * t));
} else {
tmp = fma(j, t_1, (x * ((y * z) - (a * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) tmp = 0.0 if (x <= -1.45e-7) tmp = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(-1.0 * Float64(a * i)))) + Float64(j * Float64(c * t))); elseif (x <= 3.8e-35) tmp = Float64(Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))) + Float64(j * t_1)); elseif (x <= 2.9e+94) tmp = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + Float64(c * Float64(j * t))); else tmp = fma(j, t_1, Float64(x * Float64(Float64(y * z) - Float64(a * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e-7], N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(-1.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.8e-35], N[(N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.9e+94], N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(j * t$95$1 + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-7}:\\
\;\;\;\;\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(-1 \cdot \left(a \cdot i\right)\right)\right) + j \cdot \left(c \cdot t\right)\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{-35}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right) + j \cdot t\_1\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+94}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right) + c \cdot \left(j \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_1, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\end{array}
if x < -1.4499999999999999e-7Initial program 73.0%
Taylor expanded in y around 0
lower-*.f6466.1%
Applied rewrites66.1%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6459.2%
Applied rewrites59.2%
if -1.4499999999999999e-7 < x < 3.8000000000000001e-35Initial program 73.0%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6458.7%
Applied rewrites58.7%
if 3.8000000000000001e-35 < x < 2.8999999999999998e94Initial program 73.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.0%
Applied rewrites59.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6450.9%
Applied rewrites50.9%
if 2.8999999999999998e94 < x Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.5%
Applied rewrites60.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (* c t))) (t_2 (* x (- (* y z) (* t a)))))
(if (<= x -1.45e-7)
(+ (- t_2 (* b (* -1.0 (* a i)))) t_1)
(if (<= x 2e-170)
(+ (* -1.0 (* a (- (* t x) (* b i)))) (* j (- (* c t) (* i y))))
(+ (- t_2 (* b (- (* c z) (* i 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 = j * (c * t);
double t_2 = x * ((y * z) - (t * a));
double tmp;
if (x <= -1.45e-7) {
tmp = (t_2 - (b * (-1.0 * (a * i)))) + t_1;
} else if (x <= 2e-170) {
tmp = (-1.0 * (a * ((t * x) - (b * i)))) + (j * ((c * t) - (i * y)));
} else {
tmp = (t_2 - (b * ((c * z) - (i * a)))) + 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) :: t_2
real(8) :: tmp
t_1 = j * (c * t)
t_2 = x * ((y * z) - (t * a))
if (x <= (-1.45d-7)) then
tmp = (t_2 - (b * ((-1.0d0) * (a * i)))) + t_1
else if (x <= 2d-170) then
tmp = ((-1.0d0) * (a * ((t * x) - (b * i)))) + (j * ((c * t) - (i * y)))
else
tmp = (t_2 - (b * ((c * z) - (i * a)))) + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * (c * t);
double t_2 = x * ((y * z) - (t * a));
double tmp;
if (x <= -1.45e-7) {
tmp = (t_2 - (b * (-1.0 * (a * i)))) + t_1;
} else if (x <= 2e-170) {
tmp = (-1.0 * (a * ((t * x) - (b * i)))) + (j * ((c * t) - (i * y)));
} else {
tmp = (t_2 - (b * ((c * z) - (i * a)))) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * (c * t) t_2 = x * ((y * z) - (t * a)) tmp = 0 if x <= -1.45e-7: tmp = (t_2 - (b * (-1.0 * (a * i)))) + t_1 elif x <= 2e-170: tmp = (-1.0 * (a * ((t * x) - (b * i)))) + (j * ((c * t) - (i * y))) else: tmp = (t_2 - (b * ((c * z) - (i * a)))) + t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * Float64(c * t)) t_2 = Float64(x * Float64(Float64(y * z) - Float64(t * a))) tmp = 0.0 if (x <= -1.45e-7) tmp = Float64(Float64(t_2 - Float64(b * Float64(-1.0 * Float64(a * i)))) + t_1); elseif (x <= 2e-170) tmp = Float64(Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = Float64(Float64(t_2 - Float64(b * Float64(Float64(c * z) - Float64(i * a)))) + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = j * (c * t); t_2 = x * ((y * z) - (t * a)); tmp = 0.0; if (x <= -1.45e-7) tmp = (t_2 - (b * (-1.0 * (a * i)))) + t_1; elseif (x <= 2e-170) tmp = (-1.0 * (a * ((t * x) - (b * i)))) + (j * ((c * t) - (i * y))); else tmp = (t_2 - (b * ((c * z) - (i * a)))) + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(c * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e-7], N[(N[(t$95$2 - N[(b * N[(-1.0 * N[(a * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[x, 2e-170], N[(N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$2 - N[(b * N[(N[(c * z), $MachinePrecision] - N[(i * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t\right)\\
t_2 := x \cdot \left(y \cdot z - t \cdot a\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-7}:\\
\;\;\;\;\left(t\_2 - b \cdot \left(-1 \cdot \left(a \cdot i\right)\right)\right) + t\_1\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-170}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t\_2 - b \cdot \left(c \cdot z - i \cdot a\right)\right) + t\_1\\
\end{array}
if x < -1.4499999999999999e-7Initial program 73.0%
Taylor expanded in y around 0
lower-*.f6466.1%
Applied rewrites66.1%
Taylor expanded in z around 0
lower-*.f64N/A
lower-*.f6459.2%
Applied rewrites59.2%
if -1.4499999999999999e-7 < x < 2e-170Initial program 73.0%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6458.7%
Applied rewrites58.7%
if 2e-170 < x Initial program 73.0%
Taylor expanded in y around 0
lower-*.f6466.1%
Applied rewrites66.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(* -1.0 (* a (- (* t x) (* b i))))
(* j (- (* c t) (* i y))))))
(if (<= i -2.2e-118)
t_1
(if (<= i 4.8e-95)
(fma c (- (* j t) (* b z)) (* (- (* y z) (* t a)) x))
(if (<= i 1e+235) t_1 (* i (fma -1.0 (* 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 t_1 = (-1.0 * (a * ((t * x) - (b * i)))) + (j * ((c * t) - (i * y)));
double tmp;
if (i <= -2.2e-118) {
tmp = t_1;
} else if (i <= 4.8e-95) {
tmp = fma(c, ((j * t) - (b * z)), (((y * z) - (t * a)) * x));
} else if (i <= 1e+235) {
tmp = t_1;
} else {
tmp = i * fma(-1.0, (j * y), (a * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(-1.0 * Float64(a * Float64(Float64(t * x) - Float64(b * i)))) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (i <= -2.2e-118) tmp = t_1; elseif (i <= 4.8e-95) tmp = fma(c, Float64(Float64(j * t) - Float64(b * z)), Float64(Float64(Float64(y * z) - Float64(t * a)) * x)); elseif (i <= 1e+235) tmp = t_1; else tmp = Float64(i * fma(-1.0, Float64(j * y), Float64(a * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(-1.0 * N[(a * N[(N[(t * x), $MachinePrecision] - N[(b * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.2e-118], t$95$1, If[LessEqual[i, 4.8e-95], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1e+235], t$95$1, N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := -1 \cdot \left(a \cdot \left(t \cdot x - b \cdot i\right)\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;i \leq -2.2 \cdot 10^{-118}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 4.8 \cdot 10^{-95}:\\
\;\;\;\;\mathsf{fma}\left(c, j \cdot t - b \cdot z, \left(y \cdot z - t \cdot a\right) \cdot x\right)\\
\mathbf{elif}\;i \leq 10^{+235}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;i \cdot \mathsf{fma}\left(-1, j \cdot y, a \cdot b\right)\\
\end{array}
if i < -2.1999999999999998e-118 or 4.8000000000000002e-95 < i < 1.0000000000000001e235Initial program 73.0%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6458.7%
Applied rewrites58.7%
if -2.1999999999999998e-118 < i < 4.8000000000000002e-95Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in i around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.5%
Applied rewrites58.5%
lift--.f64N/A
sub-negate-revN/A
lift-fma.f64N/A
lift-*.f64N/A
add-flipN/A
associate--r-N/A
distribute-neg-inN/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-out--N/A
lift-*.f64N/A
Applied rewrites61.1%
if 1.0000000000000001e235 < i Initial program 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
Taylor expanded in i around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma c (- (* j t) (* b z)) (* (- (* y z) (* t a)) x)))
(t_2 (* j (- (* c t) (* i y)))))
(if (<= i -1.8e+216)
(* i (fma -1.0 (* j y) (* a b)))
(if (<= i -4e+46)
t_1
(if (<= i -2.5e-118)
(+ (* a (* b i)) t_2)
(if (<= i 3.7e+36) t_1 (+ (* (* b a) i) 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(c, ((j * t) - (b * z)), (((y * z) - (t * a)) * x));
double t_2 = j * ((c * t) - (i * y));
double tmp;
if (i <= -1.8e+216) {
tmp = i * fma(-1.0, (j * y), (a * b));
} else if (i <= -4e+46) {
tmp = t_1;
} else if (i <= -2.5e-118) {
tmp = (a * (b * i)) + t_2;
} else if (i <= 3.7e+36) {
tmp = t_1;
} else {
tmp = ((b * a) * i) + t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(c, Float64(Float64(j * t) - Float64(b * z)), Float64(Float64(Float64(y * z) - Float64(t * a)) * x)) t_2 = Float64(j * Float64(Float64(c * t) - Float64(i * y))) tmp = 0.0 if (i <= -1.8e+216) tmp = Float64(i * fma(-1.0, Float64(j * y), Float64(a * b))); elseif (i <= -4e+46) tmp = t_1; elseif (i <= -2.5e-118) tmp = Float64(Float64(a * Float64(b * i)) + t_2); elseif (i <= 3.7e+36) tmp = t_1; else tmp = Float64(Float64(Float64(b * a) * i) + t_2); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.8e+216], N[(i * N[(-1.0 * N[(j * y), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, -4e+46], t$95$1, If[LessEqual[i, -2.5e-118], N[(N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision], If[LessEqual[i, 3.7e+36], t$95$1, N[(N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision] + t$95$2), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(c, j \cdot t - b \cdot z, \left(y \cdot z - t \cdot a\right) \cdot x\right)\\
t_2 := j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;i \leq -1.8 \cdot 10^{+216}:\\
\;\;\;\;i \cdot \mathsf{fma}\left(-1, j \cdot y, a \cdot b\right)\\
\mathbf{elif}\;i \leq -4 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq -2.5 \cdot 10^{-118}:\\
\;\;\;\;a \cdot \left(b \cdot i\right) + t\_2\\
\mathbf{elif}\;i \leq 3.7 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i + t\_2\\
\end{array}
if i < -1.8000000000000001e216Initial program 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
Taylor expanded in i around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.8%
Applied rewrites38.8%
if -1.8000000000000001e216 < i < -4e46 or -2.5000000000000001e-118 < i < 3.7000000000000003e36Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in i around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.5%
Applied rewrites58.5%
lift--.f64N/A
sub-negate-revN/A
lift-fma.f64N/A
lift-*.f64N/A
add-flipN/A
associate--r-N/A
distribute-neg-inN/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-out--N/A
lift-*.f64N/A
Applied rewrites61.1%
if -4e46 < i < -2.5000000000000001e-118Initial program 73.0%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6448.9%
Applied rewrites48.9%
if 3.7000000000000003e36 < i Initial program 73.0%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6448.9%
Applied rewrites48.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.8%
Applied rewrites49.8%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c t) (* i y))))
(if (<= x -1.45e-7)
(fma c (- (* j t) (* b z)) (* (- (* y z) (* t a)) x))
(if (<= x 3.5e+96)
(+ (* b (- (* a i) (* c z))) (* j t_1))
(fma j t_1 (* x (- (* y z) (* a t))))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * t) - (i * y);
double tmp;
if (x <= -1.45e-7) {
tmp = fma(c, ((j * t) - (b * z)), (((y * z) - (t * a)) * x));
} else if (x <= 3.5e+96) {
tmp = (b * ((a * i) - (c * z))) + (j * t_1);
} else {
tmp = fma(j, t_1, (x * ((y * z) - (a * t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * t) - Float64(i * y)) tmp = 0.0 if (x <= -1.45e-7) tmp = fma(c, Float64(Float64(j * t) - Float64(b * z)), Float64(Float64(Float64(y * z) - Float64(t * a)) * x)); elseif (x <= 3.5e+96) tmp = Float64(Float64(b * Float64(Float64(a * i) - Float64(c * z))) + Float64(j * t_1)); else tmp = fma(j, t_1, Float64(x * Float64(Float64(y * z) - Float64(a * t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e-7], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.5e+96], N[(N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * t$95$1), $MachinePrecision]), $MachinePrecision], N[(j * t$95$1 + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := c \cdot t - i \cdot y\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{-7}:\\
\;\;\;\;\mathsf{fma}\left(c, j \cdot t - b \cdot z, \left(y \cdot z - t \cdot a\right) \cdot x\right)\\
\mathbf{elif}\;x \leq 3.5 \cdot 10^{+96}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right) + j \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(j, t\_1, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\end{array}
if x < -1.4499999999999999e-7Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in i around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6458.5%
Applied rewrites58.5%
lift--.f64N/A
sub-negate-revN/A
lift-fma.f64N/A
lift-*.f64N/A
add-flipN/A
associate--r-N/A
distribute-neg-inN/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
distribute-rgt-out--N/A
lift-*.f64N/A
Applied rewrites61.1%
if -1.4499999999999999e-7 < x < 3.4999999999999999e96Initial program 73.0%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6458.3%
Applied rewrites58.3%
if 3.4999999999999999e96 < x Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in b around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6460.5%
Applied rewrites60.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c t) (* i y))))
(t_2 (* (- (* b i) (* x t)) a)))
(if (<= a -8.2e+207)
t_2
(if (<= a -3.7e+21)
(+ (* a (* b i)) t_1)
(if (<= a -2.1e-176)
(+ (* z (- (* x y) (* b c))) (* c (* j t)))
(if (<= a 1.8e+56) (+ (* x (* y z)) 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 * t) - (i * y));
double t_2 = ((b * i) - (x * t)) * a;
double tmp;
if (a <= -8.2e+207) {
tmp = t_2;
} else if (a <= -3.7e+21) {
tmp = (a * (b * i)) + t_1;
} else if (a <= -2.1e-176) {
tmp = (z * ((x * y) - (b * c))) + (c * (j * t));
} else if (a <= 1.8e+56) {
tmp = (x * (y * z)) + 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 * t) - (i * y))
t_2 = ((b * i) - (x * t)) * a
if (a <= (-8.2d+207)) then
tmp = t_2
else if (a <= (-3.7d+21)) then
tmp = (a * (b * i)) + t_1
else if (a <= (-2.1d-176)) then
tmp = (z * ((x * y) - (b * c))) + (c * (j * t))
else if (a <= 1.8d+56) then
tmp = (x * (y * z)) + 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 * t) - (i * y));
double t_2 = ((b * i) - (x * t)) * a;
double tmp;
if (a <= -8.2e+207) {
tmp = t_2;
} else if (a <= -3.7e+21) {
tmp = (a * (b * i)) + t_1;
} else if (a <= -2.1e-176) {
tmp = (z * ((x * y) - (b * c))) + (c * (j * t));
} else if (a <= 1.8e+56) {
tmp = (x * (y * z)) + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * t) - (i * y)) t_2 = ((b * i) - (x * t)) * a tmp = 0 if a <= -8.2e+207: tmp = t_2 elif a <= -3.7e+21: tmp = (a * (b * i)) + t_1 elif a <= -2.1e-176: tmp = (z * ((x * y) - (b * c))) + (c * (j * t)) elif a <= 1.8e+56: tmp = (x * (y * z)) + 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 * t) - Float64(i * y))) t_2 = Float64(Float64(Float64(b * i) - Float64(x * t)) * a) tmp = 0.0 if (a <= -8.2e+207) tmp = t_2; elseif (a <= -3.7e+21) tmp = Float64(Float64(a * Float64(b * i)) + t_1); elseif (a <= -2.1e-176) tmp = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + Float64(c * Float64(j * t))); elseif (a <= 1.8e+56) tmp = Float64(Float64(x * Float64(y * z)) + 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 * t) - (i * y)); t_2 = ((b * i) - (x * t)) * a; tmp = 0.0; if (a <= -8.2e+207) tmp = t_2; elseif (a <= -3.7e+21) tmp = (a * (b * i)) + t_1; elseif (a <= -2.1e-176) tmp = (z * ((x * y) - (b * c))) + (c * (j * t)); elseif (a <= 1.8e+56) tmp = (x * (y * z)) + 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 * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -8.2e+207], t$95$2, If[LessEqual[a, -3.7e+21], N[(N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[a, -2.1e-176], N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e+56], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
t_2 := \left(b \cdot i - x \cdot t\right) \cdot a\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{+207}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -3.7 \cdot 10^{+21}:\\
\;\;\;\;a \cdot \left(b \cdot i\right) + t\_1\\
\mathbf{elif}\;a \leq -2.1 \cdot 10^{-176}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right) + c \cdot \left(j \cdot t\right)\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+56}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if a < -8.2e207 or 1.8e56 < a Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
if -8.2e207 < a < -3.7e21Initial program 73.0%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6448.9%
Applied rewrites48.9%
if -3.7e21 < a < -2.0999999999999999e-176Initial program 73.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.0%
Applied rewrites59.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6450.9%
Applied rewrites50.9%
if -2.0999999999999999e-176 < a < 1.8e56Initial program 73.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.0%
Applied rewrites59.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (- (* c t) (* i y))))
(t_2 (* (- (* b i) (* x t)) a)))
(if (<= a -8.2e+207)
t_2
(if (<= a -1.48e-27)
(+ (* a (* b i)) t_1)
(if (<= a -2.65e-164)
(* c (- (* j t) (* b z)))
(if (<= a 1.8e+56) (+ (* x (* y z)) 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 * t) - (i * y));
double t_2 = ((b * i) - (x * t)) * a;
double tmp;
if (a <= -8.2e+207) {
tmp = t_2;
} else if (a <= -1.48e-27) {
tmp = (a * (b * i)) + t_1;
} else if (a <= -2.65e-164) {
tmp = c * ((j * t) - (b * z));
} else if (a <= 1.8e+56) {
tmp = (x * (y * z)) + 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 * t) - (i * y))
t_2 = ((b * i) - (x * t)) * a
if (a <= (-8.2d+207)) then
tmp = t_2
else if (a <= (-1.48d-27)) then
tmp = (a * (b * i)) + t_1
else if (a <= (-2.65d-164)) then
tmp = c * ((j * t) - (b * z))
else if (a <= 1.8d+56) then
tmp = (x * (y * z)) + 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 * t) - (i * y));
double t_2 = ((b * i) - (x * t)) * a;
double tmp;
if (a <= -8.2e+207) {
tmp = t_2;
} else if (a <= -1.48e-27) {
tmp = (a * (b * i)) + t_1;
} else if (a <= -2.65e-164) {
tmp = c * ((j * t) - (b * z));
} else if (a <= 1.8e+56) {
tmp = (x * (y * z)) + t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = j * ((c * t) - (i * y)) t_2 = ((b * i) - (x * t)) * a tmp = 0 if a <= -8.2e+207: tmp = t_2 elif a <= -1.48e-27: tmp = (a * (b * i)) + t_1 elif a <= -2.65e-164: tmp = c * ((j * t) - (b * z)) elif a <= 1.8e+56: tmp = (x * (y * z)) + 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 * t) - Float64(i * y))) t_2 = Float64(Float64(Float64(b * i) - Float64(x * t)) * a) tmp = 0.0 if (a <= -8.2e+207) tmp = t_2; elseif (a <= -1.48e-27) tmp = Float64(Float64(a * Float64(b * i)) + t_1); elseif (a <= -2.65e-164) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); elseif (a <= 1.8e+56) tmp = Float64(Float64(x * Float64(y * z)) + 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 * t) - (i * y)); t_2 = ((b * i) - (x * t)) * a; tmp = 0.0; if (a <= -8.2e+207) tmp = t_2; elseif (a <= -1.48e-27) tmp = (a * (b * i)) + t_1; elseif (a <= -2.65e-164) tmp = c * ((j * t) - (b * z)); elseif (a <= 1.8e+56) tmp = (x * (y * z)) + 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 * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -8.2e+207], t$95$2, If[LessEqual[a, -1.48e-27], N[(N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[a, -2.65e-164], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e+56], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
t_1 := j \cdot \left(c \cdot t - i \cdot y\right)\\
t_2 := \left(b \cdot i - x \cdot t\right) \cdot a\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{+207}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq -1.48 \cdot 10^{-27}:\\
\;\;\;\;a \cdot \left(b \cdot i\right) + t\_1\\
\mathbf{elif}\;a \leq -2.65 \cdot 10^{-164}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+56}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if a < -8.2e207 or 1.8e56 < a Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
if -8.2e207 < a < -1.4800000000000001e-27Initial program 73.0%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6448.9%
Applied rewrites48.9%
if -1.4800000000000001e-27 < a < -2.6500000000000002e-164Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
if -2.6500000000000002e-164 < a < 1.8e56Initial program 73.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.0%
Applied rewrites59.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (+ (* (* b a) i) (* j (- (* c t) (* i y))))))
(if (<= i -1.16e-130)
t_1
(if (<= i 4.5e-83)
(+ (* z (- (* x y) (* b c))) (* c (* j t)))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * a) * i) + (j * ((c * t) - (i * y)));
double tmp;
if (i <= -1.16e-130) {
tmp = t_1;
} else if (i <= 4.5e-83) {
tmp = (z * ((x * y) - (b * c))) + (c * (j * t));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((b * a) * i) + (j * ((c * t) - (i * y)))
if (i <= (-1.16d-130)) then
tmp = t_1
else if (i <= 4.5d-83) then
tmp = (z * ((x * y) - (b * c))) + (c * (j * t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * a) * i) + (j * ((c * t) - (i * y)));
double tmp;
if (i <= -1.16e-130) {
tmp = t_1;
} else if (i <= 4.5e-83) {
tmp = (z * ((x * y) - (b * c))) + (c * (j * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((b * a) * i) + (j * ((c * t) - (i * y))) tmp = 0 if i <= -1.16e-130: tmp = t_1 elif i <= 4.5e-83: tmp = (z * ((x * y) - (b * c))) + (c * (j * t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(b * a) * i) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))) tmp = 0.0 if (i <= -1.16e-130) tmp = t_1; elseif (i <= 4.5e-83) tmp = Float64(Float64(z * Float64(Float64(x * y) - Float64(b * c))) + Float64(c * Float64(j * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((b * a) * i) + (j * ((c * t) - (i * y))); tmp = 0.0; if (i <= -1.16e-130) tmp = t_1; elseif (i <= 4.5e-83) tmp = (z * ((x * y) - (b * c))) + (c * (j * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.16e-130], t$95$1, If[LessEqual[i, 4.5e-83], N[(N[(z * N[(N[(x * y), $MachinePrecision] - N[(b * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(b \cdot a\right) \cdot i + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{if}\;i \leq -1.16 \cdot 10^{-130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 4.5 \cdot 10^{-83}:\\
\;\;\;\;z \cdot \left(x \cdot y - b \cdot c\right) + c \cdot \left(j \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if i < -1.1600000000000001e-130 or 4.5e-83 < i Initial program 73.0%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f6448.9%
Applied rewrites48.9%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6449.8%
Applied rewrites49.8%
if -1.1600000000000001e-130 < i < 4.5e-83Initial program 73.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.0%
Applied rewrites59.0%
Taylor expanded in y around 0
lower-*.f64N/A
lower-*.f6450.9%
Applied rewrites50.9%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= a -0.0031)
(fma (* (- t) a) x (* (* a i) b))
(if (<= a 1.8e+56)
(+ (* x (* y z)) (* j (- (* c t) (* i y))))
(* (- (* b i) (* x t)) a))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -0.0031) {
tmp = fma((-t * a), x, ((a * i) * b));
} else if (a <= 1.8e+56) {
tmp = (x * (y * z)) + (j * ((c * t) - (i * y)));
} else {
tmp = ((b * i) - (x * t)) * a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -0.0031) tmp = fma(Float64(Float64(-t) * a), x, Float64(Float64(a * i) * b)); elseif (a <= 1.8e+56) tmp = Float64(Float64(x * Float64(y * z)) + Float64(j * Float64(Float64(c * t) - Float64(i * y)))); else tmp = Float64(Float64(Float64(b * i) - Float64(x * t)) * a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -0.0031], N[(N[((-t) * a), $MachinePrecision] * x + N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e+56], N[(N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * t), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \leq -0.0031:\\
\;\;\;\;\mathsf{fma}\left(\left(-t\right) \cdot a, x, \left(a \cdot i\right) \cdot b\right)\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+56}:\\
\;\;\;\;x \cdot \left(y \cdot z\right) + j \cdot \left(c \cdot t - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot i - x \cdot t\right) \cdot a\\
\end{array}
if a < -0.0030999999999999999Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-lft-inN/A
mul-1-negN/A
lift-*.f64N/A
associate-*l*N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
mul-1-negN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites35.4%
if -0.0030999999999999999 < a < 1.8e56Initial program 73.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6459.0%
Applied rewrites59.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6449.4%
Applied rewrites49.4%
if 1.8e56 < a Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (fma -1.0 (* i y) (* c t)))))
(if (<= j -8e+51)
t_1
(if (<= j -2.1e-302)
(* (- (* b i) (* x t)) a)
(if (<= j 6e-173)
(* z (fma -1.0 (* b c) (* x y)))
(if (<= j 3.75e-62) (fma (* (- t) a) x (* (* a i) 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 = j * fma(-1.0, (i * y), (c * t));
double tmp;
if (j <= -8e+51) {
tmp = t_1;
} else if (j <= -2.1e-302) {
tmp = ((b * i) - (x * t)) * a;
} else if (j <= 6e-173) {
tmp = z * fma(-1.0, (b * c), (x * y));
} else if (j <= 3.75e-62) {
tmp = fma((-t * a), x, ((a * i) * b));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * fma(-1.0, Float64(i * y), Float64(c * t))) tmp = 0.0 if (j <= -8e+51) tmp = t_1; elseif (j <= -2.1e-302) tmp = Float64(Float64(Float64(b * i) - Float64(x * t)) * a); elseif (j <= 6e-173) tmp = Float64(z * fma(-1.0, Float64(b * c), Float64(x * y))); elseif (j <= 3.75e-62) tmp = fma(Float64(Float64(-t) * a), x, Float64(Float64(a * i) * b)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(-1.0 * N[(i * y), $MachinePrecision] + N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -8e+51], t$95$1, If[LessEqual[j, -2.1e-302], N[(N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 6e-173], N[(z * N[(-1.0 * N[(b * c), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.75e-62], N[(N[((-t) * a), $MachinePrecision] * x + N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := j \cdot \mathsf{fma}\left(-1, i \cdot y, c \cdot t\right)\\
\mathbf{if}\;j \leq -8 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -2.1 \cdot 10^{-302}:\\
\;\;\;\;\left(b \cdot i - x \cdot t\right) \cdot a\\
\mathbf{elif}\;j \leq 6 \cdot 10^{-173}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(-1, b \cdot c, x \cdot y\right)\\
\mathbf{elif}\;j \leq 3.75 \cdot 10^{-62}:\\
\;\;\;\;\mathsf{fma}\left(\left(-t\right) \cdot a, x, \left(a \cdot i\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if j < -7.9999999999999999e51 or 3.7500000000000001e-62 < j Initial program 73.0%
Applied rewrites75.8%
Taylor expanded in j around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -7.9999999999999999e51 < j < -2.1000000000000001e-302Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
if -2.1000000000000001e-302 < j < 6.0000000000000002e-173Initial program 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
if 6.0000000000000002e-173 < j < 3.7500000000000001e-62Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-lft-inN/A
mul-1-negN/A
lift-*.f64N/A
associate-*l*N/A
distribute-lft-neg-outN/A
lift-*.f64N/A
mul-1-negN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
Applied rewrites35.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (fma -1.0 (* i y) (* c t)))))
(if (<= j -8e+51)
t_1
(if (<= j -2.1e-302)
(* (- (* b i) (* x t)) a)
(if (<= j 5.5e-173)
(* z (fma -1.0 (* b c) (* x y)))
(if (<= j 3.2e-62) (fma (* (- a) x) t (* (* a i) 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 = j * fma(-1.0, (i * y), (c * t));
double tmp;
if (j <= -8e+51) {
tmp = t_1;
} else if (j <= -2.1e-302) {
tmp = ((b * i) - (x * t)) * a;
} else if (j <= 5.5e-173) {
tmp = z * fma(-1.0, (b * c), (x * y));
} else if (j <= 3.2e-62) {
tmp = fma((-a * x), t, ((a * i) * b));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * fma(-1.0, Float64(i * y), Float64(c * t))) tmp = 0.0 if (j <= -8e+51) tmp = t_1; elseif (j <= -2.1e-302) tmp = Float64(Float64(Float64(b * i) - Float64(x * t)) * a); elseif (j <= 5.5e-173) tmp = Float64(z * fma(-1.0, Float64(b * c), Float64(x * y))); elseif (j <= 3.2e-62) tmp = fma(Float64(Float64(-a) * x), t, Float64(Float64(a * i) * b)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(-1.0 * N[(i * y), $MachinePrecision] + N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -8e+51], t$95$1, If[LessEqual[j, -2.1e-302], N[(N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 5.5e-173], N[(z * N[(-1.0 * N[(b * c), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.2e-62], N[(N[((-a) * x), $MachinePrecision] * t + N[(N[(a * i), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := j \cdot \mathsf{fma}\left(-1, i \cdot y, c \cdot t\right)\\
\mathbf{if}\;j \leq -8 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -2.1 \cdot 10^{-302}:\\
\;\;\;\;\left(b \cdot i - x \cdot t\right) \cdot a\\
\mathbf{elif}\;j \leq 5.5 \cdot 10^{-173}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(-1, b \cdot c, x \cdot y\right)\\
\mathbf{elif}\;j \leq 3.2 \cdot 10^{-62}:\\
\;\;\;\;\mathsf{fma}\left(\left(-a\right) \cdot x, t, \left(a \cdot i\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if j < -7.9999999999999999e51 or 3.2000000000000002e-62 < j Initial program 73.0%
Applied rewrites75.8%
Taylor expanded in j around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -7.9999999999999999e51 < j < -2.1000000000000001e-302Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
if -2.1000000000000001e-302 < j < 5.5000000000000002e-173Initial program 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
if 5.5000000000000002e-173 < j < 3.2000000000000002e-62Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
distribute-lft-inN/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
*-commutativeN/A
associate-*l*N/A
distribute-lft-neg-inN/A
*-commutativeN/A
lift-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
Applied rewrites35.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (fma -1.0 (* i y) (* c t)))))
(if (<= j -8e+51)
t_1
(if (<= j -2.1e-302)
(* (- (* b i) (* x t)) a)
(if (<= j 5.8e-173)
(* z (fma -1.0 (* b c) (* x y)))
(if (<= j 3.5e-62) (- (* (* b a) i) (* (* a x) t)) t_1))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = j * fma(-1.0, (i * y), (c * t));
double tmp;
if (j <= -8e+51) {
tmp = t_1;
} else if (j <= -2.1e-302) {
tmp = ((b * i) - (x * t)) * a;
} else if (j <= 5.8e-173) {
tmp = z * fma(-1.0, (b * c), (x * y));
} else if (j <= 3.5e-62) {
tmp = ((b * a) * i) - ((a * x) * t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * fma(-1.0, Float64(i * y), Float64(c * t))) tmp = 0.0 if (j <= -8e+51) tmp = t_1; elseif (j <= -2.1e-302) tmp = Float64(Float64(Float64(b * i) - Float64(x * t)) * a); elseif (j <= 5.8e-173) tmp = Float64(z * fma(-1.0, Float64(b * c), Float64(x * y))); elseif (j <= 3.5e-62) tmp = Float64(Float64(Float64(b * a) * i) - Float64(Float64(a * x) * t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(-1.0 * N[(i * y), $MachinePrecision] + N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -8e+51], t$95$1, If[LessEqual[j, -2.1e-302], N[(N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[j, 5.8e-173], N[(z * N[(-1.0 * N[(b * c), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.5e-62], N[(N[(N[(b * a), $MachinePrecision] * i), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := j \cdot \mathsf{fma}\left(-1, i \cdot y, c \cdot t\right)\\
\mathbf{if}\;j \leq -8 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq -2.1 \cdot 10^{-302}:\\
\;\;\;\;\left(b \cdot i - x \cdot t\right) \cdot a\\
\mathbf{elif}\;j \leq 5.8 \cdot 10^{-173}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(-1, b \cdot c, x \cdot y\right)\\
\mathbf{elif}\;j \leq 3.5 \cdot 10^{-62}:\\
\;\;\;\;\left(b \cdot a\right) \cdot i - \left(a \cdot x\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if j < -7.9999999999999999e51 or 3.5000000000000001e-62 < j Initial program 73.0%
Applied rewrites75.8%
Taylor expanded in j around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -7.9999999999999999e51 < j < -2.1000000000000001e-302Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
if -2.1000000000000001e-302 < j < 5.7999999999999997e-173Initial program 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
if 5.7999999999999997e-173 < j < 3.5000000000000001e-62Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
distribute-lft-inN/A
associate-*r*N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-neg.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6435.2%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6435.2%
Applied rewrites35.2%
lift-*.f64N/A
lift-fma.f64N/A
distribute-lft-inN/A
mul-1-negN/A
add-flip-revN/A
lower--.f64N/A
*-commutativeN/A
associate-*l*N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-rgt-neg-outN/A
*-commutativeN/A
mul-1-negN/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lift-neg.f64N/A
remove-double-negN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites34.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b i) (* x t)) a))
(t_2 (* j (fma -1.0 (* i y) (* c t)))))
(if (<= j -8e+51)
t_2
(if (<= j -2.1e-302)
t_1
(if (<= j 2.9e-173)
(* z (fma -1.0 (* b c) (* x y)))
(if (<= j 3.75e-62) t_1 t_2))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * i) - (x * t)) * a;
double t_2 = j * fma(-1.0, (i * y), (c * t));
double tmp;
if (j <= -8e+51) {
tmp = t_2;
} else if (j <= -2.1e-302) {
tmp = t_1;
} else if (j <= 2.9e-173) {
tmp = z * fma(-1.0, (b * c), (x * y));
} else if (j <= 3.75e-62) {
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(b * i) - Float64(x * t)) * a) t_2 = Float64(j * fma(-1.0, Float64(i * y), Float64(c * t))) tmp = 0.0 if (j <= -8e+51) tmp = t_2; elseif (j <= -2.1e-302) tmp = t_1; elseif (j <= 2.9e-173) tmp = Float64(z * fma(-1.0, Float64(b * c), Float64(x * y))); elseif (j <= 3.75e-62) 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[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(j * N[(-1.0 * N[(i * y), $MachinePrecision] + N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -8e+51], t$95$2, If[LessEqual[j, -2.1e-302], t$95$1, If[LessEqual[j, 2.9e-173], N[(z * N[(-1.0 * N[(b * c), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.75e-62], t$95$1, t$95$2]]]]]]
\begin{array}{l}
t_1 := \left(b \cdot i - x \cdot t\right) \cdot a\\
t_2 := j \cdot \mathsf{fma}\left(-1, i \cdot y, c \cdot t\right)\\
\mathbf{if}\;j \leq -8 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;j \leq -2.1 \cdot 10^{-302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 2.9 \cdot 10^{-173}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(-1, b \cdot c, x \cdot y\right)\\
\mathbf{elif}\;j \leq 3.75 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if j < -7.9999999999999999e51 or 3.7500000000000001e-62 < j Initial program 73.0%
Applied rewrites75.8%
Taylor expanded in j around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -7.9999999999999999e51 < j < -2.1000000000000001e-302 or 2.8999999999999998e-173 < j < 3.7500000000000001e-62Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
if -2.1000000000000001e-302 < j < 2.8999999999999998e-173Initial program 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* j (fma -1.0 (* i y) (* c t)))))
(if (<= j -8e+51)
t_1
(if (<= j 3.75e-62) (* (- (* b i) (* x t)) 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 = j * fma(-1.0, (i * y), (c * t));
double tmp;
if (j <= -8e+51) {
tmp = t_1;
} else if (j <= 3.75e-62) {
tmp = ((b * i) - (x * t)) * a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(j * fma(-1.0, Float64(i * y), Float64(c * t))) tmp = 0.0 if (j <= -8e+51) tmp = t_1; elseif (j <= 3.75e-62) tmp = Float64(Float64(Float64(b * i) - Float64(x * t)) * a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(j * N[(-1.0 * N[(i * y), $MachinePrecision] + N[(c * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -8e+51], t$95$1, If[LessEqual[j, 3.75e-62], N[(N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := j \cdot \mathsf{fma}\left(-1, i \cdot y, c \cdot t\right)\\
\mathbf{if}\;j \leq -8 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 3.75 \cdot 10^{-62}:\\
\;\;\;\;\left(b \cdot i - x \cdot t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if j < -7.9999999999999999e51 or 3.7500000000000001e-62 < j Initial program 73.0%
Applied rewrites75.8%
Taylor expanded in j around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6438.5%
Applied rewrites38.5%
if -7.9999999999999999e51 < j < 3.7500000000000001e-62Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b i) (* x t)) a)))
(if (<= a -0.0031)
t_1
(if (<= a -1.25e-201)
(* c (fma (- z) b (* t j)))
(if (<= a 5.9e+50) (* (- (* z x) (* j i)) y) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * i) - (x * t)) * a;
double tmp;
if (a <= -0.0031) {
tmp = t_1;
} else if (a <= -1.25e-201) {
tmp = c * fma(-z, b, (t * j));
} else if (a <= 5.9e+50) {
tmp = ((z * x) - (j * i)) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(b * i) - Float64(x * t)) * a) tmp = 0.0 if (a <= -0.0031) tmp = t_1; elseif (a <= -1.25e-201) tmp = Float64(c * fma(Float64(-z), b, Float64(t * j))); elseif (a <= 5.9e+50) tmp = Float64(Float64(Float64(z * x) - Float64(j * i)) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -0.0031], t$95$1, If[LessEqual[a, -1.25e-201], N[(c * N[((-z) * b + N[(t * j), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.9e+50], N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(b \cdot i - x \cdot t\right) \cdot a\\
\mathbf{if}\;a \leq -0.0031:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-201}:\\
\;\;\;\;c \cdot \mathsf{fma}\left(-z, b, t \cdot j\right)\\
\mathbf{elif}\;a \leq 5.9 \cdot 10^{+50}:\\
\;\;\;\;\left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -0.0030999999999999999 or 5.8999999999999998e50 < a Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
if -0.0030999999999999999 < a < -1.25e-201Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f6439.9%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.9%
Applied rewrites39.9%
if -1.25e-201 < a < 5.8999999999999998e50Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1%
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6439.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1%
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b i) (* x t)) a)))
(if (<= a -0.0031)
t_1
(if (<= a -1.25e-201)
(* c (- (* j t) (* b z)))
(if (<= a 5.9e+50) (* (- (* z x) (* j i)) y) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * i) - (x * t)) * a;
double tmp;
if (a <= -0.0031) {
tmp = t_1;
} else if (a <= -1.25e-201) {
tmp = c * ((j * t) - (b * z));
} else if (a <= 5.9e+50) {
tmp = ((z * x) - (j * i)) * y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((b * i) - (x * t)) * a
if (a <= (-0.0031d0)) then
tmp = t_1
else if (a <= (-1.25d-201)) then
tmp = c * ((j * t) - (b * z))
else if (a <= 5.9d+50) then
tmp = ((z * x) - (j * i)) * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * i) - (x * t)) * a;
double tmp;
if (a <= -0.0031) {
tmp = t_1;
} else if (a <= -1.25e-201) {
tmp = c * ((j * t) - (b * z));
} else if (a <= 5.9e+50) {
tmp = ((z * x) - (j * i)) * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((b * i) - (x * t)) * a tmp = 0 if a <= -0.0031: tmp = t_1 elif a <= -1.25e-201: tmp = c * ((j * t) - (b * z)) elif a <= 5.9e+50: tmp = ((z * x) - (j * i)) * y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(b * i) - Float64(x * t)) * a) tmp = 0.0 if (a <= -0.0031) tmp = t_1; elseif (a <= -1.25e-201) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); elseif (a <= 5.9e+50) tmp = Float64(Float64(Float64(z * x) - Float64(j * i)) * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((b * i) - (x * t)) * a; tmp = 0.0; if (a <= -0.0031) tmp = t_1; elseif (a <= -1.25e-201) tmp = c * ((j * t) - (b * z)); elseif (a <= 5.9e+50) tmp = ((z * x) - (j * i)) * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -0.0031], t$95$1, If[LessEqual[a, -1.25e-201], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 5.9e+50], N[(N[(N[(z * x), $MachinePrecision] - N[(j * i), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(b \cdot i - x \cdot t\right) \cdot a\\
\mathbf{if}\;a \leq -0.0031:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.25 \cdot 10^{-201}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{elif}\;a \leq 5.9 \cdot 10^{+50}:\\
\;\;\;\;\left(z \cdot x - j \cdot i\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -0.0030999999999999999 or 5.8999999999999998e50 < a Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
if -0.0030999999999999999 < a < -1.25e-201Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
if -1.25e-201 < a < 5.8999999999999998e50Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1%
lift-fma.f64N/A
+-commutativeN/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f6439.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.1%
Applied rewrites39.1%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* b i) (* x t)) a)))
(if (<= a -0.0031)
t_1
(if (<= a 5.5e+55) (* c (- (* j t) (* b z))) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * i) - (x * t)) * a;
double tmp;
if (a <= -0.0031) {
tmp = t_1;
} else if (a <= 5.5e+55) {
tmp = c * ((j * t) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = ((b * i) - (x * t)) * a
if (a <= (-0.0031d0)) then
tmp = t_1
else if (a <= 5.5d+55) then
tmp = c * ((j * t) - (b * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((b * i) - (x * t)) * a;
double tmp;
if (a <= -0.0031) {
tmp = t_1;
} else if (a <= 5.5e+55) {
tmp = c * ((j * t) - (b * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((b * i) - (x * t)) * a tmp = 0 if a <= -0.0031: tmp = t_1 elif a <= 5.5e+55: tmp = c * ((j * t) - (b * z)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(b * i) - Float64(x * t)) * a) tmp = 0.0 if (a <= -0.0031) tmp = t_1; elseif (a <= 5.5e+55) tmp = Float64(c * Float64(Float64(j * t) - Float64(b * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = ((b * i) - (x * t)) * a; tmp = 0.0; if (a <= -0.0031) tmp = t_1; elseif (a <= 5.5e+55) tmp = c * ((j * t) - (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[(N[(b * i), $MachinePrecision] - N[(x * t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -0.0031], t$95$1, If[LessEqual[a, 5.5e+55], N[(c * N[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(b \cdot i - x \cdot t\right) \cdot a\\
\mathbf{if}\;a \leq -0.0031:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.5 \cdot 10^{+55}:\\
\;\;\;\;c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -0.0030999999999999999 or 5.5000000000000004e55 < a Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f6439.4%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.4%
Applied rewrites39.4%
if -0.0030999999999999999 < a < 5.5000000000000004e55Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* c (- (* j t) (* b z)))))
(if (<= j -2.4e+63)
t_1
(if (<= j 1.35e-235)
(* b (- (* a i) (* c z)))
(if (<= j 1.7e-162)
(* x (* y z))
(if (<= j 2.9e-63) (* -1.0 (* a (* t 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) - (b * z));
double tmp;
if (j <= -2.4e+63) {
tmp = t_1;
} else if (j <= 1.35e-235) {
tmp = b * ((a * i) - (c * z));
} else if (j <= 1.7e-162) {
tmp = x * (y * z);
} else if (j <= 2.9e-63) {
tmp = -1.0 * (a * (t * 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) - (b * z))
if (j <= (-2.4d+63)) then
tmp = t_1
else if (j <= 1.35d-235) then
tmp = b * ((a * i) - (c * z))
else if (j <= 1.7d-162) then
tmp = x * (y * z)
else if (j <= 2.9d-63) then
tmp = (-1.0d0) * (a * (t * 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) - (b * z));
double tmp;
if (j <= -2.4e+63) {
tmp = t_1;
} else if (j <= 1.35e-235) {
tmp = b * ((a * i) - (c * z));
} else if (j <= 1.7e-162) {
tmp = x * (y * z);
} else if (j <= 2.9e-63) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = c * ((j * t) - (b * z)) tmp = 0 if j <= -2.4e+63: tmp = t_1 elif j <= 1.35e-235: tmp = b * ((a * i) - (c * z)) elif j <= 1.7e-162: tmp = x * (y * z) elif j <= 2.9e-63: tmp = -1.0 * (a * (t * x)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(c * Float64(Float64(j * t) - Float64(b * z))) tmp = 0.0 if (j <= -2.4e+63) tmp = t_1; elseif (j <= 1.35e-235) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (j <= 1.7e-162) tmp = Float64(x * Float64(y * z)); elseif (j <= 2.9e-63) tmp = Float64(-1.0 * Float64(a * Float64(t * 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) - (b * z)); tmp = 0.0; if (j <= -2.4e+63) tmp = t_1; elseif (j <= 1.35e-235) tmp = b * ((a * i) - (c * z)); elseif (j <= 1.7e-162) tmp = x * (y * z); elseif (j <= 2.9e-63) tmp = -1.0 * (a * (t * 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[(N[(j * t), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -2.4e+63], t$95$1, If[LessEqual[j, 1.35e-235], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.7e-162], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 2.9e-63], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := c \cdot \left(j \cdot t - b \cdot z\right)\\
\mathbf{if}\;j \leq -2.4 \cdot 10^{+63}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.35 \cdot 10^{-235}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;j \leq 1.7 \cdot 10^{-162}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;j \leq 2.9 \cdot 10^{-63}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if j < -2.4e63 or 2.8999999999999997e-63 < j Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
if -2.4e63 < j < 1.3500000000000001e-235Initial program 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0%
Applied rewrites39.0%
if 1.3500000000000001e-235 < j < 1.7e-162Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if 1.7e-162 < j < 2.8999999999999997e-63Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -6.7e+38)
(* -1.0 (* i (* j y)))
(if (<= j 1.35e-235)
(* b (- (* a i) (* c z)))
(if (<= j 1.7e-162)
(* x (* y z))
(if (<= j 2.8e+38) (* -1.0 (* a (* t x))) (* c (* j t)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -6.7e+38) {
tmp = -1.0 * (i * (j * y));
} else if (j <= 1.35e-235) {
tmp = b * ((a * i) - (c * z));
} else if (j <= 1.7e-162) {
tmp = x * (y * z);
} else if (j <= 2.8e+38) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = c * (j * t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-6.7d+38)) then
tmp = (-1.0d0) * (i * (j * y))
else if (j <= 1.35d-235) then
tmp = b * ((a * i) - (c * z))
else if (j <= 1.7d-162) then
tmp = x * (y * z)
else if (j <= 2.8d+38) then
tmp = (-1.0d0) * (a * (t * x))
else
tmp = c * (j * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -6.7e+38) {
tmp = -1.0 * (i * (j * y));
} else if (j <= 1.35e-235) {
tmp = b * ((a * i) - (c * z));
} else if (j <= 1.7e-162) {
tmp = x * (y * z);
} else if (j <= 2.8e+38) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = c * (j * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -6.7e+38: tmp = -1.0 * (i * (j * y)) elif j <= 1.35e-235: tmp = b * ((a * i) - (c * z)) elif j <= 1.7e-162: tmp = x * (y * z) elif j <= 2.8e+38: tmp = -1.0 * (a * (t * x)) else: tmp = c * (j * t) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -6.7e+38) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); elseif (j <= 1.35e-235) tmp = Float64(b * Float64(Float64(a * i) - Float64(c * z))); elseif (j <= 1.7e-162) tmp = Float64(x * Float64(y * z)); elseif (j <= 2.8e+38) tmp = Float64(-1.0 * Float64(a * Float64(t * x))); else tmp = Float64(c * Float64(j * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -6.7e+38) tmp = -1.0 * (i * (j * y)); elseif (j <= 1.35e-235) tmp = b * ((a * i) - (c * z)); elseif (j <= 1.7e-162) tmp = x * (y * z); elseif (j <= 2.8e+38) tmp = -1.0 * (a * (t * x)); else tmp = c * (j * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -6.7e+38], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.35e-235], N[(b * N[(N[(a * i), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.7e-162], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 2.8e+38], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;j \leq -6.7 \cdot 10^{+38}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;j \leq 1.35 \cdot 10^{-235}:\\
\;\;\;\;b \cdot \left(a \cdot i - c \cdot z\right)\\
\mathbf{elif}\;j \leq 1.7 \cdot 10^{-162}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;j \leq 2.8 \cdot 10^{+38}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\end{array}
if j < -6.7000000000000002e38Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6421.9%
Applied rewrites21.9%
if -6.7000000000000002e38 < j < 1.3500000000000001e-235Initial program 73.0%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
fp-cancel-sub-sign-invN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
Applied rewrites75.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.0%
Applied rewrites39.0%
if 1.3500000000000001e-235 < j < 1.7e-162Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if 1.7e-162 < j < 2.8e38Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
if 2.8e38 < j Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in z around 0
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -1.45e+34)
(* -1.0 (* i (* j y)))
(if (<= j 1.85e-271)
(* a (* b i))
(if (<= j 1.7e-162)
(* x (* y z))
(if (<= j 2.8e+38) (* -1.0 (* a (* t x))) (* c (* j t)))))))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.45e+34) {
tmp = -1.0 * (i * (j * y));
} else if (j <= 1.85e-271) {
tmp = a * (b * i);
} else if (j <= 1.7e-162) {
tmp = x * (y * z);
} else if (j <= 2.8e+38) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = c * (j * t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-1.45d+34)) then
tmp = (-1.0d0) * (i * (j * y))
else if (j <= 1.85d-271) then
tmp = a * (b * i)
else if (j <= 1.7d-162) then
tmp = x * (y * z)
else if (j <= 2.8d+38) then
tmp = (-1.0d0) * (a * (t * x))
else
tmp = c * (j * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -1.45e+34) {
tmp = -1.0 * (i * (j * y));
} else if (j <= 1.85e-271) {
tmp = a * (b * i);
} else if (j <= 1.7e-162) {
tmp = x * (y * z);
} else if (j <= 2.8e+38) {
tmp = -1.0 * (a * (t * x));
} else {
tmp = c * (j * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -1.45e+34: tmp = -1.0 * (i * (j * y)) elif j <= 1.85e-271: tmp = a * (b * i) elif j <= 1.7e-162: tmp = x * (y * z) elif j <= 2.8e+38: tmp = -1.0 * (a * (t * x)) else: tmp = c * (j * t) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -1.45e+34) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); elseif (j <= 1.85e-271) tmp = Float64(a * Float64(b * i)); elseif (j <= 1.7e-162) tmp = Float64(x * Float64(y * z)); elseif (j <= 2.8e+38) tmp = Float64(-1.0 * Float64(a * Float64(t * x))); else tmp = Float64(c * Float64(j * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -1.45e+34) tmp = -1.0 * (i * (j * y)); elseif (j <= 1.85e-271) tmp = a * (b * i); elseif (j <= 1.7e-162) tmp = x * (y * z); elseif (j <= 2.8e+38) tmp = -1.0 * (a * (t * x)); else tmp = c * (j * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -1.45e+34], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.85e-271], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.7e-162], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 2.8e+38], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;j \leq -1.45 \cdot 10^{+34}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;j \leq 1.85 \cdot 10^{-271}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;j \leq 1.7 \cdot 10^{-162}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;j \leq 2.8 \cdot 10^{+38}:\\
\;\;\;\;-1 \cdot \left(a \cdot \left(t \cdot x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\end{array}
if j < -1.4500000000000001e34Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6421.9%
Applied rewrites21.9%
if -1.4500000000000001e34 < j < 1.8500000000000001e-271Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.6%
Applied rewrites22.6%
if 1.8500000000000001e-271 < j < 1.7e-162Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if 1.7e-162 < j < 2.8e38Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.4%
Applied rewrites22.4%
if 2.8e38 < j Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in z around 0
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))) (t_2 (* c (* j t))))
(if (<= j -1.25e+63)
t_2
(if (<= j -9.2e+21)
t_1
(if (<= j 1.85e-271)
(* a (* b i))
(if (<= j 3.6e-141) 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);
double t_2 = c * (j * t);
double tmp;
if (j <= -1.25e+63) {
tmp = t_2;
} else if (j <= -9.2e+21) {
tmp = t_1;
} else if (j <= 1.85e-271) {
tmp = a * (b * i);
} else if (j <= 3.6e-141) {
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_2 = c * (j * t)
if (j <= (-1.25d+63)) then
tmp = t_2
else if (j <= (-9.2d+21)) then
tmp = t_1
else if (j <= 1.85d-271) then
tmp = a * (b * i)
else if (j <= 3.6d-141) 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);
double t_2 = c * (j * t);
double tmp;
if (j <= -1.25e+63) {
tmp = t_2;
} else if (j <= -9.2e+21) {
tmp = t_1;
} else if (j <= 1.85e-271) {
tmp = a * (b * i);
} else if (j <= 3.6e-141) {
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_2 = c * (j * t) tmp = 0 if j <= -1.25e+63: tmp = t_2 elif j <= -9.2e+21: tmp = t_1 elif j <= 1.85e-271: tmp = a * (b * i) elif j <= 3.6e-141: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(y * z)) t_2 = Float64(c * Float64(j * t)) tmp = 0.0 if (j <= -1.25e+63) tmp = t_2; elseif (j <= -9.2e+21) tmp = t_1; elseif (j <= 1.85e-271) tmp = Float64(a * Float64(b * i)); elseif (j <= 3.6e-141) 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_2 = c * (j * t); tmp = 0.0; if (j <= -1.25e+63) tmp = t_2; elseif (j <= -9.2e+21) tmp = t_1; elseif (j <= 1.85e-271) tmp = a * (b * i); elseif (j <= 3.6e-141) 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[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[j, -1.25e+63], t$95$2, If[LessEqual[j, -9.2e+21], t$95$1, If[LessEqual[j, 1.85e-271], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.6e-141], t$95$1, t$95$2]]]]]]
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
t_2 := c \cdot \left(j \cdot t\right)\\
\mathbf{if}\;j \leq -1.25 \cdot 10^{+63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;j \leq -9.2 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;j \leq 1.85 \cdot 10^{-271}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;j \leq 3.6 \cdot 10^{-141}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if j < -1.25e63 or 3.6000000000000001e-141 < j Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in z around 0
lower-*.f6422.5%
Applied rewrites22.5%
if -1.25e63 < j < -9.2e21 or 1.8500000000000001e-271 < j < 3.6000000000000001e-141Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if -9.2e21 < j < 1.8500000000000001e-271Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.6%
Applied rewrites22.6%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= j -1.45e+34)
(* -1.0 (* i (* j y)))
(if (<= j 1.85e-271)
(* a (* b i))
(if (<= j 3.6e-141) (* x (* y z)) (* c (* j t))))))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.45e+34) {
tmp = -1.0 * (i * (j * y));
} else if (j <= 1.85e-271) {
tmp = a * (b * i);
} else if (j <= 3.6e-141) {
tmp = x * (y * z);
} else {
tmp = c * (j * t);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: tmp
if (j <= (-1.45d+34)) then
tmp = (-1.0d0) * (i * (j * y))
else if (j <= 1.85d-271) then
tmp = a * (b * i)
else if (j <= 3.6d-141) then
tmp = x * (y * z)
else
tmp = c * (j * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (j <= -1.45e+34) {
tmp = -1.0 * (i * (j * y));
} else if (j <= 1.85e-271) {
tmp = a * (b * i);
} else if (j <= 3.6e-141) {
tmp = x * (y * z);
} else {
tmp = c * (j * t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if j <= -1.45e+34: tmp = -1.0 * (i * (j * y)) elif j <= 1.85e-271: tmp = a * (b * i) elif j <= 3.6e-141: tmp = x * (y * z) else: tmp = c * (j * t) return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (j <= -1.45e+34) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); elseif (j <= 1.85e-271) tmp = Float64(a * Float64(b * i)); elseif (j <= 3.6e-141) tmp = Float64(x * Float64(y * z)); else tmp = Float64(c * Float64(j * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (j <= -1.45e+34) tmp = -1.0 * (i * (j * y)); elseif (j <= 1.85e-271) tmp = a * (b * i); elseif (j <= 3.6e-141) tmp = x * (y * z); else tmp = c * (j * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[j, -1.45e+34], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 1.85e-271], N[(a * N[(b * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[j, 3.6e-141], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], N[(c * N[(j * t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;j \leq -1.45 \cdot 10^{+34}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;j \leq 1.85 \cdot 10^{-271}:\\
\;\;\;\;a \cdot \left(b \cdot i\right)\\
\mathbf{elif}\;j \leq 3.6 \cdot 10^{-141}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;c \cdot \left(j \cdot t\right)\\
\end{array}
if j < -1.4500000000000001e34Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6421.9%
Applied rewrites21.9%
if -1.4500000000000001e34 < j < 1.8500000000000001e-271Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.6%
Applied rewrites22.6%
if 1.8500000000000001e-271 < j < 3.6000000000000001e-141Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if 3.6000000000000001e-141 < j Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in z around 0
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* x (* y z)))) (if (<= x -2.9e+75) t_1 (if (<= x 0.16) (* (* i a) 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 = x * (y * z);
double tmp;
if (x <= -2.9e+75) {
tmp = t_1;
} else if (x <= 0.16) {
tmp = (i * a) * 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 = x * (y * z)
if (x <= (-2.9d+75)) then
tmp = t_1
else if (x <= 0.16d0) then
tmp = (i * a) * 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 = x * (y * z);
double tmp;
if (x <= -2.9e+75) {
tmp = t_1;
} else if (x <= 0.16) {
tmp = (i * a) * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * (y * z) tmp = 0 if x <= -2.9e+75: tmp = t_1 elif x <= 0.16: tmp = (i * a) * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(y * z)) tmp = 0.0 if (x <= -2.9e+75) tmp = t_1; elseif (x <= 0.16) tmp = Float64(Float64(i * a) * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * (y * z); tmp = 0.0; if (x <= -2.9e+75) tmp = t_1; elseif (x <= 0.16) tmp = (i * a) * 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[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.9e+75], t$95$1, If[LessEqual[x, 0.16], N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -2.9 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 0.16:\\
\;\;\;\;\left(i \cdot a\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -2.8999999999999998e75 or 0.16 < x Initial program 73.0%
Taylor expanded in y around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f6439.1%
Applied rewrites39.1%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6422.5%
Applied rewrites22.5%
if -2.8999999999999998e75 < x < 0.16Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.6%
Applied rewrites22.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
lower-*.f6422.5%
Applied rewrites22.5%
(FPCore (x y z t a b c i j) :precision binary64 (* (* i a) b))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return (i * a) * b;
}
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 = (i * a) * b
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 (i * a) * b;
}
def code(x, y, z, t, a, b, c, i, j): return (i * a) * b
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(i * a) * b) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = (i * a) * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(i * a), $MachinePrecision] * b), $MachinePrecision]
\left(i \cdot a\right) \cdot b
Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.6%
Applied rewrites22.6%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
*-commutativeN/A
remove-double-negN/A
distribute-lft-neg-outN/A
lift-neg.f64N/A
lift-*.f64N/A
lower-*.f64N/A
lift-*.f64N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
remove-double-negN/A
lower-*.f6422.5%
Applied rewrites22.5%
(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]
a \cdot \left(b \cdot i\right)
Initial program 73.0%
Taylor expanded in c around inf
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
Taylor expanded in a around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6439.4%
Applied rewrites39.4%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.6%
Applied rewrites22.6%
herbie shell --seed 2025212
(FPCore (x y z t a b c i j)
:name "Linear.Matrix:det33 from linear-1.19.1.3"
:precision binary64
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* i a)))) (* j (- (* c t) (* i y)))))