
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
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) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
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) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ y (* (+ y x) (+ y x))))
(t_2 (* (+ t y) (+ t y)))
(t_3 (/ z (+ t y)))
(t_4 (+ t (+ x y)))
(t_5 (/ y (+ y x))))
(if (<= y -1.02e+145)
(+
z
(-
(fma
(- (fma b t_1 (/ a (+ y x))) (fma a t_1 (/ z (+ y x))))
t
(* a t_5))
(* b t_5)))
(if (<= y 1.8e+199)
(fma
(/ (+ y x) (+ (+ y x) t))
z
(fma -1.0 (/ (* b y) t_4) (* a (/ (+ t y) t_4))))
(-
(+
a
(fma
(- (fma b (/ y t_2) t_3) (fma y (/ z t_2) (/ a (+ t y))))
x
(* y t_3)))
(* b (/ y (+ t y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y / ((y + x) * (y + x));
double t_2 = (t + y) * (t + y);
double t_3 = z / (t + y);
double t_4 = t + (x + y);
double t_5 = y / (y + x);
double tmp;
if (y <= -1.02e+145) {
tmp = z + (fma((fma(b, t_1, (a / (y + x))) - fma(a, t_1, (z / (y + x)))), t, (a * t_5)) - (b * t_5));
} else if (y <= 1.8e+199) {
tmp = fma(((y + x) / ((y + x) + t)), z, fma(-1.0, ((b * y) / t_4), (a * ((t + y) / t_4))));
} else {
tmp = (a + fma((fma(b, (y / t_2), t_3) - fma(y, (z / t_2), (a / (t + y)))), x, (y * t_3))) - (b * (y / (t + y)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y / Float64(Float64(y + x) * Float64(y + x))) t_2 = Float64(Float64(t + y) * Float64(t + y)) t_3 = Float64(z / Float64(t + y)) t_4 = Float64(t + Float64(x + y)) t_5 = Float64(y / Float64(y + x)) tmp = 0.0 if (y <= -1.02e+145) tmp = Float64(z + Float64(fma(Float64(fma(b, t_1, Float64(a / Float64(y + x))) - fma(a, t_1, Float64(z / Float64(y + x)))), t, Float64(a * t_5)) - Float64(b * t_5))); elseif (y <= 1.8e+199) tmp = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, fma(-1.0, Float64(Float64(b * y) / t_4), Float64(a * Float64(Float64(t + y) / t_4)))); else tmp = Float64(Float64(a + fma(Float64(fma(b, Float64(y / t_2), t_3) - fma(y, Float64(z / t_2), Float64(a / Float64(t + y)))), x, Float64(y * t_3))) - Float64(b * Float64(y / Float64(t + y)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t + y), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(z / N[(t + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+145], N[(z + N[(N[(N[(N[(b * t$95$1 + N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$1 + N[(z / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(a * t$95$5), $MachinePrecision]), $MachinePrecision] - N[(b * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e+199], N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + N[(-1.0 * N[(N[(b * y), $MachinePrecision] / t$95$4), $MachinePrecision] + N[(a * N[(N[(t + y), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + N[(N[(N[(b * N[(y / t$95$2), $MachinePrecision] + t$95$3), $MachinePrecision] - N[(y * N[(z / t$95$2), $MachinePrecision] + N[(a / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + N[(y * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
t_2 := \left(t + y\right) \cdot \left(t + y\right)\\
t_3 := \frac{z}{t + y}\\
t_4 := t + \left(x + y\right)\\
t_5 := \frac{y}{y + x}\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+145}:\\
\;\;\;\;z + \left(\mathsf{fma}\left(\mathsf{fma}\left(b, t\_1, \frac{a}{y + x}\right) - \mathsf{fma}\left(a, t\_1, \frac{z}{y + x}\right), t, a \cdot t\_5\right) - b \cdot t\_5\right)\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+199}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, \mathsf{fma}\left(-1, \frac{b \cdot y}{t\_4}, a \cdot \frac{t + y}{t\_4}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + \mathsf{fma}\left(\mathsf{fma}\left(b, \frac{y}{t\_2}, t\_3\right) - \mathsf{fma}\left(y, \frac{z}{t\_2}, \frac{a}{t + y}\right), x, y \cdot t\_3\right)\right) - b \cdot \frac{y}{t + y}\\
\end{array}
\end{array}
if y < -1.02e145Initial program 59.7%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
Applied rewrites65.8%
if -1.02e145 < y < 1.80000000000000001e199Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
if 1.80000000000000001e199 < y Initial program 59.7%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites64.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ y (* (+ y x) (+ y x))))
(t_2 (+ t (+ x y)))
(t_3 (/ y (+ y x)))
(t_4
(+
z
(-
(fma
(- (fma b t_1 (/ a (+ y x))) (fma a t_1 (/ z (+ y x))))
t
(* a t_3))
(* b t_3)))))
(if (<= y -1.02e+145)
t_4
(if (<= y 7.5e+159)
(fma
(/ (+ y x) (+ (+ y x) t))
z
(fma -1.0 (/ (* b y) t_2) (* a (/ (+ t y) t_2))))
t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y / ((y + x) * (y + x));
double t_2 = t + (x + y);
double t_3 = y / (y + x);
double t_4 = z + (fma((fma(b, t_1, (a / (y + x))) - fma(a, t_1, (z / (y + x)))), t, (a * t_3)) - (b * t_3));
double tmp;
if (y <= -1.02e+145) {
tmp = t_4;
} else if (y <= 7.5e+159) {
tmp = fma(((y + x) / ((y + x) + t)), z, fma(-1.0, ((b * y) / t_2), (a * ((t + y) / t_2))));
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y / Float64(Float64(y + x) * Float64(y + x))) t_2 = Float64(t + Float64(x + y)) t_3 = Float64(y / Float64(y + x)) t_4 = Float64(z + Float64(fma(Float64(fma(b, t_1, Float64(a / Float64(y + x))) - fma(a, t_1, Float64(z / Float64(y + x)))), t, Float64(a * t_3)) - Float64(b * t_3))) tmp = 0.0 if (y <= -1.02e+145) tmp = t_4; elseif (y <= 7.5e+159) tmp = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, fma(-1.0, Float64(Float64(b * y) / t_2), Float64(a * Float64(Float64(t + y) / t_2)))); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z + N[(N[(N[(N[(b * t$95$1 + N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$1 + N[(z / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(a * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(b * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.02e+145], t$95$4, If[LessEqual[y, 7.5e+159], N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + N[(-1.0 * N[(N[(b * y), $MachinePrecision] / t$95$2), $MachinePrecision] + N[(a * N[(N[(t + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
t_2 := t + \left(x + y\right)\\
t_3 := \frac{y}{y + x}\\
t_4 := z + \left(\mathsf{fma}\left(\mathsf{fma}\left(b, t\_1, \frac{a}{y + x}\right) - \mathsf{fma}\left(a, t\_1, \frac{z}{y + x}\right), t, a \cdot t\_3\right) - b \cdot t\_3\right)\\
\mathbf{if}\;y \leq -1.02 \cdot 10^{+145}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{+159}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, \mathsf{fma}\left(-1, \frac{b \cdot y}{t\_2}, a \cdot \frac{t + y}{t\_2}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if y < -1.02e145 or 7.4999999999999997e159 < y Initial program 59.7%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
Applied rewrites65.8%
if -1.02e145 < y < 7.4999999999999997e159Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (/ (- (+ (* (+ x y) z) t_1) (* y b)) (+ (+ x t) y)))
(t_3 (+ (+ y x) t))
(t_4 (/ (+ y x) t_3))
(t_5 (fma t_4 z (* a (/ (+ t y) (+ t (+ x y)))))))
(if (<= t_2 (- INFINITY))
t_5
(if (<= t_2 1e+300) (fma t_4 z (/ (- t_1 (* b y)) t_3)) t_5))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = ((((x + y) * z) + t_1) - (y * b)) / ((x + t) + y);
double t_3 = (y + x) + t;
double t_4 = (y + x) / t_3;
double t_5 = fma(t_4, z, (a * ((t + y) / (t + (x + y)))));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_2 <= 1e+300) {
tmp = fma(t_4, z, ((t_1 - (b * y)) / t_3));
} else {
tmp = t_5;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / Float64(Float64(x + t) + y)) t_3 = Float64(Float64(y + x) + t) t_4 = Float64(Float64(y + x) / t_3) t_5 = fma(t_4, z, Float64(a * Float64(Float64(t + y) / Float64(t + Float64(x + y))))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_5; elseif (t_2 <= 1e+300) tmp = fma(t_4, z, Float64(Float64(t_1 - Float64(b * y)) / t_3)); else tmp = t_5; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y + x), $MachinePrecision] / t$95$3), $MachinePrecision]}, Block[{t$95$5 = N[(t$95$4 * z + N[(a * N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$5, If[LessEqual[t$95$2, 1e+300], N[(t$95$4 * z + N[(N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], t$95$5]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{\left(x + t\right) + y}\\
t_3 := \left(y + x\right) + t\\
t_4 := \frac{y + x}{t\_3}\\
t_5 := \mathsf{fma}\left(t\_4, z, a \cdot \frac{t + y}{t + \left(x + y\right)}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_2 \leq 10^{+300}:\\
\;\;\;\;\mathsf{fma}\left(t\_4, z, \frac{t\_1 - b \cdot y}{t\_3}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.0000000000000001e300 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
Taylor expanded in a around inf
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f6478.1
Applied rewrites78.1%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e300Initial program 59.7%
Applied rewrites71.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (+ (+ x t) y))
(t_3 (/ (- (+ (* (+ x y) z) t_1) (* y b)) t_2))
(t_4
(fma (/ (+ y x) (+ (+ y x) t)) z (* a (/ (+ t y) (+ t (+ x y)))))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 1e+300) (/ (fma (+ y x) z (- t_1 (* b y))) t_2) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = (x + t) + y;
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2;
double t_4 = fma(((y + x) / ((y + x) + t)), z, (a * ((t + y) / (t + (x + y)))));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= 1e+300) {
tmp = fma((y + x), z, (t_1 - (b * y))) / t_2;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / t_2) t_4 = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, Float64(a * Float64(Float64(t + y) / Float64(t + Float64(x + y))))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= 1e+300) tmp = Float64(fma(Float64(y + x), z, Float64(t_1 - Float64(b * y))) / t_2); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + N[(a * N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, 1e+300], N[(N[(N[(y + x), $MachinePrecision] * z + N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{t\_2}\\
t_4 := \mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, a \cdot \frac{t + y}{t + \left(x + y\right)}\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 10^{+300}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1 - b \cdot y\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.0000000000000001e300 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
Taylor expanded in a around inf
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f6478.1
Applied rewrites78.1%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e300Initial program 59.7%
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y))))
(if (<= y -4.9e+219)
(- (+ a z) b)
(fma
(/ (+ y x) (+ (+ y x) t))
z
(fma -1.0 (/ (* b y) t_1) (* a (/ (+ t y) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double tmp;
if (y <= -4.9e+219) {
tmp = (a + z) - b;
} else {
tmp = fma(((y + x) / ((y + x) + t)), z, fma(-1.0, ((b * y) / t_1), (a * ((t + y) / t_1))));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) tmp = 0.0 if (y <= -4.9e+219) tmp = Float64(Float64(a + z) - b); else tmp = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, fma(-1.0, Float64(Float64(b * y) / t_1), Float64(a * Float64(Float64(t + y) / t_1)))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.9e+219], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + N[(-1.0 * N[(N[(b * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(a * N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
\mathbf{if}\;y \leq -4.9 \cdot 10^{+219}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, \mathsf{fma}\left(-1, \frac{b \cdot y}{t\_1}, a \cdot \frac{t + y}{t\_1}\right)\right)\\
\end{array}
\end{array}
if y < -4.90000000000000003e219Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
if -4.90000000000000003e219 < y Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (+ (+ x t) y))
(t_3 (/ (- (+ (* (+ x y) z) t_1) (* y b)) t_2))
(t_4 (fma 1.0 z (* a (/ (+ t y) (+ t (+ x y)))))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 1e+300) (/ (fma (+ y x) z (- t_1 (* b y))) t_2) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = (x + t) + y;
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2;
double t_4 = fma(1.0, z, (a * ((t + y) / (t + (x + y)))));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= 1e+300) {
tmp = fma((y + x), z, (t_1 - (b * y))) / t_2;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / t_2) t_4 = fma(1.0, z, Float64(a * Float64(Float64(t + y) / Float64(t + Float64(x + y))))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= 1e+300) tmp = Float64(fma(Float64(y + x), z, Float64(t_1 - Float64(b * y))) / t_2); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(1.0 * z + N[(a * N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, 1e+300], N[(N[(N[(y + x), $MachinePrecision] * z + N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{t\_2}\\
t_4 := \mathsf{fma}\left(1, z, a \cdot \frac{t + y}{t + \left(x + y\right)}\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 10^{+300}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1 - b \cdot y\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.0000000000000001e300 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
Taylor expanded in a around inf
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f6478.1
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites64.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e300Initial program 59.7%
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
lower-*.f6459.8
Applied rewrites59.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1))
(t_3 (fma 1.0 z (* a (/ (+ t y) (+ t (+ x y)))))))
(if (<= t_2 -1e+296)
t_3
(if (<= t_2 1e+300)
(/ (fma a t (fma (- (+ a z) b) y (* z x))) t_1)
t_3))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1;
double t_3 = fma(1.0, z, (a * ((t + y) / (t + (x + y)))));
double tmp;
if (t_2 <= -1e+296) {
tmp = t_3;
} else if (t_2 <= 1e+300) {
tmp = fma(a, t, fma(((a + z) - b), y, (z * x))) / t_1;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_3 = fma(1.0, z, Float64(a * Float64(Float64(t + y) / Float64(t + Float64(x + y))))) tmp = 0.0 if (t_2 <= -1e+296) tmp = t_3; elseif (t_2 <= 1e+300) tmp = Float64(fma(a, t, fma(Float64(Float64(a + z) - b), y, Float64(z * x))) / t_1); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(1.0 * z + N[(a * N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+296], t$95$3, If[LessEqual[t$95$2, 1e+300], N[(N[(a * t + N[(N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision] * y + N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \mathsf{fma}\left(1, z, a \cdot \frac{t + y}{t + \left(x + y\right)}\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+296}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{+300}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, \mathsf{fma}\left(\left(a + z\right) - b, y, z \cdot x\right)\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999981e295 or 1.0000000000000001e300 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
Taylor expanded in a around inf
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f6478.1
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites64.9%
if -9.99999999999999981e295 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e300Initial program 59.7%
Taylor expanded in y around 0
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f6459.9
Applied rewrites59.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1)))
(if (<= t_2 -1e+229)
(fma 1.0 z (* a (/ (+ t y) (+ t (+ x y)))))
(if (<= t_2 -1e+52)
(/ (- (fma (+ t y) a (* z y)) (* b y)) (+ t y))
(if (<= t_2 2e+194)
(/ (fma (+ t y) a (* (+ y x) z)) t_1)
(- (+ a z) b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1;
double tmp;
if (t_2 <= -1e+229) {
tmp = fma(1.0, z, (a * ((t + y) / (t + (x + y)))));
} else if (t_2 <= -1e+52) {
tmp = (fma((t + y), a, (z * y)) - (b * y)) / (t + y);
} else if (t_2 <= 2e+194) {
tmp = fma((t + y), a, ((y + x) * z)) / t_1;
} else {
tmp = (a + z) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= -1e+229) tmp = fma(1.0, z, Float64(a * Float64(Float64(t + y) / Float64(t + Float64(x + y))))); elseif (t_2 <= -1e+52) tmp = Float64(Float64(fma(Float64(t + y), a, Float64(z * y)) - Float64(b * y)) / Float64(t + y)); elseif (t_2 <= 2e+194) tmp = Float64(fma(Float64(t + y), a, Float64(Float64(y + x) * z)) / t_1); else tmp = Float64(Float64(a + z) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+229], N[(1.0 * z + N[(a * N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e+52], N[(N[(N[(N[(t + y), $MachinePrecision] * a + N[(z * y), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / N[(t + y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+194], N[(N[(N[(t + y), $MachinePrecision] * a + N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+229}:\\
\;\;\;\;\mathsf{fma}\left(1, z, a \cdot \frac{t + y}{t + \left(x + y\right)}\right)\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{+52}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, z \cdot y\right) - b \cdot y}{t + y}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+194}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, \left(y + x\right) \cdot z\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.9999999999999999e228Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
Taylor expanded in a around inf
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f6478.1
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites64.9%
if -9.9999999999999999e228 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.9999999999999999e51Initial program 59.7%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-+.f6439.7
Applied rewrites39.7%
if -9.9999999999999999e51 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999989e194Initial program 59.7%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6446.9
Applied rewrites46.9%
if 1.99999999999999989e194 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_1)))
(if (<= t_2 (- INFINITY))
(fma 1.0 z (* a (/ (+ t y) (+ t (+ x y)))))
(if (<= t_2 2e+194)
(/ (fma (+ t y) a (* (+ y x) z)) t_1)
(- (+ a z) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = fma(1.0, z, (a * ((t + y) / (t + (x + y)))));
} else if (t_2 <= 2e+194) {
tmp = fma((t + y), a, ((y + x) * z)) / t_1;
} else {
tmp = (a + z) - b;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = fma(1.0, z, Float64(a * Float64(Float64(t + y) / Float64(t + Float64(x + y))))); elseif (t_2 <= 2e+194) tmp = Float64(fma(Float64(t + y), a, Float64(Float64(y + x) * z)) / t_1); else tmp = Float64(Float64(a + z) - b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(1.0 * z + N[(a * N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+194], N[(N[(N[(t + y), $MachinePrecision] * a + N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(1, z, a \cdot \frac{t + y}{t + \left(x + y\right)}\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+194}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, \left(y + x\right) \cdot z\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) - b\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
Taylor expanded in a around inf
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f6478.1
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites64.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.99999999999999989e194Initial program 59.7%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6446.9
Applied rewrites46.9%
if 1.99999999999999989e194 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma 1.0 z (* a (/ (+ t y) (+ t (+ x y)))))))
(if (<= a -6.5e+39)
t_1
(if (<= a 6.2e+96) (fma (/ (+ y x) (+ (+ y x) t)) z a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(1.0, z, (a * ((t + y) / (t + (x + y)))));
double tmp;
if (a <= -6.5e+39) {
tmp = t_1;
} else if (a <= 6.2e+96) {
tmp = fma(((y + x) / ((y + x) + t)), z, a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(1.0, z, Float64(a * Float64(Float64(t + y) / Float64(t + Float64(x + y))))) tmp = 0.0 if (a <= -6.5e+39) tmp = t_1; elseif (a <= 6.2e+96) tmp = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 * z + N[(a * N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.5e+39], t$95$1, If[LessEqual[a, 6.2e+96], N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(1, z, a \cdot \frac{t + y}{t + \left(x + y\right)}\right)\\
\mathbf{if}\;a \leq -6.5 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 6.2 \cdot 10^{+96}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.5000000000000001e39 or 6.1999999999999996e96 < a Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-/.f64N/A
lift-*.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6487.3
Applied rewrites87.3%
Taylor expanded in a around inf
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f6478.1
Applied rewrites78.1%
Taylor expanded in x around inf
Applied rewrites64.9%
if -6.5000000000000001e39 < a < 6.1999999999999996e96Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in t around inf
Applied rewrites65.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (fma -1.0 (/ y (+ t y)) (/ a b)))))
(if (<= b -1e+217)
t_1
(if (<= b 1.5e+80) (fma (/ (+ y x) (+ (+ y x) t)) z a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * fma(-1.0, (y / (t + y)), (a / b));
double tmp;
if (b <= -1e+217) {
tmp = t_1;
} else if (b <= 1.5e+80) {
tmp = fma(((y + x) / ((y + x) + t)), z, a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(b * fma(-1.0, Float64(y / Float64(t + y)), Float64(a / b))) tmp = 0.0 if (b <= -1e+217) tmp = t_1; elseif (b <= 1.5e+80) tmp = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(-1.0 * N[(y / N[(t + y), $MachinePrecision]), $MachinePrecision] + N[(a / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1e+217], t$95$1, If[LessEqual[b, 1.5e+80], N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \mathsf{fma}\left(-1, \frac{y}{t + y}, \frac{a}{b}\right)\\
\mathbf{if}\;b \leq -1 \cdot 10^{+217}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.5 \cdot 10^{+80}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.9999999999999996e216 or 1.49999999999999993e80 < b Initial program 59.7%
Taylor expanded in x around 0
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
lift-+.f6439.7
Applied rewrites39.7%
Taylor expanded in b around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lift-+.f6446.3
Applied rewrites46.3%
Taylor expanded in y around 0
lift-/.f6440.5
Applied rewrites40.5%
if -9.9999999999999996e216 < b < 1.49999999999999993e80Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in t around inf
Applied rewrites65.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -6.2e+30)
t_1
(if (<= y 4.8e+20) (fma (/ (+ y x) (+ (+ y x) t)) z a) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double tmp;
if (y <= -6.2e+30) {
tmp = t_1;
} else if (y <= 4.8e+20) {
tmp = fma(((y + x) / ((y + x) + t)), z, a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -6.2e+30) tmp = t_1; elseif (y <= 4.8e+20) tmp = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -6.2e+30], t$95$1, If[LessEqual[y, 4.8e+20], N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.1999999999999995e30 or 4.8e20 < y Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
if -6.1999999999999995e30 < y < 4.8e20Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in t around inf
Applied rewrites65.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(t_2 (- (+ a z) b)))
(if (<= t_1 -1e+52)
t_2
(if (<= t_1 1e+164) (/ (fma a t (* z x)) (+ t x)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double t_2 = (a + z) - b;
double tmp;
if (t_1 <= -1e+52) {
tmp = t_2;
} else if (t_1 <= 1e+164) {
tmp = fma(a, t, (z * x)) / (t + x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_1 <= -1e+52) tmp = t_2; elseif (t_1 <= 1e+164) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+52], t$95$2, If[LessEqual[t$95$1, 1e+164], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+52}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+164}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.9999999999999999e51 or 1e164 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
if -9.9999999999999999e51 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e164Initial program 59.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6440.3
Applied rewrites40.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.6e+90) (* z (/ x (+ t x))) (if (<= x 4.2e+36) (- (+ a z) b) (+ z (* t (/ (- a z) x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.6e+90) {
tmp = z * (x / (t + x));
} else if (x <= 4.2e+36) {
tmp = (a + z) - b;
} else {
tmp = z + (t * ((a - z) / x));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-1.6d+90)) then
tmp = z * (x / (t + x))
else if (x <= 4.2d+36) then
tmp = (a + z) - b
else
tmp = z + (t * ((a - z) / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.6e+90) {
tmp = z * (x / (t + x));
} else if (x <= 4.2e+36) {
tmp = (a + z) - b;
} else {
tmp = z + (t * ((a - z) / x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.6e+90: tmp = z * (x / (t + x)) elif x <= 4.2e+36: tmp = (a + z) - b else: tmp = z + (t * ((a - z) / x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.6e+90) tmp = Float64(z * Float64(x / Float64(t + x))); elseif (x <= 4.2e+36) tmp = Float64(Float64(a + z) - b); else tmp = Float64(z + Float64(t * Float64(Float64(a - z) / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.6e+90) tmp = z * (x / (t + x)); elseif (x <= 4.2e+36) tmp = (a + z) - b; else tmp = z + (t * ((a - z) / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.6e+90], N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.2e+36], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(z + N[(t * N[(N[(a - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{+90}:\\
\;\;\;\;z \cdot \frac{x}{t + x}\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+36}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z + t \cdot \frac{a - z}{x}\\
\end{array}
\end{array}
if x < -1.59999999999999999e90Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in z around inf
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
Applied rewrites25.4%
Taylor expanded in x around inf
Applied rewrites31.2%
if -1.59999999999999999e90 < x < 4.20000000000000009e36Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
if 4.20000000000000009e36 < x Initial program 59.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6440.3
Applied rewrites40.3%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (/ x (+ t x))))) (if (<= x -1.6e+90) t_1 (if (<= x 3.8e+86) (- (+ a z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x / (t + x));
double tmp;
if (x <= -1.6e+90) {
tmp = t_1;
} else if (x <= 3.8e+86) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (x / (t + x))
if (x <= (-1.6d+90)) then
tmp = t_1
else if (x <= 3.8d+86) then
tmp = (a + z) - b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (x / (t + x));
double tmp;
if (x <= -1.6e+90) {
tmp = t_1;
} else if (x <= 3.8e+86) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (x / (t + x)) tmp = 0 if x <= -1.6e+90: tmp = t_1 elif x <= 3.8e+86: tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(x / Float64(t + x))) tmp = 0.0 if (x <= -1.6e+90) tmp = t_1; elseif (x <= 3.8e+86) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (x / (t + x)); tmp = 0.0; if (x <= -1.6e+90) tmp = t_1; elseif (x <= 3.8e+86) tmp = (a + z) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.6e+90], t$95$1, If[LessEqual[x, 3.8e+86], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x}{t + x}\\
\mathbf{if}\;x \leq -1.6 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.8 \cdot 10^{+86}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.59999999999999999e90 or 3.79999999999999978e86 < x Initial program 59.7%
Applied rewrites71.7%
Taylor expanded in z around inf
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6439.9
Applied rewrites39.9%
Taylor expanded in x around inf
Applied rewrites25.4%
Taylor expanded in x around inf
Applied rewrites31.2%
if -1.59999999999999999e90 < x < 3.79999999999999978e86Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -4.5e+122) z (if (<= x 9e+213) (- (+ a z) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.5e+122) {
tmp = z;
} else if (x <= 9e+213) {
tmp = (a + z) - b;
} else {
tmp = 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 (x <= (-4.5d+122)) then
tmp = z
else if (x <= 9d+213) then
tmp = (a + z) - b
else
tmp = 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 (x <= -4.5e+122) {
tmp = z;
} else if (x <= 9e+213) {
tmp = (a + z) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.5e+122: tmp = z elif x <= 9e+213: tmp = (a + z) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.5e+122) tmp = z; elseif (x <= 9e+213) tmp = Float64(Float64(a + z) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -4.5e+122) tmp = z; elseif (x <= 9e+213) tmp = (a + z) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.5e+122], z, If[LessEqual[x, 9e+213], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+122}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+213}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -4.49999999999999997e122 or 9.0000000000000003e213 < x Initial program 59.7%
Taylor expanded in x around inf
Applied rewrites32.4%
if -4.49999999999999997e122 < x < 9.0000000000000003e213Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3.1e+125) (+ a z) (if (<= a 1.45e+19) (- z b) (+ a z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.1e+125) {
tmp = a + z;
} else if (a <= 1.45e+19) {
tmp = z - b;
} else {
tmp = a + 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 <= (-3.1d+125)) then
tmp = a + z
else if (a <= 1.45d+19) then
tmp = z - b
else
tmp = a + 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 <= -3.1e+125) {
tmp = a + z;
} else if (a <= 1.45e+19) {
tmp = z - b;
} else {
tmp = a + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.1e+125: tmp = a + z elif a <= 1.45e+19: tmp = z - b else: tmp = a + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.1e+125) tmp = Float64(a + z); elseif (a <= 1.45e+19) tmp = Float64(z - b); else tmp = Float64(a + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3.1e+125) tmp = a + z; elseif (a <= 1.45e+19) tmp = z - b; else tmp = a + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.1e+125], N[(a + z), $MachinePrecision], If[LessEqual[a, 1.45e+19], N[(z - b), $MachinePrecision], N[(a + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.1 \cdot 10^{+125}:\\
\;\;\;\;a + z\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+19}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if a < -3.1e125 or 1.45e19 < a Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
Taylor expanded in b around 0
lift-+.f6452.3
Applied rewrites52.3%
if -3.1e125 < a < 1.45e19Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
Taylor expanded in z around inf
Applied rewrites37.8%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.95e+169) (- a b) (if (<= a 1.7e+20) (- z b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.95e+169) {
tmp = a - b;
} else if (a <= 1.7e+20) {
tmp = z - b;
} 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.95d+169)) then
tmp = a - b
else if (a <= 1.7d+20) then
tmp = z - b
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.95e+169) {
tmp = a - b;
} else if (a <= 1.7e+20) {
tmp = z - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.95e+169: tmp = a - b elif a <= 1.7e+20: tmp = z - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.95e+169) tmp = Float64(a - b); elseif (a <= 1.7e+20) tmp = Float64(z - b); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.95e+169) tmp = a - b; elseif (a <= 1.7e+20) tmp = z - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.95e+169], N[(a - b), $MachinePrecision], If[LessEqual[a, 1.7e+20], N[(z - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.95 \cdot 10^{+169}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;a \leq 1.7 \cdot 10^{+20}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -2.95e169Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
Taylor expanded in z around 0
Applied rewrites37.5%
if -2.95e169 < a < 1.7e20Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
Taylor expanded in z around inf
Applied rewrites37.8%
if 1.7e20 < a Initial program 59.7%
Taylor expanded in t around inf
Applied rewrites33.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -9.5e+69) z (if (<= x 0.0052) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -9.5e+69) {
tmp = z;
} else if (x <= 0.0052) {
tmp = a - b;
} else {
tmp = 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 (x <= (-9.5d+69)) then
tmp = z
else if (x <= 0.0052d0) then
tmp = a - b
else
tmp = 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 (x <= -9.5e+69) {
tmp = z;
} else if (x <= 0.0052) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -9.5e+69: tmp = z elif x <= 0.0052: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -9.5e+69) tmp = z; elseif (x <= 0.0052) tmp = Float64(a - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -9.5e+69) tmp = z; elseif (x <= 0.0052) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -9.5e+69], z, If[LessEqual[x, 0.0052], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+69}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 0.0052:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -9.4999999999999995e69 or 0.0051999999999999998 < x Initial program 59.7%
Taylor expanded in x around inf
Applied rewrites32.4%
if -9.4999999999999995e69 < x < 0.0051999999999999998Initial program 59.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6456.2
Applied rewrites56.2%
Taylor expanded in z around 0
Applied rewrites37.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2.4e+167) a (if (<= a 8.7e+14) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2.4e+167) {
tmp = a;
} else if (a <= 8.7e+14) {
tmp = z;
} 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.4d+167)) then
tmp = a
else if (a <= 8.7d+14) then
tmp = z
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.4e+167) {
tmp = a;
} else if (a <= 8.7e+14) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2.4e+167: tmp = a elif a <= 8.7e+14: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2.4e+167) tmp = a; elseif (a <= 8.7e+14) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2.4e+167) tmp = a; elseif (a <= 8.7e+14) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2.4e+167], a, If[LessEqual[a, 8.7e+14], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.4 \cdot 10^{+167}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 8.7 \cdot 10^{+14}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -2.39999999999999999e167 or 8.7e14 < a Initial program 59.7%
Taylor expanded in t around inf
Applied rewrites33.1%
if -2.39999999999999999e167 < a < 8.7e14Initial program 59.7%
Taylor expanded in x around inf
Applied rewrites32.4%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 59.7%
Taylor expanded in t around inf
Applied rewrites33.1%
herbie shell --seed 2025124
(FPCore (x y z t a b)
:name "AI.Clustering.Hierarchical.Internal:ward from clustering-0.2.1"
:precision binary64
(/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))