
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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
code = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
(FPCore (x y z t a b) :precision binary64 (fma (- 1.0 y) z (- x (fma (- 2.0 (+ t y)) b (* a (- t 1.0))))))
double code(double x, double y, double z, double t, double a, double b) {
return fma((1.0 - y), z, (x - fma((2.0 - (t + y)), b, (a * (t - 1.0)))));
}
function code(x, y, z, t, a, b) return fma(Float64(1.0 - y), z, Float64(x - fma(Float64(2.0 - Float64(t + y)), b, Float64(a * Float64(t - 1.0))))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(1.0 - y), $MachinePrecision] * z + N[(x - N[(N[(2.0 - N[(t + y), $MachinePrecision]), $MachinePrecision] * b + N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(1 - y, z, x - \mathsf{fma}\left(2 - \left(t + y\right), b, a \cdot \left(t - 1\right)\right)\right)
Initial program 94.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- y 1.0)))
(t_2 (* b (- (+ t y) 2.0)))
(t_3 (- (+ x t_2) t_1)))
(if (<= x -1.55e+95)
t_3
(if (<= x 1.05e-21) (- t_2 (fma a (- t 1.0) t_1)) t_3))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y - 1.0);
double t_2 = b * ((t + y) - 2.0);
double t_3 = (x + t_2) - t_1;
double tmp;
if (x <= -1.55e+95) {
tmp = t_3;
} else if (x <= 1.05e-21) {
tmp = t_2 - fma(a, (t - 1.0), t_1);
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y - 1.0)) t_2 = Float64(b * Float64(Float64(t + y) - 2.0)) t_3 = Float64(Float64(x + t_2) - t_1) tmp = 0.0 if (x <= -1.55e+95) tmp = t_3; elseif (x <= 1.05e-21) tmp = Float64(t_2 - fma(a, Float64(t - 1.0), t_1)); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x + t$95$2), $MachinePrecision] - t$95$1), $MachinePrecision]}, If[LessEqual[x, -1.55e+95], t$95$3, If[LessEqual[x, 1.05e-21], N[(t$95$2 - N[(a * N[(t - 1.0), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_1 := z \cdot \left(y - 1\right)\\
t_2 := b \cdot \left(\left(t + y\right) - 2\right)\\
t_3 := \left(x + t\_2\right) - t\_1\\
\mathbf{if}\;x \leq -1.55 \cdot 10^{+95}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{-21}:\\
\;\;\;\;t\_2 - \mathsf{fma}\left(a, t - 1, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if x < -1.5500000000000001e95 or 1.0500000000000001e-21 < x Initial program 94.8%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6474.4%
Applied rewrites74.4%
if -1.5500000000000001e95 < x < 1.0500000000000001e-21Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- (+ t y) 2.0))))
(if (<= b -2e+230)
t_1
(if (<= b 3.8e-35)
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* b y))
(- (+ x t_1) (* z (- y 1.0)))))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * ((t + y) - 2.0);
double tmp;
if (b <= -2e+230) {
tmp = t_1;
} else if (b <= 3.8e-35) {
tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (b * y);
} else {
tmp = (x + t_1) - (z * (y - 1.0));
}
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)
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) :: t_1
real(8) :: tmp
t_1 = b * ((t + y) - 2.0d0)
if (b <= (-2d+230)) then
tmp = t_1
else if (b <= 3.8d-35) then
tmp = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (b * y)
else
tmp = (x + t_1) - (z * (y - 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * ((t + y) - 2.0);
double tmp;
if (b <= -2e+230) {
tmp = t_1;
} else if (b <= 3.8e-35) {
tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (b * y);
} else {
tmp = (x + t_1) - (z * (y - 1.0));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * ((t + y) - 2.0) tmp = 0 if b <= -2e+230: tmp = t_1 elif b <= 3.8e-35: tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (b * y) else: tmp = (x + t_1) - (z * (y - 1.0)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(Float64(t + y) - 2.0)) tmp = 0.0 if (b <= -2e+230) tmp = t_1; elseif (b <= 3.8e-35) tmp = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(b * y)); else tmp = Float64(Float64(x + t_1) - Float64(z * Float64(y - 1.0))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * ((t + y) - 2.0); tmp = 0.0; if (b <= -2e+230) tmp = t_1; elseif (b <= 3.8e-35) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (b * y); else tmp = (x + t_1) - (z * (y - 1.0)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2e+230], t$95$1, If[LessEqual[b, 3.8e-35], N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(b * y), $MachinePrecision]), $MachinePrecision], N[(N[(x + t$95$1), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -2 \cdot 10^{+230}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{-35}:\\
\;\;\;\;\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + b \cdot y\\
\mathbf{else}:\\
\;\;\;\;\left(x + t\_1\right) - z \cdot \left(y - 1\right)\\
\end{array}
if b < -2.0000000000000002e230Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
if -2.0000000000000002e230 < b < 3.8000000000000001e-35Initial program 94.8%
Taylor expanded in y around inf
lower-*.f6476.8%
Applied rewrites76.8%
if 3.8000000000000001e-35 < b Initial program 94.8%
Taylor expanded in a around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f6474.4%
Applied rewrites74.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 y) z (* t (+ b (* -1.0 a))))))
(if (<= t -16000.0)
t_1
(if (<= t 1950000.0)
(- (+ (fma (- y 2.0) b x) a) (* (- y 1.0) z))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - y), z, (t * (b + (-1.0 * a))));
double tmp;
if (t <= -16000.0) {
tmp = t_1;
} else if (t <= 1950000.0) {
tmp = (fma((y - 2.0), b, x) + a) - ((y - 1.0) * z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - y), z, Float64(t * Float64(b + Float64(-1.0 * a)))) tmp = 0.0 if (t <= -16000.0) tmp = t_1; elseif (t <= 1950000.0) tmp = Float64(Float64(fma(Float64(y - 2.0), b, x) + a) - Float64(Float64(y - 1.0) * z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z + N[(t * N[(b + N[(-1.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -16000.0], t$95$1, If[LessEqual[t, 1950000.0], N[(N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] + a), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - y, z, t \cdot \left(b + -1 \cdot a\right)\right)\\
\mathbf{if}\;t \leq -16000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1950000:\\
\;\;\;\;\left(\mathsf{fma}\left(y - 2, b, x\right) + a\right) - \left(y - 1\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -16000 or 1.95e6 < t Initial program 94.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.4%
Taylor expanded in y around inf
lower-*.f6441.0%
Applied rewrites41.0%
Taylor expanded in t around -inf
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6457.5%
Applied rewrites57.5%
if -16000 < t < 1.95e6Initial program 94.8%
Taylor expanded in t around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6469.5%
Applied rewrites69.5%
lift--.f64N/A
lift-fma.f64N/A
associate--r+N/A
lower--.f64N/A
mul-1-negN/A
add-flip-revN/A
lower-+.f6469.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6469.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6469.5%
Applied rewrites69.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -3.8e+184)
(* b (- (+ t y) 2.0))
(if (<= b 5.4e+50)
(- x (fma a (- t 1.0) (* z (- y 1.0))))
(+ a (* (- (+ y t) 2.0) b)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.8e+184) {
tmp = b * ((t + y) - 2.0);
} else if (b <= 5.4e+50) {
tmp = x - fma(a, (t - 1.0), (z * (y - 1.0)));
} else {
tmp = a + (((y + t) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.8e+184) tmp = Float64(b * Float64(Float64(t + y) - 2.0)); elseif (b <= 5.4e+50) tmp = Float64(x - fma(a, Float64(t - 1.0), Float64(z * Float64(y - 1.0)))); else tmp = Float64(a + Float64(Float64(Float64(y + t) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.8e+184], N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.4e+50], N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+184}:\\
\;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{+50}:\\
\;\;\;\;x - \mathsf{fma}\left(a, t - 1, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(\left(y + t\right) - 2\right) \cdot b\\
\end{array}
if b < -3.8000000000000001e184Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
if -3.8000000000000001e184 < b < 5.4e50Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
if 5.4e50 < b Initial program 94.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6458.9%
Applied rewrites58.9%
Taylor expanded in t around 0
Applied rewrites46.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -3.8e+184)
(* b (- (+ t y) 2.0))
(if (<= b 5.4e+50)
(fma (- 1.0 y) z (fma (- 1.0 t) a x))
(+ a (* (- (+ y t) 2.0) b)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.8e+184) {
tmp = b * ((t + y) - 2.0);
} else if (b <= 5.4e+50) {
tmp = fma((1.0 - y), z, fma((1.0 - t), a, x));
} else {
tmp = a + (((y + t) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.8e+184) tmp = Float64(b * Float64(Float64(t + y) - 2.0)); elseif (b <= 5.4e+50) tmp = fma(Float64(1.0 - y), z, fma(Float64(1.0 - t), a, x)); else tmp = Float64(a + Float64(Float64(Float64(y + t) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.8e+184], N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.4e+50], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+184}:\\
\;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{+50}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(1 - t, a, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(\left(y + t\right) - 2\right) \cdot b\\
\end{array}
if b < -3.8000000000000001e184Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
if -3.8000000000000001e184 < b < 5.4e50Initial program 94.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.4%
Taylor expanded in y around inf
lower-*.f6441.0%
Applied rewrites41.0%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.9%
Applied rewrites66.9%
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
lift-*.f64N/A
distribute-rgt-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
*-commutativeN/A
lower-fma.f6466.9%
Applied rewrites66.9%
if 5.4e50 < b Initial program 94.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6458.9%
Applied rewrites58.9%
Taylor expanded in t around 0
Applied rewrites46.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -3.4e+136)
(* b (- (+ t y) 2.0))
(if (<= b 3.5e+38)
(- x (fma a (- t 1.0) (* y z)))
(+ a (* (- (+ y t) 2.0) b)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.4e+136) {
tmp = b * ((t + y) - 2.0);
} else if (b <= 3.5e+38) {
tmp = x - fma(a, (t - 1.0), (y * z));
} else {
tmp = a + (((y + t) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.4e+136) tmp = Float64(b * Float64(Float64(t + y) - 2.0)); elseif (b <= 3.5e+38) tmp = Float64(x - fma(a, Float64(t - 1.0), Float64(y * z))); else tmp = Float64(a + Float64(Float64(Float64(y + t) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.4e+136], N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.5e+38], N[(x - N[(a * N[(t - 1.0), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -3.4 \cdot 10^{+136}:\\
\;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+38}:\\
\;\;\;\;x - \mathsf{fma}\left(a, t - 1, y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(\left(y + t\right) - 2\right) \cdot b\\
\end{array}
if b < -3.4e136Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
if -3.4e136 < b < 3.5e38Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in y around inf
lower-*.f6457.4%
Applied rewrites57.4%
if 3.5e38 < b Initial program 94.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6458.9%
Applied rewrites58.9%
Taylor expanded in t around 0
Applied rewrites46.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -3.8e+184)
(* b (- (+ t y) 2.0))
(if (<= b 5.4e+50)
(- x (fma -1.0 a (* z (- y 1.0))))
(+ a (* (- (+ y t) 2.0) b)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.8e+184) {
tmp = b * ((t + y) - 2.0);
} else if (b <= 5.4e+50) {
tmp = x - fma(-1.0, a, (z * (y - 1.0)));
} else {
tmp = a + (((y + t) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.8e+184) tmp = Float64(b * Float64(Float64(t + y) - 2.0)); elseif (b <= 5.4e+50) tmp = Float64(x - fma(-1.0, a, Float64(z * Float64(y - 1.0)))); else tmp = Float64(a + Float64(Float64(Float64(y + t) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.8e+184], N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.4e+50], N[(x - N[(-1.0 * a + N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+184}:\\
\;\;\;\;b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{+50}:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, z \cdot \left(y - 1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(\left(y + t\right) - 2\right) \cdot b\\
\end{array}
if b < -3.8000000000000001e184Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
if -3.8000000000000001e184 < b < 5.4e50Initial program 94.8%
Taylor expanded in t around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6469.5%
Applied rewrites69.5%
Taylor expanded in z around 0
lower-*.f6446.5%
Applied rewrites46.5%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6451.3%
Applied rewrites51.3%
if 5.4e50 < b Initial program 94.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6458.9%
Applied rewrites58.9%
Taylor expanded in t around 0
Applied rewrites46.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ a (* (- (+ y t) 2.0) b))))
(if (<= b -3.8e+109)
t_1
(if (<= b -3.25e-197)
(- x (* z (- y 1.0)))
(if (<= b 1.38e+32) (- x (* a (- t 1.0))) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a + (((y + t) - 2.0) * b);
double tmp;
if (b <= -3.8e+109) {
tmp = t_1;
} else if (b <= -3.25e-197) {
tmp = x - (z * (y - 1.0));
} else if (b <= 1.38e+32) {
tmp = x - (a * (t - 1.0));
} 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)
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) :: t_1
real(8) :: tmp
t_1 = a + (((y + t) - 2.0d0) * b)
if (b <= (-3.8d+109)) then
tmp = t_1
else if (b <= (-3.25d-197)) then
tmp = x - (z * (y - 1.0d0))
else if (b <= 1.38d+32) then
tmp = x - (a * (t - 1.0d0))
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 t_1 = a + (((y + t) - 2.0) * b);
double tmp;
if (b <= -3.8e+109) {
tmp = t_1;
} else if (b <= -3.25e-197) {
tmp = x - (z * (y - 1.0));
} else if (b <= 1.38e+32) {
tmp = x - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a + (((y + t) - 2.0) * b) tmp = 0 if b <= -3.8e+109: tmp = t_1 elif b <= -3.25e-197: tmp = x - (z * (y - 1.0)) elif b <= 1.38e+32: tmp = x - (a * (t - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -3.8e+109) tmp = t_1; elseif (b <= -3.25e-197) tmp = Float64(x - Float64(z * Float64(y - 1.0))); elseif (b <= 1.38e+32) tmp = Float64(x - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a + (((y + t) - 2.0) * b); tmp = 0.0; if (b <= -3.8e+109) tmp = t_1; elseif (b <= -3.25e-197) tmp = x - (z * (y - 1.0)); elseif (b <= 1.38e+32) tmp = x - (a * (t - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.8e+109], t$95$1, If[LessEqual[b, -3.25e-197], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.38e+32], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := a + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -3.8 \cdot 10^{+109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.25 \cdot 10^{-197}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;b \leq 1.38 \cdot 10^{+32}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -3.8000000000000004e109 or 1.38e32 < b Initial program 94.8%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6458.9%
Applied rewrites58.9%
Taylor expanded in t around 0
Applied rewrites46.8%
if -3.8000000000000004e109 < b < -3.2499999999999997e-197Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6442.4%
Applied rewrites42.4%
if -3.2499999999999997e-197 < b < 1.38e32Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower--.f6441.3%
Applied rewrites41.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- (+ t y) 2.0))))
(if (<= b -1.12e+110)
t_1
(if (<= b -3.25e-197)
(- x (* z (- y 1.0)))
(if (<= b 1.38e+32) (- x (* a (- t 1.0))) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * ((t + y) - 2.0);
double tmp;
if (b <= -1.12e+110) {
tmp = t_1;
} else if (b <= -3.25e-197) {
tmp = x - (z * (y - 1.0));
} else if (b <= 1.38e+32) {
tmp = x - (a * (t - 1.0));
} 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)
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) :: t_1
real(8) :: tmp
t_1 = b * ((t + y) - 2.0d0)
if (b <= (-1.12d+110)) then
tmp = t_1
else if (b <= (-3.25d-197)) then
tmp = x - (z * (y - 1.0d0))
else if (b <= 1.38d+32) then
tmp = x - (a * (t - 1.0d0))
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 t_1 = b * ((t + y) - 2.0);
double tmp;
if (b <= -1.12e+110) {
tmp = t_1;
} else if (b <= -3.25e-197) {
tmp = x - (z * (y - 1.0));
} else if (b <= 1.38e+32) {
tmp = x - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * ((t + y) - 2.0) tmp = 0 if b <= -1.12e+110: tmp = t_1 elif b <= -3.25e-197: tmp = x - (z * (y - 1.0)) elif b <= 1.38e+32: tmp = x - (a * (t - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(Float64(t + y) - 2.0)) tmp = 0.0 if (b <= -1.12e+110) tmp = t_1; elseif (b <= -3.25e-197) tmp = Float64(x - Float64(z * Float64(y - 1.0))); elseif (b <= 1.38e+32) tmp = Float64(x - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * ((t + y) - 2.0); tmp = 0.0; if (b <= -1.12e+110) tmp = t_1; elseif (b <= -3.25e-197) tmp = x - (z * (y - 1.0)); elseif (b <= 1.38e+32) tmp = x - (a * (t - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.12e+110], t$95$1, If[LessEqual[b, -3.25e-197], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.38e+32], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -1.12 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -3.25 \cdot 10^{-197}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{elif}\;b \leq 1.38 \cdot 10^{+32}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1.1200000000000001e110 or 1.38e32 < b Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
if -1.1200000000000001e110 < b < -3.2499999999999997e-197Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6442.4%
Applied rewrites42.4%
if -3.2499999999999997e-197 < b < 1.38e32Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in z around 0
lower-*.f64N/A
lower--.f6441.3%
Applied rewrites41.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- (+ t y) 2.0))))
(if (<= b -1.12e+110)
t_1
(if (<= b 5.4e+50) (- x (* z (- y 1.0))) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * ((t + y) - 2.0);
double tmp;
if (b <= -1.12e+110) {
tmp = t_1;
} else if (b <= 5.4e+50) {
tmp = x - (z * (y - 1.0));
} 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)
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) :: t_1
real(8) :: tmp
t_1 = b * ((t + y) - 2.0d0)
if (b <= (-1.12d+110)) then
tmp = t_1
else if (b <= 5.4d+50) then
tmp = x - (z * (y - 1.0d0))
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 t_1 = b * ((t + y) - 2.0);
double tmp;
if (b <= -1.12e+110) {
tmp = t_1;
} else if (b <= 5.4e+50) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * ((t + y) - 2.0) tmp = 0 if b <= -1.12e+110: tmp = t_1 elif b <= 5.4e+50: tmp = x - (z * (y - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(Float64(t + y) - 2.0)) tmp = 0.0 if (b <= -1.12e+110) tmp = t_1; elseif (b <= 5.4e+50) tmp = Float64(x - Float64(z * Float64(y - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * ((t + y) - 2.0); tmp = 0.0; if (b <= -1.12e+110) tmp = t_1; elseif (b <= 5.4e+50) tmp = x - (z * (y - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.12e+110], t$95$1, If[LessEqual[b, 5.4e+50], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := b \cdot \left(\left(t + y\right) - 2\right)\\
\mathbf{if}\;b \leq -1.12 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{+50}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1.1200000000000001e110 or 5.4e50 < b Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6438.0%
Applied rewrites38.0%
if -1.1200000000000001e110 < b < 5.4e50Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6442.4%
Applied rewrites42.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -16000.0)
t_1
(if (<= t 5.4e+29) (- x (* z (- y 1.0))) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -16000.0) {
tmp = t_1;
} else if (t <= 5.4e+29) {
tmp = x - (z * (y - 1.0));
} 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)
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) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-16000.0d0)) then
tmp = t_1
else if (t <= 5.4d+29) then
tmp = x - (z * (y - 1.0d0))
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 t_1 = t * (b - a);
double tmp;
if (t <= -16000.0) {
tmp = t_1;
} else if (t <= 5.4e+29) {
tmp = x - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -16000.0: tmp = t_1 elif t <= 5.4e+29: tmp = x - (z * (y - 1.0)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -16000.0) tmp = t_1; elseif (t <= 5.4e+29) tmp = Float64(x - Float64(z * Float64(y - 1.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -16000.0) tmp = t_1; elseif (t <= 5.4e+29) tmp = x - (z * (y - 1.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -16000.0], t$95$1, If[LessEqual[t, 5.4e+29], N[(x - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -16000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{+29}:\\
\;\;\;\;x - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -16000 or 5.4e29 < t Initial program 94.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7%
Applied rewrites32.7%
if -16000 < t < 5.4e29Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6466.8%
Applied rewrites66.8%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f6442.4%
Applied rewrites42.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -16000.0)
t_1
(if (<= t 2.12e-172)
(* z (- 1.0 y))
(if (<= t 4.5e+64) (* y (- b z)) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -16000.0) {
tmp = t_1;
} else if (t <= 2.12e-172) {
tmp = z * (1.0 - y);
} else if (t <= 4.5e+64) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-16000.0d0)) then
tmp = t_1
else if (t <= 2.12d-172) then
tmp = z * (1.0d0 - y)
else if (t <= 4.5d+64) then
tmp = y * (b - z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -16000.0) {
tmp = t_1;
} else if (t <= 2.12e-172) {
tmp = z * (1.0 - y);
} else if (t <= 4.5e+64) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -16000.0: tmp = t_1 elif t <= 2.12e-172: tmp = z * (1.0 - y) elif t <= 4.5e+64: tmp = y * (b - z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -16000.0) tmp = t_1; elseif (t <= 2.12e-172) tmp = Float64(z * Float64(1.0 - y)); elseif (t <= 4.5e+64) tmp = Float64(y * Float64(b - z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -16000.0) tmp = t_1; elseif (t <= 2.12e-172) tmp = z * (1.0 - y); elseif (t <= 4.5e+64) tmp = y * (b - z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -16000.0], t$95$1, If[LessEqual[t, 2.12e-172], N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.5e+64], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -16000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.12 \cdot 10^{-172}:\\
\;\;\;\;z \cdot \left(1 - y\right)\\
\mathbf{elif}\;t \leq 4.5 \cdot 10^{+64}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -16000 or 4.4999999999999997e64 < t Initial program 94.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7%
Applied rewrites32.7%
if -16000 < t < 2.1199999999999999e-172Initial program 94.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6428.7%
Applied rewrites28.7%
if 2.1199999999999999e-172 < t < 4.4999999999999997e64Initial program 94.8%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f6432.8%
Applied rewrites32.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -16000.0)
t_1
(if (<= t 6.8e-212)
(* z (- 1.0 y))
(if (<= t 2.8e+20) (* b (- y 2.0)) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -16000.0) {
tmp = t_1;
} else if (t <= 6.8e-212) {
tmp = z * (1.0 - y);
} else if (t <= 2.8e+20) {
tmp = b * (y - 2.0);
} 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)
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) :: t_1
real(8) :: tmp
t_1 = t * (b - a)
if (t <= (-16000.0d0)) then
tmp = t_1
else if (t <= 6.8d-212) then
tmp = z * (1.0d0 - y)
else if (t <= 2.8d+20) then
tmp = b * (y - 2.0d0)
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 t_1 = t * (b - a);
double tmp;
if (t <= -16000.0) {
tmp = t_1;
} else if (t <= 6.8e-212) {
tmp = z * (1.0 - y);
} else if (t <= 2.8e+20) {
tmp = b * (y - 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = t * (b - a) tmp = 0 if t <= -16000.0: tmp = t_1 elif t <= 6.8e-212: tmp = z * (1.0 - y) elif t <= 2.8e+20: tmp = b * (y - 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -16000.0) tmp = t_1; elseif (t <= 6.8e-212) tmp = Float64(z * Float64(1.0 - y)); elseif (t <= 2.8e+20) tmp = Float64(b * Float64(y - 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = t * (b - a); tmp = 0.0; if (t <= -16000.0) tmp = t_1; elseif (t <= 6.8e-212) tmp = z * (1.0 - y); elseif (t <= 2.8e+20) tmp = b * (y - 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -16000.0], t$95$1, If[LessEqual[t, 6.8e-212], N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.8e+20], N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -16000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{-212}:\\
\;\;\;\;z \cdot \left(1 - y\right)\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{+20}:\\
\;\;\;\;b \cdot \left(y - 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -16000 or 2.8e20 < t Initial program 94.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7%
Applied rewrites32.7%
if -16000 < t < 6.8e-212Initial program 94.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6428.7%
Applied rewrites28.7%
if 6.8e-212 < t < 2.8e20Initial program 94.8%
Taylor expanded in t around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6469.5%
Applied rewrites69.5%
Taylor expanded in z around 0
lower-*.f6446.5%
Applied rewrites46.5%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6446.5%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6446.5%
Applied rewrites46.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f6423.8%
Applied rewrites23.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 y))))
(if (<= z -2.1e+48)
t_1
(if (<= z 3.1e-189)
(* a (- 1.0 t))
(if (<= z 1e+58) (* b (- y 2.0)) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - y);
double tmp;
if (z <= -2.1e+48) {
tmp = t_1;
} else if (z <= 3.1e-189) {
tmp = a * (1.0 - t);
} else if (z <= 1e+58) {
tmp = b * (y - 2.0);
} 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)
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) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - y)
if (z <= (-2.1d+48)) then
tmp = t_1
else if (z <= 3.1d-189) then
tmp = a * (1.0d0 - t)
else if (z <= 1d+58) then
tmp = b * (y - 2.0d0)
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 t_1 = z * (1.0 - y);
double tmp;
if (z <= -2.1e+48) {
tmp = t_1;
} else if (z <= 3.1e-189) {
tmp = a * (1.0 - t);
} else if (z <= 1e+58) {
tmp = b * (y - 2.0);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - y) tmp = 0 if z <= -2.1e+48: tmp = t_1 elif z <= 3.1e-189: tmp = a * (1.0 - t) elif z <= 1e+58: tmp = b * (y - 2.0) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - y)) tmp = 0.0 if (z <= -2.1e+48) tmp = t_1; elseif (z <= 3.1e-189) tmp = Float64(a * Float64(1.0 - t)); elseif (z <= 1e+58) tmp = Float64(b * Float64(y - 2.0)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - y); tmp = 0.0; if (z <= -2.1e+48) tmp = t_1; elseif (z <= 3.1e-189) tmp = a * (1.0 - t); elseif (z <= 1e+58) tmp = b * (y - 2.0); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+48], t$95$1, If[LessEqual[z, 3.1e-189], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+58], N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := z \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-189}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\
\mathbf{elif}\;z \leq 10^{+58}:\\
\;\;\;\;b \cdot \left(y - 2\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.0999999999999998e48 or 9.9999999999999994e57 < z Initial program 94.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6428.7%
Applied rewrites28.7%
if -2.0999999999999998e48 < z < 3.1e-189Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6427.5%
Applied rewrites27.5%
if 3.1e-189 < z < 9.9999999999999994e57Initial program 94.8%
Taylor expanded in t around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6469.5%
Applied rewrites69.5%
Taylor expanded in z around 0
lower-*.f6446.5%
Applied rewrites46.5%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6446.5%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6446.5%
Applied rewrites46.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f6423.8%
Applied rewrites23.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- y 2.0))))
(if (<= b -2.25e+181)
t_1
(if (<= b 5.4e+50)
(* z (- 1.0 y))
(if (<= b 3.7e+77) (* t b) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (y - 2.0);
double tmp;
if (b <= -2.25e+181) {
tmp = t_1;
} else if (b <= 5.4e+50) {
tmp = z * (1.0 - y);
} else if (b <= 3.7e+77) {
tmp = t * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = b * (y - 2.0d0)
if (b <= (-2.25d+181)) then
tmp = t_1
else if (b <= 5.4d+50) then
tmp = z * (1.0d0 - y)
else if (b <= 3.7d+77) then
tmp = t * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (y - 2.0);
double tmp;
if (b <= -2.25e+181) {
tmp = t_1;
} else if (b <= 5.4e+50) {
tmp = z * (1.0 - y);
} else if (b <= 3.7e+77) {
tmp = t * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (y - 2.0) tmp = 0 if b <= -2.25e+181: tmp = t_1 elif b <= 5.4e+50: tmp = z * (1.0 - y) elif b <= 3.7e+77: tmp = t * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(y - 2.0)) tmp = 0.0 if (b <= -2.25e+181) tmp = t_1; elseif (b <= 5.4e+50) tmp = Float64(z * Float64(1.0 - y)); elseif (b <= 3.7e+77) tmp = Float64(t * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (y - 2.0); tmp = 0.0; if (b <= -2.25e+181) tmp = t_1; elseif (b <= 5.4e+50) tmp = z * (1.0 - y); elseif (b <= 3.7e+77) tmp = t * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y - 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.25e+181], t$95$1, If[LessEqual[b, 5.4e+50], N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.7e+77], N[(t * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := b \cdot \left(y - 2\right)\\
\mathbf{if}\;b \leq -2.25 \cdot 10^{+181}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.4 \cdot 10^{+50}:\\
\;\;\;\;z \cdot \left(1 - y\right)\\
\mathbf{elif}\;b \leq 3.7 \cdot 10^{+77}:\\
\;\;\;\;t \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -2.25e181 or 3.6999999999999999e77 < b Initial program 94.8%
Taylor expanded in t around 0
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower--.f6469.5%
Applied rewrites69.5%
Taylor expanded in z around 0
lower-*.f6446.5%
Applied rewrites46.5%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6446.5%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6446.5%
Applied rewrites46.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower--.f6423.8%
Applied rewrites23.8%
if -2.25e181 < b < 5.4e50Initial program 94.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6428.7%
Applied rewrites28.7%
if 5.4e50 < b < 3.6999999999999999e77Initial program 94.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7%
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 y))))
(if (<= z -2.1e+48)
t_1
(if (<= z 1.3e-185) (* (- t) a) (if (<= z 2.2e+80) (* t b) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - y);
double tmp;
if (z <= -2.1e+48) {
tmp = t_1;
} else if (z <= 1.3e-185) {
tmp = -t * a;
} else if (z <= 2.2e+80) {
tmp = t * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = z * (1.0d0 - y)
if (z <= (-2.1d+48)) then
tmp = t_1
else if (z <= 1.3d-185) then
tmp = -t * a
else if (z <= 2.2d+80) then
tmp = t * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - y);
double tmp;
if (z <= -2.1e+48) {
tmp = t_1;
} else if (z <= 1.3e-185) {
tmp = -t * a;
} else if (z <= 2.2e+80) {
tmp = t * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - y) tmp = 0 if z <= -2.1e+48: tmp = t_1 elif z <= 1.3e-185: tmp = -t * a elif z <= 2.2e+80: tmp = t * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - y)) tmp = 0.0 if (z <= -2.1e+48) tmp = t_1; elseif (z <= 1.3e-185) tmp = Float64(Float64(-t) * a); elseif (z <= 2.2e+80) tmp = Float64(t * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - y); tmp = 0.0; if (z <= -2.1e+48) tmp = t_1; elseif (z <= 1.3e-185) tmp = -t * a; elseif (z <= 2.2e+80) tmp = t * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.1e+48], t$95$1, If[LessEqual[z, 1.3e-185], N[((-t) * a), $MachinePrecision], If[LessEqual[z, 2.2e+80], N[(t * b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := z \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -2.1 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-185}:\\
\;\;\;\;\left(-t\right) \cdot a\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+80}:\\
\;\;\;\;t \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -2.0999999999999998e48 or 2.2e80 < z Initial program 94.8%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lift--.f64N/A
sub-flipN/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
distribute-lft-neg-outN/A
lift--.f64N/A
sub-negate-revN/A
lower-fma.f64N/A
lower--.f64N/A
lower--.f64N/A
sub-flipN/A
+-commutativeN/A
Applied rewrites97.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6428.7%
Applied rewrites28.7%
if -2.0999999999999998e48 < z < 1.2999999999999999e-185Initial program 94.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7%
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6418.7%
Applied rewrites18.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6418.7%
Applied rewrites18.7%
if 1.2999999999999999e-185 < z < 2.2e80Initial program 94.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7%
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- t) a))) (if (<= a -9.5e+22) t_1 (if (<= a 7.5e-26) (* t b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -t * a;
double tmp;
if (a <= -9.5e+22) {
tmp = t_1;
} else if (a <= 7.5e-26) {
tmp = t * b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: t_1
real(8) :: tmp
t_1 = -t * a
if (a <= (-9.5d+22)) then
tmp = t_1
else if (a <= 7.5d-26) then
tmp = t * b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -t * a;
double tmp;
if (a <= -9.5e+22) {
tmp = t_1;
} else if (a <= 7.5e-26) {
tmp = t * b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -t * a tmp = 0 if a <= -9.5e+22: tmp = t_1 elif a <= 7.5e-26: tmp = t * b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-t) * a) tmp = 0.0 if (a <= -9.5e+22) tmp = t_1; elseif (a <= 7.5e-26) tmp = Float64(t * b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -t * a; tmp = 0.0; if (a <= -9.5e+22) tmp = t_1; elseif (a <= 7.5e-26) tmp = t * b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-t) * a), $MachinePrecision]}, If[LessEqual[a, -9.5e+22], t$95$1, If[LessEqual[a, 7.5e-26], N[(t * b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(-t\right) \cdot a\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-26}:\\
\;\;\;\;t \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -9.4999999999999994e22 or 7.4999999999999994e-26 < a Initial program 94.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7%
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.1%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f6418.7%
Applied rewrites18.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f6418.7%
Applied rewrites18.7%
if -9.4999999999999994e22 < a < 7.4999999999999994e-26Initial program 94.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7%
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.1%
(FPCore (x y z t a b) :precision binary64 (if (<= t -4000000.0) (* t b) (if (<= t 190000.0) a (* t b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4000000.0) {
tmp = t * b;
} else if (t <= 190000.0) {
tmp = a;
} else {
tmp = t * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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) :: tmp
if (t <= (-4000000.0d0)) then
tmp = t * b
else if (t <= 190000.0d0) then
tmp = a
else
tmp = t * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -4000000.0) {
tmp = t * b;
} else if (t <= 190000.0) {
tmp = a;
} else {
tmp = t * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -4000000.0: tmp = t * b elif t <= 190000.0: tmp = a else: tmp = t * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -4000000.0) tmp = Float64(t * b); elseif (t <= 190000.0) tmp = a; else tmp = Float64(t * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -4000000.0) tmp = t * b; elseif (t <= 190000.0) tmp = a; else tmp = t * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -4000000.0], N[(t * b), $MachinePrecision], If[LessEqual[t, 190000.0], a, N[(t * b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -4000000:\\
\;\;\;\;t \cdot b\\
\mathbf{elif}\;t \leq 190000:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;t \cdot b\\
\end{array}
if t < -4e6 or 1.9e5 < t Initial program 94.8%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f6432.7%
Applied rewrites32.7%
Taylor expanded in a around 0
Applied rewrites18.1%
if -4e6 < t < 1.9e5Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6427.5%
Applied rewrites27.5%
Taylor expanded in t around 0
Applied rewrites10.9%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
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)
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
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
a
Initial program 94.8%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6480.9%
Applied rewrites80.9%
Taylor expanded in a around inf
lower-*.f64N/A
lower--.f6427.5%
Applied rewrites27.5%
Taylor expanded in t around 0
Applied rewrites10.9%
herbie shell --seed 2025212
(FPCore (x y z t a b)
:name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
:precision binary64
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))