
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i j) :precision binary64 (+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
}
def code(x, y, z, t, a, b, c, i, j): return ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)))
function code(x, y, z, t, a, b, c, i, j) return Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)
\end{array}
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (- (* c a) (* i y))))
(if (<= z -2.6e+207)
(* (fma (- i) j (* z x)) y)
(if (<= z 3.1e-81)
(* (- (fma i t (/ (fma t_1 j (* (- (* z y) (* a t)) x)) b)) (* c z)) b)
(*
(- z)
(-
(+
(- (/ (fma (- a) (* t x) (- (* t_1 j) (- (* (* i t) b)))) z))
(- (* y x)))
(- (* c b))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = (c * a) - (i * y);
double tmp;
if (z <= -2.6e+207) {
tmp = fma(-i, j, (z * x)) * y;
} else if (z <= 3.1e-81) {
tmp = (fma(i, t, (fma(t_1, j, (((z * y) - (a * t)) * x)) / b)) - (c * z)) * b;
} else {
tmp = -z * ((-(fma(-a, (t * x), ((t_1 * j) - -((i * t) * b))) / z) + -(y * x)) - -(c * b));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(c * a) - Float64(i * y)) tmp = 0.0 if (z <= -2.6e+207) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (z <= 3.1e-81) tmp = Float64(Float64(fma(i, t, Float64(fma(t_1, j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)) / b)) - Float64(c * z)) * b); else tmp = Float64(Float64(-z) * Float64(Float64(Float64(-Float64(fma(Float64(-a), Float64(t * x), Float64(Float64(t_1 * j) - Float64(-Float64(Float64(i * t) * b)))) / z)) + Float64(-Float64(y * x))) - Float64(-Float64(c * b)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.6e+207], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 3.1e-81], N[(N[(N[(i * t + N[(N[(t$95$1 * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], N[((-z) * N[(N[((-N[(N[((-a) * N[(t * x), $MachinePrecision] + N[(N[(t$95$1 * j), $MachinePrecision] - (-N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision])), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]) + (-N[(y * x), $MachinePrecision])), $MachinePrecision] - (-N[(c * b), $MachinePrecision])), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := c \cdot a - i \cdot y\\
\mathbf{if}\;z \leq -2.6 \cdot 10^{+207}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-81}:\\
\;\;\;\;\left(\mathsf{fma}\left(i, t, \frac{\mathsf{fma}\left(t\_1, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)}{b}\right) - c \cdot z\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(-z\right) \cdot \left(\left(\left(-\frac{\mathsf{fma}\left(-a, t \cdot x, t\_1 \cdot j - \left(-\left(i \cdot t\right) \cdot b\right)\right)}{z}\right) + \left(-y \cdot x\right)\right) - \left(-c \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -2.5999999999999998e207Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
if -2.5999999999999998e207 < z < 3.09999999999999988e-81Initial program 73.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites70.8%
if 3.09999999999999988e-81 < z Initial program 73.0%
Taylor expanded in z around -inf
Applied rewrites67.3%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i))))
(* j (- (* c a) (* y i))))))
(if (<= t_1 INFINITY)
t_1
(fma (- (* c a) (* i y)) j (* (* t (- (/ (* y z) t) a)) x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((x * ((y * z) - (t * a))) - (b * ((c * z) - (t * i)))) + (j * ((c * a) - (y * i)));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(((c * a) - (i * y)), j, ((t * (((y * z) / t) - a)) * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(x * Float64(Float64(y * z) - Float64(t * a))) - Float64(b * Float64(Float64(c * z) - Float64(t * i)))) + Float64(j * Float64(Float64(c * a) - Float64(y * i)))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(t * Float64(Float64(Float64(y * z) / t) - a)) * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(x * N[(N[(y * z), $MachinePrecision] - N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(N[(c * z), $MachinePrecision] - N[(t * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(c * a), $MachinePrecision] - N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x \cdot \left(y \cdot z - t \cdot a\right) - b \cdot \left(c \cdot z - t \cdot i\right)\right) + j \cdot \left(c \cdot a - y \cdot i\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(t \cdot \left(\frac{y \cdot z}{t} - a\right)\right) \cdot x\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) < +inf.0Initial program 73.0%
if +inf.0 < (+.f64 (-.f64 (*.f64 x (-.f64 (*.f64 y z) (*.f64 t a))) (*.f64 b (-.f64 (*.f64 c z) (*.f64 t i)))) (*.f64 j (-.f64 (*.f64 c a) (*.f64 y i)))) Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-*.f6459.5
Applied rewrites59.5%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1
(+
(* (- (fma z y (- (* b (/ (- (* c z) (* i t)) x)))) (* a t)) x)
(* j (* a c)))))
(if (<= x -4.4e+234)
(* (* x (/ (* t (- (/ (* y z) t) a)) b)) b)
(if (<= x -8.5e-137)
t_1
(if (<= x 7.2e-167)
(fma (* j c) a (- (* i (- (* b t) (* j y))) (* (* c b) z)))
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((fma(z, y, -(b * (((c * z) - (i * t)) / x))) - (a * t)) * x) + (j * (a * c));
double tmp;
if (x <= -4.4e+234) {
tmp = (x * ((t * (((y * z) / t) - a)) / b)) * b;
} else if (x <= -8.5e-137) {
tmp = t_1;
} else if (x <= 7.2e-167) {
tmp = fma((j * c), a, ((i * ((b * t) - (j * y))) - ((c * b) * z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(fma(z, y, Float64(-Float64(b * Float64(Float64(Float64(c * z) - Float64(i * t)) / x)))) - Float64(a * t)) * x) + Float64(j * Float64(a * c))) tmp = 0.0 if (x <= -4.4e+234) tmp = Float64(Float64(x * Float64(Float64(t * Float64(Float64(Float64(y * z) / t) - a)) / b)) * b); elseif (x <= -8.5e-137) tmp = t_1; elseif (x <= 7.2e-167) tmp = fma(Float64(j * c), a, Float64(Float64(i * Float64(Float64(b * t) - Float64(j * y))) - Float64(Float64(c * b) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(N[(z * y + (-N[(b * N[(N[(N[(c * z), $MachinePrecision] - N[(i * t), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision])), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision] + N[(j * N[(a * c), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e+234], N[(N[(x * N[(N[(t * N[(N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, -8.5e-137], t$95$1, If[LessEqual[x, 7.2e-167], N[(N[(j * c), $MachinePrecision] * a + N[(N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(z, y, -b \cdot \frac{c \cdot z - i \cdot t}{x}\right) - a \cdot t\right) \cdot x + j \cdot \left(a \cdot c\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+234}:\\
\;\;\;\;\left(x \cdot \frac{t \cdot \left(\frac{y \cdot z}{t} - a\right)}{b}\right) \cdot b\\
\mathbf{elif}\;x \leq -8.5 \cdot 10^{-137}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{-167}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, i \cdot \left(b \cdot t - j \cdot y\right) - \left(c \cdot b\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -4.40000000000000015e234Initial program 73.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites70.8%
Taylor expanded in x around inf
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6437.5
Applied rewrites37.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lift-*.f6438.3
Applied rewrites38.3%
if -4.40000000000000015e234 < x < -8.5000000000000001e-137 or 7.2000000000000002e-167 < x Initial program 73.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
Taylor expanded in y around 0
lower-*.f6462.8
Applied rewrites62.8%
if -8.5000000000000001e-137 < x < 7.2000000000000002e-167Initial program 73.0%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6456.4
Applied rewrites56.4%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))))
(if (<= x -1.95e+93)
t_1
(if (<= x 1.9e-34)
(fma (* j c) a (- (* i (- (* b t) (* j y))) (* (* c b) z)))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
double tmp;
if (x <= -1.95e+93) {
tmp = t_1;
} else if (x <= 1.9e-34) {
tmp = fma((j * c), a, ((i * ((b * t) - (j * y))) - ((c * b) * z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)) tmp = 0.0 if (x <= -1.95e+93) tmp = t_1; elseif (x <= 1.9e-34) tmp = fma(Float64(j * c), a, Float64(Float64(i * Float64(Float64(b * t) - Float64(j * y))) - Float64(Float64(c * b) * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e+93], t$95$1, If[LessEqual[x, 1.9e-34], N[(N[(j * c), $MachinePrecision] * a + N[(N[(i * N[(N[(b * t), $MachinePrecision] - N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(c * b), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{+93}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.9 \cdot 10^{-34}:\\
\;\;\;\;\mathsf{fma}\left(j \cdot c, a, i \cdot \left(b \cdot t - j \cdot y\right) - \left(c \cdot b\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.9500000000000001e93 or 1.9000000000000001e-34 < x Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
if -1.9500000000000001e93 < x < 1.9000000000000001e-34Initial program 73.0%
Taylor expanded in i around 0
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites73.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lift-*.f64N/A
lift-*.f6456.4
Applied rewrites56.4%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= z -1.3e+207)
(* (fma (- i) j (* z x)) y)
(if (<= z 1.2e+64)
(fma (- (* c a) (* i y)) j (* (- (* z y) (* a t)) x))
(* (- (* y x) (* c b)) z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (z <= -1.3e+207) {
tmp = fma(-i, j, (z * x)) * y;
} else if (z <= 1.2e+64) {
tmp = fma(((c * a) - (i * y)), j, (((z * y) - (a * t)) * x));
} else {
tmp = ((y * x) - (c * b)) * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (z <= -1.3e+207) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (z <= 1.2e+64) tmp = fma(Float64(Float64(c * a) - Float64(i * y)), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)); else tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[z, -1.3e+207], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[z, 1.2e+64], N[(N[(N[(c * a), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+207}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+64}:\\
\;\;\;\;\mathsf{fma}\left(c \cdot a - i \cdot y, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\end{array}
\end{array}
if z < -1.2999999999999999e207Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
if -1.2999999999999999e207 < z < 1.2e64Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
if 1.2e64 < z Initial program 73.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.2
Applied rewrites39.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* y x) (* c b)) z)))
(if (<= z -42000000.0)
t_1
(if (<= z 6.5e+39)
(fma -1.0 (* a (* t x)) (* j (- (* a c) (* i y))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((y * x) - (c * b)) * z;
double tmp;
if (z <= -42000000.0) {
tmp = t_1;
} else if (z <= 6.5e+39) {
tmp = fma(-1.0, (a * (t * x)), (j * ((a * c) - (i * y))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(y * x) - Float64(c * b)) * z) tmp = 0.0 if (z <= -42000000.0) tmp = t_1; elseif (z <= 6.5e+39) tmp = fma(-1.0, Float64(a * Float64(t * x)), Float64(j * Float64(Float64(a * c) - Float64(i * y)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -42000000.0], t$95$1, If[LessEqual[z, 6.5e+39], N[(-1.0 * N[(a * N[(t * x), $MachinePrecision]), $MachinePrecision] + N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{if}\;z \leq -42000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{+39}:\\
\;\;\;\;\mathsf{fma}\left(-1, a \cdot \left(t \cdot x\right), j \cdot \left(a \cdot c - i \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.2e7 or 6.5000000000000001e39 < z Initial program 73.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.2
Applied rewrites39.2%
if -4.2e7 < z < 6.5000000000000001e39Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6450.7
Applied rewrites50.7%
(FPCore (x y z t a b c i j)
:precision binary64
(if (<= a -1.95e-16)
(fma a (* c j) (* x (- (* y z) (* a t))))
(if (<= a -2.2e-198)
(* (fma (- i) j (* z x)) y)
(if (<= a 2.4e-105)
(* (- i) (- (* j y) (* b t)))
(if (<= a 6.6e-11)
(* (- (* y x) (* c b)) z)
(fma (* a c) j (* (- (* z y) (* a t)) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (a <= -1.95e-16) {
tmp = fma(a, (c * j), (x * ((y * z) - (a * t))));
} else if (a <= -2.2e-198) {
tmp = fma(-i, j, (z * x)) * y;
} else if (a <= 2.4e-105) {
tmp = -i * ((j * y) - (b * t));
} else if (a <= 6.6e-11) {
tmp = ((y * x) - (c * b)) * z;
} else {
tmp = fma((a * c), j, (((z * y) - (a * t)) * x));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (a <= -1.95e-16) tmp = fma(a, Float64(c * j), Float64(x * Float64(Float64(y * z) - Float64(a * t)))); elseif (a <= -2.2e-198) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (a <= 2.4e-105) tmp = Float64(Float64(-i) * Float64(Float64(j * y) - Float64(b * t))); elseif (a <= 6.6e-11) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); else tmp = fma(Float64(a * c), j, Float64(Float64(Float64(z * y) - Float64(a * t)) * x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[a, -1.95e-16], N[(a * N[(c * j), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -2.2e-198], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, 2.4e-105], N[((-i) * N[(N[(j * y), $MachinePrecision] - N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.6e-11], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], N[(N[(a * c), $MachinePrecision] * j + N[(N[(N[(z * y), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{-16}:\\
\;\;\;\;\mathsf{fma}\left(a, c \cdot j, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{elif}\;a \leq -2.2 \cdot 10^{-198}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-105}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y - b \cdot t\right)\\
\mathbf{elif}\;a \leq 6.6 \cdot 10^{-11}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a \cdot c, j, \left(z \cdot y - a \cdot t\right) \cdot x\right)\\
\end{array}
\end{array}
if a < -1.94999999999999989e-16Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in i around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6453.0
Applied rewrites53.0%
if -1.94999999999999989e-16 < a < -2.2e-198Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
if -2.2e-198 < a < 2.40000000000000015e-105Initial program 73.0%
Taylor expanded in i around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
if 2.40000000000000015e-105 < a < 6.6000000000000005e-11Initial program 73.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.2
Applied rewrites39.2%
if 6.6000000000000005e-11 < a Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in y around 0
lower-*.f6451.9
Applied rewrites51.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (fma a (* c j) (* x (- (* y z) (* a t))))))
(if (<= a -1.95e-16)
t_1
(if (<= a -2.2e-198)
(* (fma (- i) j (* z x)) y)
(if (<= a 2.4e-105)
(* (- i) (- (* j y) (* b t)))
(if (<= a 1.8e-9) (* (- (* y x) (* c b)) z) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = fma(a, (c * j), (x * ((y * z) - (a * t))));
double tmp;
if (a <= -1.95e-16) {
tmp = t_1;
} else if (a <= -2.2e-198) {
tmp = fma(-i, j, (z * x)) * y;
} else if (a <= 2.4e-105) {
tmp = -i * ((j * y) - (b * t));
} else if (a <= 1.8e-9) {
tmp = ((y * x) - (c * b)) * z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i, j) t_1 = fma(a, Float64(c * j), Float64(x * Float64(Float64(y * z) - Float64(a * t)))) tmp = 0.0 if (a <= -1.95e-16) tmp = t_1; elseif (a <= -2.2e-198) tmp = Float64(fma(Float64(-i), j, Float64(z * x)) * y); elseif (a <= 2.4e-105) tmp = Float64(Float64(-i) * Float64(Float64(j * y) - Float64(b * t))); elseif (a <= 1.8e-9) tmp = Float64(Float64(Float64(y * x) - Float64(c * b)) * z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(a * N[(c * j), $MachinePrecision] + N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.95e-16], t$95$1, If[LessEqual[a, -2.2e-198], N[(N[((-i) * j + N[(z * x), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[a, 2.4e-105], N[((-i) * N[(N[(j * y), $MachinePrecision] - N[(b * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e-9], N[(N[(N[(y * x), $MachinePrecision] - N[(c * b), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, c \cdot j, x \cdot \left(y \cdot z - a \cdot t\right)\right)\\
\mathbf{if}\;a \leq -1.95 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.2 \cdot 10^{-198}:\\
\;\;\;\;\mathsf{fma}\left(-i, j, z \cdot x\right) \cdot y\\
\mathbf{elif}\;a \leq 2.4 \cdot 10^{-105}:\\
\;\;\;\;\left(-i\right) \cdot \left(j \cdot y - b \cdot t\right)\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{-9}:\\
\;\;\;\;\left(y \cdot x - c \cdot b\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.94999999999999989e-16 or 1.8e-9 < a Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in i around 0
lower-fma.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6453.0
Applied rewrites53.0%
if -1.94999999999999989e-16 < a < -2.2e-198Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
if -2.2e-198 < a < 2.40000000000000015e-105Initial program 73.0%
Taylor expanded in i around -inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6438.2
Applied rewrites38.2%
if 2.40000000000000015e-105 < a < 1.8e-9Initial program 73.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.2
Applied rewrites39.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -1.05e+46)
t_1
(if (<= x -1.05e-177)
(* (- (* i t) (* c z)) b)
(if (<= x 5.5e-243)
(* j (- (* a c) (* i y)))
(if (<= x 9.5e-34) (* (- (* j a) (* b z)) c) t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -1.05e+46) {
tmp = t_1;
} else if (x <= -1.05e-177) {
tmp = ((i * t) - (c * z)) * b;
} else if (x <= 5.5e-243) {
tmp = j * ((a * c) - (i * y));
} else if (x <= 9.5e-34) {
tmp = ((j * a) - (b * z)) * c;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((y * z) - (a * t))
if (x <= (-1.05d+46)) then
tmp = t_1
else if (x <= (-1.05d-177)) then
tmp = ((i * t) - (c * z)) * b
else if (x <= 5.5d-243) then
tmp = j * ((a * c) - (i * y))
else if (x <= 9.5d-34) then
tmp = ((j * a) - (b * z)) * c
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -1.05e+46) {
tmp = t_1;
} else if (x <= -1.05e-177) {
tmp = ((i * t) - (c * z)) * b;
} else if (x <= 5.5e-243) {
tmp = j * ((a * c) - (i * y));
} else if (x <= 9.5e-34) {
tmp = ((j * a) - (b * z)) * c;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * ((y * z) - (a * t)) tmp = 0 if x <= -1.05e+46: tmp = t_1 elif x <= -1.05e-177: tmp = ((i * t) - (c * z)) * b elif x <= 5.5e-243: tmp = j * ((a * c) - (i * y)) elif x <= 9.5e-34: tmp = ((j * a) - (b * z)) * c else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -1.05e+46) tmp = t_1; elseif (x <= -1.05e-177) tmp = Float64(Float64(Float64(i * t) - Float64(c * z)) * b); elseif (x <= 5.5e-243) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); elseif (x <= 9.5e-34) tmp = Float64(Float64(Float64(j * a) - Float64(b * z)) * c); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * ((y * z) - (a * t)); tmp = 0.0; if (x <= -1.05e+46) tmp = t_1; elseif (x <= -1.05e-177) tmp = ((i * t) - (c * z)) * b; elseif (x <= 5.5e-243) tmp = j * ((a * c) - (i * y)); elseif (x <= 9.5e-34) tmp = ((j * a) - (b * z)) * c; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+46], t$95$1, If[LessEqual[x, -1.05e-177], N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 5.5e-243], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9.5e-34], N[(N[(N[(j * a), $MachinePrecision] - N[(b * z), $MachinePrecision]), $MachinePrecision] * c), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-177}:\\
\;\;\;\;\left(i \cdot t - c \cdot z\right) \cdot b\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-243}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-34}:\\
\;\;\;\;\left(j \cdot a - b \cdot z\right) \cdot c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.05e46 or 9.49999999999999985e-34 < x Initial program 73.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
Taylor expanded in x around inf
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6440.3
Applied rewrites40.3%
if -1.05e46 < x < -1.05e-177Initial program 73.0%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
if -1.05e-177 < x < 5.50000000000000004e-243Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.7
Applied rewrites39.7%
if 5.50000000000000004e-243 < x < 9.49999999999999985e-34Initial program 73.0%
Taylor expanded in c around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6439.2
Applied rewrites39.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* (- (* i t) (* c z)) b)) (t_2 (* x (- (* y z) (* a t)))))
(if (<= x -1.05e+46)
t_2
(if (<= x -1.05e-177)
t_1
(if (<= x 1.5e-142)
(* j (- (* a c) (* i y)))
(if (<= x 700.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = ((i * t) - (c * z)) * b;
double t_2 = x * ((y * z) - (a * t));
double tmp;
if (x <= -1.05e+46) {
tmp = t_2;
} else if (x <= -1.05e-177) {
tmp = t_1;
} else if (x <= 1.5e-142) {
tmp = j * ((a * c) - (i * y));
} else if (x <= 700.0) {
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 = ((i * t) - (c * z)) * b
t_2 = x * ((y * z) - (a * t))
if (x <= (-1.05d+46)) then
tmp = t_2
else if (x <= (-1.05d-177)) then
tmp = t_1
else if (x <= 1.5d-142) then
tmp = j * ((a * c) - (i * y))
else if (x <= 700.0d0) 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 = ((i * t) - (c * z)) * b;
double t_2 = x * ((y * z) - (a * t));
double tmp;
if (x <= -1.05e+46) {
tmp = t_2;
} else if (x <= -1.05e-177) {
tmp = t_1;
} else if (x <= 1.5e-142) {
tmp = j * ((a * c) - (i * y));
} else if (x <= 700.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = ((i * t) - (c * z)) * b t_2 = x * ((y * z) - (a * t)) tmp = 0 if x <= -1.05e+46: tmp = t_2 elif x <= -1.05e-177: tmp = t_1 elif x <= 1.5e-142: tmp = j * ((a * c) - (i * y)) elif x <= 700.0: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(Float64(Float64(i * t) - Float64(c * z)) * b) t_2 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -1.05e+46) tmp = t_2; elseif (x <= -1.05e-177) tmp = t_1; elseif (x <= 1.5e-142) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); elseif (x <= 700.0) 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 = ((i * t) - (c * z)) * b; t_2 = x * ((y * z) - (a * t)); tmp = 0.0; if (x <= -1.05e+46) tmp = t_2; elseif (x <= -1.05e-177) tmp = t_1; elseif (x <= 1.5e-142) tmp = j * ((a * c) - (i * y)); elseif (x <= 700.0) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(N[(N[(i * t), $MachinePrecision] - N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.05e+46], t$95$2, If[LessEqual[x, -1.05e-177], t$95$1, If[LessEqual[x, 1.5e-142], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 700.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(i \cdot t - c \cdot z\right) \cdot b\\
t_2 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-177}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{-142}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{elif}\;x \leq 700:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -1.05e46 or 700 < x Initial program 73.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
Taylor expanded in x around inf
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6440.3
Applied rewrites40.3%
if -1.05e46 < x < -1.05e-177 or 1.5000000000000001e-142 < x < 700Initial program 73.0%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
if -1.05e-177 < x < 1.5000000000000001e-142Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.7
Applied rewrites39.7%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (- (* y z) (* a t)))))
(if (<= x -1.15e+46)
t_1
(if (<= x 3.9e+34) (* j (- (* a c) (* i y))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -1.15e+46) {
tmp = t_1;
} else if (x <= 3.9e+34) {
tmp = j * ((a * c) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
real(8) :: t_1
real(8) :: tmp
t_1 = x * ((y * z) - (a * t))
if (x <= (-1.15d+46)) then
tmp = t_1
else if (x <= 3.9d+34) then
tmp = j * ((a * c) - (i * y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double t_1 = x * ((y * z) - (a * t));
double tmp;
if (x <= -1.15e+46) {
tmp = t_1;
} else if (x <= 3.9e+34) {
tmp = j * ((a * c) - (i * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): t_1 = x * ((y * z) - (a * t)) tmp = 0 if x <= -1.15e+46: tmp = t_1 elif x <= 3.9e+34: tmp = j * ((a * c) - (i * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i, j) t_1 = Float64(x * Float64(Float64(y * z) - Float64(a * t))) tmp = 0.0 if (x <= -1.15e+46) tmp = t_1; elseif (x <= 3.9e+34) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) t_1 = x * ((y * z) - (a * t)); tmp = 0.0; if (x <= -1.15e+46) tmp = t_1; elseif (x <= 3.9e+34) tmp = j * ((a * c) - (i * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := Block[{t$95$1 = N[(x * N[(N[(y * z), $MachinePrecision] - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+46], t$95$1, If[LessEqual[x, 3.9e+34], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z - a \cdot t\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{+34}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.15e46 or 3.90000000000000019e34 < x Initial program 73.0%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites68.1%
Taylor expanded in x around inf
lower-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f6440.3
Applied rewrites40.3%
if -1.15e46 < x < 3.90000000000000019e34Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.7
Applied rewrites39.7%
(FPCore (x y z t a b c i j) :precision binary64 (if (<= x -1.35e+101) (* x (* y z)) (if (<= x 3.15e+134) (* j (- (* a c) (* i y))) (* (* -1.0 (* t x)) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
double tmp;
if (x <= -1.35e+101) {
tmp = x * (y * z);
} else if (x <= 3.15e+134) {
tmp = j * ((a * c) - (i * y));
} else {
tmp = (-1.0 * (t * x)) * a;
}
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 (x <= (-1.35d+101)) then
tmp = x * (y * z)
else if (x <= 3.15d+134) then
tmp = j * ((a * c) - (i * y))
else
tmp = ((-1.0d0) * (t * x)) * a
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 (x <= -1.35e+101) {
tmp = x * (y * z);
} else if (x <= 3.15e+134) {
tmp = j * ((a * c) - (i * y));
} else {
tmp = (-1.0 * (t * x)) * a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i, j): tmp = 0 if x <= -1.35e+101: tmp = x * (y * z) elif x <= 3.15e+134: tmp = j * ((a * c) - (i * y)) else: tmp = (-1.0 * (t * x)) * a return tmp
function code(x, y, z, t, a, b, c, i, j) tmp = 0.0 if (x <= -1.35e+101) tmp = Float64(x * Float64(y * z)); elseif (x <= 3.15e+134) tmp = Float64(j * Float64(Float64(a * c) - Float64(i * y))); else tmp = Float64(Float64(-1.0 * Float64(t * x)) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i, j) tmp = 0.0; if (x <= -1.35e+101) tmp = x * (y * z); elseif (x <= 3.15e+134) tmp = j * ((a * c) - (i * y)); else tmp = (-1.0 * (t * x)) * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := If[LessEqual[x, -1.35e+101], N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.15e+134], N[(j * N[(N[(a * c), $MachinePrecision] - N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-1.0 * N[(t * x), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+101}:\\
\;\;\;\;x \cdot \left(y \cdot z\right)\\
\mathbf{elif}\;x \leq 3.15 \cdot 10^{+134}:\\
\;\;\;\;j \cdot \left(a \cdot c - i \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-1 \cdot \left(t \cdot x\right)\right) \cdot a\\
\end{array}
\end{array}
if x < -1.35000000000000003e101Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
if -1.35000000000000003e101 < x < 3.1500000000000001e134Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6439.7
Applied rewrites39.7%
if 3.1500000000000001e134 < x Initial program 73.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.8
Applied rewrites39.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6421.9
Applied rewrites21.9%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= x -1.05e+46)
t_1
(if (<= x -1.05e-177)
(* (* -1.0 (* b c)) z)
(if (<= x 1.15e-242)
(* (* -1.0 (* i j)) y)
(if (<= x 1.2e-34) (* (* c j) 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 = x * (y * z);
double tmp;
if (x <= -1.05e+46) {
tmp = t_1;
} else if (x <= -1.05e-177) {
tmp = (-1.0 * (b * c)) * z;
} else if (x <= 1.15e-242) {
tmp = (-1.0 * (i * j)) * y;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= (-1.05d+46)) then
tmp = t_1
else if (x <= (-1.05d-177)) then
tmp = ((-1.0d0) * (b * c)) * z
else if (x <= 1.15d-242) then
tmp = ((-1.0d0) * (i * j)) * y
else if (x <= 1.2d-34) then
tmp = (c * j) * a
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 <= -1.05e+46) {
tmp = t_1;
} else if (x <= -1.05e-177) {
tmp = (-1.0 * (b * c)) * z;
} else if (x <= 1.15e-242) {
tmp = (-1.0 * (i * j)) * y;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= -1.05e+46: tmp = t_1 elif x <= -1.05e-177: tmp = (-1.0 * (b * c)) * z elif x <= 1.15e-242: tmp = (-1.0 * (i * j)) * y elif x <= 1.2e-34: tmp = (c * j) * a 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 <= -1.05e+46) tmp = t_1; elseif (x <= -1.05e-177) tmp = Float64(Float64(-1.0 * Float64(b * c)) * z); elseif (x <= 1.15e-242) tmp = Float64(Float64(-1.0 * Float64(i * j)) * y); elseif (x <= 1.2e-34) tmp = Float64(Float64(c * j) * a); 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 <= -1.05e+46) tmp = t_1; elseif (x <= -1.05e-177) tmp = (-1.0 * (b * c)) * z; elseif (x <= 1.15e-242) tmp = (-1.0 * (i * j)) * y; elseif (x <= 1.2e-34) tmp = (c * j) * a; 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, -1.05e+46], t$95$1, If[LessEqual[x, -1.05e-177], N[(N[(-1.0 * N[(b * c), $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[x, 1.15e-242], N[(N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 1.2e-34], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-177}:\\
\;\;\;\;\left(-1 \cdot \left(b \cdot c\right)\right) \cdot z\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-242}:\\
\;\;\;\;\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.05e46 or 1.19999999999999996e-34 < x Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
if -1.05e46 < x < -1.05e-177Initial program 73.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6439.2
Applied rewrites39.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6421.4
Applied rewrites21.4%
if -1.05e-177 < x < 1.14999999999999992e-242Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if 1.14999999999999992e-242 < x < 1.19999999999999996e-34Initial program 73.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.8
Applied rewrites39.8%
Taylor expanded in x around 0
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= x -1.05e+46)
t_1
(if (<= x -1.05e-177)
(* (* -1.0 (* c z)) b)
(if (<= x 1.15e-242)
(* (* -1.0 (* i j)) y)
(if (<= x 1.2e-34) (* (* c j) 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 = x * (y * z);
double tmp;
if (x <= -1.05e+46) {
tmp = t_1;
} else if (x <= -1.05e-177) {
tmp = (-1.0 * (c * z)) * b;
} else if (x <= 1.15e-242) {
tmp = (-1.0 * (i * j)) * y;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= (-1.05d+46)) then
tmp = t_1
else if (x <= (-1.05d-177)) then
tmp = ((-1.0d0) * (c * z)) * b
else if (x <= 1.15d-242) then
tmp = ((-1.0d0) * (i * j)) * y
else if (x <= 1.2d-34) then
tmp = (c * j) * a
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 <= -1.05e+46) {
tmp = t_1;
} else if (x <= -1.05e-177) {
tmp = (-1.0 * (c * z)) * b;
} else if (x <= 1.15e-242) {
tmp = (-1.0 * (i * j)) * y;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= -1.05e+46: tmp = t_1 elif x <= -1.05e-177: tmp = (-1.0 * (c * z)) * b elif x <= 1.15e-242: tmp = (-1.0 * (i * j)) * y elif x <= 1.2e-34: tmp = (c * j) * a 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 <= -1.05e+46) tmp = t_1; elseif (x <= -1.05e-177) tmp = Float64(Float64(-1.0 * Float64(c * z)) * b); elseif (x <= 1.15e-242) tmp = Float64(Float64(-1.0 * Float64(i * j)) * y); elseif (x <= 1.2e-34) tmp = Float64(Float64(c * j) * a); 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 <= -1.05e+46) tmp = t_1; elseif (x <= -1.05e-177) tmp = (-1.0 * (c * z)) * b; elseif (x <= 1.15e-242) tmp = (-1.0 * (i * j)) * y; elseif (x <= 1.2e-34) tmp = (c * j) * a; 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, -1.05e+46], t$95$1, If[LessEqual[x, -1.05e-177], N[(N[(-1.0 * N[(c * z), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 1.15e-242], N[(N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 1.2e-34], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-177}:\\
\;\;\;\;\left(-1 \cdot \left(c \cdot z\right)\right) \cdot b\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-242}:\\
\;\;\;\;\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.05e46 or 1.19999999999999996e-34 < x Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
if -1.05e46 < x < -1.05e-177Initial program 73.0%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
Taylor expanded in z around inf
lower-*.f64N/A
lift-*.f6421.9
Applied rewrites21.9%
if -1.05e-177 < x < 1.14999999999999992e-242Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if 1.14999999999999992e-242 < x < 1.19999999999999996e-34Initial program 73.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.8
Applied rewrites39.8%
Taylor expanded in x around 0
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= x -9.5e+29)
t_1
(if (<= x -4.1e-112)
(* (* i t) b)
(if (<= x 1.15e-242)
(* (* -1.0 (* i j)) y)
(if (<= x 1.2e-34) (* (* c j) 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 = x * (y * z);
double tmp;
if (x <= -9.5e+29) {
tmp = t_1;
} else if (x <= -4.1e-112) {
tmp = (i * t) * b;
} else if (x <= 1.15e-242) {
tmp = (-1.0 * (i * j)) * y;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= (-9.5d+29)) then
tmp = t_1
else if (x <= (-4.1d-112)) then
tmp = (i * t) * b
else if (x <= 1.15d-242) then
tmp = ((-1.0d0) * (i * j)) * y
else if (x <= 1.2d-34) then
tmp = (c * j) * a
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 <= -9.5e+29) {
tmp = t_1;
} else if (x <= -4.1e-112) {
tmp = (i * t) * b;
} else if (x <= 1.15e-242) {
tmp = (-1.0 * (i * j)) * y;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= -9.5e+29: tmp = t_1 elif x <= -4.1e-112: tmp = (i * t) * b elif x <= 1.15e-242: tmp = (-1.0 * (i * j)) * y elif x <= 1.2e-34: tmp = (c * j) * a 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 <= -9.5e+29) tmp = t_1; elseif (x <= -4.1e-112) tmp = Float64(Float64(i * t) * b); elseif (x <= 1.15e-242) tmp = Float64(Float64(-1.0 * Float64(i * j)) * y); elseif (x <= 1.2e-34) tmp = Float64(Float64(c * j) * a); 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 <= -9.5e+29) tmp = t_1; elseif (x <= -4.1e-112) tmp = (i * t) * b; elseif (x <= 1.15e-242) tmp = (-1.0 * (i * j)) * y; elseif (x <= 1.2e-34) tmp = (c * j) * a; 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, -9.5e+29], t$95$1, If[LessEqual[x, -4.1e-112], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 1.15e-242], N[(N[(-1.0 * N[(i * j), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[x, 1.2e-34], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -4.1 \cdot 10^{-112}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-242}:\\
\;\;\;\;\left(-1 \cdot \left(i \cdot j\right)\right) \cdot y\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.5000000000000003e29 or 1.19999999999999996e-34 < x Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
if -9.5000000000000003e29 < x < -4.09999999999999996e-112Initial program 73.0%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
Taylor expanded in z around 0
lift-*.f6421.3
Applied rewrites21.3%
if -4.09999999999999996e-112 < x < 1.14999999999999992e-242Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around 0
lower-*.f64N/A
lower-*.f6422.3
Applied rewrites22.3%
if 1.14999999999999992e-242 < x < 1.19999999999999996e-34Initial program 73.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.8
Applied rewrites39.8%
Taylor expanded in x around 0
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= x -9.5e+29)
t_1
(if (<= x -1.05e-142)
(* (* i t) b)
(if (<= x 1.35e-242)
(* -1.0 (* i (* j y)))
(if (<= x 1.2e-34) (* (* c j) 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 = x * (y * z);
double tmp;
if (x <= -9.5e+29) {
tmp = t_1;
} else if (x <= -1.05e-142) {
tmp = (i * t) * b;
} else if (x <= 1.35e-242) {
tmp = -1.0 * (i * (j * y));
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= (-9.5d+29)) then
tmp = t_1
else if (x <= (-1.05d-142)) then
tmp = (i * t) * b
else if (x <= 1.35d-242) then
tmp = (-1.0d0) * (i * (j * y))
else if (x <= 1.2d-34) then
tmp = (c * j) * a
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 <= -9.5e+29) {
tmp = t_1;
} else if (x <= -1.05e-142) {
tmp = (i * t) * b;
} else if (x <= 1.35e-242) {
tmp = -1.0 * (i * (j * y));
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= -9.5e+29: tmp = t_1 elif x <= -1.05e-142: tmp = (i * t) * b elif x <= 1.35e-242: tmp = -1.0 * (i * (j * y)) elif x <= 1.2e-34: tmp = (c * j) * a 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 <= -9.5e+29) tmp = t_1; elseif (x <= -1.05e-142) tmp = Float64(Float64(i * t) * b); elseif (x <= 1.35e-242) tmp = Float64(-1.0 * Float64(i * Float64(j * y))); elseif (x <= 1.2e-34) tmp = Float64(Float64(c * j) * a); 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 <= -9.5e+29) tmp = t_1; elseif (x <= -1.05e-142) tmp = (i * t) * b; elseif (x <= 1.35e-242) tmp = -1.0 * (i * (j * y)); elseif (x <= 1.2e-34) tmp = (c * j) * a; 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, -9.5e+29], t$95$1, If[LessEqual[x, -1.05e-142], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 1.35e-242], N[(-1.0 * N[(i * N[(j * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.2e-34], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.05 \cdot 10^{-142}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{-242}:\\
\;\;\;\;-1 \cdot \left(i \cdot \left(j \cdot y\right)\right)\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.5000000000000003e29 or 1.19999999999999996e-34 < x Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
if -9.5000000000000003e29 < x < -1.05e-142Initial program 73.0%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
Taylor expanded in z around 0
lift-*.f6421.3
Applied rewrites21.3%
if -1.05e-142 < x < 1.35e-242Initial program 73.0%
Taylor expanded in b around 0
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6461.8
Applied rewrites61.8%
Taylor expanded in i around inf
lower-*.f64N/A
lower-*.f64N/A
lift-*.f6422.3
Applied rewrites22.3%
if 1.35e-242 < x < 1.19999999999999996e-34Initial program 73.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.8
Applied rewrites39.8%
Taylor expanded in x around 0
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j)
:precision binary64
(let* ((t_1 (* x (* y z))))
(if (<= x -9.5e+29)
t_1
(if (<= x -2.55e-102)
(* (* i t) b)
(if (<= x 1.2e-34) (* (* c j) 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 = x * (y * z);
double tmp;
if (x <= -9.5e+29) {
tmp = t_1;
} else if (x <= -2.55e-102) {
tmp = (i * t) * b;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= (-9.5d+29)) then
tmp = t_1
else if (x <= (-2.55d-102)) then
tmp = (i * t) * b
else if (x <= 1.2d-34) then
tmp = (c * j) * a
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 <= -9.5e+29) {
tmp = t_1;
} else if (x <= -2.55e-102) {
tmp = (i * t) * b;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= -9.5e+29: tmp = t_1 elif x <= -2.55e-102: tmp = (i * t) * b elif x <= 1.2e-34: tmp = (c * j) * a 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 <= -9.5e+29) tmp = t_1; elseif (x <= -2.55e-102) tmp = Float64(Float64(i * t) * b); elseif (x <= 1.2e-34) tmp = Float64(Float64(c * j) * a); 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 <= -9.5e+29) tmp = t_1; elseif (x <= -2.55e-102) tmp = (i * t) * b; elseif (x <= 1.2e-34) tmp = (c * j) * a; 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, -9.5e+29], t$95$1, If[LessEqual[x, -2.55e-102], N[(N[(i * t), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 1.2e-34], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -9.5 \cdot 10^{+29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -2.55 \cdot 10^{-102}:\\
\;\;\;\;\left(i \cdot t\right) \cdot b\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.5000000000000003e29 or 1.19999999999999996e-34 < x Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
if -9.5000000000000003e29 < x < -2.55e-102Initial program 73.0%
Taylor expanded in b around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
lift-*.f6437.8
Applied rewrites37.8%
Taylor expanded in z around 0
lift-*.f6421.3
Applied rewrites21.3%
if -2.55e-102 < x < 1.19999999999999996e-34Initial program 73.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.8
Applied rewrites39.8%
Taylor expanded in x around 0
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j) :precision binary64 (let* ((t_1 (* x (* y z)))) (if (<= x -1.6e-21) t_1 (if (<= x 1.2e-34) (* (* c j) 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 = x * (y * z);
double tmp;
if (x <= -1.6e-21) {
tmp = t_1;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= (-1.6d-21)) then
tmp = t_1
else if (x <= 1.2d-34) then
tmp = (c * j) * a
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 <= -1.6e-21) {
tmp = t_1;
} else if (x <= 1.2e-34) {
tmp = (c * j) * a;
} 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 <= -1.6e-21: tmp = t_1 elif x <= 1.2e-34: tmp = (c * j) * a 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 <= -1.6e-21) tmp = t_1; elseif (x <= 1.2e-34) tmp = Float64(Float64(c * j) * a); 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 <= -1.6e-21) tmp = t_1; elseif (x <= 1.2e-34) tmp = (c * j) * a; 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, -1.6e-21], t$95$1, If[LessEqual[x, 1.2e-34], N[(N[(c * j), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(y \cdot z\right)\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-34}:\\
\;\;\;\;\left(c \cdot j\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.6000000000000001e-21 or 1.19999999999999996e-34 < x Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
if -1.6000000000000001e-21 < x < 1.19999999999999996e-34Initial program 73.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6439.8
Applied rewrites39.8%
Taylor expanded in x around 0
lower-*.f6423.2
Applied rewrites23.2%
(FPCore (x y z t a b c i j) :precision binary64 (* x (* y z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return x * (y * z);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i, j)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8), intent (in) :: j
code = x * (y * z)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i, double j) {
return x * (y * z);
}
def code(x, y, z, t, a, b, c, i, j): return x * (y * z)
function code(x, y, z, t, a, b, c, i, j) return Float64(x * Float64(y * z)) end
function tmp = code(x, y, z, t, a, b, c, i, j) tmp = x * (y * z); end
code[x_, y_, z_, t_, a_, b_, c_, i_, j_] := N[(x * N[(y * z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(y \cdot z\right)
\end{array}
Initial program 73.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64N/A
*-commutativeN/A
lower-*.f6440.9
Applied rewrites40.9%
Taylor expanded in x around inf
lower-*.f64N/A
lift-*.f6423.8
Applied rewrites23.8%
herbie shell --seed 2025134
(FPCore (x y z t a b c i j)
:name "Data.Colour.Matrix:determinant from colour-2.3.3, A"
:precision binary64
(+ (- (* x (- (* y z) (* t a))) (* b (- (* c z) (* t i)))) (* j (- (* c a) (* y i)))))