
(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 22 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 (- (+ (fma (- b z) y (fma (- t 2.0) b x)) z) (* (- t 1.0) a)))
double code(double x, double y, double z, double t, double a, double b) {
return (fma((b - z), y, fma((t - 2.0), b, x)) + z) - ((t - 1.0) * a);
}
function code(x, y, z, t, a, b) return Float64(Float64(fma(Float64(b - z), y, fma(Float64(t - 2.0), b, x)) + z) - Float64(Float64(t - 1.0) * a)) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, x\right)\right) + z\right) - \left(t - 1\right) \cdot a
\end{array}
Initial program 94.9%
Taylor expanded in y around 0
Applied rewrites96.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -2.3e+108)
(* (- b a) t)
(if (<= t -1.6e-7)
(- (* (- b z) y) (* (- t 1.0) a))
(if (<= t 4.9e-19)
(+ (fma -2.0 b (+ z x)) a)
(if (<= t 7e+116)
(+ x (fma y b (* (- t 2.0) b)))
(fma (- t 2.0) b (- x (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.3e+108) {
tmp = (b - a) * t;
} else if (t <= -1.6e-7) {
tmp = ((b - z) * y) - ((t - 1.0) * a);
} else if (t <= 4.9e-19) {
tmp = fma(-2.0, b, (z + x)) + a;
} else if (t <= 7e+116) {
tmp = x + fma(y, b, ((t - 2.0) * b));
} else {
tmp = fma((t - 2.0), b, (x - (a * t)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.3e+108) tmp = Float64(Float64(b - a) * t); elseif (t <= -1.6e-7) tmp = Float64(Float64(Float64(b - z) * y) - Float64(Float64(t - 1.0) * a)); elseif (t <= 4.9e-19) tmp = Float64(fma(-2.0, b, Float64(z + x)) + a); elseif (t <= 7e+116) tmp = Float64(x + fma(y, b, Float64(Float64(t - 2.0) * b))); else tmp = fma(Float64(t - 2.0), b, Float64(x - Float64(a * t))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.3e+108], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[t, -1.6e-7], N[(N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 4.9e-19], N[(N[(-2.0 * b + N[(z + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 7e+116], N[(x + N[(y * b + N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b + N[(x - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.3 \cdot 10^{+108}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;t \leq -1.6 \cdot 10^{-7}:\\
\;\;\;\;\left(b - z\right) \cdot y - \left(t - 1\right) \cdot a\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, z + x\right) + a\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+116}:\\
\;\;\;\;x + \mathsf{fma}\left(y, b, \left(t - 2\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x - a \cdot t\right)\\
\end{array}
\end{array}
if t < -2.2999999999999999e108Initial program 95.5%
Taylor expanded in t around inf
Applied rewrites84.8%
if -2.2999999999999999e108 < t < -1.6e-7Initial program 96.9%
Taylor expanded in y around 0
Applied rewrites96.9%
Taylor expanded in y around inf
Applied rewrites72.8%
if -1.6e-7 < t < 4.89999999999999993e-19Initial program 97.4%
Taylor expanded in y around 0
Applied rewrites72.4%
Taylor expanded in t around 0
Applied rewrites72.4%
if 4.89999999999999993e-19 < t < 6.99999999999999993e116Initial program 88.5%
Taylor expanded in x around inf
Applied rewrites81.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
lift--.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f6481.2
Applied rewrites81.2%
if 6.99999999999999993e116 < t Initial program 90.0%
Taylor expanded in y around 0
Applied rewrites92.6%
Taylor expanded in t around inf
Applied rewrites90.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 y) z)) (t_2 (* (- b a) t)))
(if (<= t -2.5e+33)
t_2
(if (<= t -3.6e-165)
t_1
(if (<= t 3e-157)
(fma y b x)
(if (<= t 2e-29) t_1 (if (<= t 3.1e+112) (fma y b x) 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 <= -2.5e+33) {
tmp = t_2;
} else if (t <= -3.6e-165) {
tmp = t_1;
} else if (t <= 3e-157) {
tmp = fma(y, b, x);
} else if (t <= 2e-29) {
tmp = t_1;
} else if (t <= 3.1e+112) {
tmp = fma(y, b, x);
} 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 <= -2.5e+33) tmp = t_2; elseif (t <= -3.6e-165) tmp = t_1; elseif (t <= 3e-157) tmp = fma(y, b, x); elseif (t <= 2e-29) tmp = t_1; elseif (t <= 3.1e+112) tmp = fma(y, b, x); 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), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.5e+33], t$95$2, If[LessEqual[t, -3.6e-165], t$95$1, If[LessEqual[t, 3e-157], N[(y * b + x), $MachinePrecision], If[LessEqual[t, 2e-29], t$95$1, If[LessEqual[t, 3.1e+112], N[(y * b + x), $MachinePrecision], 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 -2.5 \cdot 10^{+33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t \leq -3.6 \cdot 10^{-165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3 \cdot 10^{-157}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-29}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if t < -2.49999999999999986e33 or 3.09999999999999983e112 < t Initial program 93.4%
Taylor expanded in t around inf
Applied rewrites81.4%
if -2.49999999999999986e33 < t < -3.59999999999999984e-165 or 3e-157 < t < 1.99999999999999989e-29Initial program 97.1%
Taylor expanded in z around inf
Applied rewrites47.2%
if -3.59999999999999984e-165 < t < 3e-157 or 1.99999999999999989e-29 < t < 3.09999999999999983e112Initial program 95.0%
Taylor expanded in x around inf
Applied rewrites63.1%
Taylor expanded in y around inf
Applied rewrites58.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6458.2
Applied rewrites58.2%
Taylor expanded in y around inf
Applied rewrites50.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) a)))
(if (<= a -2.5e+124)
(- (+ x z) t_1)
(if (or (<= a -0.014) (not (<= a 9.2e-79)))
(- (* (- b z) y) t_1)
(+ (fma (- z) (- y 1.0) x) (* t b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * a;
double tmp;
if (a <= -2.5e+124) {
tmp = (x + z) - t_1;
} else if ((a <= -0.014) || !(a <= 9.2e-79)) {
tmp = ((b - z) * y) - t_1;
} else {
tmp = fma(-z, (y - 1.0), x) + (t * b);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * a) tmp = 0.0 if (a <= -2.5e+124) tmp = Float64(Float64(x + z) - t_1); elseif ((a <= -0.014) || !(a <= 9.2e-79)) tmp = Float64(Float64(Float64(b - z) * y) - t_1); else tmp = Float64(fma(Float64(-z), Float64(y - 1.0), x) + Float64(t * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -2.5e+124], N[(N[(x + z), $MachinePrecision] - t$95$1), $MachinePrecision], If[Or[LessEqual[a, -0.014], N[Not[LessEqual[a, 9.2e-79]], $MachinePrecision]], N[(N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision] - t$95$1), $MachinePrecision], N[(N[((-z) * N[(y - 1.0), $MachinePrecision] + x), $MachinePrecision] + N[(t * b), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot a\\
\mathbf{if}\;a \leq -2.5 \cdot 10^{+124}:\\
\;\;\;\;\left(x + z\right) - t\_1\\
\mathbf{elif}\;a \leq -0.014 \lor \neg \left(a \leq 9.2 \cdot 10^{-79}\right):\\
\;\;\;\;\left(b - z\right) \cdot y - t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-z, y - 1, x\right) + t \cdot b\\
\end{array}
\end{array}
if a < -2.4999999999999998e124Initial program 89.7%
Taylor expanded in y around 0
Applied rewrites89.7%
Taylor expanded in x around inf
Applied rewrites89.3%
if -2.4999999999999998e124 < a < -0.0140000000000000003 or 9.20000000000000047e-79 < a Initial program 94.3%
Taylor expanded in y around 0
Applied rewrites96.2%
Taylor expanded in y around inf
Applied rewrites77.0%
if -0.0140000000000000003 < a < 9.20000000000000047e-79Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites70.1%
Taylor expanded in t around inf
Applied rewrites51.2%
Taylor expanded in a around 0
Applied rewrites78.1%
Final simplification79.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -2e+124)
(+ x t_1)
(if (<= b 2.25e-35)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(if (<= b 5.2e+53) (+ (fma (- z) (- y 1.0) x) (* t b)) (+ a t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -2e+124) {
tmp = x + t_1;
} else if (b <= 2.25e-35) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else if (b <= 5.2e+53) {
tmp = fma(-z, (y - 1.0), x) + (t * b);
} else {
tmp = a + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -2e+124) tmp = Float64(x + t_1); elseif (b <= 2.25e-35) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); elseif (b <= 5.2e+53) tmp = Float64(fma(Float64(-z), Float64(y - 1.0), x) + Float64(t * b)); else tmp = Float64(a + t_1); 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]}, If[LessEqual[b, -2e+124], N[(x + t$95$1), $MachinePrecision], If[LessEqual[b, 2.25e-35], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 5.2e+53], N[(N[((-z) * N[(y - 1.0), $MachinePrecision] + x), $MachinePrecision] + N[(t * b), $MachinePrecision]), $MachinePrecision], N[(a + t$95$1), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -2 \cdot 10^{+124}:\\
\;\;\;\;x + t\_1\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{-35}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{+53}:\\
\;\;\;\;\mathsf{fma}\left(-z, y - 1, x\right) + t \cdot b\\
\mathbf{else}:\\
\;\;\;\;a + t\_1\\
\end{array}
\end{array}
if b < -1.9999999999999999e124Initial program 89.1%
Taylor expanded in x around inf
Applied rewrites89.1%
if -1.9999999999999999e124 < b < 2.25000000000000005e-35Initial program 97.3%
Taylor expanded in b around 0
Applied rewrites86.4%
if 2.25000000000000005e-35 < b < 5.19999999999999996e53Initial program 100.0%
Taylor expanded in x around inf
Applied rewrites54.8%
Taylor expanded in t around inf
Applied rewrites50.2%
Taylor expanded in a around 0
Applied rewrites90.4%
if 5.19999999999999996e53 < b Initial program 91.3%
Taylor expanded in a around inf
Applied rewrites76.7%
Taylor expanded in t around 0
Applied rewrites74.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -800.0) (not (<= y 1.65e+109))) (+ (fma (- b z) y (fma (- t 2.0) b x)) z) (fma (- t 2.0) b (- x (fma (- t 1.0) a (- z))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -800.0) || !(y <= 1.65e+109)) {
tmp = fma((b - z), y, fma((t - 2.0), b, x)) + z;
} else {
tmp = fma((t - 2.0), b, (x - fma((t - 1.0), a, -z)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -800.0) || !(y <= 1.65e+109)) tmp = Float64(fma(Float64(b - z), y, fma(Float64(t - 2.0), b, x)) + z); else tmp = fma(Float64(t - 2.0), b, Float64(x - fma(Float64(t - 1.0), a, Float64(-z)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -800.0], N[Not[LessEqual[y, 1.65e+109]], $MachinePrecision]], N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b + N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + (-z)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -800 \lor \neg \left(y \leq 1.65 \cdot 10^{+109}\right):\\
\;\;\;\;\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, x\right)\right) + z\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, x - \mathsf{fma}\left(t - 1, a, -z\right)\right)\\
\end{array}
\end{array}
if y < -800 or 1.6499999999999999e109 < y Initial program 89.7%
Taylor expanded in y around 0
Applied rewrites94.8%
Taylor expanded in a around 0
Applied rewrites80.1%
if -800 < y < 1.6499999999999999e109Initial program 98.1%
Taylor expanded in y around 0
Applied rewrites96.2%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- t 2.0) b (- x (* a t)))))
(if (<= t -2.2e+33)
t_1
(if (<= t 4.9e-19)
(+ (fma -2.0 b (+ z x)) a)
(if (<= t 7e+116) (+ x (fma y b (* (- t 2.0) b))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((t - 2.0), b, (x - (a * t)));
double tmp;
if (t <= -2.2e+33) {
tmp = t_1;
} else if (t <= 4.9e-19) {
tmp = fma(-2.0, b, (z + x)) + a;
} else if (t <= 7e+116) {
tmp = x + fma(y, b, ((t - 2.0) * b));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(t - 2.0), b, Float64(x - Float64(a * t))) tmp = 0.0 if (t <= -2.2e+33) tmp = t_1; elseif (t <= 4.9e-19) tmp = Float64(fma(-2.0, b, Float64(z + x)) + a); elseif (t <= 7e+116) tmp = Float64(x + fma(y, b, Float64(Float64(t - 2.0) * b))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 2.0), $MachinePrecision] * b + N[(x - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2e+33], t$95$1, If[LessEqual[t, 4.9e-19], N[(N[(-2.0 * b + N[(z + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 7e+116], N[(x + N[(y * b + N[(N[(t - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - 2, b, x - a \cdot t\right)\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, z + x\right) + a\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+116}:\\
\;\;\;\;x + \mathsf{fma}\left(y, b, \left(t - 2\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.19999999999999994e33 or 6.99999999999999993e116 < t Initial program 94.3%
Taylor expanded in y around 0
Applied rewrites84.4%
Taylor expanded in t around inf
Applied rewrites82.6%
if -2.19999999999999994e33 < t < 4.89999999999999993e-19Initial program 96.8%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in t around 0
Applied rewrites69.4%
if 4.89999999999999993e-19 < t < 6.99999999999999993e116Initial program 88.5%
Taylor expanded in x around inf
Applied rewrites81.2%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
lift--.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lower-*.f6481.2
Applied rewrites81.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- t 2.0) b (- x (* a t)))))
(if (<= t -2.2e+33)
t_1
(if (<= t 4.9e-19)
(+ (fma -2.0 b (+ z x)) a)
(if (<= t 7e+116) (+ x (* (- (+ y t) 2.0) b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma((t - 2.0), b, (x - (a * t)));
double tmp;
if (t <= -2.2e+33) {
tmp = t_1;
} else if (t <= 4.9e-19) {
tmp = fma(-2.0, b, (z + x)) + a;
} else if (t <= 7e+116) {
tmp = x + (((y + t) - 2.0) * b);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(t - 2.0), b, Float64(x - Float64(a * t))) tmp = 0.0 if (t <= -2.2e+33) tmp = t_1; elseif (t <= 4.9e-19) tmp = Float64(fma(-2.0, b, Float64(z + x)) + a); elseif (t <= 7e+116) tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 2.0), $MachinePrecision] * b + N[(x - N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.2e+33], t$95$1, If[LessEqual[t, 4.9e-19], N[(N[(-2.0 * b + N[(z + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 7e+116], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(t - 2, b, x - a \cdot t\right)\\
\mathbf{if}\;t \leq -2.2 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, z + x\right) + a\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+116}:\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.19999999999999994e33 or 6.99999999999999993e116 < t Initial program 94.3%
Taylor expanded in y around 0
Applied rewrites84.4%
Taylor expanded in t around inf
Applied rewrites82.6%
if -2.19999999999999994e33 < t < 4.89999999999999993e-19Initial program 96.8%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in t around 0
Applied rewrites69.4%
if 4.89999999999999993e-19 < t < 6.99999999999999993e116Initial program 88.5%
Taylor expanded in x around inf
Applied rewrites81.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.5e+33) (not (<= a 5.2e+96))) (- x (fma (- t 1.0) a (* (- y 1.0) z))) (+ (fma (- b z) y (fma (- t 2.0) b x)) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.5e+33) || !(a <= 5.2e+96)) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = fma((b - z), y, fma((t - 2.0), b, x)) + z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.5e+33) || !(a <= 5.2e+96)) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = Float64(fma(Float64(b - z), y, fma(Float64(t - 2.0), b, x)) + z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.5e+33], N[Not[LessEqual[a, 5.2e+96]], $MachinePrecision]], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - z), $MachinePrecision] * y + N[(N[(t - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.5 \cdot 10^{+33} \lor \neg \left(a \leq 5.2 \cdot 10^{+96}\right):\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - z, y, \mathsf{fma}\left(t - 2, b, x\right)\right) + z\\
\end{array}
\end{array}
if a < -3.5000000000000001e33 or 5.2e96 < a Initial program 93.3%
Taylor expanded in b around 0
Applied rewrites85.9%
if -3.5000000000000001e33 < a < 5.2e96Initial program 96.0%
Taylor expanded in y around 0
Applied rewrites100.0%
Taylor expanded in a around 0
Applied rewrites89.6%
Final simplification88.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -1.85e+25)
t_1
(if (<= t 5.05e-144)
(fma (- y 2.0) b x)
(if (<= t 2e-29)
(* (- 1.0 y) z)
(if (<= t 3.1e+112) (fma y b 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 <= -1.85e+25) {
tmp = t_1;
} else if (t <= 5.05e-144) {
tmp = fma((y - 2.0), b, x);
} else if (t <= 2e-29) {
tmp = (1.0 - y) * z;
} else if (t <= 3.1e+112) {
tmp = fma(y, b, 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 <= -1.85e+25) tmp = t_1; elseif (t <= 5.05e-144) tmp = fma(Float64(y - 2.0), b, x); elseif (t <= 2e-29) tmp = Float64(Float64(1.0 - y) * z); elseif (t <= 3.1e+112) 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[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -1.85e+25], t$95$1, If[LessEqual[t, 5.05e-144], N[(N[(y - 2.0), $MachinePrecision] * b + x), $MachinePrecision], If[LessEqual[t, 2e-29], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[t, 3.1e+112], N[(y * b + x), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -1.85 \cdot 10^{+25}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.05 \cdot 10^{-144}:\\
\;\;\;\;\mathsf{fma}\left(y - 2, b, x\right)\\
\mathbf{elif}\;t \leq 2 \cdot 10^{-29}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.8499999999999999e25 or 3.09999999999999983e112 < t Initial program 93.4%
Taylor expanded in t around inf
Applied rewrites80.7%
if -1.8499999999999999e25 < t < 5.0499999999999999e-144Initial program 96.1%
Taylor expanded in x around inf
Applied rewrites48.2%
Taylor expanded in y around inf
Applied rewrites48.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6448.2
Applied rewrites48.2%
if 5.0499999999999999e-144 < t < 1.99999999999999989e-29Initial program 100.0%
Taylor expanded in z around inf
Applied rewrites62.8%
if 1.99999999999999989e-29 < t < 3.09999999999999983e112Initial program 92.0%
Taylor expanded in x around inf
Applied rewrites80.4%
Taylor expanded in y around inf
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6464.7
Applied rewrites64.7%
Taylor expanded in y around inf
Applied rewrites64.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 t) a)))
(if (<= a -4.1e+68)
t_1
(if (<= a -1.4e-18)
(fma y b x)
(if (<= a 2.6e-80)
(fma t b x)
(if (<= a 1.5e+65) (* (- 1.0 y) 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 <= -4.1e+68) {
tmp = t_1;
} else if (a <= -1.4e-18) {
tmp = fma(y, b, x);
} else if (a <= 2.6e-80) {
tmp = fma(t, b, x);
} else if (a <= 1.5e+65) {
tmp = (1.0 - y) * 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 <= -4.1e+68) tmp = t_1; elseif (a <= -1.4e-18) tmp = fma(y, b, x); elseif (a <= 2.6e-80) tmp = fma(t, b, x); elseif (a <= 1.5e+65) 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[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -4.1e+68], t$95$1, If[LessEqual[a, -1.4e-18], N[(y * b + x), $MachinePrecision], If[LessEqual[a, 2.6e-80], N[(t * b + x), $MachinePrecision], If[LessEqual[a, 1.5e+65], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a\\
\mathbf{if}\;a \leq -4.1 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.4 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-80}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+65}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.0999999999999999e68 or 1.5000000000000001e65 < a Initial program 91.7%
Taylor expanded in a around inf
Applied rewrites69.5%
if -4.0999999999999999e68 < a < -1.40000000000000006e-18Initial program 95.0%
Taylor expanded in x around inf
Applied rewrites61.4%
Taylor expanded in y around inf
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6457.0
Applied rewrites57.0%
Taylor expanded in y around inf
Applied rewrites52.1%
if -1.40000000000000006e-18 < a < 2.6000000000000001e-80Initial program 97.2%
Taylor expanded in x around inf
Applied rewrites70.8%
Taylor expanded in t around inf
Applied rewrites52.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6452.3
Applied rewrites52.3%
if 2.6000000000000001e-80 < a < 1.5000000000000001e65Initial program 97.0%
Taylor expanded in z around inf
Applied rewrites41.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -2.5e+33)
t_1
(if (<= t 4.9e-19)
(+ (fma -2.0 b (+ z x)) a)
(if (<= t 5.8e+112) (+ x (* (- (+ y t) 2.0) b)) 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 <= -2.5e+33) {
tmp = t_1;
} else if (t <= 4.9e-19) {
tmp = fma(-2.0, b, (z + x)) + a;
} else if (t <= 5.8e+112) {
tmp = x + (((y + t) - 2.0) * b);
} 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 <= -2.5e+33) tmp = t_1; elseif (t <= 4.9e-19) tmp = Float64(fma(-2.0, b, Float64(z + x)) + a); elseif (t <= 5.8e+112) tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); 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, -2.5e+33], t$95$1, If[LessEqual[t, 4.9e-19], N[(N[(-2.0 * b + N[(z + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 5.8e+112], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, z + x\right) + a\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+112}:\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.49999999999999986e33 or 5.8000000000000004e112 < t Initial program 93.4%
Taylor expanded in t around inf
Applied rewrites81.4%
if -2.49999999999999986e33 < t < 4.89999999999999993e-19Initial program 96.8%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in t around 0
Applied rewrites69.4%
if 4.89999999999999993e-19 < t < 5.8000000000000004e112Initial program 92.0%
Taylor expanded in x around inf
Applied rewrites80.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b a) t)))
(if (<= t -2.5e+33)
t_1
(if (<= t 4.9e-19)
(+ (fma -2.0 b (+ z x)) a)
(if (<= t 3.1e+112) (fma y b 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 <= -2.5e+33) {
tmp = t_1;
} else if (t <= 4.9e-19) {
tmp = fma(-2.0, b, (z + x)) + a;
} else if (t <= 3.1e+112) {
tmp = fma(y, b, 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 <= -2.5e+33) tmp = t_1; elseif (t <= 4.9e-19) tmp = Float64(fma(-2.0, b, Float64(z + x)) + a); elseif (t <= 3.1e+112) 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[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[t, -2.5e+33], t$95$1, If[LessEqual[t, 4.9e-19], N[(N[(-2.0 * b + N[(z + x), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[t, 3.1e+112], N[(y * b + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - a\right) \cdot t\\
\mathbf{if}\;t \leq -2.5 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.9 \cdot 10^{-19}:\\
\;\;\;\;\mathsf{fma}\left(-2, b, z + x\right) + a\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.49999999999999986e33 or 3.09999999999999983e112 < t Initial program 93.4%
Taylor expanded in t around inf
Applied rewrites81.4%
if -2.49999999999999986e33 < t < 4.89999999999999993e-19Initial program 96.8%
Taylor expanded in y around 0
Applied rewrites71.1%
Taylor expanded in t around 0
Applied rewrites69.4%
if 4.89999999999999993e-19 < t < 3.09999999999999983e112Initial program 92.0%
Taylor expanded in x around inf
Applied rewrites80.4%
Taylor expanded in y around inf
Applied rewrites64.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6464.7
Applied rewrites64.7%
Taylor expanded in y around inf
Applied rewrites64.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 t) a)))
(if (<= a -4.1e+68)
t_1
(if (<= a -1.4e-18) (fma y b x) (if (<= a 1.4e+54) (fma t b x) 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 <= -4.1e+68) {
tmp = t_1;
} else if (a <= -1.4e-18) {
tmp = fma(y, b, x);
} else if (a <= 1.4e+54) {
tmp = fma(t, b, x);
} 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 <= -4.1e+68) tmp = t_1; elseif (a <= -1.4e-18) tmp = fma(y, b, x); elseif (a <= 1.4e+54) tmp = fma(t, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]}, If[LessEqual[a, -4.1e+68], t$95$1, If[LessEqual[a, -1.4e-18], N[(y * b + x), $MachinePrecision], If[LessEqual[a, 1.4e+54], N[(t * b + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a\\
\mathbf{if}\;a \leq -4.1 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.4 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -4.0999999999999999e68 or 1.40000000000000008e54 < a Initial program 91.8%
Taylor expanded in a around inf
Applied rewrites68.8%
if -4.0999999999999999e68 < a < -1.40000000000000006e-18Initial program 95.0%
Taylor expanded in x around inf
Applied rewrites61.4%
Taylor expanded in y around inf
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6457.0
Applied rewrites57.0%
Taylor expanded in y around inf
Applied rewrites52.1%
if -1.40000000000000006e-18 < a < 1.40000000000000008e54Initial program 97.1%
Taylor expanded in x around inf
Applied rewrites64.7%
Taylor expanded in t around inf
Applied rewrites46.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6446.2
Applied rewrites46.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- (+ y t) 2.0) b)))
(if (<= b -7.8e+48)
(+ x t_1)
(if (<= b 1.65e+52) (- (+ x z) (* (- t 1.0) a)) (+ a t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -7.8e+48) {
tmp = x + t_1;
} else if (b <= 1.65e+52) {
tmp = (x + z) - ((t - 1.0) * a);
} else {
tmp = a + t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 + t) - 2.0d0) * b
if (b <= (-7.8d+48)) then
tmp = x + t_1
else if (b <= 1.65d+52) then
tmp = (x + z) - ((t - 1.0d0) * a)
else
tmp = a + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((y + t) - 2.0) * b;
double tmp;
if (b <= -7.8e+48) {
tmp = x + t_1;
} else if (b <= 1.65e+52) {
tmp = (x + z) - ((t - 1.0) * a);
} else {
tmp = a + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((y + t) - 2.0) * b tmp = 0 if b <= -7.8e+48: tmp = x + t_1 elif b <= 1.65e+52: tmp = (x + z) - ((t - 1.0) * a) else: tmp = a + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (b <= -7.8e+48) tmp = Float64(x + t_1); elseif (b <= 1.65e+52) tmp = Float64(Float64(x + z) - Float64(Float64(t - 1.0) * a)); else tmp = Float64(a + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((y + t) - 2.0) * b; tmp = 0.0; if (b <= -7.8e+48) tmp = x + t_1; elseif (b <= 1.65e+52) tmp = (x + z) - ((t - 1.0) * a); else tmp = a + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -7.8e+48], N[(x + t$95$1), $MachinePrecision], If[LessEqual[b, 1.65e+52], N[(N[(x + z), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(a + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -7.8 \cdot 10^{+48}:\\
\;\;\;\;x + t\_1\\
\mathbf{elif}\;b \leq 1.65 \cdot 10^{+52}:\\
\;\;\;\;\left(x + z\right) - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;a + t\_1\\
\end{array}
\end{array}
if b < -7.8000000000000002e48Initial program 88.5%
Taylor expanded in x around inf
Applied rewrites79.0%
if -7.8000000000000002e48 < b < 1.65e52Initial program 98.6%
Taylor expanded in y around 0
Applied rewrites98.7%
Taylor expanded in x around inf
Applied rewrites71.7%
if 1.65e52 < b Initial program 91.3%
Taylor expanded in a around inf
Applied rewrites76.7%
Taylor expanded in t around 0
Applied rewrites74.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a) t)))
(if (<= a -1.16e+73)
t_1
(if (<= a -1.4e-18) (fma y b x) (if (<= a 1.6e+54) (fma t b x) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a * t;
double tmp;
if (a <= -1.16e+73) {
tmp = t_1;
} else if (a <= -1.4e-18) {
tmp = fma(y, b, x);
} else if (a <= 1.6e+54) {
tmp = fma(t, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-a) * t) tmp = 0.0 if (a <= -1.16e+73) tmp = t_1; elseif (a <= -1.4e-18) tmp = fma(y, b, x); elseif (a <= 1.6e+54) tmp = fma(t, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) * t), $MachinePrecision]}, If[LessEqual[a, -1.16e+73], t$95$1, If[LessEqual[a, -1.4e-18], N[(y * b + x), $MachinePrecision], If[LessEqual[a, 1.6e+54], N[(t * b + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot t\\
\mathbf{if}\;a \leq -1.16 \cdot 10^{+73}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -1.4 \cdot 10^{-18}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.16000000000000007e73 or 1.6e54 < a Initial program 91.8%
Taylor expanded in t around inf
Applied rewrites47.6%
Taylor expanded in a around inf
Applied rewrites42.4%
if -1.16000000000000007e73 < a < -1.40000000000000006e-18Initial program 95.0%
Taylor expanded in x around inf
Applied rewrites61.4%
Taylor expanded in y around inf
Applied rewrites57.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6457.0
Applied rewrites57.0%
Taylor expanded in y around inf
Applied rewrites52.1%
if -1.40000000000000006e-18 < a < 1.6e54Initial program 97.1%
Taylor expanded in x around inf
Applied rewrites64.7%
Taylor expanded in t around inf
Applied rewrites46.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6446.2
Applied rewrites46.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.2e+54) (not (<= b 3.2e-21))) (* (- (+ t y) 2.0) b) (- x (* (- t 1.0) a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.2e+54) || !(b <= 3.2e-21)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = x - ((t - 1.0) * 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) :: tmp
if ((b <= (-5.2d+54)) .or. (.not. (b <= 3.2d-21))) then
tmp = ((t + y) - 2.0d0) * b
else
tmp = x - ((t - 1.0d0) * a)
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 <= -5.2e+54) || !(b <= 3.2e-21)) {
tmp = ((t + y) - 2.0) * b;
} else {
tmp = x - ((t - 1.0) * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.2e+54) or not (b <= 3.2e-21): tmp = ((t + y) - 2.0) * b else: tmp = x - ((t - 1.0) * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.2e+54) || !(b <= 3.2e-21)) tmp = Float64(Float64(Float64(t + y) - 2.0) * b); else tmp = Float64(x - Float64(Float64(t - 1.0) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.2e+54) || ~((b <= 3.2e-21))) tmp = ((t + y) - 2.0) * b; else tmp = x - ((t - 1.0) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.2e+54], N[Not[LessEqual[b, 3.2e-21]], $MachinePrecision]], N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.2 \cdot 10^{+54} \lor \neg \left(b \leq 3.2 \cdot 10^{-21}\right):\\
\;\;\;\;\left(\left(t + y\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;x - \left(t - 1\right) \cdot a\\
\end{array}
\end{array}
if b < -5.20000000000000013e54 or 3.2000000000000002e-21 < b Initial program 91.1%
Taylor expanded in b around inf
Applied rewrites63.9%
if -5.20000000000000013e54 < b < 3.2000000000000002e-21Initial program 98.5%
Taylor expanded in y around 0
Applied rewrites98.5%
Taylor expanded in x around inf
Applied rewrites67.4%
Final simplification65.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.8e+40) (* b t) (if (<= t 3.1e-52) a (if (<= t 3.1e+112) x (* b t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.8e+40) {
tmp = b * t;
} else if (t <= 3.1e-52) {
tmp = a;
} else if (t <= 3.1e+112) {
tmp = x;
} 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 <= (-1.8d+40)) then
tmp = b * t
else if (t <= 3.1d-52) then
tmp = a
else if (t <= 3.1d+112) then
tmp = x
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 <= -1.8e+40) {
tmp = b * t;
} else if (t <= 3.1e-52) {
tmp = a;
} else if (t <= 3.1e+112) {
tmp = x;
} else {
tmp = b * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.8e+40: tmp = b * t elif t <= 3.1e-52: tmp = a elif t <= 3.1e+112: tmp = x else: tmp = b * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.8e+40) tmp = Float64(b * t); elseif (t <= 3.1e-52) tmp = a; elseif (t <= 3.1e+112) tmp = x; else tmp = Float64(b * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.8e+40) tmp = b * t; elseif (t <= 3.1e-52) tmp = a; elseif (t <= 3.1e+112) tmp = x; else tmp = b * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.8e+40], N[(b * t), $MachinePrecision], If[LessEqual[t, 3.1e-52], a, If[LessEqual[t, 3.1e+112], x, N[(b * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{+40}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-52}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{+112}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;b \cdot t\\
\end{array}
\end{array}
if t < -1.79999999999999998e40 or 3.09999999999999983e112 < t Initial program 93.1%
Taylor expanded in t around inf
Applied rewrites81.9%
Taylor expanded in a around 0
Applied rewrites43.5%
if -1.79999999999999998e40 < t < 3.0999999999999999e-52Initial program 96.7%
Taylor expanded in a around inf
Applied rewrites29.6%
Taylor expanded in t around 0
Applied rewrites26.2%
if 3.0999999999999999e-52 < t < 3.09999999999999983e112Initial program 93.8%
Taylor expanded in x around inf
Applied rewrites33.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.45e+72) (not (<= y 1.05e+158))) (fma y b x) (fma t b x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.45e+72) || !(y <= 1.05e+158)) {
tmp = fma(y, b, x);
} else {
tmp = fma(t, b, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.45e+72) || !(y <= 1.05e+158)) tmp = fma(y, b, x); else tmp = fma(t, b, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.45e+72], N[Not[LessEqual[y, 1.05e+158]], $MachinePrecision]], N[(y * b + x), $MachinePrecision], N[(t * b + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+72} \lor \neg \left(y \leq 1.05 \cdot 10^{+158}\right):\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\end{array}
\end{array}
if y < -1.45000000000000009e72 or 1.0499999999999999e158 < y Initial program 88.9%
Taylor expanded in x around inf
Applied rewrites51.8%
Taylor expanded in y around inf
Applied rewrites49.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6449.4
Applied rewrites49.4%
Taylor expanded in y around inf
Applied rewrites49.4%
if -1.45000000000000009e72 < y < 1.0499999999999999e158Initial program 97.3%
Taylor expanded in x around inf
Applied rewrites48.4%
Taylor expanded in t around inf
Applied rewrites40.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6440.1
Applied rewrites40.1%
Final simplification42.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -5.5e+115) a (if (<= a 3.5e+86) (fma t b x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.5e+115) {
tmp = a;
} else if (a <= 3.5e+86) {
tmp = fma(t, b, x);
} else {
tmp = a;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.5e+115) tmp = a; elseif (a <= 3.5e+86) tmp = fma(t, b, x); else tmp = a; end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.5e+115], a, If[LessEqual[a, 3.5e+86], N[(t * b + x), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+115}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{+86}:\\
\;\;\;\;\mathsf{fma}\left(t, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -5.5e115 or 3.50000000000000019e86 < a Initial program 92.0%
Taylor expanded in a around inf
Applied rewrites73.0%
Taylor expanded in t around 0
Applied rewrites31.6%
if -5.5e115 < a < 3.50000000000000019e86Initial program 96.4%
Taylor expanded in x around inf
Applied rewrites63.1%
Taylor expanded in t around inf
Applied rewrites42.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6442.7
Applied rewrites42.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.7e+72) a (if (<= a 1.35e-73) x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.7e+72) {
tmp = a;
} else if (a <= 1.35e-73) {
tmp = x;
} else {
tmp = 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) :: tmp
if (a <= (-2.7d+72)) then
tmp = a
else if (a <= 1.35d-73) then
tmp = x
else
tmp = a
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 <= -2.7e+72) {
tmp = a;
} else if (a <= 1.35e-73) {
tmp = x;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.7e+72: tmp = a elif a <= 1.35e-73: tmp = x else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.7e+72) tmp = a; elseif (a <= 1.35e-73) tmp = x; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.7e+72) tmp = a; elseif (a <= 1.35e-73) tmp = x; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.7e+72], a, If[LessEqual[a, 1.35e-73], x, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.7 \cdot 10^{+72}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 1.35 \cdot 10^{-73}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -2.7000000000000001e72 or 1.34999999999999997e-73 < a Initial program 92.9%
Taylor expanded in a around inf
Applied rewrites59.2%
Taylor expanded in t around 0
Applied rewrites25.0%
if -2.7000000000000001e72 < a < 1.34999999999999997e-73Initial program 96.9%
Taylor expanded in x around inf
Applied rewrites23.0%
(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 94.9%
Taylor expanded in x around inf
Applied rewrites14.9%
herbie shell --seed 2025026
(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)))