
(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 22 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 (/ z (+ t y)))
(t_2 (* (+ t y) (+ t y)))
(t_3 (* t_2 (+ t y)))
(t_4 (/ z t_2))
(t_5 (/ y (+ y x)))
(t_6 (/ y (* (+ y x) (+ y x))))
(t_7 (+ t (+ x y))))
(if (<= t -7.5e+82)
(-
(+
(fma
(-
(fma
(- (fma y (/ z t_3) (/ a t_2)) (fma b (/ y t_3) t_4))
x
(fma b (/ y t_2) t_1))
(fma y t_4 (/ a (+ t y))))
x
(* y t_1))
a)
(* b (/ y (+ t y))))
(if (<= t 2.15e-64)
(+
z
(-
(fma
(- (fma b t_6 (/ a (+ y x))) (fma a t_6 (/ z (+ y x))))
t
(* a t_5))
(* b t_5)))
(fma
(/ (+ t y) (+ (+ y x) t))
a
(* b (fma -1.0 (/ y t_7) (/ (* z (+ x y)) (* b t_7)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z / (t + y);
double t_2 = (t + y) * (t + y);
double t_3 = t_2 * (t + y);
double t_4 = z / t_2;
double t_5 = y / (y + x);
double t_6 = y / ((y + x) * (y + x));
double t_7 = t + (x + y);
double tmp;
if (t <= -7.5e+82) {
tmp = (fma((fma((fma(y, (z / t_3), (a / t_2)) - fma(b, (y / t_3), t_4)), x, fma(b, (y / t_2), t_1)) - fma(y, t_4, (a / (t + y)))), x, (y * t_1)) + a) - (b * (y / (t + y)));
} else if (t <= 2.15e-64) {
tmp = z + (fma((fma(b, t_6, (a / (y + x))) - fma(a, t_6, (z / (y + x)))), t, (a * t_5)) - (b * t_5));
} else {
tmp = fma(((t + y) / ((y + x) + t)), a, (b * fma(-1.0, (y / t_7), ((z * (x + y)) / (b * t_7)))));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z / Float64(t + y)) t_2 = Float64(Float64(t + y) * Float64(t + y)) t_3 = Float64(t_2 * Float64(t + y)) t_4 = Float64(z / t_2) t_5 = Float64(y / Float64(y + x)) t_6 = Float64(y / Float64(Float64(y + x) * Float64(y + x))) t_7 = Float64(t + Float64(x + y)) tmp = 0.0 if (t <= -7.5e+82) tmp = Float64(Float64(fma(Float64(fma(Float64(fma(y, Float64(z / t_3), Float64(a / t_2)) - fma(b, Float64(y / t_3), t_4)), x, fma(b, Float64(y / t_2), t_1)) - fma(y, t_4, Float64(a / Float64(t + y)))), x, Float64(y * t_1)) + a) - Float64(b * Float64(y / Float64(t + y)))); elseif (t <= 2.15e-64) tmp = Float64(z + Float64(fma(Float64(fma(b, t_6, Float64(a / Float64(y + x))) - fma(a, t_6, Float64(z / Float64(y + x)))), t, Float64(a * t_5)) - Float64(b * t_5))); else tmp = fma(Float64(Float64(t + y) / Float64(Float64(y + x) + t)), a, Float64(b * fma(-1.0, Float64(y / t_7), Float64(Float64(z * Float64(x + y)) / Float64(b * t_7))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z / N[(t + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(t + y), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 * N[(t + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(z / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$7 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e+82], N[(N[(N[(N[(N[(N[(N[(y * N[(z / t$95$3), $MachinePrecision] + N[(a / t$95$2), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / t$95$3), $MachinePrecision] + t$95$4), $MachinePrecision]), $MachinePrecision] * x + N[(b * N[(y / t$95$2), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision] - N[(y * t$95$4 + N[(a / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + N[(y * t$95$1), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] - N[(b * N[(y / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.15e-64], N[(z + N[(N[(N[(N[(b * t$95$6 + N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$6 + 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], N[(N[(N[(t + y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * a + N[(b * N[(-1.0 * N[(y / t$95$7), $MachinePrecision] + N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(b * t$95$7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{t + y}\\
t_2 := \left(t + y\right) \cdot \left(t + y\right)\\
t_3 := t\_2 \cdot \left(t + y\right)\\
t_4 := \frac{z}{t\_2}\\
t_5 := \frac{y}{y + x}\\
t_6 := \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
t_7 := t + \left(x + y\right)\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{+82}:\\
\;\;\;\;\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, \frac{z}{t\_3}, \frac{a}{t\_2}\right) - \mathsf{fma}\left(b, \frac{y}{t\_3}, t\_4\right), x, \mathsf{fma}\left(b, \frac{y}{t\_2}, t\_1\right)\right) - \mathsf{fma}\left(y, t\_4, \frac{a}{t + y}\right), x, y \cdot t\_1\right) + a\right) - b \cdot \frac{y}{t + y}\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{-64}:\\
\;\;\;\;z + \left(\mathsf{fma}\left(\mathsf{fma}\left(b, t\_6, \frac{a}{y + x}\right) - \mathsf{fma}\left(a, t\_6, \frac{z}{y + x}\right), t, a \cdot t\_5\right) - b \cdot t\_5\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t + y}{\left(y + x\right) + t}, a, b \cdot \mathsf{fma}\left(-1, \frac{y}{t\_7}, \frac{z \cdot \left(x + y\right)}{b \cdot t\_7}\right)\right)\\
\end{array}
\end{array}
if t < -7.4999999999999999e82Initial program 49.3%
Taylor expanded in x around 0
Applied rewrites82.6%
if -7.4999999999999999e82 < t < 2.14999999999999987e-64Initial program 68.3%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
Applied rewrites82.9%
if 2.14999999999999987e-64 < t Initial program 56.1%
Applied rewrites73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6475.1
Applied rewrites75.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) (+ t y)))
(t_2 (/ z (+ t y)))
(t_3 (/ y (+ y x)))
(t_4 (/ y (* (+ y x) (+ y x))))
(t_5 (+ t (+ x y))))
(if (<= t -7.5e+82)
(-
(+
a
(fma
(- (fma b (/ y t_1) t_2) (fma y (/ z t_1) (/ a (+ t y))))
x
(* y t_2)))
(* b (/ y (+ t y))))
(if (<= t 2.15e-64)
(+
z
(-
(fma
(- (fma b t_4 (/ a (+ y x))) (fma a t_4 (/ z (+ y x))))
t
(* a t_3))
(* b t_3)))
(fma
(/ (+ t y) (+ (+ y x) t))
a
(* b (fma -1.0 (/ y t_5) (/ (* z (+ x y)) (* b t_5)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * (t + y);
double t_2 = z / (t + y);
double t_3 = y / (y + x);
double t_4 = y / ((y + x) * (y + x));
double t_5 = t + (x + y);
double tmp;
if (t <= -7.5e+82) {
tmp = (a + fma((fma(b, (y / t_1), t_2) - fma(y, (z / t_1), (a / (t + y)))), x, (y * t_2))) - (b * (y / (t + y)));
} else if (t <= 2.15e-64) {
tmp = z + (fma((fma(b, t_4, (a / (y + x))) - fma(a, t_4, (z / (y + x)))), t, (a * t_3)) - (b * t_3));
} else {
tmp = fma(((t + y) / ((y + x) + t)), a, (b * fma(-1.0, (y / t_5), ((z * (x + y)) / (b * t_5)))));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * Float64(t + y)) t_2 = Float64(z / Float64(t + y)) t_3 = Float64(y / Float64(y + x)) t_4 = Float64(y / Float64(Float64(y + x) * Float64(y + x))) t_5 = Float64(t + Float64(x + y)) tmp = 0.0 if (t <= -7.5e+82) tmp = Float64(Float64(a + fma(Float64(fma(b, Float64(y / t_1), t_2) - fma(y, Float64(z / t_1), Float64(a / Float64(t + y)))), x, Float64(y * t_2))) - Float64(b * Float64(y / Float64(t + y)))); elseif (t <= 2.15e-64) tmp = Float64(z + Float64(fma(Float64(fma(b, t_4, Float64(a / Float64(y + x))) - fma(a, t_4, Float64(z / Float64(y + x)))), t, Float64(a * t_3)) - Float64(b * t_3))); else tmp = fma(Float64(Float64(t + y) / Float64(Float64(y + x) + t)), a, Float64(b * fma(-1.0, Float64(y / t_5), Float64(Float64(z * Float64(x + y)) / Float64(b * t_5))))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * N[(t + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z / N[(t + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -7.5e+82], N[(N[(a + N[(N[(N[(b * N[(y / t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision] - N[(y * N[(z / t$95$1), $MachinePrecision] + N[(a / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x + N[(y * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(b * N[(y / N[(t + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.15e-64], N[(z + N[(N[(N[(N[(b * t$95$4 + N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$4 + 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], N[(N[(N[(t + y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * a + N[(b * N[(-1.0 * N[(y / t$95$5), $MachinePrecision] + N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(b * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot \left(t + y\right)\\
t_2 := \frac{z}{t + y}\\
t_3 := \frac{y}{y + x}\\
t_4 := \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
t_5 := t + \left(x + y\right)\\
\mathbf{if}\;t \leq -7.5 \cdot 10^{+82}:\\
\;\;\;\;\left(a + \mathsf{fma}\left(\mathsf{fma}\left(b, \frac{y}{t\_1}, t\_2\right) - \mathsf{fma}\left(y, \frac{z}{t\_1}, \frac{a}{t + y}\right), x, y \cdot t\_2\right)\right) - b \cdot \frac{y}{t + y}\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{-64}:\\
\;\;\;\;z + \left(\mathsf{fma}\left(\mathsf{fma}\left(b, t\_4, \frac{a}{y + x}\right) - \mathsf{fma}\left(a, t\_4, \frac{z}{y + x}\right), t, a \cdot t\_3\right) - b \cdot t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t + y}{\left(y + x\right) + t}, a, b \cdot \mathsf{fma}\left(-1, \frac{y}{t\_5}, \frac{z \cdot \left(x + y\right)}{b \cdot t\_5}\right)\right)\\
\end{array}
\end{array}
if t < -7.4999999999999999e82Initial program 49.3%
Taylor expanded in x around 0
lower--.f64N/A
Applied rewrites82.8%
if -7.4999999999999999e82 < t < 2.14999999999999987e-64Initial program 68.3%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
Applied rewrites82.9%
if 2.14999999999999987e-64 < t Initial program 56.1%
Applied rewrites73.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6475.1
Applied rewrites75.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (/ y (+ y x)))
(t_3 (/ (- (+ (* (+ x y) z) t_1) (* y b)) (+ (+ x t) y)))
(t_4 (+ (+ y x) t))
(t_5 (/ y (* (+ y x) (+ y x))))
(t_6
(+
z
(-
(fma
(- (fma b t_5 (/ a (+ y x))) (fma a t_5 (/ z (+ y x))))
t
(* a t_2))
(* b t_2)))))
(if (<= t_3 (- INFINITY))
t_6
(if (<= t_3 1e+296)
(fma (/ (+ y x) t_4) z (/ (- t_1 (* b y)) t_4))
t_6))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = y / (y + x);
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / ((x + t) + y);
double t_4 = (y + x) + t;
double t_5 = y / ((y + x) * (y + x));
double t_6 = z + (fma((fma(b, t_5, (a / (y + x))) - fma(a, t_5, (z / (y + x)))), t, (a * t_2)) - (b * t_2));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_6;
} else if (t_3 <= 1e+296) {
tmp = fma(((y + x) / t_4), z, ((t_1 - (b * y)) / t_4));
} else {
tmp = t_6;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(y / Float64(y + x)) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / Float64(Float64(x + t) + y)) t_4 = Float64(Float64(y + x) + t) t_5 = Float64(y / Float64(Float64(y + x) * Float64(y + x))) t_6 = Float64(z + Float64(fma(Float64(fma(b, t_5, Float64(a / Float64(y + x))) - fma(a, t_5, Float64(z / Float64(y + x)))), t, Float64(a * t_2)) - Float64(b * t_2))) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_6; elseif (t_3 <= 1e+296) tmp = fma(Float64(Float64(y + x) / t_4), z, Float64(Float64(t_1 - Float64(b * y)) / t_4)); else tmp = t_6; 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[(y / N[(y + x), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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$4 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$5 = N[(y / N[(N[(y + x), $MachinePrecision] * N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(z + N[(N[(N[(N[(b * t$95$5 + N[(a / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(a * t$95$5 + N[(z / N[(y + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t + N[(a * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(b * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$6, If[LessEqual[t$95$3, 1e+296], N[(N[(N[(y + x), $MachinePrecision] / t$95$4), $MachinePrecision] * z + N[(N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$4), $MachinePrecision]), $MachinePrecision], t$95$6]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \frac{y}{y + x}\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{\left(x + t\right) + y}\\
t_4 := \left(y + x\right) + t\\
t_5 := \frac{y}{\left(y + x\right) \cdot \left(y + x\right)}\\
t_6 := z + \left(\mathsf{fma}\left(\mathsf{fma}\left(b, t\_5, \frac{a}{y + x}\right) - \mathsf{fma}\left(a, t\_5, \frac{z}{y + x}\right), t, a \cdot t\_2\right) - b \cdot t\_2\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_3 \leq 10^{+296}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{t\_4}, z, \frac{t\_1 - b \cdot y}{t\_4}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_6\\
\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 9.99999999999999981e295 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 5.9%
Taylor expanded in t around 0
associate--l+N/A
lower-+.f64N/A
lower--.f64N/A
Applied rewrites73.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)) < 9.99999999999999981e295Initial program 99.6%
Applied rewrites99.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y))) (t_2 (* z (/ (+ x y) t_1))))
(if (<= z -7.5e+146)
t_2
(if (<= z 3.7e+83)
(+
(* (/ (+ t y) (+ (+ y x) t)) a)
(* b (fma -1.0 (/ y t_1) (/ (* z (+ x y)) (* b t_1)))))
t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = z * ((x + y) / t_1);
double tmp;
if (z <= -7.5e+146) {
tmp = t_2;
} else if (z <= 3.7e+83) {
tmp = (((t + y) / ((y + x) + t)) * a) + (b * fma(-1.0, (y / t_1), ((z * (x + y)) / (b * t_1))));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(z * Float64(Float64(x + y) / t_1)) tmp = 0.0 if (z <= -7.5e+146) tmp = t_2; elseif (z <= 3.7e+83) tmp = Float64(Float64(Float64(Float64(t + y) / Float64(Float64(y + x) + t)) * a) + Float64(b * fma(-1.0, Float64(y / t_1), Float64(Float64(z * Float64(x + y)) / Float64(b * t_1))))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e+146], t$95$2, If[LessEqual[z, 3.7e+83], N[(N[(N[(N[(t + y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] + N[(b * N[(-1.0 * N[(y / t$95$1), $MachinePrecision] + N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := z \cdot \frac{x + y}{t\_1}\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+146}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+83}:\\
\;\;\;\;\frac{t + y}{\left(y + x\right) + t} \cdot a + b \cdot \mathsf{fma}\left(-1, \frac{y}{t\_1}, \frac{z \cdot \left(x + y\right)}{b \cdot t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -7.49999999999999983e146 or 3.7000000000000002e83 < z Initial program 40.7%
Applied rewrites47.5%
Taylor expanded in z around inf
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lift-+.f6470.3
Applied rewrites70.3%
if -7.49999999999999983e146 < z < 3.7000000000000002e83Initial program 70.4%
Applied rewrites83.9%
Taylor expanded in b around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6487.7
Applied rewrites87.7%
lift-fma.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lower-+.f64N/A
Applied rewrites87.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ t (+ x y))) (t_2 (* z (/ (+ x y) t_1))))
(if (<= z -7.5e+146)
t_2
(if (<= z 3.7e+83)
(fma
(/ (+ t y) (+ (+ y x) t))
a
(* b (fma -1.0 (/ y t_1) (/ (* z (+ x y)) (* b t_1)))))
t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = z * ((x + y) / t_1);
double tmp;
if (z <= -7.5e+146) {
tmp = t_2;
} else if (z <= 3.7e+83) {
tmp = fma(((t + y) / ((y + x) + t)), a, (b * fma(-1.0, (y / t_1), ((z * (x + y)) / (b * t_1)))));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(z * Float64(Float64(x + y) / t_1)) tmp = 0.0 if (z <= -7.5e+146) tmp = t_2; elseif (z <= 3.7e+83) tmp = fma(Float64(Float64(t + y) / Float64(Float64(y + x) + t)), a, Float64(b * fma(-1.0, Float64(y / t_1), Float64(Float64(z * Float64(x + y)) / Float64(b * t_1))))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(N[(x + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.5e+146], t$95$2, If[LessEqual[z, 3.7e+83], N[(N[(N[(t + y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * a + N[(b * N[(-1.0 * N[(y / t$95$1), $MachinePrecision] + N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] / N[(b * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := z \cdot \frac{x + y}{t\_1}\\
\mathbf{if}\;z \leq -7.5 \cdot 10^{+146}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 3.7 \cdot 10^{+83}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t + y}{\left(y + x\right) + t}, a, b \cdot \mathsf{fma}\left(-1, \frac{y}{t\_1}, \frac{z \cdot \left(x + y\right)}{b \cdot t\_1}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -7.49999999999999983e146 or 3.7000000000000002e83 < z Initial program 40.7%
Applied rewrites47.5%
Taylor expanded in z around inf
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lift-+.f6470.3
Applied rewrites70.3%
if -7.49999999999999983e146 < z < 3.7000000000000002e83Initial program 70.4%
Applied rewrites83.9%
Taylor expanded in b around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6487.7
Applied rewrites87.7%
(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)))
(if (<= t_2 (- INFINITY))
(+ (* (/ (+ t y) t_3) a) (* b (* -1.0 (/ y (+ t (+ x y))))))
(if (<= t_2 1e+140)
(fma (/ (+ y x) t_3) z (/ (- t_1 (* b y)) t_3))
(- (+ a z) b)))))
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 tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = (((t + y) / t_3) * a) + (b * (-1.0 * (y / (t + (x + y)))));
} else if (t_2 <= 1e+140) {
tmp = fma(((y + x) / t_3), z, ((t_1 - (b * y)) / t_3));
} else {
tmp = (a + z) - b;
}
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) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(t + y) / t_3) * a) + Float64(b * Float64(-1.0 * Float64(y / Float64(t + Float64(x + y)))))); elseif (t_2 <= 1e+140) tmp = fma(Float64(Float64(y + x) / t_3), z, Float64(Float64(t_1 - Float64(b * y)) / t_3)); else tmp = Float64(Float64(a + z) - b); 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]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(N[(t + y), $MachinePrecision] / t$95$3), $MachinePrecision] * a), $MachinePrecision] + N[(b * N[(-1.0 * N[(y / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+140], N[(N[(N[(y + x), $MachinePrecision] / t$95$3), $MachinePrecision] * z + N[(N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]]
\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\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\frac{t + y}{t\_3} \cdot a + b \cdot \left(-1 \cdot \frac{y}{t + \left(x + y\right)}\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{t\_3}, z, \frac{t\_1 - b \cdot y}{t\_3}\right)\\
\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 6.1%
Applied rewrites39.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6455.3
Applied rewrites55.3%
lift-fma.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lower-+.f64N/A
Applied rewrites55.3%
Taylor expanded in z around 0
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f6459.5
Applied rewrites59.5%
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.00000000000000006e140Initial program 99.5%
Applied rewrites99.0%
if 1.00000000000000006e140 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 25.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.4
Applied rewrites70.4%
(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 (+ (+ y x) t)))
(if (<= t_1 (- INFINITY))
(+ (* (/ (+ t y) t_2) a) (* b (* -1.0 (/ y (+ t (+ x y))))))
(if (<= t_1 1e+140)
(- (/ (fma (+ t y) a (* (+ y x) z)) t_2) (* b (/ y t_2)))
(- (+ a z) b)))))
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 = (y + x) + t;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (((t + y) / t_2) * a) + (b * (-1.0 * (y / (t + (x + y)))));
} else if (t_1 <= 1e+140) {
tmp = (fma((t + y), a, ((y + x) * z)) / t_2) - (b * (y / t_2));
} else {
tmp = (a + z) - b;
}
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(y + x) + t) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(t + y) / t_2) * a) + Float64(b * Float64(-1.0 * Float64(y / Float64(t + Float64(x + y)))))); elseif (t_1 <= 1e+140) tmp = Float64(Float64(fma(Float64(t + y), a, Float64(Float64(y + x) * z)) / t_2) - Float64(b * Float64(y / t_2))); else tmp = Float64(Float64(a + z) - b); 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[(y + x), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(t + y), $MachinePrecision] / t$95$2), $MachinePrecision] * a), $MachinePrecision] + N[(b * N[(-1.0 * N[(y / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+140], N[(N[(N[(N[(t + y), $MachinePrecision] * a + N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] - N[(b * N[(y / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]]
\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(y + x\right) + t\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{t + y}{t\_2} \cdot a + b \cdot \left(-1 \cdot \frac{y}{t + \left(x + y\right)}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+140}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, \left(y + x\right) \cdot z\right)}{t\_2} - b \cdot \frac{y}{t\_2}\\
\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 6.1%
Applied rewrites39.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6455.3
Applied rewrites55.3%
lift-fma.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lower-+.f64N/A
Applied rewrites55.3%
Taylor expanded in z around 0
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f6459.5
Applied rewrites59.5%
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.00000000000000006e140Initial program 99.5%
Applied rewrites98.1%
if 1.00000000000000006e140 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 25.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.4
Applied rewrites70.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
(if (<= t_1 (- INFINITY))
(+ (* (/ (+ t y) (+ (+ y x) t)) a) (* b (* -1.0 (/ y (+ t (+ x y))))))
(if (<= t_1 1e+140) t_1 (- (+ a z) b)))))
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 tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (((t + y) / ((y + x) + t)) * a) + (b * (-1.0 * (y / (t + (x + y)))));
} else if (t_1 <= 1e+140) {
tmp = t_1;
} else {
tmp = (a + z) - b;
}
return tmp;
}
public static 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 tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (((t + y) / ((y + x) + t)) * a) + (b * (-1.0 * (y / (t + (x + y)))));
} else if (t_1 <= 1e+140) {
tmp = t_1;
} else {
tmp = (a + z) - b;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y) tmp = 0 if t_1 <= -math.inf: tmp = (((t + y) / ((y + x) + t)) * a) + (b * (-1.0 * (y / (t + (x + y))))) elif t_1 <= 1e+140: tmp = t_1 else: tmp = (a + z) - b 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)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(Float64(Float64(t + y) / Float64(Float64(y + x) + t)) * a) + Float64(b * Float64(-1.0 * Float64(y / Float64(t + Float64(x + y)))))); elseif (t_1 <= 1e+140) tmp = t_1; else tmp = Float64(Float64(a + z) - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); tmp = 0.0; if (t_1 <= -Inf) tmp = (((t + y) / ((y + x) + t)) * a) + (b * (-1.0 * (y / (t + (x + y))))); elseif (t_1 <= 1e+140) tmp = t_1; else tmp = (a + z) - b; end tmp_2 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(N[(t + y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * a), $MachinePrecision] + N[(b * N[(-1.0 * N[(y / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+140], t$95$1, N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]
\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}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{t + y}{\left(y + x\right) + t} \cdot a + b \cdot \left(-1 \cdot \frac{y}{t + \left(x + y\right)}\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+140}:\\
\;\;\;\;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 6.1%
Applied rewrites39.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6455.3
Applied rewrites55.3%
lift-fma.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lower-+.f64N/A
Applied rewrites55.3%
Taylor expanded in z around 0
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f6459.5
Applied rewrites59.5%
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.00000000000000006e140Initial program 99.5%
if 1.00000000000000006e140 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 25.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.4
Applied rewrites70.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y))))
(if (<= t_1 (- INFINITY))
(fma (/ (+ t y) (+ (+ y x) t)) a (* b (* -1.0 (/ y (+ t (+ x y))))))
(if (<= t_1 1e+140) t_1 (- (+ a z) b)))))
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 tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = fma(((t + y) / ((y + x) + t)), a, (b * (-1.0 * (y / (t + (x + y))))));
} else if (t_1 <= 1e+140) {
tmp = t_1;
} else {
tmp = (a + z) - b;
}
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)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = fma(Float64(Float64(t + y) / Float64(Float64(y + x) + t)), a, Float64(b * Float64(-1.0 * Float64(y / Float64(t + Float64(x + y)))))); elseif (t_1 <= 1e+140) tmp = 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[(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]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(N[(t + y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * a + N[(b * N[(-1.0 * N[(y / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+140], t$95$1, N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]]]]
\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}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{t + y}{\left(y + x\right) + t}, a, b \cdot \left(-1 \cdot \frac{y}{t + \left(x + y\right)}\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+140}:\\
\;\;\;\;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 6.1%
Applied rewrites39.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lift-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6455.3
Applied rewrites55.3%
Taylor expanded in z around 0
lower-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f6459.5
Applied rewrites59.5%
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.00000000000000006e140Initial program 99.5%
if 1.00000000000000006e140 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 25.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.4
Applied rewrites70.4%
(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 (- INFINITY)) t_2 (if (<= t_1 1e+140) t_1 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 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 1e+140) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
public static 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 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 1e+140) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y) t_2 = (a + z) - b tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 1e+140: tmp = t_1 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 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 1e+140) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); t_2 = (a + z) - b; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 1e+140) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(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, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 1e+140], t$95$1, 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 -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+140}:\\
\;\;\;\;t\_1\\
\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)) < -inf.0 or 1.00000000000000006e140 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 18.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6470.0
Applied rewrites70.0%
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.00000000000000006e140Initial program 99.5%
(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 (- (+ a z) b)))
(if (<= t_2 -2e+117)
t_3
(if (<= t_2 1e+140) (/ (fma (+ t y) a (* (+ y x) z)) 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 = (a + z) - b;
double tmp;
if (t_2 <= -2e+117) {
tmp = t_3;
} else if (t_2 <= 1e+140) {
tmp = fma((t + y), a, ((y + x) * z)) / 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 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_2 <= -2e+117) tmp = t_3; elseif (t_2 <= 1e+140) tmp = Float64(fma(Float64(t + y), a, Float64(Float64(y + x) * z)) / 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[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+117], t$95$3, If[LessEqual[t$95$2, 1e+140], N[(N[(N[(t + y), $MachinePrecision] * a + N[(N[(y + x), $MachinePrecision] * z), $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 := \left(a + z\right) - b\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+117}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 10^{+140}:\\
\;\;\;\;\frac{\mathsf{fma}\left(t + y, a, \left(y + x\right) \cdot z\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)) < -2.0000000000000001e117 or 1.00000000000000006e140 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 30.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6469.0
Applied rewrites69.0%
if -2.0000000000000001e117 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000006e140Initial program 99.5%
Taylor expanded in b around 0
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f6477.7
Applied rewrites77.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -4.2e+60)
t_1
(if (<= y 3.6e+117) (fma (/ (+ t y) (+ (+ y x) t)) a z) 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 <= -4.2e+60) {
tmp = t_1;
} else if (y <= 3.6e+117) {
tmp = fma(((t + y) / ((y + x) + t)), a, z);
} 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 <= -4.2e+60) tmp = t_1; elseif (y <= 3.6e+117) tmp = fma(Float64(Float64(t + y) / Float64(Float64(y + x) + t)), a, z); 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, -4.2e+60], t$95$1, If[LessEqual[y, 3.6e+117], N[(N[(N[(t + y), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * a + z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+117}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t + y}{\left(y + x\right) + t}, a, z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.2000000000000002e60 or 3.60000000000000013e117 < y Initial program 34.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6476.4
Applied rewrites76.4%
if -4.2000000000000002e60 < y < 3.60000000000000013e117Initial program 76.2%
Applied rewrites86.1%
Taylor expanded in x around inf
Applied rewrites65.8%
(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 -5e+110)
t_2
(if (<= t_1 1e+140) (/ (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 <= -5e+110) {
tmp = t_2;
} else if (t_1 <= 1e+140) {
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 <= -5e+110) tmp = t_2; elseif (t_1 <= 1e+140) 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, -5e+110], t$95$2, If[LessEqual[t$95$1, 1e+140], 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 -5 \cdot 10^{+110}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+140}:\\
\;\;\;\;\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)) < -4.99999999999999978e110 or 1.00000000000000006e140 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 31.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6468.7
Applied rewrites68.7%
if -4.99999999999999978e110 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.00000000000000006e140Initial program 99.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6460.7
Applied rewrites60.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.25e+153) (+ a (* x (/ (- z a) t))) (if (<= t 5.8e+230) (- (+ a z) b) (* a (/ t (+ t x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.25e+153) {
tmp = a + (x * ((z - a) / t));
} else if (t <= 5.8e+230) {
tmp = (a + z) - b;
} else {
tmp = a * (t / (t + x));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-1.25d+153)) then
tmp = a + (x * ((z - a) / t))
else if (t <= 5.8d+230) then
tmp = (a + z) - b
else
tmp = a * (t / (t + x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.25e+153) {
tmp = a + (x * ((z - a) / t));
} else if (t <= 5.8e+230) {
tmp = (a + z) - b;
} else {
tmp = a * (t / (t + x));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.25e+153: tmp = a + (x * ((z - a) / t)) elif t <= 5.8e+230: tmp = (a + z) - b else: tmp = a * (t / (t + x)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.25e+153) tmp = Float64(a + Float64(x * Float64(Float64(z - a) / t))); elseif (t <= 5.8e+230) tmp = Float64(Float64(a + z) - b); else tmp = Float64(a * Float64(t / Float64(t + x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1.25e+153) tmp = a + (x * ((z - a) / t)); elseif (t <= 5.8e+230) tmp = (a + z) - b; else tmp = a * (t / (t + x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.25e+153], N[(a + N[(x * N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.8e+230], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.25 \cdot 10^{+153}:\\
\;\;\;\;a + x \cdot \frac{z - a}{t}\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+230}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a \cdot \frac{t}{t + x}\\
\end{array}
\end{array}
if t < -1.25000000000000005e153Initial program 46.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6434.2
Applied rewrites34.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6461.6
Applied rewrites61.6%
if -1.25000000000000005e153 < t < 5.7999999999999998e230Initial program 65.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6458.5
Applied rewrites58.5%
if 5.7999999999999998e230 < t Initial program 41.0%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites32.3%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6437.9
Applied rewrites37.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6464.2
Applied rewrites64.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* a (/ t (+ t x))))) (if (<= t -1.25e+153) t_1 (if (<= t 5.8e+230) (- (+ a z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t / (t + x));
double tmp;
if (t <= -1.25e+153) {
tmp = t_1;
} else if (t <= 5.8e+230) {
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 = a * (t / (t + x))
if (t <= (-1.25d+153)) then
tmp = t_1
else if (t <= 5.8d+230) 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 = a * (t / (t + x));
double tmp;
if (t <= -1.25e+153) {
tmp = t_1;
} else if (t <= 5.8e+230) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t / (t + x)) tmp = 0 if t <= -1.25e+153: tmp = t_1 elif t <= 5.8e+230: tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t / Float64(t + x))) tmp = 0.0 if (t <= -1.25e+153) tmp = t_1; elseif (t <= 5.8e+230) 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 = a * (t / (t + x)); tmp = 0.0; if (t <= -1.25e+153) tmp = t_1; elseif (t <= 5.8e+230) 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[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.25e+153], t$95$1, If[LessEqual[t, 5.8e+230], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \frac{t}{t + x}\\
\mathbf{if}\;t \leq -1.25 \cdot 10^{+153}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 5.8 \cdot 10^{+230}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.25000000000000005e153 or 5.7999999999999998e230 < t Initial program 44.8%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites36.5%
Taylor expanded in a around inf
lower-*.f64N/A
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lift-+.f6438.8
Applied rewrites38.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6459.0
Applied rewrites59.0%
if -1.25000000000000005e153 < t < 5.7999999999999998e230Initial program 65.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6458.5
Applied rewrites58.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (/ x (+ t x))))) (if (<= x -2.45e+114) t_1 (if (<= x 8e+217) (- (+ 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 <= -2.45e+114) {
tmp = t_1;
} else if (x <= 8e+217) {
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 <= (-2.45d+114)) then
tmp = t_1
else if (x <= 8d+217) 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 <= -2.45e+114) {
tmp = t_1;
} else if (x <= 8e+217) {
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 <= -2.45e+114: tmp = t_1 elif x <= 8e+217: 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 <= -2.45e+114) tmp = t_1; elseif (x <= 8e+217) 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 <= -2.45e+114) tmp = t_1; elseif (x <= 8e+217) 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, -2.45e+114], t$95$1, If[LessEqual[x, 8e+217], 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 -2.45 \cdot 10^{+114}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+217}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.45e114 or 7.99999999999999968e217 < x Initial program 46.6%
Applied rewrites56.3%
Taylor expanded in z around inf
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lift-+.f6457.4
Applied rewrites57.4%
Taylor expanded in x around inf
Applied rewrites52.6%
Taylor expanded in x around inf
Applied rewrites56.5%
if -2.45e114 < x < 7.99999999999999968e217Initial program 65.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6458.6
Applied rewrites58.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -1.35e+153) a (if (<= t 6e+224) (- (+ a z) b) (+ a z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1.35e+153) {
tmp = a;
} else if (t <= 6e+224) {
tmp = (a + 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 (t <= (-1.35d+153)) then
tmp = a
else if (t <= 6d+224) then
tmp = (a + 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 (t <= -1.35e+153) {
tmp = a;
} else if (t <= 6e+224) {
tmp = (a + z) - b;
} else {
tmp = a + z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1.35e+153: tmp = a elif t <= 6e+224: tmp = (a + z) - b else: tmp = a + z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1.35e+153) tmp = a; elseif (t <= 6e+224) tmp = Float64(Float64(a + 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 (t <= -1.35e+153) tmp = a; elseif (t <= 6e+224) tmp = (a + z) - b; else tmp = a + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1.35e+153], a, If[LessEqual[t, 6e+224], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], N[(a + z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.35 \cdot 10^{+153}:\\
\;\;\;\;a\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+224}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if t < -1.35e153Initial program 46.6%
Taylor expanded in t around inf
Applied rewrites53.4%
if -1.35e153 < t < 6.0000000000000002e224Initial program 65.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6458.5
Applied rewrites58.5%
if 6.0000000000000002e224 < t Initial program 40.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6435.4
Applied rewrites35.4%
Taylor expanded in b around 0
lift-+.f6447.1
Applied rewrites47.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -5e+198) (- a b) (if (<= b 1.8e+90) (+ a z) (- z b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5e+198) {
tmp = a - b;
} else if (b <= 1.8e+90) {
tmp = a + z;
} else {
tmp = z - b;
}
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 <= (-5d+198)) then
tmp = a - b
else if (b <= 1.8d+90) then
tmp = a + z
else
tmp = z - b
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 <= -5e+198) {
tmp = a - b;
} else if (b <= 1.8e+90) {
tmp = a + z;
} else {
tmp = z - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -5e+198: tmp = a - b elif b <= 1.8e+90: tmp = a + z else: tmp = z - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5e+198) tmp = Float64(a - b); elseif (b <= 1.8e+90) tmp = Float64(a + z); else tmp = Float64(z - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -5e+198) tmp = a - b; elseif (b <= 1.8e+90) tmp = a + z; else tmp = z - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5e+198], N[(a - b), $MachinePrecision], If[LessEqual[b, 1.8e+90], N[(a + z), $MachinePrecision], N[(z - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+198}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+90}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;z - b\\
\end{array}
\end{array}
if b < -5.00000000000000049e198Initial program 46.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6440.3
Applied rewrites40.3%
Taylor expanded in z around 0
Applied rewrites35.8%
if -5.00000000000000049e198 < b < 1.8e90Initial program 64.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6459.4
Applied rewrites59.4%
Taylor expanded in b around 0
lift-+.f6457.8
Applied rewrites57.8%
if 1.8e90 < b Initial program 54.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6440.8
Applied rewrites40.8%
Taylor expanded in z around inf
Applied rewrites30.8%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3.8e+30) a (if (<= a 3700000000.0) (- z b) (- a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.8e+30) {
tmp = a;
} else if (a <= 3700000000.0) {
tmp = z - b;
} else {
tmp = a - b;
}
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.8d+30)) then
tmp = a
else if (a <= 3700000000.0d0) then
tmp = z - b
else
tmp = a - b
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.8e+30) {
tmp = a;
} else if (a <= 3700000000.0) {
tmp = z - b;
} else {
tmp = a - b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.8e+30: tmp = a elif a <= 3700000000.0: tmp = z - b else: tmp = a - b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.8e+30) tmp = a; elseif (a <= 3700000000.0) tmp = Float64(z - b); else tmp = Float64(a - b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3.8e+30) tmp = a; elseif (a <= 3700000000.0) tmp = z - b; else tmp = a - b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.8e+30], a, If[LessEqual[a, 3700000000.0], N[(z - b), $MachinePrecision], N[(a - b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.8 \cdot 10^{+30}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 3700000000:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a - b\\
\end{array}
\end{array}
if a < -3.8000000000000001e30Initial program 46.9%
Taylor expanded in t around inf
Applied rewrites49.1%
if -3.8000000000000001e30 < a < 3.7e9Initial program 73.2%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6450.8
Applied rewrites50.8%
Taylor expanded in z around inf
Applied rewrites46.1%
if 3.7e9 < a Initial program 49.1%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6459.0
Applied rewrites59.0%
Taylor expanded in z around 0
Applied rewrites50.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7.2e-19) z (if (<= x 3.7e+170) (- a b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.2e-19) {
tmp = z;
} else if (x <= 3.7e+170) {
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 <= (-7.2d-19)) then
tmp = z
else if (x <= 3.7d+170) 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 <= -7.2e-19) {
tmp = z;
} else if (x <= 3.7e+170) {
tmp = a - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7.2e-19: tmp = z elif x <= 3.7e+170: tmp = a - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.2e-19) tmp = z; elseif (x <= 3.7e+170) 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 <= -7.2e-19) tmp = z; elseif (x <= 3.7e+170) tmp = a - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.2e-19], z, If[LessEqual[x, 3.7e+170], N[(a - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.2 \cdot 10^{-19}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 3.7 \cdot 10^{+170}:\\
\;\;\;\;a - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -7.2000000000000002e-19 or 3.69999999999999987e170 < x Initial program 52.7%
Taylor expanded in x around inf
Applied rewrites46.5%
if -7.2000000000000002e-19 < x < 3.69999999999999987e170Initial program 66.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6460.5
Applied rewrites60.5%
Taylor expanded in z around 0
Applied rewrites46.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.1e-50) a (if (<= a 2100.0) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.1e-50) {
tmp = a;
} else if (a <= 2100.0) {
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 <= (-1.1d-50)) then
tmp = a
else if (a <= 2100.0d0) 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 <= -1.1e-50) {
tmp = a;
} else if (a <= 2100.0) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.1e-50: tmp = a elif a <= 2100.0: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.1e-50) tmp = a; elseif (a <= 2100.0) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.1e-50) tmp = a; elseif (a <= 2100.0) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.1e-50], a, If[LessEqual[a, 2100.0], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.1 \cdot 10^{-50}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 2100:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.0999999999999999e-50 or 2100 < a Initial program 51.1%
Taylor expanded in t around inf
Applied rewrites46.4%
if -1.0999999999999999e-50 < a < 2100Initial program 73.4%
Taylor expanded in x around inf
Applied rewrites41.8%
(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 61.2%
Taylor expanded in t around inf
Applied rewrites32.6%
herbie shell --seed 2025117
(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)))