
(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 18 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 (+ t (+ x y)))
(t_2 (/ (+ y x) (+ (+ y x) t)))
(t_3 (/ (+ t y) t_1))
(t_4 (fma t_2 z (* a (fma -1.0 (* (/ b a) (/ y t_1)) t_3)))))
(if (<= a -2.3e-32)
t_4
(if (<= a 2.2e-30)
(fma t_2 z (fma -1.0 (/ (* b y) t_1) (* a t_3)))
t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t + (x + y);
double t_2 = (y + x) / ((y + x) + t);
double t_3 = (t + y) / t_1;
double t_4 = fma(t_2, z, (a * fma(-1.0, ((b / a) * (y / t_1)), t_3)));
double tmp;
if (a <= -2.3e-32) {
tmp = t_4;
} else if (a <= 2.2e-30) {
tmp = fma(t_2, z, fma(-1.0, ((b * y) / t_1), (a * t_3)));
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t + Float64(x + y)) t_2 = Float64(Float64(y + x) / Float64(Float64(y + x) + t)) t_3 = Float64(Float64(t + y) / t_1) t_4 = fma(t_2, z, Float64(a * fma(-1.0, Float64(Float64(b / a) * Float64(y / t_1)), t_3))) tmp = 0.0 if (a <= -2.3e-32) tmp = t_4; elseif (a <= 2.2e-30) tmp = fma(t_2, z, fma(-1.0, Float64(Float64(b * y) / t_1), Float64(a * t_3))); else tmp = t_4; 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[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$2 * z + N[(a * N[(-1.0 * N[(N[(b / a), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.3e-32], t$95$4, If[LessEqual[a, 2.2e-30], N[(t$95$2 * z + N[(-1.0 * N[(N[(b * y), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(a * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := \frac{y + x}{\left(y + x\right) + t}\\
t_3 := \frac{t + y}{t\_1}\\
t_4 := \mathsf{fma}\left(t\_2, z, a \cdot \mathsf{fma}\left(-1, \frac{b}{a} \cdot \frac{y}{t\_1}, t\_3\right)\right)\\
\mathbf{if}\;a \leq -2.3 \cdot 10^{-32}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;a \leq 2.2 \cdot 10^{-30}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, z, \mathsf{fma}\left(-1, \frac{b \cdot y}{t\_1}, a \cdot t\_3\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if a < -2.3000000000000001e-32 or 2.19999999999999983e-30 < a Initial program 50.7%
Applied rewrites59.4%
Taylor expanded in a around inf
lower-*.f64N/A
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-+.f6486.7
Applied rewrites86.7%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift-+.f64N/A
lift-+.f6499.2
Applied rewrites99.2%
if -2.3000000000000001e-32 < a < 2.19999999999999983e-30Initial program 70.9%
Applied rewrites86.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-+.f6486.9
Applied rewrites86.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)) (t_2 (+ t (+ x y))))
(if (<= y -6.8e+127)
t_1
(if (<= y 2.05e+179)
(fma
(/ (+ y x) (+ (+ y x) t))
z
(fma -1.0 (/ (* b y) t_2) (* a (/ (+ t y) t_2))))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double t_2 = t + (x + y);
double tmp;
if (y <= -6.8e+127) {
tmp = t_1;
} else if (y <= 2.05e+179) {
tmp = fma(((y + x) / ((y + x) + t)), z, fma(-1.0, ((b * y) / t_2), (a * ((t + y) / t_2))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) t_2 = Float64(t + Float64(x + y)) tmp = 0.0 if (y <= -6.8e+127) tmp = t_1; elseif (y <= 2.05e+179) 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_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, Block[{t$95$2 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.8e+127], t$95$1, If[LessEqual[y, 2.05e+179], 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$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
t_2 := t + \left(x + y\right)\\
\mathbf{if}\;y \leq -6.8 \cdot 10^{+127}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{+179}:\\
\;\;\;\;\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\_1\\
\end{array}
\end{array}
if y < -6.79999999999999955e127 or 2.05000000000000005e179 < y Initial program 28.6%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6483.8
Applied rewrites83.8%
if -6.79999999999999955e127 < y < 2.05000000000000005e179Initial program 70.7%
Applied rewrites82.0%
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-+.f6495.1
Applied rewrites95.1%
(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))
(t_3 (fma (/ (+ y x) t_2) z (* a (/ (+ t y) (+ t (+ x y)))))))
(if (<= t_1 (- INFINITY))
t_3
(if (<= t_1 2e+276)
(fma (/ (+ t y) t_2) a (/ (- (* (+ y x) z) (* b y)) t_2))
t_3))))
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 t_3 = fma(((y + x) / t_2), z, (a * ((t + y) / (t + (x + y)))));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_1 <= 2e+276) {
tmp = fma(((t + y) / t_2), a, ((((y + x) * z) - (b * y)) / t_2));
} else {
tmp = t_3;
}
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) t_3 = fma(Float64(Float64(y + x) / t_2), z, Float64(a * Float64(Float64(t + y) / Float64(t + Float64(x + y))))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_3; elseif (t_1 <= 2e+276) tmp = fma(Float64(Float64(t + y) / t_2), a, Float64(Float64(Float64(Float64(y + x) * z) - Float64(b * y)) / t_2)); else tmp = t_3; 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]}, Block[{t$95$3 = N[(N[(N[(y + x), $MachinePrecision] / t$95$2), $MachinePrecision] * z + N[(a * N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$3, If[LessEqual[t$95$1, 2e+276], N[(N[(N[(t + y), $MachinePrecision] / t$95$2), $MachinePrecision] * a + N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\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\\
t_3 := \mathsf{fma}\left(\frac{y + x}{t\_2}, z, a \cdot \frac{t + y}{t + \left(x + y\right)}\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+276}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t + y}{t\_2}, a, \frac{\left(y + x\right) \cdot z - b \cdot y}{t\_2}\right)\\
\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)) < -inf.0 or 2.0000000000000001e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.5%
Applied rewrites34.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-+.f6471.1
Applied rewrites71.1%
Taylor expanded in a around inf
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f6479.2
Applied rewrites79.2%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e276Initial program 99.5%
Applied rewrites99.4%
(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 (/ (+ y x) (+ (+ y x) t)) z (* a (/ (+ t y) (+ t (+ x y)))))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 2e+276)
(/ (fma a t (fma (+ a (+ z (* -1.0 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(((y + x) / ((y + x) + t)), z, (a * ((t + y) / (t + (x + y)))));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 2e+276) {
tmp = fma(a, t, fma((a + (z + (-1.0 * 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(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_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 2e+276) tmp = Float64(fma(a, t, fma(Float64(a + Float64(z + Float64(-1.0 * 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[(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$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 2e+276], N[(N[(a * t + N[(N[(a + N[(z + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision]), $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(\frac{y + x}{\left(y + x\right) + t}, z, a \cdot \frac{t + y}{t + \left(x + y\right)}\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+276}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, \mathsf{fma}\left(a + \left(z + -1 \cdot b\right), 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)) < -inf.0 or 2.0000000000000001e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.5%
Applied rewrites34.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-+.f6471.1
Applied rewrites71.1%
Taylor expanded in a around inf
div-add-revN/A
lift-+.f64N/A
lift-+.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-*.f6479.2
Applied rewrites79.2%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e276Initial program 99.5%
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-*.f6499.5
Applied rewrites99.5%
Taylor expanded in b around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f6499.5
Applied rewrites99.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)))
(if (<= t_2 (- INFINITY))
(fma (/ (+ y x) (+ (+ y x) t)) z a)
(if (<= t_2 2e+276)
(/ (fma a t (fma (+ a (+ z (* -1.0 b))) y (* z x))) 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(((y + x) / ((y + x) + t)), z, a);
} else if (t_2 <= 2e+276) {
tmp = fma(a, t, fma((a + (z + (-1.0 * b))), y, (z * x))) / 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(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, a); elseif (t_2 <= 2e+276) tmp = Float64(fma(a, t, fma(Float64(a + Float64(z + Float64(-1.0 * b))), y, Float64(z * x))) / 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[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + a), $MachinePrecision], If[LessEqual[t$95$2, 2e+276], N[(N[(a * t + N[(N[(a + N[(z + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y + N[(z * x), $MachinePrecision]), $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(\frac{y + x}{\left(y + x\right) + t}, z, a\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+276}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, \mathsf{fma}\left(a + \left(z + -1 \cdot b\right), y, z \cdot x\right)\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 6.2%
Applied rewrites38.8%
Taylor expanded in t around inf
Applied rewrites72.4%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e276Initial program 99.5%
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-*.f6499.5
Applied rewrites99.5%
Taylor expanded in b around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f6499.5
Applied rewrites99.5%
if 2.0000000000000001e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6472.6
Applied rewrites72.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b))
(t_2 (+ (+ x t) y))
(t_3 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_2)))
(if (<= t_3 (- INFINITY))
(fma (/ (+ y x) (+ (+ y x) t)) z a)
(if (<= t_3 2e+276) (/ (fma a t (fma t_1 y (* z x))) t_2) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - b;
double t_2 = (x + t) + y;
double t_3 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_2;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = fma(((y + x) / ((y + x) + t)), z, a);
} else if (t_3 <= 2e+276) {
tmp = fma(a, t, fma(t_1, y, (z * x))) / t_2;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_2) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, a); elseif (t_3 <= 2e+276) tmp = Float64(fma(a, t, fma(t_1, y, Float64(z * x))) / t_2); 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]}, 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] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + a), $MachinePrecision], If[LessEqual[t$95$3, 2e+276], N[(N[(a * t + N[(t$95$1 * y + N[(z * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_2}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, a\right)\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+276}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, \mathsf{fma}\left(t\_1, y, z \cdot x\right)\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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.2%
Applied rewrites38.8%
Taylor expanded in t around inf
Applied rewrites72.4%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 2.0000000000000001e276Initial program 99.5%
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-*.f6499.5
Applied rewrites99.5%
if 2.0000000000000001e276 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 6.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6472.6
Applied rewrites72.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t)) (t_2 (- (+ a z) b)))
(if (<= y -1.35e+85)
t_2
(if (<= y 2e-113)
(fma (/ (+ y x) t_1) z (* a (/ t (+ t x))))
(if (<= y 8.6e+31)
(fma 1.0 z (/ (- (* (+ t y) a) (* b y)) t_1))
(if (<= y 6.6e+175) (- a (* b (/ y t_1))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = (a + z) - b;
double tmp;
if (y <= -1.35e+85) {
tmp = t_2;
} else if (y <= 2e-113) {
tmp = fma(((y + x) / t_1), z, (a * (t / (t + x))));
} else if (y <= 8.6e+31) {
tmp = fma(1.0, z, ((((t + y) * a) - (b * y)) / t_1));
} else if (y <= 6.6e+175) {
tmp = a - (b * (y / t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -1.35e+85) tmp = t_2; elseif (y <= 2e-113) tmp = fma(Float64(Float64(y + x) / t_1), z, Float64(a * Float64(t / Float64(t + x)))); elseif (y <= 8.6e+31) tmp = fma(1.0, z, Float64(Float64(Float64(Float64(t + y) * a) - Float64(b * y)) / t_1)); elseif (y <= 6.6e+175) tmp = Float64(a - Float64(b * Float64(y / t_1))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -1.35e+85], t$95$2, If[LessEqual[y, 2e-113], N[(N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] * z + N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.6e+31], N[(1.0 * z + N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+175], N[(a - N[(b * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.35 \cdot 10^{+85}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-113}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{t\_1}, z, a \cdot \frac{t}{t + x}\right)\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(1, z, \frac{\left(t + y\right) \cdot a - b \cdot y}{t\_1}\right)\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+175}:\\
\;\;\;\;a - b \cdot \frac{y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.34999999999999992e85 or 6.6000000000000005e175 < y Initial program 31.3%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6481.4
Applied rewrites81.4%
if -1.34999999999999992e85 < y < 1.99999999999999996e-113Initial program 75.7%
Applied rewrites85.9%
Taylor expanded in a around inf
lower-*.f64N/A
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-+.f6493.9
Applied rewrites93.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f6481.5
Applied rewrites81.5%
if 1.99999999999999996e-113 < y < 8.59999999999999978e31Initial program 76.5%
Applied rewrites86.8%
Taylor expanded in x around inf
Applied rewrites70.8%
if 8.59999999999999978e31 < y < 6.6000000000000005e175Initial program 50.4%
Applied rewrites61.0%
Taylor expanded in t around inf
Applied rewrites55.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t)) (t_2 (- (+ a z) b)))
(if (<= y -5.5e+90)
t_2
(if (<= y 6.1e-114)
(fma (/ (+ y x) t_1) z a)
(if (<= y 8.6e+31)
(fma 1.0 z (/ (- (* (+ t y) a) (* b y)) t_1))
(if (<= y 6.6e+175) (- a (* b (/ y t_1))) t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = (a + z) - b;
double tmp;
if (y <= -5.5e+90) {
tmp = t_2;
} else if (y <= 6.1e-114) {
tmp = fma(((y + x) / t_1), z, a);
} else if (y <= 8.6e+31) {
tmp = fma(1.0, z, ((((t + y) * a) - (b * y)) / t_1));
} else if (y <= 6.6e+175) {
tmp = a - (b * (y / t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -5.5e+90) tmp = t_2; elseif (y <= 6.1e-114) tmp = fma(Float64(Float64(y + x) / t_1), z, a); elseif (y <= 8.6e+31) tmp = fma(1.0, z, Float64(Float64(Float64(Float64(t + y) * a) - Float64(b * y)) / t_1)); elseif (y <= 6.6e+175) tmp = Float64(a - Float64(b * Float64(y / t_1))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -5.5e+90], t$95$2, If[LessEqual[y, 6.1e-114], N[(N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] * z + a), $MachinePrecision], If[LessEqual[y, 8.6e+31], N[(1.0 * z + N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+175], N[(a - N[(b * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -5.5 \cdot 10^{+90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{-114}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{t\_1}, z, a\right)\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{+31}:\\
\;\;\;\;\mathsf{fma}\left(1, z, \frac{\left(t + y\right) \cdot a - b \cdot y}{t\_1}\right)\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+175}:\\
\;\;\;\;a - b \cdot \frac{y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -5.49999999999999999e90 or 6.6000000000000005e175 < y Initial program 30.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6481.7
Applied rewrites81.7%
if -5.49999999999999999e90 < y < 6.09999999999999977e-114Initial program 75.6%
Applied rewrites85.8%
Taylor expanded in t around inf
Applied rewrites66.9%
if 6.09999999999999977e-114 < y < 8.59999999999999978e31Initial program 76.5%
Applied rewrites86.8%
Taylor expanded in x around inf
Applied rewrites70.8%
if 8.59999999999999978e31 < y < 6.6000000000000005e175Initial program 50.4%
Applied rewrites61.0%
Taylor expanded in t around inf
Applied rewrites55.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ y x) t)) (t_2 (fma (/ (+ y x) t_1) z a))) (if (<= z -1.1e+55) t_2 (if (<= z 4400.0) (- a (* b (/ y t_1))) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double t_2 = fma(((y + x) / t_1), z, a);
double tmp;
if (z <= -1.1e+55) {
tmp = t_2;
} else if (z <= 4400.0) {
tmp = a - (b * (y / t_1));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) t_2 = fma(Float64(Float64(y + x) / t_1), z, a) tmp = 0.0 if (z <= -1.1e+55) tmp = t_2; elseif (z <= 4400.0) tmp = Float64(a - Float64(b * Float64(y / t_1))); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] * z + a), $MachinePrecision]}, If[LessEqual[z, -1.1e+55], t$95$2, If[LessEqual[z, 4400.0], N[(a - N[(b * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
t_2 := \mathsf{fma}\left(\frac{y + x}{t\_1}, z, a\right)\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+55}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 4400:\\
\;\;\;\;a - b \cdot \frac{y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -1.10000000000000005e55 or 4400 < z Initial program 46.5%
Applied rewrites71.9%
Taylor expanded in t around inf
Applied rewrites81.1%
if -1.10000000000000005e55 < z < 4400Initial program 71.1%
Applied rewrites78.1%
Taylor expanded in t around inf
Applied rewrites66.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (/ (+ x y) (+ t (+ x y))))))
(if (<= z -7.8e+157)
t_1
(if (<= z 6.2e+56) (- a (* b (/ y (+ (+ y x) t)))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * ((x + y) / (t + (x + y)));
double tmp;
if (z <= -7.8e+157) {
tmp = t_1;
} else if (z <= 6.2e+56) {
tmp = a - (b * (y / ((y + x) + t)));
} 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 + y) / (t + (x + y)))
if (z <= (-7.8d+157)) then
tmp = t_1
else if (z <= 6.2d+56) then
tmp = a - (b * (y / ((y + x) + t)))
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 + y) / (t + (x + y)));
double tmp;
if (z <= -7.8e+157) {
tmp = t_1;
} else if (z <= 6.2e+56) {
tmp = a - (b * (y / ((y + x) + t)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * ((x + y) / (t + (x + y))) tmp = 0 if z <= -7.8e+157: tmp = t_1 elif z <= 6.2e+56: tmp = a - (b * (y / ((y + x) + t))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(Float64(x + y) / Float64(t + Float64(x + y)))) tmp = 0.0 if (z <= -7.8e+157) tmp = t_1; elseif (z <= 6.2e+56) tmp = Float64(a - Float64(b * Float64(y / Float64(Float64(y + x) + t)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * ((x + y) / (t + (x + y))); tmp = 0.0; if (z <= -7.8e+157) tmp = t_1; elseif (z <= 6.2e+56) tmp = a - (b * (y / ((y + x) + t))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(N[(x + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -7.8e+157], t$95$1, If[LessEqual[z, 6.2e+56], N[(a - N[(b * N[(y / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \frac{x + y}{t + \left(x + y\right)}\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{+157}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.2 \cdot 10^{+56}:\\
\;\;\;\;a - b \cdot \frac{y}{\left(y + x\right) + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.79999999999999941e157 or 6.20000000000000009e56 < z Initial program 41.9%
Applied rewrites43.5%
Taylor expanded in z around inf
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6471.1
Applied rewrites71.1%
if -7.79999999999999941e157 < z < 6.20000000000000009e56Initial program 68.8%
Applied rewrites75.2%
Taylor expanded in t around inf
Applied rewrites62.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -1.5e-36)
t_1
(if (<= y 2.05e-46)
(/ (fma a t (* z x)) (+ t x))
(if (<= y 6.6e+175) (- a (* b (/ y (+ (+ y x) t)))) 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 <= -1.5e-36) {
tmp = t_1;
} else if (y <= 2.05e-46) {
tmp = fma(a, t, (z * x)) / (t + x);
} else if (y <= 6.6e+175) {
tmp = a - (b * (y / ((y + x) + t)));
} 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 <= -1.5e-36) tmp = t_1; elseif (y <= 2.05e-46) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); elseif (y <= 6.6e+175) tmp = Float64(a - Float64(b * Float64(y / Float64(Float64(y + x) + t)))); 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, -1.5e-36], t$95$1, If[LessEqual[y, 2.05e-46], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.6e+175], N[(a - N[(b * N[(y / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-46}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+175}:\\
\;\;\;\;a - b \cdot \frac{y}{\left(y + x\right) + t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.5000000000000001e-36 or 6.6000000000000005e175 < y Initial program 41.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6474.1
Applied rewrites74.1%
if -1.5000000000000001e-36 < y < 2.05e-46Initial program 76.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6458.3
Applied rewrites58.3%
if 2.05e-46 < y < 6.6000000000000005e175Initial program 59.9%
Applied rewrites67.0%
Taylor expanded in t around inf
Applied rewrites52.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -1.5e-36)
t_1
(if (<= y 1e-98) (/ (fma a t (* z x)) (+ t x)) 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 <= -1.5e-36) {
tmp = t_1;
} else if (y <= 1e-98) {
tmp = fma(a, t, (z * x)) / (t + x);
} 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 <= -1.5e-36) tmp = t_1; elseif (y <= 1e-98) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); 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, -1.5e-36], t$95$1, If[LessEqual[y, 1e-98], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{-36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 10^{-98}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.5000000000000001e-36 or 9.99999999999999939e-99 < y Initial program 48.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6467.7
Applied rewrites67.7%
if -1.5000000000000001e-36 < y < 9.99999999999999939e-99Initial program 76.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6459.7
Applied rewrites59.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (- (+ a z) b))) (if (<= y -5e+90) t_1 (if (<= y 4.1e-44) (+ 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 <= -5e+90) {
tmp = t_1;
} else if (y <= 4.1e-44) {
tmp = a + z;
} 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 + z) - b
if (y <= (-5d+90)) then
tmp = t_1
else if (y <= 4.1d-44) then
tmp = a + z
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 + z) - b;
double tmp;
if (y <= -5e+90) {
tmp = t_1;
} else if (y <= 4.1e-44) {
tmp = a + z;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b tmp = 0 if y <= -5e+90: tmp = t_1 elif y <= 4.1e-44: tmp = 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 <= -5e+90) tmp = t_1; elseif (y <= 4.1e-44) tmp = Float64(a + z); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; tmp = 0.0; if (y <= -5e+90) tmp = t_1; elseif (y <= 4.1e-44) tmp = a + z; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -5e+90], t$95$1, If[LessEqual[y, 4.1e-44], N[(a + z), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -5 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.1 \cdot 10^{-44}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.0000000000000004e90 or 4.09999999999999992e-44 < y Initial program 41.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6473.1
Applied rewrites73.1%
if -5.0000000000000004e90 < y < 4.09999999999999992e-44Initial program 75.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6440.3
Applied rewrites40.3%
Taylor expanded in b around 0
lift-+.f6448.4
Applied rewrites48.4%
(FPCore (x y z t a b) :precision binary64 (if (<= t 2.3e+176) (+ a z) a))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= 2.3e+176) {
tmp = a + 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 (t <= 2.3d+176) then
tmp = a + 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 (t <= 2.3e+176) {
tmp = a + z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= 2.3e+176: tmp = a + z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= 2.3e+176) tmp = Float64(a + z); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= 2.3e+176) tmp = a + z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, 2.3e+176], N[(a + z), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 2.3 \cdot 10^{+176}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if t < 2.29999999999999996e176Initial program 61.8%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.7
Applied rewrites57.7%
Taylor expanded in b around 0
lift-+.f6452.7
Applied rewrites52.7%
if 2.29999999999999996e176 < t Initial program 44.2%
Taylor expanded in t around inf
Applied rewrites54.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.3e-75) (- a b) (if (<= a 4.2e+55) (- z b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.3e-75) {
tmp = a - b;
} else if (a <= 4.2e+55) {
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 <= (-1.3d-75)) then
tmp = a - b
else if (a <= 4.2d+55) 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 <= -1.3e-75) {
tmp = a - b;
} else if (a <= 4.2e+55) {
tmp = z - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.3e-75: tmp = a - b elif a <= 4.2e+55: tmp = z - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.3e-75) tmp = Float64(a - b); elseif (a <= 4.2e+55) 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 <= -1.3e-75) tmp = a - b; elseif (a <= 4.2e+55) tmp = z - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.3e-75], N[(a - b), $MachinePrecision], If[LessEqual[a, 4.2e+55], N[(z - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.3 \cdot 10^{-75}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;a \leq 4.2 \cdot 10^{+55}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.3e-75Initial program 53.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.8
Applied rewrites57.8%
Taylor expanded in z around 0
Applied rewrites46.0%
if -1.3e-75 < a < 4.2000000000000001e55Initial program 70.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6453.0
Applied rewrites53.0%
Taylor expanded in z around inf
Applied rewrites48.1%
if 4.2000000000000001e55 < a Initial program 44.9%
Taylor expanded in t around inf
Applied rewrites50.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.45e-100) (- a b) (if (<= a 2.6e+56) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.45e-100) {
tmp = a - b;
} else if (a <= 2.6e+56) {
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.45d-100)) then
tmp = a - b
else if (a <= 2.6d+56) 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.45e-100) {
tmp = a - b;
} else if (a <= 2.6e+56) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.45e-100: tmp = a - b elif a <= 2.6e+56: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.45e-100) tmp = Float64(a - b); elseif (a <= 2.6e+56) 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.45e-100) tmp = a - b; elseif (a <= 2.6e+56) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.45e-100], N[(a - b), $MachinePrecision], If[LessEqual[a, 2.6e+56], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.45 \cdot 10^{-100}:\\
\;\;\;\;a - b\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+56}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.44999999999999988e-100Initial program 53.9%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6457.1
Applied rewrites57.1%
Taylor expanded in z around 0
Applied rewrites44.7%
if -1.44999999999999988e-100 < a < 2.60000000000000011e56Initial program 70.6%
Taylor expanded in x around inf
Applied rewrites42.3%
if 2.60000000000000011e56 < a Initial program 44.9%
Taylor expanded in t around inf
Applied rewrites50.7%
(FPCore (x y z t a b) :precision binary64 (if (<= a -1.2e-75) a (if (<= a 2.6e+56) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.2e-75) {
tmp = a;
} else if (a <= 2.6e+56) {
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.2d-75)) then
tmp = a
else if (a <= 2.6d+56) 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.2e-75) {
tmp = a;
} else if (a <= 2.6e+56) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.2e-75: tmp = a elif a <= 2.6e+56: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.2e-75) tmp = a; elseif (a <= 2.6e+56) 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.2e-75) tmp = a; elseif (a <= 2.6e+56) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.2e-75], a, If[LessEqual[a, 2.6e+56], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.2 \cdot 10^{-75}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+56}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.2000000000000001e-75 or 2.60000000000000011e56 < a Initial program 49.8%
Taylor expanded in t around inf
Applied rewrites47.0%
if -1.2000000000000001e-75 < a < 2.60000000000000011e56Initial program 70.5%
Taylor expanded in x around inf
Applied rewrites42.2%
(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.9%
Taylor expanded in t around inf
Applied rewrites32.0%
herbie shell --seed 2025114
(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)))