
(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}
Sampling outcomes in binary64 precision:
Herbie found 23 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
(let* ((t_1 (* (- y 1.0) z)))
(if (<= (+ (- (- x t_1) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)) INFINITY)
(fma (- (+ t y) 2.0) b (- x (fma (- t 1.0) a t_1)))
(- (fma (- b z) y (fma t b x)) (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y - 1.0) * z;
double tmp;
if ((((x - t_1) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)) <= ((double) INFINITY)) {
tmp = fma(((t + y) - 2.0), b, (x - fma((t - 1.0), a, t_1)));
} else {
tmp = fma((b - z), y, fma(t, b, x)) - -z;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y - 1.0) * z) tmp = 0.0 if (Float64(Float64(Float64(x - t_1) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) <= Inf) tmp = fma(Float64(Float64(t + y) - 2.0), b, Float64(x - fma(Float64(t - 1.0), a, t_1))); else tmp = Float64(fma(Float64(b - z), y, fma(t, b, x)) - Float64(-z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x - t$95$1), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - z), $MachinePrecision] * y + N[(t * b + x), $MachinePrecision]), $MachinePrecision] - (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y - 1\right) \cdot z\\
\mathbf{if}\;\left(\left(x - t\_1\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, x - \mathsf{fma}\left(t - 1, a, t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t, b, x\right)\right) - \left(-z\right)\\
\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 100.0%
lift-+.f64N/A
lift--.f64N/A
lift--.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate--l-N/A
*-commutativeN/A
*-commutativeN/A
Applied rewrites100.0%
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 0.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f6445.5
Applied rewrites45.5%
Taylor expanded in z around inf
mul-1-negN/A
lift-neg.f6481.8
Applied rewrites81.8%
Taylor expanded in t around inf
Applied rewrites81.8%
lift-+.f64N/A
lift--.f64N/A
lift-fma.f64N/A
associate-+l+N/A
lower-fma.f64N/A
lift--.f64N/A
lift-*.f64N/A
lower-fma.f6481.8
Applied rewrites81.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -880000000.0)
t_1
(if (<= t 1.8e-240)
(fma y b x)
(if (<= t 2.6e-190)
(fma (- t 2.0) b a)
(if (<= t 2.7e-37)
(* (- b z) y)
(if (<= t 1.55e+84) (- x (- z)) 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 <= -880000000.0) {
tmp = t_1;
} else if (t <= 1.8e-240) {
tmp = fma(y, b, x);
} else if (t <= 2.6e-190) {
tmp = fma((t - 2.0), b, a);
} else if (t <= 2.7e-37) {
tmp = (b - z) * y;
} else if (t <= 1.55e+84) {
tmp = x - -z;
} 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 <= -880000000.0) tmp = t_1; elseif (t <= 1.8e-240) tmp = fma(y, b, x); elseif (t <= 2.6e-190) tmp = fma(Float64(t - 2.0), b, a); elseif (t <= 2.7e-37) tmp = Float64(Float64(b - z) * y); elseif (t <= 1.55e+84) tmp = Float64(x - Float64(-z)); 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, -880000000.0], t$95$1, If[LessEqual[t, 1.8e-240], N[(y * b + x), $MachinePrecision], If[LessEqual[t, 2.6e-190], N[(N[(t - 2.0), $MachinePrecision] * b + a), $MachinePrecision], If[LessEqual[t, 2.7e-37], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.55e+84], N[(x - (-z)), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -880000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.8 \cdot 10^{-240}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{-190}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, a\right)\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-37}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+84}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.8e8 or 1.55000000000000001e84 < t Initial program 93.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.3
Applied rewrites67.3%
if -8.8e8 < t < 1.7999999999999999e-240Initial program 97.5%
Taylor expanded in x around inf
Applied rewrites64.9%
Taylor expanded in y around inf
Applied rewrites50.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6450.6
+-commutative50.6
Applied rewrites50.6%
if 1.7999999999999999e-240 < t < 2.5999999999999998e-190Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6465.3
Applied rewrites65.3%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6465.3
Applied rewrites65.3%
Taylor expanded in t around 0
Applied rewrites65.3%
Taylor expanded in y around 0
Applied rewrites64.7%
if 2.5999999999999998e-190 < t < 2.70000000000000016e-37Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6458.3
Applied rewrites58.3%
if 2.70000000000000016e-37 < t < 1.55000000000000001e84Initial program 93.3%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in z around inf
mul-1-negN/A
lift-neg.f6486.7
Applied rewrites86.7%
Taylor expanded in t around inf
Applied rewrites86.7%
Taylor expanded in x around inf
Applied rewrites60.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -0.0038)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(if (<= a 1.8e+163)
(- (+ (fma (- b z) y (* (- t 2.0) b)) x) (- z))
(fma (- (+ t y) 2.0) b (fma (- a) t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -0.0038) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else if (a <= 1.8e+163) {
tmp = (fma((b - z), y, ((t - 2.0) * b)) + x) - -z;
} else {
tmp = fma(((t + y) - 2.0), b, fma(-a, t, a));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -0.0038) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); elseif (a <= 1.8e+163) tmp = Float64(Float64(fma(Float64(b - z), y, Float64(Float64(t - 2.0) * b)) + x) - Float64(-z)); else tmp = fma(Float64(Float64(t + y) - 2.0), b, fma(Float64(-a), t, a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -0.0038], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.8e+163], N[(N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] - (-z)), $MachinePrecision], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[((-a) * t + a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -0.0038:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{elif}\;a \leq 1.8 \cdot 10^{+163}:\\
\;\;\;\;\left(\mathsf{fma}\left(b - z, y, \left(t - 2\right) \cdot b\right) + x\right) - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, \mathsf{fma}\left(-a, t, a\right)\right)\\
\end{array}
\end{array}
if a < -0.00379999999999999999Initial program 93.5%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6484.6
Applied rewrites84.6%
if -0.00379999999999999999 < a < 1.79999999999999989e163Initial program 96.2%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f6498.1
Applied rewrites98.1%
Taylor expanded in z around inf
mul-1-negN/A
lift-neg.f6492.8
Applied rewrites92.8%
if 1.79999999999999989e163 < a Initial program 96.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6492.9
Applied rewrites92.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6493.0
Applied rewrites93.0%
Taylor expanded in t around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6493.0
Applied rewrites93.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.6e+80) (not (<= b 5.7e+38))) (fma (- (+ t y) 2.0) b (fma (- a) t a)) (- (fma (- y) z x) (fma (- t 1.0) a (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.6e+80) || !(b <= 5.7e+38)) {
tmp = fma(((t + y) - 2.0), b, fma(-a, t, a));
} else {
tmp = fma(-y, z, x) - fma((t - 1.0), a, -z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.6e+80) || !(b <= 5.7e+38)) tmp = fma(Float64(Float64(t + y) - 2.0), b, fma(Float64(-a), t, a)); else tmp = Float64(fma(Float64(-y), z, x) - fma(Float64(t - 1.0), a, Float64(-z))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.6e+80], N[Not[LessEqual[b, 5.7e+38]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[((-a) * t + a), $MachinePrecision]), $MachinePrecision], N[(N[((-y) * z + x), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{+80} \lor \neg \left(b \leq 5.7 \cdot 10^{+38}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, \mathsf{fma}\left(-a, t, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, z, x\right) - \mathsf{fma}\left(t - 1, a, -z\right)\\
\end{array}
\end{array}
if b < -4.60000000000000008e80 or 5.6999999999999997e38 < b Initial program 88.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6484.4
Applied rewrites84.4%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6485.5
Applied rewrites85.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6485.5
Applied rewrites85.5%
if -4.60000000000000008e80 < b < 5.6999999999999997e38Initial program 100.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in b around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6492.3
Applied rewrites92.3%
Final simplification89.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -880000000.0)
t_1
(if (<= t -8e-303)
(fma y b x)
(if (<= t 2.7e-37)
(* (- b z) y)
(if (<= t 1.55e+84) (- x (- z)) 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 <= -880000000.0) {
tmp = t_1;
} else if (t <= -8e-303) {
tmp = fma(y, b, x);
} else if (t <= 2.7e-37) {
tmp = (b - z) * y;
} else if (t <= 1.55e+84) {
tmp = x - -z;
} 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 <= -880000000.0) tmp = t_1; elseif (t <= -8e-303) tmp = fma(y, b, x); elseif (t <= 2.7e-37) tmp = Float64(Float64(b - z) * y); elseif (t <= 1.55e+84) tmp = Float64(x - Float64(-z)); 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, -880000000.0], t$95$1, If[LessEqual[t, -8e-303], N[(y * b + x), $MachinePrecision], If[LessEqual[t, 2.7e-37], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t, 1.55e+84], N[(x - (-z)), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -880000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -8 \cdot 10^{-303}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{-37}:\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+84}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.8e8 or 1.55000000000000001e84 < t Initial program 93.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.3
Applied rewrites67.3%
if -8.8e8 < t < -7.99999999999999944e-303Initial program 98.4%
Taylor expanded in x around inf
Applied rewrites66.4%
Taylor expanded in y around inf
Applied rewrites53.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6453.4
+-commutative53.4
Applied rewrites53.4%
if -7.99999999999999944e-303 < t < 2.70000000000000016e-37Initial program 98.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6447.4
Applied rewrites47.4%
if 2.70000000000000016e-37 < t < 1.55000000000000001e84Initial program 93.3%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in z around inf
mul-1-negN/A
lift-neg.f6486.7
Applied rewrites86.7%
Taylor expanded in t around inf
Applied rewrites86.7%
Taylor expanded in x around inf
Applied rewrites60.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.6e+80) (not (<= b 5.7e+38))) (fma (- (+ t y) 2.0) b (fma (- a) t a)) (- x (fma (- t 1.0) a (* (- y 1.0) z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4.6e+80) || !(b <= 5.7e+38)) {
tmp = fma(((t + y) - 2.0), b, fma(-a, t, a));
} else {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4.6e+80) || !(b <= 5.7e+38)) tmp = fma(Float64(Float64(t + y) - 2.0), b, fma(Float64(-a), t, a)); else tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4.6e+80], N[Not[LessEqual[b, 5.7e+38]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[((-a) * t + a), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.6 \cdot 10^{+80} \lor \neg \left(b \leq 5.7 \cdot 10^{+38}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, \mathsf{fma}\left(-a, t, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\end{array}
\end{array}
if b < -4.60000000000000008e80 or 5.6999999999999997e38 < b Initial program 88.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6484.4
Applied rewrites84.4%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6485.5
Applied rewrites85.5%
Taylor expanded in t around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6485.5
Applied rewrites85.5%
if -4.60000000000000008e80 < b < 5.6999999999999997e38Initial program 100.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6492.3
Applied rewrites92.3%
Final simplification89.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -8.8e+80)
(fma (- (+ t y) 2.0) b a)
(if (<= b 5.6e+28)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(+ x (* (- (+ y t) 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.8e+80) {
tmp = fma(((t + y) - 2.0), b, a);
} else if (b <= 5.6e+28) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = x + (((y + t) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.8e+80) tmp = fma(Float64(Float64(t + y) - 2.0), b, a); elseif (b <= 5.6e+28) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.8e+80], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + a), $MachinePrecision], If[LessEqual[b, 5.6e+28], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, a\right)\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+28}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -8.80000000000000011e80Initial program 88.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6486.4
Applied rewrites86.4%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6488.4
Applied rewrites88.4%
Taylor expanded in t around 0
Applied rewrites86.6%
if -8.80000000000000011e80 < b < 5.6000000000000003e28Initial program 100.0%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6492.8
Applied rewrites92.8%
if 5.6000000000000003e28 < b Initial program 89.4%
Taylor expanded in x around inf
Applied rewrites77.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- (+ t y) 2.0) b a)))
(if (<= b -7.4e+71)
t_1
(if (<= b 4.4e-115)
(- x (fma -1.0 a (- z)))
(if (<= b 3.8e+28) (* (- 1.0 y) z) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, a);
double tmp;
if (b <= -7.4e+71) {
tmp = t_1;
} else if (b <= 4.4e-115) {
tmp = x - fma(-1.0, a, -z);
} else if (b <= 3.8e+28) {
tmp = (1.0 - y) * z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, a) tmp = 0.0 if (b <= -7.4e+71) tmp = t_1; elseif (b <= 4.4e-115) tmp = Float64(x - fma(-1.0, a, Float64(-z))); elseif (b <= 3.8e+28) tmp = Float64(Float64(1.0 - y) * z); 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 + a), $MachinePrecision]}, If[LessEqual[b, -7.4e+71], t$95$1, If[LessEqual[b, 4.4e-115], N[(x - N[(-1.0 * a + (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.8e+28], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, a\right)\\
\mathbf{if}\;b \leq -7.4 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{-115}:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, -z\right)\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+28}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -7.4e71 or 3.7999999999999999e28 < b Initial program 89.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6482.5
Applied rewrites82.5%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6483.5
Applied rewrites83.5%
Taylor expanded in t around 0
Applied rewrites80.8%
if -7.4e71 < b < 4.3999999999999999e-115Initial program 100.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites75.1%
Taylor expanded in t around 0
Applied rewrites53.4%
if 4.3999999999999999e-115 < b < 3.7999999999999999e28Initial program 99.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6452.7
Applied rewrites52.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ t y) 2.0) b)))
(if (<= b -7.4e+71)
t_1
(if (<= b 4.4e-115)
(- x (fma -1.0 a (- z)))
(if (<= b 3.8e+28) (* (- 1.0 y) z) 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 <= -7.4e+71) {
tmp = t_1;
} else if (b <= 4.4e-115) {
tmp = x - fma(-1.0, a, -z);
} else if (b <= 3.8e+28) {
tmp = (1.0 - y) * z;
} 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 <= -7.4e+71) tmp = t_1; elseif (b <= 4.4e-115) tmp = Float64(x - fma(-1.0, a, Float64(-z))); elseif (b <= 3.8e+28) tmp = Float64(Float64(1.0 - y) * z); 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, -7.4e+71], t$95$1, If[LessEqual[b, 4.4e-115], N[(x - N[(-1.0 * a + (-z)), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.8e+28], N[(N[(1.0 - y), $MachinePrecision] * z), $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 -7.4 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{-115}:\\
\;\;\;\;x - \mathsf{fma}\left(-1, a, -z\right)\\
\mathbf{elif}\;b \leq 3.8 \cdot 10^{+28}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -7.4e71 or 3.7999999999999999e28 < b Initial program 89.2%
Taylor expanded in b around inf
*-commutativeN/A
+-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f6474.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6474.9
Applied rewrites74.9%
if -7.4e71 < b < 4.3999999999999999e-115Initial program 100.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites75.1%
Taylor expanded in t around 0
Applied rewrites53.4%
if 4.3999999999999999e-115 < b < 3.7999999999999999e28Initial program 99.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6452.7
Applied rewrites52.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.5e+76) (not (<= b 520000.0))) (fma (- (+ t y) 2.0) b a) (- x (fma (- t 1.0) a (- z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.5e+76) || !(b <= 520000.0)) {
tmp = fma(((t + y) - 2.0), b, a);
} else {
tmp = x - fma((t - 1.0), a, -z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.5e+76) || !(b <= 520000.0)) tmp = fma(Float64(Float64(t + y) - 2.0), b, a); else tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(-z))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.5e+76], N[Not[LessEqual[b, 520000.0]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + a), $MachinePrecision], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.5 \cdot 10^{+76} \lor \neg \left(b \leq 520000\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, a\right)\\
\mathbf{else}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, -z\right)\\
\end{array}
\end{array}
if b < -2.49999999999999996e76 or 5.2e5 < b Initial program 89.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.2
Applied rewrites81.2%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6482.2
Applied rewrites82.2%
Taylor expanded in t around 0
Applied rewrites79.6%
if -2.49999999999999996e76 < b < 5.2e5Initial program 100.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites72.7%
Final simplification75.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -7800.0)
t_1
(if (<= t 1.2e-36)
(fma (- y 2.0) b a)
(if (<= t 1.55e+84) (- x (- z)) 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 <= -7800.0) {
tmp = t_1;
} else if (t <= 1.2e-36) {
tmp = fma((y - 2.0), b, a);
} else if (t <= 1.55e+84) {
tmp = x - -z;
} 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 <= -7800.0) tmp = t_1; elseif (t <= 1.2e-36) tmp = fma(Float64(y - 2.0), b, a); elseif (t <= 1.55e+84) tmp = Float64(x - Float64(-z)); 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, -7800.0], t$95$1, If[LessEqual[t, 1.2e-36], N[(N[(y - 2.0), $MachinePrecision] * b + a), $MachinePrecision], If[LessEqual[t, 1.55e+84], N[(x - (-z)), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -7800:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{-36}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, a\right)\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{+84}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -7800 or 1.55000000000000001e84 < t Initial program 93.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.8
Applied rewrites66.8%
if -7800 < t < 1.2e-36Initial program 98.3%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6456.6
Applied rewrites56.6%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6456.7
Applied rewrites56.7%
Taylor expanded in t around 0
Applied rewrites56.1%
Taylor expanded in y around inf
Applied rewrites55.9%
if 1.2e-36 < t < 1.55000000000000001e84Initial program 93.3%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in z around inf
mul-1-negN/A
lift-neg.f6486.7
Applied rewrites86.7%
Taylor expanded in t around inf
Applied rewrites86.7%
Taylor expanded in x around inf
Applied rewrites60.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -880000000.0)
t_1
(if (<= t 4.6e-20) (fma y b x) (if (<= t 5e+81) (* (- 1.0 y) z) 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 <= -880000000.0) {
tmp = t_1;
} else if (t <= 4.6e-20) {
tmp = fma(y, b, x);
} else if (t <= 5e+81) {
tmp = (1.0 - y) * z;
} 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 <= -880000000.0) tmp = t_1; elseif (t <= 4.6e-20) tmp = fma(y, b, x); elseif (t <= 5e+81) tmp = Float64(Float64(1.0 - y) * z); 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, -880000000.0], t$95$1, If[LessEqual[t, 4.6e-20], N[(y * b + x), $MachinePrecision], If[LessEqual[t, 5e+81], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -880000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.6 \cdot 10^{-20}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;t \leq 5 \cdot 10^{+81}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -8.8e8 or 4.9999999999999998e81 < t Initial program 92.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6466.8
Applied rewrites66.8%
if -8.8e8 < t < 4.5999999999999998e-20Initial program 98.4%
Taylor expanded in x around inf
Applied rewrites59.9%
Taylor expanded in y around inf
Applied rewrites46.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6446.5
+-commutative46.5
Applied rewrites46.5%
if 4.5999999999999998e-20 < t < 4.9999999999999998e81Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6478.5
Applied rewrites78.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- a) t a)))
(if (<= a -1.4e+81)
t_1
(if (<= a -2.4e-45) (* (- 1.0 y) z) (if (<= a 2e+48) (fma y b x) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(-a, t, a);
double tmp;
if (a <= -1.4e+81) {
tmp = t_1;
} else if (a <= -2.4e-45) {
tmp = (1.0 - y) * z;
} else if (a <= 2e+48) {
tmp = fma(y, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(-a), t, a) tmp = 0.0 if (a <= -1.4e+81) tmp = t_1; elseif (a <= -2.4e-45) tmp = Float64(Float64(1.0 - y) * z); elseif (a <= 2e+48) tmp = fma(y, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) * t + a), $MachinePrecision]}, If[LessEqual[a, -1.4e+81], t$95$1, If[LessEqual[a, -2.4e-45], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 2e+48], N[(y * b + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-a, t, a\right)\\
\mathbf{if}\;a \leq -1.4 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -2.4 \cdot 10^{-45}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;a \leq 2 \cdot 10^{+48}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.39999999999999997e81 or 2.00000000000000009e48 < a Initial program 92.9%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6463.3
Applied rewrites63.3%
Taylor expanded in t around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6463.3
Applied rewrites63.3%
if -1.39999999999999997e81 < a < -2.3999999999999999e-45Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6446.9
Applied rewrites46.9%
if -2.3999999999999999e-45 < a < 2.00000000000000009e48Initial program 97.0%
Taylor expanded in x around inf
Applied rewrites70.7%
Taylor expanded in y around inf
Applied rewrites45.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6445.7
+-commutative45.7
Applied rewrites45.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.65e+76)
(fma (- (+ t y) 2.0) b (* (- y) z))
(if (<= b 1.15e-21)
(- x (fma (- t 1.0) a (- z)))
(+ x (* (- (+ y t) 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.65e+76) {
tmp = fma(((t + y) - 2.0), b, (-y * z));
} else if (b <= 1.15e-21) {
tmp = x - fma((t - 1.0), a, -z);
} else {
tmp = x + (((y + t) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.65e+76) tmp = fma(Float64(Float64(t + y) - 2.0), b, Float64(Float64(-y) * z)); elseif (b <= 1.15e-21) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.65e+76], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + N[((-y) * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.15e-21], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.65 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, \left(-y\right) \cdot z\right)\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-21}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -1.65e76Initial program 89.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6483.9
Applied rewrites83.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6485.8
Applied rewrites85.8%
Taylor expanded in y around inf
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6485.1
Applied rewrites85.1%
if -1.65e76 < b < 1.15e-21Initial program 100.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites73.3%
if 1.15e-21 < b Initial program 90.7%
Taylor expanded in x around inf
Applied rewrites73.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -2.5e+76)
(fma (- (+ t y) 2.0) b a)
(if (<= b 1.15e-21)
(- x (fma (- t 1.0) a (- z)))
(+ x (* (- (+ y t) 2.0) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.5e+76) {
tmp = fma(((t + y) - 2.0), b, a);
} else if (b <= 1.15e-21) {
tmp = x - fma((t - 1.0), a, -z);
} else {
tmp = x + (((y + t) - 2.0) * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.5e+76) tmp = fma(Float64(Float64(t + y) - 2.0), b, a); elseif (b <= 1.15e-21) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(-z))); else tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.5e+76], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + a), $MachinePrecision], If[LessEqual[b, 1.15e-21], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.5 \cdot 10^{+76}:\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, a\right)\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{-21}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, -z\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\end{array}
\end{array}
if b < -2.49999999999999996e76Initial program 89.0%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6483.9
Applied rewrites83.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6485.8
Applied rewrites85.8%
Taylor expanded in t around 0
Applied rewrites84.1%
if -2.49999999999999996e76 < b < 1.15e-21Initial program 100.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites73.3%
if 1.15e-21 < b Initial program 90.7%
Taylor expanded in x around inf
Applied rewrites73.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -7.8e+68) (not (<= b 2.6e+33))) (fma (- (+ t y) 2.0) b a) (- (fma (- y) z x) (- z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7.8e+68) || !(b <= 2.6e+33)) {
tmp = fma(((t + y) - 2.0), b, a);
} else {
tmp = fma(-y, z, x) - -z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -7.8e+68) || !(b <= 2.6e+33)) tmp = fma(Float64(Float64(t + y) - 2.0), b, a); else tmp = Float64(fma(Float64(-y), z, x) - Float64(-z)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -7.8e+68], N[Not[LessEqual[b, 2.6e+33]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + a), $MachinePrecision], N[(N[((-y) * z + x), $MachinePrecision] - (-z)), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.8 \cdot 10^{+68} \lor \neg \left(b \leq 2.6 \cdot 10^{+33}\right):\\
\;\;\;\;\mathsf{fma}\left(\left(t + y\right) - 2, b, a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-y, z, x\right) - \left(-z\right)\\
\end{array}
\end{array}
if b < -7.80000000000000037e68 or 2.5999999999999997e33 < b Initial program 89.1%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6483.3
Applied rewrites83.3%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-+.f6484.3
Applied rewrites84.3%
Taylor expanded in t around 0
Applied rewrites81.6%
if -7.80000000000000037e68 < b < 2.5999999999999997e33Initial program 100.0%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in z around inf
mul-1-negN/A
lift-neg.f6467.2
Applied rewrites67.2%
Taylor expanded in b around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6459.6
Applied rewrites59.6%
Final simplification68.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.8e+29) (not (<= a 2e+48))) (fma (- a) t a) (fma y b x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.8e+29) || !(a <= 2e+48)) {
tmp = fma(-a, t, a);
} else {
tmp = fma(y, b, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.8e+29) || !(a <= 2e+48)) tmp = fma(Float64(-a), t, a); else tmp = fma(y, b, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.8e+29], N[Not[LessEqual[a, 2e+48]], $MachinePrecision]], N[((-a) * t + a), $MachinePrecision], N[(y * b + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+29} \lor \neg \left(a \leq 2 \cdot 10^{+48}\right):\\
\;\;\;\;\mathsf{fma}\left(-a, t, a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\end{array}
\end{array}
if a < -3.79999999999999971e29 or 2.00000000000000009e48 < a Initial program 93.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6460.1
Applied rewrites60.1%
Taylor expanded in t around 0
+-commutativeN/A
associate-*r*N/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6460.1
Applied rewrites60.1%
if -3.79999999999999971e29 < a < 2.00000000000000009e48Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites68.6%
Taylor expanded in y around inf
Applied rewrites43.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6443.4
+-commutative43.4
Applied rewrites43.4%
Final simplification50.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.2e+135) (not (<= t 6.5e+87))) (* b t) (fma y b x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.2e+135) || !(t <= 6.5e+87)) {
tmp = b * t;
} else {
tmp = fma(y, b, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.2e+135) || !(t <= 6.5e+87)) tmp = Float64(b * t); else tmp = fma(y, b, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.2e+135], N[Not[LessEqual[t, 6.5e+87]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(y * b + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.2 \cdot 10^{+135} \lor \neg \left(t \leq 6.5 \cdot 10^{+87}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\end{array}
\end{array}
if t < -4.20000000000000019e135 or 6.5000000000000002e87 < t Initial program 90.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.2
Applied rewrites72.2%
Taylor expanded in a around 0
Applied rewrites42.2%
if -4.20000000000000019e135 < t < 6.5000000000000002e87Initial program 98.2%
Taylor expanded in x around inf
Applied rewrites54.0%
Taylor expanded in y around inf
Applied rewrites41.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6441.9
+-commutative41.9
Applied rewrites41.9%
Final simplification42.0%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.6e+50) (* (- a) t) (if (<= t 6.5e+87) (fma y b x) (* b t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.6e+50) {
tmp = -a * t;
} else if (t <= 6.5e+87) {
tmp = fma(y, b, x);
} else {
tmp = b * t;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.6e+50) tmp = Float64(Float64(-a) * t); elseif (t <= 6.5e+87) tmp = fma(y, b, x); else tmp = Float64(b * t); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.6e+50], N[((-a) * t), $MachinePrecision], If[LessEqual[t, 6.5e+87], N[(y * b + x), $MachinePrecision], N[(b * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.6 \cdot 10^{+50}:\\
\;\;\;\;\left(-a\right) \cdot t\\
\mathbf{elif}\;t \leq 6.5 \cdot 10^{+87}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -1.59999999999999991e50Initial program 96.1%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.3
Applied rewrites68.3%
Taylor expanded in a around inf
mul-1-negN/A
lower-neg.f6443.7
Applied rewrites43.7%
if -1.59999999999999991e50 < t < 6.5000000000000002e87Initial program 97.9%
Taylor expanded in x around inf
Applied rewrites56.9%
Taylor expanded in y around inf
Applied rewrites44.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6444.4
+-commutative44.4
Applied rewrites44.4%
if 6.5000000000000002e87 < t Initial program 89.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.5
Applied rewrites69.5%
Taylor expanded in a around 0
Applied rewrites43.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.25e+135) (not (<= t 5e+28))) (* b t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.25e+135) || !(t <= 5e+28)) {
tmp = b * t;
} else {
tmp = x;
}
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 <= (-1.25d+135)) .or. (.not. (t <= 5d+28))) then
tmp = b * t
else
tmp = x
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 <= -1.25e+135) || !(t <= 5e+28)) {
tmp = b * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.25e+135) or not (t <= 5e+28): tmp = b * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.25e+135) || !(t <= 5e+28)) tmp = Float64(b * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.25e+135) || ~((t <= 5e+28))) tmp = b * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.25e+135], N[Not[LessEqual[t, 5e+28]], $MachinePrecision]], N[(b * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+135} \lor \neg \left(t \leq 5 \cdot 10^{+28}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.25000000000000007e135 or 4.99999999999999957e28 < t Initial program 90.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6469.5
Applied rewrites69.5%
Taylor expanded in a around 0
Applied rewrites40.1%
if -1.25000000000000007e135 < t < 4.99999999999999957e28Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites26.2%
Final simplification31.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.55e+173) (not (<= a 2.8e+44))) (* 1.0 a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.55e+173) || !(a <= 2.8e+44)) {
tmp = 1.0 * a;
} else {
tmp = x;
}
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 ((a <= (-1.55d+173)) .or. (.not. (a <= 2.8d+44))) then
tmp = 1.0d0 * a
else
tmp = x
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 ((a <= -1.55e+173) || !(a <= 2.8e+44)) {
tmp = 1.0 * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.55e+173) or not (a <= 2.8e+44): tmp = 1.0 * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.55e+173) || !(a <= 2.8e+44)) tmp = Float64(1.0 * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.55e+173) || ~((a <= 2.8e+44))) tmp = 1.0 * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.55e+173], N[Not[LessEqual[a, 2.8e+44]], $MachinePrecision]], N[(1.0 * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.55 \cdot 10^{+173} \lor \neg \left(a \leq 2.8 \cdot 10^{+44}\right):\\
\;\;\;\;1 \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.55e173 or 2.8000000000000001e44 < a Initial program 91.4%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Taylor expanded in t around 0
Applied rewrites28.1%
if -1.55e173 < a < 2.8000000000000001e44Initial program 97.7%
Taylor expanded in x around inf
Applied rewrites25.7%
Final simplification26.5%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.75e+78) (* b t) (if (<= b 4.8e+89) (- x (- z)) (* b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.75e+78) {
tmp = b * t;
} else if (b <= 4.8e+89) {
tmp = x - -z;
} 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 <= (-1.75d+78)) then
tmp = b * t
else if (b <= 4.8d+89) then
tmp = x - -z
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 <= -1.75e+78) {
tmp = b * t;
} else if (b <= 4.8e+89) {
tmp = x - -z;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.75e+78: tmp = b * t elif b <= 4.8e+89: tmp = x - -z else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.75e+78) tmp = Float64(b * t); elseif (b <= 4.8e+89) tmp = Float64(x - Float64(-z)); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.75e+78) tmp = b * t; elseif (b <= 4.8e+89) tmp = x - -z; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.75e+78], N[(b * t), $MachinePrecision], If[LessEqual[b, 4.8e+89], N[(x - (-z)), $MachinePrecision], N[(b * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.75 \cdot 10^{+78}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;b \leq 4.8 \cdot 10^{+89}:\\
\;\;\;\;x - \left(-z\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if b < -1.7500000000000001e78Initial program 88.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6444.4
Applied rewrites44.4%
Taylor expanded in a around 0
Applied rewrites38.8%
if -1.7500000000000001e78 < b < 4.80000000000000009e89Initial program 99.4%
Taylor expanded in y around 0
lower--.f64N/A
+-commutativeN/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.f64100.0
Applied rewrites100.0%
Taylor expanded in z around inf
mul-1-negN/A
lift-neg.f6468.2
Applied rewrites68.2%
Taylor expanded in t around inf
Applied rewrites66.5%
Taylor expanded in x around inf
Applied rewrites36.0%
if 4.80000000000000009e89 < b Initial program 88.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6444.8
Applied rewrites44.8%
Taylor expanded in z around 0
Applied rewrites41.9%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 95.7%
Taylor expanded in x around inf
Applied rewrites19.0%
herbie shell --seed 2025043
(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)))