
(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]
\begin{array}{l}
\\
\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
\end{array}
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]
\begin{array}{l}
\\
\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
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (<= b 6e+150) (+ x (- (fma (- b a) t (* (- y 2.0) b)) (fma (- y 1.0) z (- a)))) (* (- (+ t y) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 6e+150) {
tmp = x + (fma((b - a), t, ((y - 2.0) * b)) - fma((y - 1.0), z, -a));
} else {
tmp = ((t + y) - 2.0) * b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 6e+150) tmp = Float64(x + Float64(fma(Float64(b - a), t, Float64(Float64(y - 2.0) * b)) - fma(Float64(y - 1.0), z, Float64(-a)))); else tmp = Float64(Float64(Float64(t + y) - 2.0) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 6e+150], N[(x + N[(N[(N[(b - a), $MachinePrecision] * t + N[(N[(y - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z + (-a)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 6 \cdot 10^{+150}:\\
\;\;\;\;x + \left(\mathsf{fma}\left(b - a, t, \left(y - 2\right) \cdot b\right) - \mathsf{fma}\left(y - 1, z, -a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\end{array}
\end{array}
if b < 6.00000000000000025e150Initial program 95.2%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.4
Applied rewrites96.4%
if 6.00000000000000025e150 < b Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.4
Applied rewrites37.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)) (t_2 (* (- y 1.0) z)))
(if (<= (+ (- (- x t_2) (* (- t 1.0) a)) t_1) INFINITY)
(+ (- (fma (- 1.0 t) a x) t_2) t_1)
(* (- b a) t))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double t_2 = (y - 1.0) * z;
double tmp;
if ((((x - t_2) - ((t - 1.0) * a)) + t_1) <= ((double) INFINITY)) {
tmp = (fma((1.0 - t), a, x) - t_2) + t_1;
} else {
tmp = (b - a) * t;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) t_2 = Float64(Float64(y - 1.0) * z) tmp = 0.0 if (Float64(Float64(Float64(x - t_2) - Float64(Float64(t - 1.0) * a)) + t_1) <= Inf) tmp = Float64(Float64(fma(Float64(1.0 - t), a, x) - t_2) + t_1); else tmp = Float64(Float64(b - a) * t); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - t$95$2), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], Infinity], N[(N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] - t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
t_2 := \left(y - 1\right) \cdot z\\
\mathbf{if}\;\left(\left(x - t\_2\right) - \left(t - 1\right) \cdot a\right) + t\_1 \leq \infty:\\
\;\;\;\;\left(\mathsf{fma}\left(1 - t, a, x\right) - t\_2\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6495.2
Applied rewrites95.2%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -1.8e+130)
(- (fma t_1 b x) (* (- y 1.0) z))
(if (<= b 1.25e+86)
(- (+ (fma (- a) t x) a) (* z (- y 1.0)))
(* t_1 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if (b <= -1.8e+130) {
tmp = fma(t_1, b, x) - ((y - 1.0) * z);
} else if (b <= 1.25e+86) {
tmp = (fma(-a, t, x) + a) - (z * (y - 1.0));
} else {
tmp = t_1 * b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -1.8e+130) tmp = Float64(fma(t_1, b, x) - Float64(Float64(y - 1.0) * z)); elseif (b <= 1.25e+86) tmp = Float64(Float64(fma(Float64(-a), t, x) + a) - Float64(z * Float64(y - 1.0))); else tmp = Float64(t_1 * b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[b, -1.8e+130], N[(N[(t$95$1 * b + x), $MachinePrecision] - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.25e+86], N[(N[(N[((-a) * t + x), $MachinePrecision] + a), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -1.8 \cdot 10^{+130}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, x\right) - \left(y - 1\right) \cdot z\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{+86}:\\
\;\;\;\;\left(\mathsf{fma}\left(-a, t, x\right) + a\right) - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1 \cdot b\\
\end{array}
\end{array}
if b < -1.8000000000000001e130Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
if -1.8000000000000001e130 < b < 1.2499999999999999e86Initial program 95.2%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.4
Applied rewrites96.4%
Taylor expanded in b around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lift--.f6467.2
Applied rewrites67.2%
if 1.2499999999999999e86 < b Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.4
Applied rewrites37.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -1.9e+130)
t_1
(if (<= b 1.25e+86) (- (+ (fma (- a) t x) a) (* z (- y 1.0))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.9e+130) {
tmp = t_1;
} else if (b <= 1.25e+86) {
tmp = (fma(-a, t, x) + a) - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.9e+130) tmp = t_1; elseif (b <= 1.25e+86) tmp = Float64(Float64(fma(Float64(-a), t, x) + a) - Float64(z * Float64(y - 1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.9e+130], t$95$1, If[LessEqual[b, 1.25e+86], N[(N[(N[((-a) * t + x), $MachinePrecision] + a), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.9 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{+86}:\\
\;\;\;\;\left(\mathsf{fma}\left(-a, t, x\right) + a\right) - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.9000000000000001e130 or 1.2499999999999999e86 < b Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.4
Applied rewrites37.4%
if -1.9000000000000001e130 < b < 1.2499999999999999e86Initial program 95.2%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f6496.4
Applied rewrites96.4%
Taylor expanded in b around 0
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lower-*.f64N/A
lift--.f6467.2
Applied rewrites67.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -1.9e+130)
t_1
(if (<= b 1.25e+86) (- (fma (- 1.0 t) a 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 + y) - 2.0) * b;
double tmp;
if (b <= -1.9e+130) {
tmp = t_1;
} else if (b <= 1.25e+86) {
tmp = fma((1.0 - t), a, x) - (z * (y - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.9e+130) tmp = t_1; elseif (b <= 1.25e+86) tmp = Float64(fma(Float64(1.0 - t), a, x) - Float64(z * Float64(y - 1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.9e+130], t$95$1, If[LessEqual[b, 1.25e+86], N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] - N[(z * N[(y - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.9 \cdot 10^{+130}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.25 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) - z \cdot \left(y - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.9000000000000001e130 or 1.2499999999999999e86 < b Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.4
Applied rewrites37.4%
if -1.9000000000000001e130 < b < 1.2499999999999999e86Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lift--.f64N/A
lift-*.f6467.2
Applied rewrites67.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -1.7e+123)
t_1
(if (<= b 3.5e-58)
(- x (fma z (- y 1.0) (- a)))
(if (<= b 2.15e+68) (- x (* a (- t 1.0))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.7e+123) {
tmp = t_1;
} else if (b <= 3.5e-58) {
tmp = x - fma(z, (y - 1.0), -a);
} else if (b <= 2.15e+68) {
tmp = x - (a * (t - 1.0));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.7e+123) tmp = t_1; elseif (b <= 3.5e-58) tmp = Float64(x - fma(z, Float64(y - 1.0), Float64(-a))); elseif (b <= 2.15e+68) tmp = Float64(x - Float64(a * Float64(t - 1.0))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.7e+123], t$95$1, If[LessEqual[b, 3.5e-58], N[(x - N[(z * N[(y - 1.0), $MachinePrecision] + (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.15e+68], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.7 \cdot 10^{+123}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{-58}:\\
\;\;\;\;x - \mathsf{fma}\left(z, y - 1, -a\right)\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{+68}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.70000000000000001e123 or 2.1500000000000001e68 < b Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.4
Applied rewrites37.4%
if -1.70000000000000001e123 < b < 3.4999999999999999e-58Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6451.1
Applied rewrites51.1%
if 3.4999999999999999e-58 < b < 2.1500000000000001e68Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6442.6
Applied rewrites42.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 y) z x)) (t_2 (* (- b a) t)))
(if (<= t -9.2e+170)
t_2
(if (<= t -3.7e-91)
t_1
(if (<= t 3.7e-10)
(- (fma (- y 2.0) b x) (- a))
(if (<= t 6.2e+72) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - y), z, x);
double t_2 = (b - a) * t;
double tmp;
if (t <= -9.2e+170) {
tmp = t_2;
} else if (t <= -3.7e-91) {
tmp = t_1;
} else if (t <= 3.7e-10) {
tmp = fma((y - 2.0), b, x) - -a;
} else if (t <= 6.2e+72) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - y), z, x) t_2 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -9.2e+170) tmp = t_2; elseif (t <= -3.7e-91) tmp = t_1; elseif (t <= 3.7e-10) tmp = Float64(fma(Float64(y - 2.0), b, x) - Float64(-a)); elseif (t <= 6.2e+72) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -9.2e+170], t$95$2, If[LessEqual[t, -3.7e-91], t$95$1, If[LessEqual[t, 3.7e-10], N[(N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision] - (-a)), $MachinePrecision], If[LessEqual[t, 6.2e+72], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - y, z, x\right)\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+170}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.7 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.7 \cdot 10^{-10}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x\right) - \left(-a\right)\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -9.2000000000000003e170 or 6.19999999999999977e72 < t Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
if -9.2000000000000003e170 < t < -3.7000000000000002e-91 or 3.70000000000000015e-10 < t < 6.19999999999999977e72Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.4
Applied rewrites41.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6441.4
Applied rewrites41.4%
if -3.7000000000000002e-91 < t < 3.70000000000000015e-10Initial program 95.2%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6474.0
Applied rewrites74.0%
Taylor expanded in t around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
mul-1-negN/A
lift-neg.f6447.9
Applied rewrites47.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (* a (- t 1.0)))) (t_2 (* (- (+ t y) 2.0) b)))
(if (<= b -1.9e+130)
t_2
(if (<= b -4.8e-121)
t_1
(if (<= b 1.16e-62)
(fma (- 1.0 y) z x)
(if (<= b 2.15e+68) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - (a * (t - 1.0));
double t_2 = ((t + y) - 2.0) * b;
double tmp;
if (b <= -1.9e+130) {
tmp = t_2;
} else if (b <= -4.8e-121) {
tmp = t_1;
} else if (b <= 1.16e-62) {
tmp = fma((1.0 - y), z, x);
} else if (b <= 2.15e+68) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x - Float64(a * Float64(t - 1.0))) t_2 = Float64(Float64(Float64(t + y) - 2.0) * b) tmp = 0.0 if (b <= -1.9e+130) tmp = t_2; elseif (b <= -4.8e-121) tmp = t_1; elseif (b <= 1.16e-62) tmp = fma(Float64(1.0 - y), z, x); elseif (b <= 2.15e+68) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -1.9e+130], t$95$2, If[LessEqual[b, -4.8e-121], t$95$1, If[LessEqual[b, 1.16e-62], N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision], If[LessEqual[b, 2.15e+68], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - a \cdot \left(t - 1\right)\\
t_2 := \left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -1.9 \cdot 10^{+130}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -4.8 \cdot 10^{-121}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.16 \cdot 10^{-62}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right)\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.9000000000000001e130 or 2.1500000000000001e68 < b Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6437.4
Applied rewrites37.4%
if -1.9000000000000001e130 < b < -4.80000000000000007e-121 or 1.1599999999999999e-62 < b < 2.1500000000000001e68Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6442.6
Applied rewrites42.6%
if -4.80000000000000007e-121 < b < 1.1599999999999999e-62Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.4
Applied rewrites41.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6441.4
Applied rewrites41.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- 1.0 y) z x)) (t_2 (* (- b a) t)))
(if (<= t -9.2e+170)
t_2
(if (<= t -3.1e-91)
t_1
(if (<= t -8.8e-249)
(- x (* a (- t 1.0)))
(if (<= t 6.2e+72) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((1.0 - y), z, x);
double t_2 = (b - a) * t;
double tmp;
if (t <= -9.2e+170) {
tmp = t_2;
} else if (t <= -3.1e-91) {
tmp = t_1;
} else if (t <= -8.8e-249) {
tmp = x - (a * (t - 1.0));
} else if (t <= 6.2e+72) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(1.0 - y), z, x) t_2 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -9.2e+170) tmp = t_2; elseif (t <= -3.1e-91) tmp = t_1; elseif (t <= -8.8e-249) tmp = Float64(x - Float64(a * Float64(t - 1.0))); elseif (t <= 6.2e+72) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -9.2e+170], t$95$2, If[LessEqual[t, -3.1e-91], t$95$1, If[LessEqual[t, -8.8e-249], N[(x - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 6.2e+72], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1 - y, z, x\right)\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+170}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -8.8 \cdot 10^{-249}:\\
\;\;\;\;x - a \cdot \left(t - 1\right)\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+72}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -9.2000000000000003e170 or 6.19999999999999977e72 < t Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
if -9.2000000000000003e170 < t < -3.09999999999999981e-91 or -8.8e-249 < t < 6.19999999999999977e72Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.4
Applied rewrites41.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6441.4
Applied rewrites41.4%
if -3.09999999999999981e-91 < t < -8.8e-249Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in z around 0
lower-*.f64N/A
lift--.f6442.6
Applied rewrites42.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b a) t))) (if (<= t -9.2e+170) t_1 (if (<= t 6.2e+72) (fma (- 1.0 y) z x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - a) * t;
double tmp;
if (t <= -9.2e+170) {
tmp = t_1;
} else if (t <= 6.2e+72) {
tmp = fma((1.0 - y), z, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -9.2e+170) tmp = t_1; elseif (t <= 6.2e+72) tmp = fma(Float64(1.0 - y), z, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -9.2e+170], t$95$1, If[LessEqual[t, 6.2e+72], N[(N[(1.0 - y), $MachinePrecision] * z + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -9.2 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.2 \cdot 10^{+72}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -9.2000000000000003e170 or 6.19999999999999977e72 < t Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
if -9.2000000000000003e170 < t < 6.19999999999999977e72Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.4
Applied rewrites41.4%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f6441.4
Applied rewrites41.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 y) z)) (t_2 (* (- b a) t)))
(if (<= t -80000000.0)
t_2
(if (<= t -3.1e-91)
t_1
(if (<= t -1.8e-175)
(* (- 1.0 t) a)
(if (<= t 2.15e-229) (- x (- z)) (if (<= t 3e+71) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double t_2 = (b - a) * t;
double tmp;
if (t <= -80000000.0) {
tmp = t_2;
} else if (t <= -3.1e-91) {
tmp = t_1;
} else if (t <= -1.8e-175) {
tmp = (1.0 - t) * a;
} else if (t <= 2.15e-229) {
tmp = x - -z;
} else if (t <= 3e+71) {
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)
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) :: t_2
real(8) :: tmp
t_1 = (1.0d0 - y) * z
t_2 = (b - a) * t
if (t <= (-80000000.0d0)) then
tmp = t_2
else if (t <= (-3.1d-91)) then
tmp = t_1
else if (t <= (-1.8d-175)) then
tmp = (1.0d0 - t) * a
else if (t <= 2.15d-229) then
tmp = x - -z
else if (t <= 3d+71) 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 t_1 = (1.0 - y) * z;
double t_2 = (b - a) * t;
double tmp;
if (t <= -80000000.0) {
tmp = t_2;
} else if (t <= -3.1e-91) {
tmp = t_1;
} else if (t <= -1.8e-175) {
tmp = (1.0 - t) * a;
} else if (t <= 2.15e-229) {
tmp = x - -z;
} else if (t <= 3e+71) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - y) * z t_2 = (b - a) * t tmp = 0 if t <= -80000000.0: tmp = t_2 elif t <= -3.1e-91: tmp = t_1 elif t <= -1.8e-175: tmp = (1.0 - t) * a elif t <= 2.15e-229: tmp = x - -z elif t <= 3e+71: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - y) * z) t_2 = Float64(Float64(b - a) * t) tmp = 0.0 if (t <= -80000000.0) tmp = t_2; elseif (t <= -3.1e-91) tmp = t_1; elseif (t <= -1.8e-175) tmp = Float64(Float64(1.0 - t) * a); elseif (t <= 2.15e-229) tmp = Float64(x - Float64(-z)); elseif (t <= 3e+71) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 - y) * z; t_2 = (b - a) * t; tmp = 0.0; if (t <= -80000000.0) tmp = t_2; elseif (t <= -3.1e-91) tmp = t_1; elseif (t <= -1.8e-175) tmp = (1.0 - t) * a; elseif (t <= 2.15e-229) tmp = x - -z; elseif (t <= 3e+71) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -80000000.0], t$95$2, If[LessEqual[t, -3.1e-91], t$95$1, If[LessEqual[t, -1.8e-175], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], If[LessEqual[t, 2.15e-229], N[(x - (-z)), $MachinePrecision], If[LessEqual[t, 3e+71], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z\\
t_2 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -80000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.1 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -1.8 \cdot 10^{-175}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{-229}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{elif}\;t \leq 3 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -8e7 or 3.00000000000000013e71 < t Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
if -8e7 < t < -3.09999999999999981e-91 or 2.15000000000000005e-229 < t < 3.00000000000000013e71Initial program 95.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.6
Applied rewrites27.6%
if -3.09999999999999981e-91 < t < -1.8e-175Initial program 95.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.8
Applied rewrites28.8%
if -1.8e-175 < t < 2.15000000000000005e-229Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.4
Applied rewrites41.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6424.8
Applied rewrites24.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- b z) y))) (if (<= y -110000000000.0) t_1 (if (<= y 6.3e+19) (* (- b a) t) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -110000000000.0) {
tmp = t_1;
} else if (y <= 6.3e+19) {
tmp = (b - a) * t;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 - z) * y
if (y <= (-110000000000.0d0)) then
tmp = t_1
else if (y <= 6.3d+19) then
tmp = (b - a) * t
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -110000000000.0) {
tmp = t_1;
} else if (y <= 6.3e+19) {
tmp = (b - a) * t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (b - z) * y tmp = 0 if y <= -110000000000.0: tmp = t_1 elif y <= 6.3e+19: tmp = (b - a) * t else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -110000000000.0) tmp = t_1; elseif (y <= 6.3e+19) tmp = Float64(Float64(b - a) * t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (b - z) * y; tmp = 0.0; if (y <= -110000000000.0) tmp = t_1; elseif (y <= 6.3e+19) tmp = (b - a) * t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -110000000000.0], t$95$1, If[LessEqual[y, 6.3e+19], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -110000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.3 \cdot 10^{+19}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.1e11 or 6.3e19 < y Initial program 95.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.8
Applied rewrites32.8%
if -1.1e11 < y < 6.3e19Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- 1.0 y) z))) (if (<= z -4e+27) t_1 (if (<= z 1.35e+72) (* (- 1.0 t) a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - y) * z;
double tmp;
if (z <= -4e+27) {
tmp = t_1;
} else if (z <= 1.35e+72) {
tmp = (1.0 - t) * 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)
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 = (1.0d0 - y) * z
if (z <= (-4d+27)) then
tmp = t_1
else if (z <= 1.35d+72) then
tmp = (1.0d0 - t) * 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 t_1 = (1.0 - y) * z;
double tmp;
if (z <= -4e+27) {
tmp = t_1;
} else if (z <= 1.35e+72) {
tmp = (1.0 - t) * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - y) * z tmp = 0 if z <= -4e+27: tmp = t_1 elif z <= 1.35e+72: tmp = (1.0 - t) * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - y) * z) tmp = 0.0 if (z <= -4e+27) tmp = t_1; elseif (z <= 1.35e+72) tmp = Float64(Float64(1.0 - t) * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 - y) * z; tmp = 0.0; if (z <= -4e+27) tmp = t_1; elseif (z <= 1.35e+72) tmp = (1.0 - t) * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -4e+27], t$95$1, If[LessEqual[z, 1.35e+72], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z\\
\mathbf{if}\;z \leq -4 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+72}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.0000000000000001e27 or 1.35e72 < z Initial program 95.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6427.6
Applied rewrites27.6%
if -4.0000000000000001e27 < z < 1.35e72Initial program 95.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.8
Applied rewrites28.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- 1.0 t) a))) (if (<= a -5.2e+79) t_1 (if (<= a 1.85e+45) (- x (- z)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (1.0 - t) * a;
double tmp;
if (a <= -5.2e+79) {
tmp = t_1;
} else if (a <= 1.85e+45) {
tmp = x - -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 = (1.0d0 - t) * a
if (a <= (-5.2d+79)) then
tmp = t_1
else if (a <= 1.85d+45) then
tmp = x - -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 = (1.0 - t) * a;
double tmp;
if (a <= -5.2e+79) {
tmp = t_1;
} else if (a <= 1.85e+45) {
tmp = x - -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (1.0 - t) * a tmp = 0 if a <= -5.2e+79: tmp = t_1 elif a <= 1.85e+45: tmp = x - -z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(1.0 - t) * a) tmp = 0.0 if (a <= -5.2e+79) tmp = t_1; elseif (a <= 1.85e+45) tmp = Float64(x - Float64(-z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (1.0 - t) * a; tmp = 0.0; if (a <= -5.2e+79) tmp = t_1; elseif (a <= 1.85e+45) tmp = x - -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -5.2e+79], t$95$1, If[LessEqual[a, 1.85e+45], N[(x - (-z)), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a\\
\mathbf{if}\;a \leq -5.2 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.85 \cdot 10^{+45}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -5.20000000000000029e79 or 1.84999999999999989e45 < a Initial program 95.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.8
Applied rewrites28.8%
if -5.20000000000000029e79 < a < 1.84999999999999989e45Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.4
Applied rewrites41.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6424.8
Applied rewrites24.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- y) z)))
(if (<= y -110000000000.0)
t_1
(if (<= y -2.25e-272) (* b t) (if (<= y 210000000.0) (- x (- z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -y * z;
double tmp;
if (y <= -110000000000.0) {
tmp = t_1;
} else if (y <= -2.25e-272) {
tmp = b * t;
} else if (y <= 210000000.0) {
tmp = x - -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 = -y * z
if (y <= (-110000000000.0d0)) then
tmp = t_1
else if (y <= (-2.25d-272)) then
tmp = b * t
else if (y <= 210000000.0d0) then
tmp = x - -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 = -y * z;
double tmp;
if (y <= -110000000000.0) {
tmp = t_1;
} else if (y <= -2.25e-272) {
tmp = b * t;
} else if (y <= 210000000.0) {
tmp = x - -z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -y * z tmp = 0 if y <= -110000000000.0: tmp = t_1 elif y <= -2.25e-272: tmp = b * t elif y <= 210000000.0: tmp = x - -z else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-y) * z) tmp = 0.0 if (y <= -110000000000.0) tmp = t_1; elseif (y <= -2.25e-272) tmp = Float64(b * t); elseif (y <= 210000000.0) tmp = Float64(x - Float64(-z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -y * z; tmp = 0.0; if (y <= -110000000000.0) tmp = t_1; elseif (y <= -2.25e-272) tmp = b * t; elseif (y <= 210000000.0) tmp = x - -z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-y) * z), $MachinePrecision]}, If[LessEqual[y, -110000000000.0], t$95$1, If[LessEqual[y, -2.25e-272], N[(b * t), $MachinePrecision], If[LessEqual[y, 210000000.0], N[(x - (-z)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-y\right) \cdot z\\
\mathbf{if}\;y \leq -110000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.25 \cdot 10^{-272}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;y \leq 210000000:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.1e11 or 2.1e8 < y Initial program 95.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.8
Applied rewrites32.8%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6418.6
Applied rewrites18.6%
if -1.1e11 < y < -2.2499999999999999e-272Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
Taylor expanded in a around 0
Applied rewrites17.0%
if -2.2499999999999999e-272 < y < 2.1e8Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.4
Applied rewrites41.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6424.8
Applied rewrites24.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))))
(if (<= t_1 -1e+267)
(* (- y) z)
(if (<= t_1 2e+305) (- x (- z)) (* (- t) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -1e+267) {
tmp = -y * z;
} else if (t_1 <= 2e+305) {
tmp = x - -z;
} else {
tmp = -t * 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)
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 = ((x - ((y - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
if (t_1 <= (-1d+267)) then
tmp = -y * z
else if (t_1 <= 2d+305) then
tmp = x - -z
else
tmp = -t * a
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 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= -1e+267) {
tmp = -y * z;
} else if (t_1 <= 2e+305) {
tmp = x - -z;
} else {
tmp = -t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b) tmp = 0 if t_1 <= -1e+267: tmp = -y * z elif t_1 <= 2e+305: tmp = x - -z else: tmp = -t * a return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (t_1 <= -1e+267) tmp = Float64(Float64(-y) * z); elseif (t_1 <= 2e+305) tmp = Float64(x - Float64(-z)); else tmp = Float64(Float64(-t) * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); tmp = 0.0; if (t_1 <= -1e+267) tmp = -y * z; elseif (t_1 <= 2e+305) tmp = x - -z; else tmp = -t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -1e+267], N[((-y) * z), $MachinePrecision], If[LessEqual[t$95$1, 2e+305], N[(x - (-z)), $MachinePrecision], N[((-t) * a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \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\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+267}:\\
\;\;\;\;\left(-y\right) \cdot z\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(-t\right) \cdot a\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < -9.9999999999999997e266Initial program 95.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.8
Applied rewrites32.8%
Taylor expanded in z around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6418.6
Applied rewrites18.6%
if -9.9999999999999997e266 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < 1.9999999999999999e305Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.4
Applied rewrites41.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6424.8
Applied rewrites24.8%
if 1.9999999999999999e305 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 95.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.8
Applied rewrites28.8%
Taylor expanded in t around inf
mul-1-negN/A
lower-neg.f6419.3
Applied rewrites19.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.2e+130) (* b y) (if (<= b 2.25e+54) (- x (- z)) (if (<= b 4e+212) (* b t) (* b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.2e+130) {
tmp = b * y;
} else if (b <= 2.25e+54) {
tmp = x - -z;
} else if (b <= 4e+212) {
tmp = b * t;
} else {
tmp = b * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 (b <= (-2.2d+130)) then
tmp = b * y
else if (b <= 2.25d+54) then
tmp = x - -z
else if (b <= 4d+212) then
tmp = b * t
else
tmp = b * y
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 (b <= -2.2e+130) {
tmp = b * y;
} else if (b <= 2.25e+54) {
tmp = x - -z;
} else if (b <= 4e+212) {
tmp = b * t;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.2e+130: tmp = b * y elif b <= 2.25e+54: tmp = x - -z elif b <= 4e+212: tmp = b * t else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.2e+130) tmp = Float64(b * y); elseif (b <= 2.25e+54) tmp = Float64(x - Float64(-z)); elseif (b <= 4e+212) tmp = Float64(b * t); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -2.2e+130) tmp = b * y; elseif (b <= 2.25e+54) tmp = x - -z; elseif (b <= 4e+212) tmp = b * t; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.2e+130], N[(b * y), $MachinePrecision], If[LessEqual[b, 2.25e+54], N[(x - (-z)), $MachinePrecision], If[LessEqual[b, 4e+212], N[(b * t), $MachinePrecision], N[(b * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{+130}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{+54}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+212}:\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if b < -2.19999999999999993e130 or 3.9999999999999996e212 < b Initial program 95.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.8
Applied rewrites32.8%
Taylor expanded in z around 0
Applied rewrites18.3%
if -2.19999999999999993e130 < b < 2.24999999999999992e54Initial program 95.2%
Taylor expanded in a around 0
lower--.f64N/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-*.f6472.6
Applied rewrites72.6%
Taylor expanded in b around 0
lower--.f64N/A
lower-*.f64N/A
lift--.f6441.4
Applied rewrites41.4%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6424.8
Applied rewrites24.8%
if 2.24999999999999992e54 < b < 3.9999999999999996e212Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
Taylor expanded in a around 0
Applied rewrites17.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.75e+160) (* b y) (if (<= y 5.6e+25) (* b t) (* b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.75e+160) {
tmp = b * y;
} else if (y <= 5.6e+25) {
tmp = b * t;
} else {
tmp = b * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 (y <= (-2.75d+160)) then
tmp = b * y
else if (y <= 5.6d+25) then
tmp = b * t
else
tmp = b * y
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 (y <= -2.75e+160) {
tmp = b * y;
} else if (y <= 5.6e+25) {
tmp = b * t;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.75e+160: tmp = b * y elif y <= 5.6e+25: tmp = b * t else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.75e+160) tmp = Float64(b * y); elseif (y <= 5.6e+25) tmp = Float64(b * t); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.75e+160) tmp = b * y; elseif (y <= 5.6e+25) tmp = b * t; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.75e+160], N[(b * y), $MachinePrecision], If[LessEqual[y, 5.6e+25], N[(b * t), $MachinePrecision], N[(b * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.75 \cdot 10^{+160}:\\
\;\;\;\;b \cdot y\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+25}:\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if y < -2.75e160 or 5.6000000000000003e25 < y Initial program 95.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.8
Applied rewrites32.8%
Taylor expanded in z around 0
Applied rewrites18.3%
if -2.75e160 < y < 5.6000000000000003e25Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
Taylor expanded in a around 0
Applied rewrites17.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -0.82) (* b t) (if (<= t 0.046) a (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -0.82) {
tmp = b * t;
} else if (t <= 0.046) {
tmp = a;
} else {
tmp = b * t;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 <= (-0.82d0)) then
tmp = b * t
else if (t <= 0.046d0) then
tmp = a
else
tmp = b * t
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 <= -0.82) {
tmp = b * t;
} else if (t <= 0.046) {
tmp = a;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -0.82: tmp = b * t elif t <= 0.046: tmp = a else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -0.82) tmp = Float64(b * t); elseif (t <= 0.046) tmp = a; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -0.82) tmp = b * t; elseif (t <= 0.046) tmp = a; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -0.82], N[(b * t), $MachinePrecision], If[LessEqual[t, 0.046], a, N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -0.82:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 0.046:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -0.819999999999999951 or 0.045999999999999999 < t Initial program 95.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6432.5
Applied rewrites32.5%
Taylor expanded in a around 0
Applied rewrites17.0%
if -0.819999999999999951 < t < 0.045999999999999999Initial program 95.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.8
Applied rewrites28.8%
Taylor expanded in t around 0
Applied rewrites11.6%
(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
\begin{array}{l}
\\
a
\end{array}
Initial program 95.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6428.8
Applied rewrites28.8%
Taylor expanded in t around 0
Applied rewrites11.6%
herbie shell --seed 2025139
(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)))