
(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 26 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 (- (+ t y) 2.0)))
(if (<=
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))
INFINITY)
(- (+ (fma (- 1.0 y) z (* t_1 b)) x) (fma a t (- a)))
(fma (- 1.0 y) z (fma t_1 b x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if ((((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)) <= ((double) INFINITY)) {
tmp = (fma((1.0 - y), z, (t_1 * b)) + x) - fma(a, t, -a);
} else {
tmp = fma((1.0 - y), z, fma(t_1, b, x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) <= Inf) tmp = Float64(Float64(fma(Float64(1.0 - y), z, Float64(t_1 * b)) + x) - fma(a, t, Float64(-a))); else tmp = fma(Float64(1.0 - y), z, fma(t_1, b, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(N[(N[(N[(1.0 - y), $MachinePrecision] * z + N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] - N[(a * t + (-a)), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - y), $MachinePrecision] * z + N[(t$95$1 * b + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;\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 \leq \infty:\\
\;\;\;\;\left(\mathsf{fma}\left(1 - y, z, t\_1 \cdot b\right) + x\right) - \mathsf{fma}\left(a, t, -a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(t\_1, b, x\right)\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%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64100.0
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 z around 0
lower--.f64N/A
Applied rewrites30.8%
Taylor expanded in a around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6476.9
Applied rewrites76.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<=
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b))
INFINITY)
(+ (fma (- 1.0 t) a x) (fma t_1 b (* (- 1.0 y) z)))
(fma (- 1.0 y) z (fma t_1 b x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if ((((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)) <= ((double) INFINITY)) {
tmp = fma((1.0 - t), a, x) + fma(t_1, b, ((1.0 - y) * z));
} else {
tmp = fma((1.0 - y), z, fma(t_1, b, x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) <= Inf) tmp = Float64(fma(Float64(1.0 - t), a, x) + fma(t_1, b, Float64(Float64(1.0 - y) * z))); else tmp = fma(Float64(1.0 - y), z, fma(t_1, b, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[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], Infinity], N[(N[(N[(1.0 - t), $MachinePrecision] * a + x), $MachinePrecision] + N[(t$95$1 * b + N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - y), $MachinePrecision] * z + N[(t$95$1 * b + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;\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 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(1 - t, a, x\right) + \mathsf{fma}\left(t\_1, b, \left(1 - y\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(t\_1, b, x\right)\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%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in a around 0
associate-+r+N/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64100.0
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 z around 0
lower--.f64N/A
Applied rewrites30.8%
Taylor expanded in a around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6476.9
Applied rewrites76.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* (- 1.0 y) z) a))
(t_2 (- (+ t y) 2.0))
(t_3 (- x (fma a t (- a)))))
(if (<= b -2.9e+21)
(fma t_2 b x)
(if (<= b -2.5e-49)
t_1
(if (<= b -2.9e-165)
t_3
(if (<= b 5e-112) t_1 (if (<= b 1.1e+91) t_3 (fma t_2 b z))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((1.0 - y) * z) + a;
double t_2 = (t + y) - 2.0;
double t_3 = x - fma(a, t, -a);
double tmp;
if (b <= -2.9e+21) {
tmp = fma(t_2, b, x);
} else if (b <= -2.5e-49) {
tmp = t_1;
} else if (b <= -2.9e-165) {
tmp = t_3;
} else if (b <= 5e-112) {
tmp = t_1;
} else if (b <= 1.1e+91) {
tmp = t_3;
} else {
tmp = fma(t_2, b, z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(1.0 - y) * z) + a) t_2 = Float64(Float64(t + y) - 2.0) t_3 = Float64(x - fma(a, t, Float64(-a))) tmp = 0.0 if (b <= -2.9e+21) tmp = fma(t_2, b, x); elseif (b <= -2.5e-49) tmp = t_1; elseif (b <= -2.9e-165) tmp = t_3; elseif (b <= 5e-112) tmp = t_1; elseif (b <= 1.1e+91) tmp = t_3; else tmp = fma(t_2, b, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] + a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$3 = N[(x - N[(a * t + (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.9e+21], N[(t$95$2 * b + x), $MachinePrecision], If[LessEqual[b, -2.5e-49], t$95$1, If[LessEqual[b, -2.9e-165], t$95$3, If[LessEqual[b, 5e-112], t$95$1, If[LessEqual[b, 1.1e+91], t$95$3, N[(t$95$2 * b + z), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - y\right) \cdot z + a\\
t_2 := \left(t + y\right) - 2\\
t_3 := x - \mathsf{fma}\left(a, t, -a\right)\\
\mathbf{if}\;b \leq -2.9 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, b, x\right)\\
\mathbf{elif}\;b \leq -2.5 \cdot 10^{-49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -2.9 \cdot 10^{-165}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{+91}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, b, z\right)\\
\end{array}
\end{array}
if b < -2.9e21Initial program 92.5%
Taylor expanded in x around inf
Applied rewrites74.2%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6474.2
Applied rewrites74.2%
if -2.9e21 < b < -2.4999999999999999e-49 or -2.9e-165 < b < 5.00000000000000044e-112Initial program 97.4%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites97.4%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6497.4
Applied rewrites97.4%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites97.4%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f64N/A
lift--.f6463.0
Applied rewrites63.0%
if -2.4999999999999999e-49 < b < -2.9e-165 or 5.00000000000000044e-112 < b < 1.1e91Initial program 100.0%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites68.8%
if 1.1e91 < b Initial program 87.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.1
Applied rewrites81.1%
Taylor expanded in y around 0
Applied rewrites87.6%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6487.6
Applied rewrites87.6%
Final simplification71.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)) (t_2 (fma t_1 b x)))
(if (<= a -1.2e+62)
(- x (fma a t (- a)))
(if (<= a -1.65e-178)
(fma t_1 b z)
(if (<= a 7.6e-117)
t_2
(if (<= a 2e-79)
(* (- 1.0 y) z)
(if (<= a 2.65e+97) t_2 (* (- 1.0 t) a))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double t_2 = fma(t_1, b, x);
double tmp;
if (a <= -1.2e+62) {
tmp = x - fma(a, t, -a);
} else if (a <= -1.65e-178) {
tmp = fma(t_1, b, z);
} else if (a <= 7.6e-117) {
tmp = t_2;
} else if (a <= 2e-79) {
tmp = (1.0 - y) * z;
} else if (a <= 2.65e+97) {
tmp = t_2;
} else {
tmp = (1.0 - t) * a;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) t_2 = fma(t_1, b, x) tmp = 0.0 if (a <= -1.2e+62) tmp = Float64(x - fma(a, t, Float64(-a))); elseif (a <= -1.65e-178) tmp = fma(t_1, b, z); elseif (a <= 7.6e-117) tmp = t_2; elseif (a <= 2e-79) tmp = Float64(Float64(1.0 - y) * z); elseif (a <= 2.65e+97) tmp = t_2; else tmp = Float64(Float64(1.0 - t) * a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * b + x), $MachinePrecision]}, If[LessEqual[a, -1.2e+62], N[(x - N[(a * t + (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -1.65e-178], N[(t$95$1 * b + z), $MachinePrecision], If[LessEqual[a, 7.6e-117], t$95$2, If[LessEqual[a, 2e-79], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 2.65e+97], t$95$2, N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
t_2 := \mathsf{fma}\left(t\_1, b, x\right)\\
\mathbf{if}\;a \leq -1.2 \cdot 10^{+62}:\\
\;\;\;\;x - \mathsf{fma}\left(a, t, -a\right)\\
\mathbf{elif}\;a \leq -1.65 \cdot 10^{-178}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, z\right)\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{-117}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-79}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;a \leq 2.65 \cdot 10^{+97}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\end{array}
\end{array}
if a < -1.2e62Initial program 90.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites92.4%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6492.4
Applied rewrites92.4%
Taylor expanded in x around inf
Applied rewrites75.0%
if -1.2e62 < a < -1.6500000000000001e-178Initial program 97.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6480.5
Applied rewrites80.5%
Taylor expanded in y around 0
Applied rewrites68.2%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6468.2
Applied rewrites68.2%
if -1.6500000000000001e-178 < a < 7.59999999999999945e-117 or 2e-79 < a < 2.6500000000000001e97Initial program 97.2%
Taylor expanded in x around inf
Applied rewrites67.9%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6467.9
Applied rewrites67.9%
if 7.59999999999999945e-117 < a < 2e-79Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6491.0
Applied rewrites91.0%
if 2.6500000000000001e97 < a Initial program 89.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.5
Applied rewrites75.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9.5e+83) (not (<= b 9.5e+93))) (fma (- 1.0 y) z (fma (- (+ t y) 2.0) b x)) (+ (+ (fma y b (fma (- 1.0 y) z (* (- b a) t))) x) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.5e+83) || !(b <= 9.5e+93)) {
tmp = fma((1.0 - y), z, fma(((t + y) - 2.0), b, x));
} else {
tmp = (fma(y, b, fma((1.0 - y), z, ((b - a) * t))) + x) + a;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9.5e+83) || !(b <= 9.5e+93)) tmp = fma(Float64(1.0 - y), z, fma(Float64(Float64(t + y) - 2.0), b, x)); else tmp = Float64(Float64(fma(y, b, fma(Float64(1.0 - y), z, Float64(Float64(b - a) * t))) + x) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9.5e+83], N[Not[LessEqual[b, 9.5e+93]], $MachinePrecision]], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y * b + N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.5 \cdot 10^{+83} \lor \neg \left(b \leq 9.5 \cdot 10^{+93}\right):\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\mathsf{fma}\left(y, b, \mathsf{fma}\left(1 - y, z, \left(b - a\right) \cdot t\right)\right) + x\right) + a\\
\end{array}
\end{array}
if b < -9.5000000000000002e83 or 9.4999999999999991e93 < b Initial program 89.2%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites93.5%
Taylor expanded in a around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6492.2
Applied rewrites92.2%
if -9.5000000000000002e83 < b < 9.4999999999999991e93Initial program 98.1%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites98.1%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6498.1
Applied rewrites98.1%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites98.8%
Taylor expanded in y around inf
Applied rewrites97.6%
Final simplification95.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- x (fma a t (- a))))
(t_2 (* (- b z) y))
(t_3 (fma (- t 2.0) b z)))
(if (<= y -3.6e+17)
t_2
(if (<= y -9.5e-74)
t_1
(if (<= y -7.2e-250)
t_3
(if (<= y 2.5e-203) t_1 (if (<= y 2.6e+27) t_3 t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x - fma(a, t, -a);
double t_2 = (b - z) * y;
double t_3 = fma((t - 2.0), b, z);
double tmp;
if (y <= -3.6e+17) {
tmp = t_2;
} else if (y <= -9.5e-74) {
tmp = t_1;
} else if (y <= -7.2e-250) {
tmp = t_3;
} else if (y <= 2.5e-203) {
tmp = t_1;
} else if (y <= 2.6e+27) {
tmp = t_3;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x - fma(a, t, Float64(-a))) t_2 = Float64(Float64(b - z) * y) t_3 = fma(Float64(t - 2.0), b, z) tmp = 0.0 if (y <= -3.6e+17) tmp = t_2; elseif (y <= -9.5e-74) tmp = t_1; elseif (y <= -7.2e-250) tmp = t_3; elseif (y <= 2.5e-203) tmp = t_1; elseif (y <= 2.6e+27) tmp = t_3; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x - N[(a * t + (-a)), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision]}, If[LessEqual[y, -3.6e+17], t$95$2, If[LessEqual[y, -9.5e-74], t$95$1, If[LessEqual[y, -7.2e-250], t$95$3, If[LessEqual[y, 2.5e-203], t$95$1, If[LessEqual[y, 2.6e+27], t$95$3, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x - \mathsf{fma}\left(a, t, -a\right)\\
t_2 := \left(b - z\right) \cdot y\\
t_3 := \mathsf{fma}\left(t - 2, b, z\right)\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+17}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -9.5 \cdot 10^{-74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -7.2 \cdot 10^{-250}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+27}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -3.6e17 or 2.60000000000000009e27 < y Initial program 91.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.0
Applied rewrites72.0%
if -3.6e17 < y < -9.5000000000000007e-74 or -7.19999999999999964e-250 < y < 2.5000000000000001e-203Initial program 100.0%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites72.0%
if -9.5000000000000007e-74 < y < -7.19999999999999964e-250 or 2.5000000000000001e-203 < y < 2.60000000000000009e27Initial program 96.5%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6461.8
Applied rewrites61.8%
Taylor expanded in y around 0
Applied rewrites61.8%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6461.8
Applied rewrites61.8%
Taylor expanded in y around 0
Applied rewrites61.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- (+ t y) 2.0) b x)))
(if (<= a -6.5e+61)
(- x (fma a t (- a)))
(if (<= a 7.6e-117)
t_1
(if (<= a 2e-79)
(* (- 1.0 y) z)
(if (<= a 2.65e+97) t_1 (* (- 1.0 t) a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, x);
double tmp;
if (a <= -6.5e+61) {
tmp = x - fma(a, t, -a);
} else if (a <= 7.6e-117) {
tmp = t_1;
} else if (a <= 2e-79) {
tmp = (1.0 - y) * z;
} else if (a <= 2.65e+97) {
tmp = t_1;
} else {
tmp = (1.0 - t) * a;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, x) tmp = 0.0 if (a <= -6.5e+61) tmp = Float64(x - fma(a, t, Float64(-a))); elseif (a <= 7.6e-117) tmp = t_1; elseif (a <= 2e-79) tmp = Float64(Float64(1.0 - y) * z); elseif (a <= 2.65e+97) tmp = t_1; else tmp = Float64(Float64(1.0 - t) * a); 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 + x), $MachinePrecision]}, If[LessEqual[a, -6.5e+61], N[(x - N[(a * t + (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 7.6e-117], t$95$1, If[LessEqual[a, 2e-79], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[a, 2.65e+97], t$95$1, N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\\
\mathbf{if}\;a \leq -6.5 \cdot 10^{+61}:\\
\;\;\;\;x - \mathsf{fma}\left(a, t, -a\right)\\
\mathbf{elif}\;a \leq 7.6 \cdot 10^{-117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2 \cdot 10^{-79}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\mathbf{elif}\;a \leq 2.65 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\end{array}
\end{array}
if a < -6.4999999999999996e61Initial program 90.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites92.4%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6492.4
Applied rewrites92.4%
Taylor expanded in x around inf
Applied rewrites75.0%
if -6.4999999999999996e61 < a < 7.59999999999999945e-117 or 2e-79 < a < 2.6500000000000001e97Initial program 97.4%
Taylor expanded in x around inf
Applied rewrites64.4%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6464.4
Applied rewrites64.4%
if 7.59999999999999945e-117 < a < 2e-79Initial program 100.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6491.0
Applied rewrites91.0%
if 2.6500000000000001e97 < a Initial program 89.5%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6475.5
Applied rewrites75.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (- (+ t y) 2.0) b x)))
(if (<= a -9.5e+61)
(- t_1 (* a (- t 1.0)))
(if (<= a 3.3e+97)
(fma (- 1.0 y) z t_1)
(- (* (fma -1.0 z b) y) (* (- t 1.0) a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((t + y) - 2.0), b, x);
double tmp;
if (a <= -9.5e+61) {
tmp = t_1 - (a * (t - 1.0));
} else if (a <= 3.3e+97) {
tmp = fma((1.0 - y), z, t_1);
} else {
tmp = (fma(-1.0, z, b) * y) - ((t - 1.0) * a);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(t + y) - 2.0), b, x) tmp = 0.0 if (a <= -9.5e+61) tmp = Float64(t_1 - Float64(a * Float64(t - 1.0))); elseif (a <= 3.3e+97) tmp = fma(Float64(1.0 - y), z, t_1); else tmp = Float64(Float64(fma(-1.0, z, b) * y) - Float64(Float64(t - 1.0) * a)); 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 + x), $MachinePrecision]}, If[LessEqual[a, -9.5e+61], N[(t$95$1 - N[(a * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e+97], N[(N[(1.0 - y), $MachinePrecision] * z + t$95$1), $MachinePrecision], N[(N[(N[(-1.0 * z + b), $MachinePrecision] * y), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\\
\mathbf{if}\;a \leq -9.5 \cdot 10^{+61}:\\
\;\;\;\;t\_1 - a \cdot \left(t - 1\right)\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+97}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, z, b\right) \cdot y - \left(t - 1\right) \cdot a\\
\end{array}
\end{array}
if a < -9.49999999999999959e61Initial program 90.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites92.4%
Taylor expanded in z around 0
lower--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lift--.f6487.2
Applied rewrites87.2%
if -9.49999999999999959e61 < a < 3.3000000000000001e97Initial program 97.6%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites98.8%
Taylor expanded in a around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6496.2
Applied rewrites96.2%
if 3.3000000000000001e97 < a Initial program 89.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites92.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6489.6
Applied rewrites89.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -6.5e+61)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(if (<= a 3.3e+97)
(fma (- 1.0 y) z (fma (- (+ t y) 2.0) b x))
(- (* (fma -1.0 z b) y) (* (- t 1.0) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -6.5e+61) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else if (a <= 3.3e+97) {
tmp = fma((1.0 - y), z, fma(((t + y) - 2.0), b, x));
} else {
tmp = (fma(-1.0, z, b) * y) - ((t - 1.0) * a);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -6.5e+61) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); elseif (a <= 3.3e+97) tmp = fma(Float64(1.0 - y), z, fma(Float64(Float64(t + y) - 2.0), b, x)); else tmp = Float64(Float64(fma(-1.0, z, b) * y) - Float64(Float64(t - 1.0) * a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -6.5e+61], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.3e+97], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision], N[(N[(N[(-1.0 * z + b), $MachinePrecision] * y), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+61}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{elif}\;a \leq 3.3 \cdot 10^{+97}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, z, b\right) \cdot y - \left(t - 1\right) \cdot a\\
\end{array}
\end{array}
if a < -6.4999999999999996e61Initial program 90.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--.f6482.1
Applied rewrites82.1%
if -6.4999999999999996e61 < a < 3.3000000000000001e97Initial program 97.6%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites98.8%
Taylor expanded in a around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6496.2
Applied rewrites96.2%
if 3.3000000000000001e97 < a Initial program 89.5%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites92.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6489.6
Applied rewrites89.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -6.5e+61) (not (<= a 4.2e+145))) (- x (fma (- t 1.0) a (* (- y 1.0) z))) (fma (- 1.0 y) z (fma (- (+ t y) 2.0) b x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -6.5e+61) || !(a <= 4.2e+145)) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = fma((1.0 - y), z, fma(((t + y) - 2.0), b, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -6.5e+61) || !(a <= 4.2e+145)) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = fma(Float64(1.0 - y), z, fma(Float64(Float64(t + y) - 2.0), b, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -6.5e+61], N[Not[LessEqual[a, 4.2e+145]], $MachinePrecision]], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - y), $MachinePrecision] * z + N[(N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision] * b + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -6.5 \cdot 10^{+61} \lor \neg \left(a \leq 4.2 \cdot 10^{+145}\right):\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1 - y, z, \mathsf{fma}\left(\left(t + y\right) - 2, b, x\right)\right)\\
\end{array}
\end{array}
if a < -6.4999999999999996e61 or 4.19999999999999979e145 < a Initial program 90.3%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6485.2
Applied rewrites85.2%
if -6.4999999999999996e61 < a < 4.19999999999999979e145Initial program 97.1%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites98.8%
Taylor expanded in a around 0
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6494.7
Applied rewrites94.7%
Final simplification91.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- b z) y)))
(if (<= y -3.6e+17)
t_1
(if (<= y -9e-272)
(* (- b a) t)
(if (<= y 2.5e-203) (+ x a) (if (<= y 2.6e+27) (fma t b z) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (b - z) * y;
double tmp;
if (y <= -3.6e+17) {
tmp = t_1;
} else if (y <= -9e-272) {
tmp = (b - a) * t;
} else if (y <= 2.5e-203) {
tmp = x + a;
} else if (y <= 2.6e+27) {
tmp = fma(t, b, z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(b - z) * y) tmp = 0.0 if (y <= -3.6e+17) tmp = t_1; elseif (y <= -9e-272) tmp = Float64(Float64(b - a) * t); elseif (y <= 2.5e-203) tmp = Float64(x + a); elseif (y <= 2.6e+27) tmp = fma(t, b, z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -3.6e+17], t$95$1, If[LessEqual[y, -9e-272], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], If[LessEqual[y, 2.5e-203], N[(x + a), $MachinePrecision], If[LessEqual[y, 2.6e+27], N[(t * b + z), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - z\right) \cdot y\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-272}:\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{elif}\;y \leq 2.5 \cdot 10^{-203}:\\
\;\;\;\;x + a\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(t, b, z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.6e17 or 2.60000000000000009e27 < y Initial program 91.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.0
Applied rewrites72.0%
if -3.6e17 < y < -8.9999999999999995e-272Initial program 96.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6448.9
Applied rewrites48.9%
if -8.9999999999999995e-272 < y < 2.5000000000000001e-203Initial program 99.9%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites99.9%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6499.9
Applied rewrites99.9%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites99.9%
Taylor expanded in x around inf
Applied rewrites54.2%
if 2.5000000000000001e-203 < y < 2.60000000000000009e27Initial program 98.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6456.7
Applied rewrites56.7%
Taylor expanded in y around 0
Applied rewrites56.6%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6456.6
Applied rewrites56.6%
Taylor expanded in t around inf
Applied rewrites46.7%
Final simplification59.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -2.16e+80)
(fma t_1 b x)
(if (<= b 3.9e+93)
(- x (fma (- t 1.0) a (* (- y 1.0) z)))
(fma t_1 b z)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if (b <= -2.16e+80) {
tmp = fma(t_1, b, x);
} else if (b <= 3.9e+93) {
tmp = x - fma((t - 1.0), a, ((y - 1.0) * z));
} else {
tmp = fma(t_1, b, z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -2.16e+80) tmp = fma(t_1, b, x); elseif (b <= 3.9e+93) tmp = Float64(x - fma(Float64(t - 1.0), a, Float64(Float64(y - 1.0) * z))); else tmp = fma(t_1, b, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[b, -2.16e+80], N[(t$95$1 * b + x), $MachinePrecision], If[LessEqual[b, 3.9e+93], N[(x - N[(N[(t - 1.0), $MachinePrecision] * a + N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -2.16 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, x\right)\\
\mathbf{elif}\;b \leq 3.9 \cdot 10^{+93}:\\
\;\;\;\;x - \mathsf{fma}\left(t - 1, a, \left(y - 1\right) \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, z\right)\\
\end{array}
\end{array}
if b < -2.16e80Initial program 91.5%
Taylor expanded in x around inf
Applied rewrites84.7%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6484.7
Applied rewrites84.7%
if -2.16e80 < b < 3.9000000000000002e93Initial program 98.1%
Taylor expanded in b around 0
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift--.f6490.3
Applied rewrites90.3%
if 3.9000000000000002e93 < b Initial program 87.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.1
Applied rewrites81.1%
Taylor expanded in y around 0
Applied rewrites87.6%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6487.6
Applied rewrites87.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- a) t)))
(if (<= t -9e+165)
(fma t b z)
(if (<= t -1.95e+80)
t_1
(if (<= t 1.56e+47) (fma y b z) (if (<= t 4e+122) t_1 (fma t b z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -a * t;
double tmp;
if (t <= -9e+165) {
tmp = fma(t, b, z);
} else if (t <= -1.95e+80) {
tmp = t_1;
} else if (t <= 1.56e+47) {
tmp = fma(y, b, z);
} else if (t <= 4e+122) {
tmp = t_1;
} else {
tmp = fma(t, b, z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-a) * t) tmp = 0.0 if (t <= -9e+165) tmp = fma(t, b, z); elseif (t <= -1.95e+80) tmp = t_1; elseif (t <= 1.56e+47) tmp = fma(y, b, z); elseif (t <= 4e+122) tmp = t_1; else tmp = fma(t, b, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-a) * t), $MachinePrecision]}, If[LessEqual[t, -9e+165], N[(t * b + z), $MachinePrecision], If[LessEqual[t, -1.95e+80], t$95$1, If[LessEqual[t, 1.56e+47], N[(y * b + z), $MachinePrecision], If[LessEqual[t, 4e+122], t$95$1, N[(t * b + z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-a\right) \cdot t\\
\mathbf{if}\;t \leq -9 \cdot 10^{+165}:\\
\;\;\;\;\mathsf{fma}\left(t, b, z\right)\\
\mathbf{elif}\;t \leq -1.95 \cdot 10^{+80}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.56 \cdot 10^{+47}:\\
\;\;\;\;\mathsf{fma}\left(y, b, z\right)\\
\mathbf{elif}\;t \leq 4 \cdot 10^{+122}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, b, z\right)\\
\end{array}
\end{array}
if t < -8.9999999999999993e165 or 4.00000000000000006e122 < t Initial program 90.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6465.7
Applied rewrites65.7%
Taylor expanded in y around 0
Applied rewrites56.7%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6456.7
Applied rewrites56.7%
Taylor expanded in t around inf
Applied rewrites52.9%
if -8.9999999999999993e165 < t < -1.94999999999999999e80 or 1.55999999999999998e47 < t < 4.00000000000000006e122Initial program 92.8%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6465.3
Applied rewrites65.3%
Taylor expanded in a around inf
mul-1-negN/A
lower-neg.f6461.9
Applied rewrites61.9%
if -1.94999999999999999e80 < t < 1.55999999999999998e47Initial program 97.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6463.1
Applied rewrites63.1%
Taylor expanded in y around 0
Applied rewrites50.3%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6450.3
Applied rewrites50.3%
Taylor expanded in y around inf
Applied rewrites40.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -6e+79)
(fma t_1 b x)
(if (<= b 2.35e+93) (- (* (- 1.0 y) z) (* (- t 1.0) a)) (fma t_1 b z)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if (b <= -6e+79) {
tmp = fma(t_1, b, x);
} else if (b <= 2.35e+93) {
tmp = ((1.0 - y) * z) - ((t - 1.0) * a);
} else {
tmp = fma(t_1, b, z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -6e+79) tmp = fma(t_1, b, x); elseif (b <= 2.35e+93) tmp = Float64(Float64(Float64(1.0 - y) * z) - Float64(Float64(t - 1.0) * a)); else tmp = fma(t_1, b, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[b, -6e+79], N[(t$95$1 * b + x), $MachinePrecision], If[LessEqual[b, 2.35e+93], N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * b + z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -6 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, x\right)\\
\mathbf{elif}\;b \leq 2.35 \cdot 10^{+93}:\\
\;\;\;\;\left(1 - y\right) \cdot z - \left(t - 1\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, z\right)\\
\end{array}
\end{array}
if b < -5.99999999999999948e79Initial program 91.5%
Taylor expanded in x around inf
Applied rewrites84.7%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6484.7
Applied rewrites84.7%
if -5.99999999999999948e79 < b < 2.3499999999999999e93Initial program 98.1%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites98.1%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f64N/A
lift--.f6470.8
Applied rewrites70.8%
if 2.3499999999999999e93 < b Initial program 87.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6481.1
Applied rewrites81.1%
Taylor expanded in y around 0
Applied rewrites87.6%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6487.6
Applied rewrites87.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- 1.0 t) a)))
(if (<= a -8e+61)
t_1
(if (<= a 5.3e-247) (fma t b z) (if (<= a 3.4e+95) (fma y b 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 <= -8e+61) {
tmp = t_1;
} else if (a <= 5.3e-247) {
tmp = fma(t, b, z);
} else if (a <= 3.4e+95) {
tmp = fma(y, b, 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 <= -8e+61) tmp = t_1; elseif (a <= 5.3e-247) tmp = fma(t, b, z); elseif (a <= 3.4e+95) tmp = fma(y, b, 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, -8e+61], t$95$1, If[LessEqual[a, 5.3e-247], N[(t * b + z), $MachinePrecision], If[LessEqual[a, 3.4e+95], N[(y * b + z), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(1 - t\right) \cdot a\\
\mathbf{if}\;a \leq -8 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.3 \cdot 10^{-247}:\\
\;\;\;\;\mathsf{fma}\left(t, b, z\right)\\
\mathbf{elif}\;a \leq 3.4 \cdot 10^{+95}:\\
\;\;\;\;\mathsf{fma}\left(y, b, z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -7.9999999999999996e61 or 3.40000000000000022e95 < a Initial program 90.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.7
Applied rewrites68.7%
if -7.9999999999999996e61 < a < 5.2999999999999998e-247Initial program 98.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6479.1
Applied rewrites79.1%
Taylor expanded in y around 0
Applied rewrites61.7%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6461.7
Applied rewrites61.7%
Taylor expanded in t around inf
Applied rewrites41.0%
if 5.2999999999999998e-247 < a < 3.40000000000000022e95Initial program 95.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6476.2
Applied rewrites76.2%
Taylor expanded in y around 0
Applied rewrites59.2%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6459.2
Applied rewrites59.2%
Taylor expanded in y around inf
Applied rewrites40.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ t y) 2.0)))
(if (<= b -6e+79)
(fma t_1 b x)
(if (<= b 4.5e+75) (+ (+ (* (- 1.0 y) z) x) a) (fma t_1 b z)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) - 2.0;
double tmp;
if (b <= -6e+79) {
tmp = fma(t_1, b, x);
} else if (b <= 4.5e+75) {
tmp = (((1.0 - y) * z) + x) + a;
} else {
tmp = fma(t_1, b, z);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) - 2.0) tmp = 0.0 if (b <= -6e+79) tmp = fma(t_1, b, x); elseif (b <= 4.5e+75) tmp = Float64(Float64(Float64(Float64(1.0 - y) * z) + x) + a); else tmp = fma(t_1, b, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] - 2.0), $MachinePrecision]}, If[LessEqual[b, -6e+79], N[(t$95$1 * b + x), $MachinePrecision], If[LessEqual[b, 4.5e+75], N[(N[(N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision] + x), $MachinePrecision] + a), $MachinePrecision], N[(t$95$1 * b + z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) - 2\\
\mathbf{if}\;b \leq -6 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, x\right)\\
\mathbf{elif}\;b \leq 4.5 \cdot 10^{+75}:\\
\;\;\;\;\left(\left(1 - y\right) \cdot z + x\right) + a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, b, z\right)\\
\end{array}
\end{array}
if b < -5.99999999999999948e79Initial program 91.5%
Taylor expanded in x around inf
Applied rewrites84.7%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6484.7
Applied rewrites84.7%
if -5.99999999999999948e79 < b < 4.5000000000000004e75Initial program 98.1%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites98.1%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6498.1
Applied rewrites98.1%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites98.7%
Taylor expanded in z around inf
*-commutativeN/A
lift-*.f64N/A
lift--.f6470.0
Applied rewrites70.0%
if 4.5000000000000004e75 < b Initial program 88.2%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6478.8
Applied rewrites78.8%
Taylor expanded in y around 0
Applied rewrites84.8%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6484.8
Applied rewrites84.8%
Final simplification75.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -7e-6) (fma t b z) (if (<= t -4.5e-115) (+ x a) (if (<= t 1.95e+88) (fma y b z) (fma t b z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -7e-6) {
tmp = fma(t, b, z);
} else if (t <= -4.5e-115) {
tmp = x + a;
} else if (t <= 1.95e+88) {
tmp = fma(y, b, z);
} else {
tmp = fma(t, b, z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -7e-6) tmp = fma(t, b, z); elseif (t <= -4.5e-115) tmp = Float64(x + a); elseif (t <= 1.95e+88) tmp = fma(y, b, z); else tmp = fma(t, b, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -7e-6], N[(t * b + z), $MachinePrecision], If[LessEqual[t, -4.5e-115], N[(x + a), $MachinePrecision], If[LessEqual[t, 1.95e+88], N[(y * b + z), $MachinePrecision], N[(t * b + z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7 \cdot 10^{-6}:\\
\;\;\;\;\mathsf{fma}\left(t, b, z\right)\\
\mathbf{elif}\;t \leq -4.5 \cdot 10^{-115}:\\
\;\;\;\;x + a\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(y, b, z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, b, z\right)\\
\end{array}
\end{array}
if t < -6.99999999999999989e-6 or 1.9500000000000001e88 < t Initial program 91.9%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6461.6
Applied rewrites61.6%
Taylor expanded in y around 0
Applied rewrites50.5%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6450.5
Applied rewrites50.5%
Taylor expanded in t around inf
Applied rewrites44.5%
if -6.99999999999999989e-6 < t < -4.50000000000000023e-115Initial program 100.0%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites100.0%
Taylor expanded in x around inf
Applied rewrites46.7%
if -4.50000000000000023e-115 < t < 1.9500000000000001e88Initial program 96.8%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6463.7
Applied rewrites63.7%
Taylor expanded in y around 0
Applied rewrites51.7%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6451.7
Applied rewrites51.7%
Taylor expanded in y around inf
Applied rewrites42.5%
Final simplification43.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -90.0) (not (<= y 2.6e+27))) (* (- b z) y) (fma (- t 2.0) b z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -90.0) || !(y <= 2.6e+27)) {
tmp = (b - z) * y;
} else {
tmp = fma((t - 2.0), b, z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -90.0) || !(y <= 2.6e+27)) tmp = Float64(Float64(b - z) * y); else tmp = fma(Float64(t - 2.0), b, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -90.0], N[Not[LessEqual[y, 2.6e+27]], $MachinePrecision]], N[(N[(b - z), $MachinePrecision] * y), $MachinePrecision], N[(N[(t - 2.0), $MachinePrecision] * b + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -90 \lor \neg \left(y \leq 2.6 \cdot 10^{+27}\right):\\
\;\;\;\;\left(b - z\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t - 2, b, z\right)\\
\end{array}
\end{array}
if y < -90 or 2.60000000000000009e27 < y Initial program 91.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.0
Applied rewrites71.0%
if -90 < y < 2.60000000000000009e27Initial program 97.7%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6452.1
Applied rewrites52.1%
Taylor expanded in y around 0
Applied rewrites51.8%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6451.8
Applied rewrites51.8%
Taylor expanded in y around 0
Applied rewrites51.7%
Final simplification60.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -4.4e+79) (not (<= t 1.08e+46))) (* (- b a) t) (fma y b z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -4.4e+79) || !(t <= 1.08e+46)) {
tmp = (b - a) * t;
} else {
tmp = fma(y, b, z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -4.4e+79) || !(t <= 1.08e+46)) tmp = Float64(Float64(b - a) * t); else tmp = fma(y, b, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -4.4e+79], N[Not[LessEqual[t, 1.08e+46]], $MachinePrecision]], N[(N[(b - a), $MachinePrecision] * t), $MachinePrecision], N[(y * b + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.4 \cdot 10^{+79} \lor \neg \left(t \leq 1.08 \cdot 10^{+46}\right):\\
\;\;\;\;\left(b - a\right) \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, b, z\right)\\
\end{array}
\end{array}
if t < -4.3999999999999998e79 or 1.07999999999999994e46 < t Initial program 91.3%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.6
Applied rewrites72.6%
if -4.3999999999999998e79 < t < 1.07999999999999994e46Initial program 97.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6463.1
Applied rewrites63.1%
Taylor expanded in y around 0
Applied rewrites50.3%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6450.3
Applied rewrites50.3%
Taylor expanded in y around inf
Applied rewrites40.4%
Final simplification53.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.06e+58) (not (<= a 3.1e+95))) (* (- 1.0 t) a) (* (- 1.0 y) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.06e+58) || !(a <= 3.1e+95)) {
tmp = (1.0 - t) * a;
} else {
tmp = (1.0 - y) * z;
}
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.06d+58)) .or. (.not. (a <= 3.1d+95))) then
tmp = (1.0d0 - t) * a
else
tmp = (1.0d0 - y) * z
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.06e+58) || !(a <= 3.1e+95)) {
tmp = (1.0 - t) * a;
} else {
tmp = (1.0 - y) * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.06e+58) or not (a <= 3.1e+95): tmp = (1.0 - t) * a else: tmp = (1.0 - y) * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.06e+58) || !(a <= 3.1e+95)) tmp = Float64(Float64(1.0 - t) * a); else tmp = Float64(Float64(1.0 - y) * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.06e+58) || ~((a <= 3.1e+95))) tmp = (1.0 - t) * a; else tmp = (1.0 - y) * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.06e+58], N[Not[LessEqual[a, 3.1e+95]], $MachinePrecision]], N[(N[(1.0 - t), $MachinePrecision] * a), $MachinePrecision], N[(N[(1.0 - y), $MachinePrecision] * z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.06 \cdot 10^{+58} \lor \neg \left(a \leq 3.1 \cdot 10^{+95}\right):\\
\;\;\;\;\left(1 - t\right) \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(1 - y\right) \cdot z\\
\end{array}
\end{array}
if a < -1.05999999999999997e58 or 3.1000000000000003e95 < a Initial program 90.2%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6468.7
Applied rewrites68.7%
if -1.05999999999999997e58 < a < 3.1000000000000003e95Initial program 97.6%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6440.8
Applied rewrites40.8%
Final simplification50.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.3e+51) (not (<= y 2.6e+38))) (* b y) (fma t b z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -2.3e+51) || !(y <= 2.6e+38)) {
tmp = b * y;
} else {
tmp = fma(t, b, z);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -2.3e+51) || !(y <= 2.6e+38)) tmp = Float64(b * y); else tmp = fma(t, b, z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -2.3e+51], N[Not[LessEqual[y, 2.6e+38]], $MachinePrecision]], N[(b * y), $MachinePrecision], N[(t * b + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.3 \cdot 10^{+51} \lor \neg \left(y \leq 2.6 \cdot 10^{+38}\right):\\
\;\;\;\;b \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, b, z\right)\\
\end{array}
\end{array}
if y < -2.30000000000000005e51 or 2.5999999999999999e38 < y Initial program 90.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6473.0
Applied rewrites73.0%
Taylor expanded in z around 0
Applied rewrites39.6%
if -2.30000000000000005e51 < y < 2.5999999999999999e38Initial program 98.0%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
Applied rewrites50.7%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift--.f64N/A
+-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift-+.f6450.7
Applied rewrites50.7%
Taylor expanded in t around inf
Applied rewrites40.4%
Final simplification40.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.32e+82) (not (<= t 2.55e+46))) (* b t) (+ x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.32e+82) || !(t <= 2.55e+46)) {
tmp = b * t;
} else {
tmp = x + a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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.32d+82)) .or. (.not. (t <= 2.55d+46))) then
tmp = b * t
else
tmp = x + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.32e+82) || !(t <= 2.55e+46)) {
tmp = b * t;
} else {
tmp = x + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.32e+82) or not (t <= 2.55e+46): tmp = b * t else: tmp = x + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.32e+82) || !(t <= 2.55e+46)) tmp = Float64(b * t); else tmp = Float64(x + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.32e+82) || ~((t <= 2.55e+46))) tmp = b * t; else tmp = x + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.32e+82], N[Not[LessEqual[t, 2.55e+46]], $MachinePrecision]], N[(b * t), $MachinePrecision], N[(x + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.32 \cdot 10^{+82} \lor \neg \left(t \leq 2.55 \cdot 10^{+46}\right):\\
\;\;\;\;b \cdot t\\
\mathbf{else}:\\
\;\;\;\;x + a\\
\end{array}
\end{array}
if t < -1.32e82 or 2.5499999999999999e46 < t Initial program 91.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6472.3
Applied rewrites72.3%
Taylor expanded in a around 0
Applied rewrites39.2%
if -1.32e82 < t < 2.5499999999999999e46Initial program 97.4%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites99.3%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6499.3
Applied rewrites99.3%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites97.4%
Taylor expanded in x around inf
Applied rewrites31.2%
Final simplification34.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.9e+138) (not (<= z 2.6e+114))) (* 1.0 z) (+ x a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.9e+138) || !(z <= 2.6e+114)) {
tmp = 1.0 * z;
} else {
tmp = x + a;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 ((z <= (-2.9d+138)) .or. (.not. (z <= 2.6d+114))) then
tmp = 1.0d0 * z
else
tmp = x + a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.9e+138) || !(z <= 2.6e+114)) {
tmp = 1.0 * z;
} else {
tmp = x + a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.9e+138) or not (z <= 2.6e+114): tmp = 1.0 * z else: tmp = x + a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.9e+138) || !(z <= 2.6e+114)) tmp = Float64(1.0 * z); else tmp = Float64(x + a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.9e+138) || ~((z <= 2.6e+114))) tmp = 1.0 * z; else tmp = x + a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.9e+138], N[Not[LessEqual[z, 2.6e+114]], $MachinePrecision]], N[(1.0 * z), $MachinePrecision], N[(x + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+138} \lor \neg \left(z \leq 2.6 \cdot 10^{+114}\right):\\
\;\;\;\;1 \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + a\\
\end{array}
\end{array}
if z < -2.9000000000000001e138 or 2.6e114 < z Initial program 88.3%
Taylor expanded in z around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6471.2
Applied rewrites71.2%
Taylor expanded in y around 0
Applied rewrites30.6%
if -2.9000000000000001e138 < z < 2.6e114Initial program 97.7%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites97.7%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6497.8
Applied rewrites97.8%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites98.9%
Taylor expanded in x around inf
Applied rewrites28.5%
Final simplification29.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -3.8e+84) (* b t) (if (<= b 1.45e+94) (+ x a) (* b y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.8e+84) {
tmp = b * t;
} else if (b <= 1.45e+94) {
tmp = x + a;
} 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 <= (-3.8d+84)) then
tmp = b * t
else if (b <= 1.45d+94) then
tmp = x + a
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 <= -3.8e+84) {
tmp = b * t;
} else if (b <= 1.45e+94) {
tmp = x + a;
} else {
tmp = b * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.8e+84: tmp = b * t elif b <= 1.45e+94: tmp = x + a else: tmp = b * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.8e+84) tmp = Float64(b * t); elseif (b <= 1.45e+94) tmp = Float64(x + a); else tmp = Float64(b * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -3.8e+84) tmp = b * t; elseif (b <= 1.45e+94) tmp = x + a; else tmp = b * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.8e+84], N[(b * t), $MachinePrecision], If[LessEqual[b, 1.45e+94], N[(x + a), $MachinePrecision], N[(b * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{+84}:\\
\;\;\;\;b \cdot t\\
\mathbf{elif}\;b \leq 1.45 \cdot 10^{+94}:\\
\;\;\;\;x + a\\
\mathbf{else}:\\
\;\;\;\;b \cdot y\\
\end{array}
\end{array}
if b < -3.8000000000000001e84Initial program 90.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6449.6
Applied rewrites49.6%
Taylor expanded in a around 0
Applied rewrites45.0%
if -3.8000000000000001e84 < b < 1.4499999999999999e94Initial program 98.2%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites98.2%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6498.2
Applied rewrites98.2%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites98.8%
Taylor expanded in x around inf
Applied rewrites30.4%
if 1.4499999999999999e94 < b Initial program 87.2%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f6456.4
Applied rewrites56.4%
Taylor expanded in z around 0
Applied rewrites52.3%
Final simplification36.9%
(FPCore (x y z t a b) :precision binary64 (+ x a))
double code(double x, double y, double z, double t, double a, double b) {
return x + a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x + a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + a;
}
def code(x, y, z, t, a, b): return x + a
function code(x, y, z, t, a, b) return Float64(x + a) end
function tmp = code(x, y, z, t, a, b) tmp = x + a; end
code[x_, y_, z_, t_, a_, b_] := N[(x + a), $MachinePrecision]
\begin{array}{l}
\\
x + a
\end{array}
Initial program 94.9%
Taylor expanded in z around 0
lower--.f64N/A
Applied rewrites96.5%
Taylor expanded in t around 0
+-commutativeN/A
lower-fma.f64N/A
mul-1-negN/A
lower-neg.f6496.5
Applied rewrites96.5%
Taylor expanded in t around 0
lower--.f64N/A
Applied rewrites96.1%
Taylor expanded in x around inf
Applied rewrites22.1%
Final simplification22.1%
(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.6%
herbie shell --seed 2025085
(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)))