
(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 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
}
def code(x, y, z, t, a, b): return ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) end
function tmp = code(x, y, z, t, a, b) tmp = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ y x) t))) (fma (/ (+ y x) t_1) z (- (* (/ (+ t y) t_1) a) (* (/ y t_1) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
return fma(((y + x) / t_1), z, ((((t + y) / t_1) * a) - ((y / t_1) * b)));
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) return fma(Float64(Float64(y + x) / t_1), z, Float64(Float64(Float64(Float64(t + y) / t_1) * a) - Float64(Float64(y / t_1) * b))) end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, N[(N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] * z + N[(N[(N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision] * a), $MachinePrecision] - N[(N[(y / t$95$1), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
\mathsf{fma}\left(\frac{y + x}{t\_1}, z, \frac{t + y}{t\_1} \cdot a - \frac{y}{t\_1} \cdot b\right)
\end{array}
\end{array}
Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
(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 (* (/ y t_2) b)))))
(if (<= t_1 (- INFINITY))
t_3
(if (<= t_1 2e+228)
(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 - ((y / t_2) * b)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_1 <= 2e+228) {
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(y / t_2) * b))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_3; elseif (t_1 <= 2e+228) 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[(y / t$95$2), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$3, If[LessEqual[t$95$1, 2e+228], 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 - \frac{y}{t\_2} \cdot b\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;\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 1.9999999999999998e228 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
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.9999999999999998e228Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
associate--l+N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites72.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))
(t_3 (fma (/ (+ y x) t_2) z (- a (* (/ y t_2) b)))))
(if (<= t_1 -2e+304) t_3 (if (<= t_1 2e+228) t_1 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 - ((y / t_2) * b)));
double tmp;
if (t_1 <= -2e+304) {
tmp = t_3;
} else if (t_1 <= 2e+228) {
tmp = t_1;
} 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(y / t_2) * b))) tmp = 0.0 if (t_1 <= -2e+304) tmp = t_3; elseif (t_1 <= 2e+228) tmp = t_1; 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[(y / t$95$2), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+304], t$95$3, If[LessEqual[t$95$1, 2e+228], t$95$1, 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 - \frac{y}{t\_2} \cdot b\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+304}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+228}:\\
\;\;\;\;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)) < -1.9999999999999999e304 or 1.9999999999999998e228 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
if -1.9999999999999999e304 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.9999999999999998e228Initial program 60.7%
(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 (* y (/ b t_2))))))
(if (<= t_1 -2e+304) t_3 (if (<= t_1 4e+282) t_1 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 - (y * (b / t_2))));
double tmp;
if (t_1 <= -2e+304) {
tmp = t_3;
} else if (t_1 <= 4e+282) {
tmp = t_1;
} 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(y * Float64(b / t_2)))) tmp = 0.0 if (t_1 <= -2e+304) tmp = t_3; elseif (t_1 <= 4e+282) tmp = t_1; 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[(y * N[(b / t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+304], t$95$3, If[LessEqual[t$95$1, 4e+282], t$95$1, 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 - y \cdot \frac{b}{t\_2}\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+304}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+282}:\\
\;\;\;\;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)) < -1.9999999999999999e304 or 4.00000000000000013e282 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
lift-*.f64N/A
lift-/.f64N/A
associate-*l/N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.9
Applied rewrites82.9%
if -1.9999999999999999e304 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000013e282Initial program 60.7%
(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 (+ y t))))
(if (<= t_1 -2e+304)
(fma t_2 z (- a (* t_2 b)))
(if (<= t_1 1e+241) t_1 (fma 1.0 z (- a (* (/ y (+ (+ y x) t)) 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 / (y + t);
double tmp;
if (t_1 <= -2e+304) {
tmp = fma(t_2, z, (a - (t_2 * b)));
} else if (t_1 <= 1e+241) {
tmp = t_1;
} else {
tmp = fma(1.0, z, (a - ((y / ((y + x) + t)) * 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(y / Float64(y + t)) tmp = 0.0 if (t_1 <= -2e+304) tmp = fma(t_2, z, Float64(a - Float64(t_2 * b))); elseif (t_1 <= 1e+241) tmp = t_1; else tmp = fma(1.0, z, Float64(a - Float64(Float64(y / Float64(Float64(y + x) + t)) * 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[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+304], N[(t$95$2 * z + N[(a - N[(t$95$2 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+241], t$95$1, N[(1.0 * z + N[(a - N[(N[(y / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $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 := \frac{y}{y + t}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+304}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, z, a - t\_2 \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+241}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, z, a - \frac{y}{\left(y + x\right) + t} \cdot b\right)\\
\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)) < -1.9999999999999999e304Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around 0
Applied rewrites65.9%
Taylor expanded in x around 0
Applied rewrites72.6%
Taylor expanded in x around 0
Applied rewrites67.6%
if -1.9999999999999999e304 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.0000000000000001e241Initial program 60.7%
if 1.0000000000000001e241 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around inf
Applied rewrites70.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ y (+ y t))))
(if (<= y -2.1e-166)
(fma 1.0 z (- a (* (/ y (+ (+ y x) t)) b)))
(if (<= y 5e-77)
(fma z (/ x (+ t x)) (* a (/ t (+ t x))))
(if (<= y 7.5)
(- (+ z (/ (* a y) (+ x y))) (/ (* b y) (+ x y)))
(fma t_1 z (- a (* t_1 b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y / (y + t);
double tmp;
if (y <= -2.1e-166) {
tmp = fma(1.0, z, (a - ((y / ((y + x) + t)) * b)));
} else if (y <= 5e-77) {
tmp = fma(z, (x / (t + x)), (a * (t / (t + x))));
} else if (y <= 7.5) {
tmp = (z + ((a * y) / (x + y))) - ((b * y) / (x + y));
} else {
tmp = fma(t_1, z, (a - (t_1 * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y / Float64(y + t)) tmp = 0.0 if (y <= -2.1e-166) tmp = fma(1.0, z, Float64(a - Float64(Float64(y / Float64(Float64(y + x) + t)) * b))); elseif (y <= 5e-77) tmp = fma(z, Float64(x / Float64(t + x)), Float64(a * Float64(t / Float64(t + x)))); elseif (y <= 7.5) tmp = Float64(Float64(z + Float64(Float64(a * y) / Float64(x + y))) - Float64(Float64(b * y) / Float64(x + y))); else tmp = fma(t_1, z, Float64(a - Float64(t_1 * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e-166], N[(1.0 * z + N[(a - N[(N[(y / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e-77], N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.5], N[(N[(z + N[(N[(a * y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * z + N[(a - N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{y + t}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;\mathsf{fma}\left(1, z, a - \frac{y}{\left(y + x\right) + t} \cdot b\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{-77}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{x}{t + x}, a \cdot \frac{t}{t + x}\right)\\
\mathbf{elif}\;y \leq 7.5:\\
\;\;\;\;\left(z + \frac{a \cdot y}{x + y}\right) - \frac{b \cdot y}{x + y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, a - t\_1 \cdot b\right)\\
\end{array}
\end{array}
if y < -2.0999999999999999e-166Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around inf
Applied rewrites70.4%
if -2.0999999999999999e-166 < y < 4.99999999999999963e-77Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.5
Applied rewrites59.5%
if 4.99999999999999963e-77 < y < 7.5Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
Taylor expanded in t around 0
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-+.f6450.7
Applied rewrites50.7%
if 7.5 < y Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around 0
Applied rewrites65.9%
Taylor expanded in x around 0
Applied rewrites72.6%
Taylor expanded in x around 0
Applied rewrites67.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t)))
(if (<= y -2.1e-166)
(fma 1.0 z (- a (* (/ y t_1) b)))
(if (<= y 2.3e-61)
(fma z (/ x (+ t x)) (* a (/ t (+ t x))))
(if (<= y 700000000.0)
(/ (* y (- (+ a z) b)) (+ (+ x t) y))
(fma (/ (+ y x) t_1) z (- a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double tmp;
if (y <= -2.1e-166) {
tmp = fma(1.0, z, (a - ((y / t_1) * b)));
} else if (y <= 2.3e-61) {
tmp = fma(z, (x / (t + x)), (a * (t / (t + x))));
} else if (y <= 700000000.0) {
tmp = (y * ((a + z) - b)) / ((x + t) + y);
} else {
tmp = fma(((y + x) / t_1), z, (a - b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) tmp = 0.0 if (y <= -2.1e-166) tmp = fma(1.0, z, Float64(a - Float64(Float64(y / t_1) * b))); elseif (y <= 2.3e-61) tmp = fma(z, Float64(x / Float64(t + x)), Float64(a * Float64(t / Float64(t + x)))); elseif (y <= 700000000.0) tmp = Float64(Float64(y * Float64(Float64(a + z) - b)) / Float64(Float64(x + t) + y)); else tmp = fma(Float64(Float64(y + x) / t_1), z, Float64(a - b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[y, -2.1e-166], N[(1.0 * z + N[(a - N[(N[(y / t$95$1), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.3e-61], N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 700000000.0], N[(N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] * z + N[(a - b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;\mathsf{fma}\left(1, z, a - \frac{y}{t\_1} \cdot b\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{x}{t + x}, a \cdot \frac{t}{t + x}\right)\\
\mathbf{elif}\;y \leq 700000000:\\
\;\;\;\;\frac{y \cdot \left(\left(a + z\right) - b\right)}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{t\_1}, z, a - b\right)\\
\end{array}
\end{array}
if y < -2.0999999999999999e-166Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around inf
Applied rewrites70.4%
if -2.0999999999999999e-166 < y < 2.29999999999999992e-61Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.5
Applied rewrites59.5%
if 2.29999999999999992e-61 < y < 7e8Initial program 60.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6430.9
Applied rewrites30.9%
if 7e8 < y Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in y around inf
lower--.f6463.6
Applied rewrites63.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ x t) y))
(t_2 (* (+ x y) z))
(t_3 (/ (- (+ t_2 (* (+ t y) a)) (* y b)) t_1))
(t_4 (+ (+ y x) t)))
(if (<= t_3 -4e+126)
(fma (/ (+ y x) t_4) z (- a b))
(if (<= t_3 1e+103)
(/ (- (+ t_2 (* a t)) (* y b)) t_1)
(fma 1.0 z (- a (* (/ y t_4) 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;
double t_3 = ((t_2 + ((t + y) * a)) - (y * b)) / t_1;
double t_4 = (y + x) + t;
double tmp;
if (t_3 <= -4e+126) {
tmp = fma(((y + x) / t_4), z, (a - b));
} else if (t_3 <= 1e+103) {
tmp = ((t_2 + (a * t)) - (y * b)) / t_1;
} else {
tmp = fma(1.0, z, (a - ((y / t_4) * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(x + y) * z) t_3 = Float64(Float64(Float64(t_2 + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_4 = Float64(Float64(y + x) + t) tmp = 0.0 if (t_3 <= -4e+126) tmp = fma(Float64(Float64(y + x) / t_4), z, Float64(a - b)); elseif (t_3 <= 1e+103) tmp = Float64(Float64(Float64(t_2 + Float64(a * t)) - Float64(y * b)) / t_1); else tmp = fma(1.0, z, Float64(a - Float64(Float64(y / t_4) * 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[(x + y), $MachinePrecision] * z), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(t$95$2 + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[t$95$3, -4e+126], N[(N[(N[(y + x), $MachinePrecision] / t$95$4), $MachinePrecision] * z + N[(a - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e+103], N[(N[(N[(t$95$2 + N[(a * t), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], N[(1.0 * z + N[(a - N[(N[(y / t$95$4), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \left(x + y\right) \cdot z\\
t_3 := \frac{\left(t\_2 + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_4 := \left(y + x\right) + t\\
\mathbf{if}\;t\_3 \leq -4 \cdot 10^{+126}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{t\_4}, z, a - b\right)\\
\mathbf{elif}\;t\_3 \leq 10^{+103}:\\
\;\;\;\;\frac{\left(t\_2 + a \cdot t\right) - y \cdot b}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, z, a - \frac{y}{t\_4} \cdot b\right)\\
\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)) < -3.9999999999999997e126Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in y around inf
lower--.f6463.6
Applied rewrites63.6%
if -3.9999999999999997e126 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e103Initial program 60.7%
Taylor expanded in y around 0
lower-*.f6452.9
Applied rewrites52.9%
if 1e103 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around inf
Applied rewrites70.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ y (+ y t))))
(if (<= y -2.1e-166)
(fma 1.0 z (- a (* (/ y (+ (+ y x) t)) b)))
(if (<= y 2.8e-52)
(fma z (/ x (+ t x)) (* a (/ t (+ t x))))
(fma t_1 z (- a (* t_1 b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y / (y + t);
double tmp;
if (y <= -2.1e-166) {
tmp = fma(1.0, z, (a - ((y / ((y + x) + t)) * b)));
} else if (y <= 2.8e-52) {
tmp = fma(z, (x / (t + x)), (a * (t / (t + x))));
} else {
tmp = fma(t_1, z, (a - (t_1 * b)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y / Float64(y + t)) tmp = 0.0 if (y <= -2.1e-166) tmp = fma(1.0, z, Float64(a - Float64(Float64(y / Float64(Float64(y + x) + t)) * b))); elseif (y <= 2.8e-52) tmp = fma(z, Float64(x / Float64(t + x)), Float64(a * Float64(t / Float64(t + x)))); else tmp = fma(t_1, z, Float64(a - Float64(t_1 * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y / N[(y + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.1e-166], N[(1.0 * z + N[(a - N[(N[(y / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-52], N[(z * N[(x / N[(t + x), $MachinePrecision]), $MachinePrecision] + N[(a * N[(t / N[(t + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 * z + N[(a - N[(t$95$1 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{y + t}\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;\mathsf{fma}\left(1, z, a - \frac{y}{\left(y + x\right) + t} \cdot b\right)\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-52}:\\
\;\;\;\;\mathsf{fma}\left(z, \frac{x}{t + x}, a \cdot \frac{t}{t + x}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_1, z, a - t\_1 \cdot b\right)\\
\end{array}
\end{array}
if y < -2.0999999999999999e-166Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around inf
Applied rewrites70.4%
if -2.0999999999999999e-166 < y < 2.79999999999999995e-52Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
lift-/.f64N/A
lift-fma.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.5
Applied rewrites59.5%
if 2.79999999999999995e-52 < y Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around 0
Applied rewrites65.9%
Taylor expanded in x around 0
Applied rewrites72.6%
Taylor expanded in x around 0
Applied rewrites67.6%
(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 (+ (+ y x) t)))
(if (<= t_2 -4e+126)
(fma (/ (+ y x) t_3) z (- a b))
(if (<= t_2 -1e-162)
(/ (- (* z (+ x y)) (* b y)) t_1)
(if (<= t_2 1e+22)
(/ (fma a t (* x z)) (+ t x))
(fma 1.0 z (- a (* (/ y t_3) 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 t_3 = (y + x) + t;
double tmp;
if (t_2 <= -4e+126) {
tmp = fma(((y + x) / t_3), z, (a - b));
} else if (t_2 <= -1e-162) {
tmp = ((z * (x + y)) - (b * y)) / t_1;
} else if (t_2 <= 1e+22) {
tmp = fma(a, t, (x * z)) / (t + x);
} else {
tmp = fma(1.0, z, (a - ((y / t_3) * 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) t_3 = Float64(Float64(y + x) + t) tmp = 0.0 if (t_2 <= -4e+126) tmp = fma(Float64(Float64(y + x) / t_3), z, Float64(a - b)); elseif (t_2 <= -1e-162) tmp = Float64(Float64(Float64(z * Float64(x + y)) - Float64(b * y)) / t_1); elseif (t_2 <= 1e+22) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); else tmp = fma(1.0, z, Float64(a - Float64(Float64(y / t_3) * 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]}, Block[{t$95$3 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+126], N[(N[(N[(y + x), $MachinePrecision] / t$95$3), $MachinePrecision] * z + N[(a - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -1e-162], N[(N[(N[(z * N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 1e+22], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], N[(1.0 * z + N[(a - N[(N[(y / t$95$3), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $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}\\
t_3 := \left(y + x\right) + t\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+126}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{t\_3}, z, a - b\right)\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-162}:\\
\;\;\;\;\frac{z \cdot \left(x + y\right) - b \cdot y}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 10^{+22}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(1, z, a - \frac{y}{t\_3} \cdot b\right)\\
\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)) < -3.9999999999999997e126Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in y around inf
lower--.f6463.6
Applied rewrites63.6%
if -3.9999999999999997e126 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999954e-163Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6437.8
Applied rewrites37.8%
if -9.99999999999999954e-163 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1e22Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
if 1e22 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around inf
Applied rewrites70.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (+ y x) t)))
(if (<= y -2.1e-166)
(fma 1.0 z (- a (* (/ y t_1) b)))
(if (<= y 5.5e-105)
(/ (fma a t (* x z)) (+ t x))
(if (<= y 700000000.0)
(/ (* y (- (+ a z) b)) (+ (+ x t) y))
(fma (/ (+ y x) t_1) z (- a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) + t;
double tmp;
if (y <= -2.1e-166) {
tmp = fma(1.0, z, (a - ((y / t_1) * b)));
} else if (y <= 5.5e-105) {
tmp = fma(a, t, (x * z)) / (t + x);
} else if (y <= 700000000.0) {
tmp = (y * ((a + z) - b)) / ((x + t) + y);
} else {
tmp = fma(((y + x) / t_1), z, (a - b));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) + t) tmp = 0.0 if (y <= -2.1e-166) tmp = fma(1.0, z, Float64(a - Float64(Float64(y / t_1) * b))); elseif (y <= 5.5e-105) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); elseif (y <= 700000000.0) tmp = Float64(Float64(y * Float64(Float64(a + z) - b)) / Float64(Float64(x + t) + y)); else tmp = fma(Float64(Float64(y + x) / t_1), z, Float64(a - b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, If[LessEqual[y, -2.1e-166], N[(1.0 * z + N[(a - N[(N[(y / t$95$1), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-105], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 700000000.0], N[(N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(y + x), $MachinePrecision] / t$95$1), $MachinePrecision] * z + N[(a - b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) + t\\
\mathbf{if}\;y \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;\mathsf{fma}\left(1, z, a - \frac{y}{t\_1} \cdot b\right)\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-105}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{elif}\;y \leq 700000000:\\
\;\;\;\;\frac{y \cdot \left(\left(a + z\right) - b\right)}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y + x}{t\_1}, z, a - b\right)\\
\end{array}
\end{array}
if y < -2.0999999999999999e-166Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in x around 0
Applied rewrites84.3%
Taylor expanded in x around inf
Applied rewrites70.4%
if -2.0999999999999999e-166 < y < 5.50000000000000029e-105Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
if 5.50000000000000029e-105 < y < 7e8Initial program 60.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6430.9
Applied rewrites30.9%
if 7e8 < y Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in y around inf
lower--.f6463.6
Applied rewrites63.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma (/ (+ y x) (+ (+ y x) t)) z (- a b))))
(if (<= y -1.45e+105)
t_1
(if (<= y -2.1e-166)
(- (+ a z) (/ (* b y) (+ t (+ x y))))
(if (<= y 5.5e-105)
(/ (fma a t (* x z)) (+ t x))
(if (<= y 700000000.0) (/ (* y (- (+ a z) b)) (+ (+ x t) y)) t_1))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((y + x) / ((y + x) + t)), z, (a - b));
double tmp;
if (y <= -1.45e+105) {
tmp = t_1;
} else if (y <= -2.1e-166) {
tmp = (a + z) - ((b * y) / (t + (x + y)));
} else if (y <= 5.5e-105) {
tmp = fma(a, t, (x * z)) / (t + x);
} else if (y <= 700000000.0) {
tmp = (y * ((a + z) - b)) / ((x + t) + y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, Float64(a - b)) tmp = 0.0 if (y <= -1.45e+105) tmp = t_1; elseif (y <= -2.1e-166) tmp = Float64(Float64(a + z) - Float64(Float64(b * y) / Float64(t + Float64(x + y)))); elseif (y <= 5.5e-105) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); elseif (y <= 700000000.0) tmp = Float64(Float64(y * Float64(Float64(a + z) - b)) / Float64(Float64(x + t) + y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.45e+105], t$95$1, If[LessEqual[y, -2.1e-166], N[(N[(a + z), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-105], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 700000000.0], N[(N[(y * N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, a - b\right)\\
\mathbf{if}\;y \leq -1.45 \cdot 10^{+105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;\left(a + z\right) - \frac{b \cdot y}{t + \left(x + y\right)}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-105}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{elif}\;y \leq 700000000:\\
\;\;\;\;\frac{y \cdot \left(\left(a + z\right) - b\right)}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.45000000000000005e105 or 7e8 < y Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
lift--.f64N/A
lift-fma.f64N/A
+-commutativeN/A
associate--l+N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites98.6%
Taylor expanded in y around inf
lower--.f6463.6
Applied rewrites63.6%
if -1.45000000000000005e105 < y < -2.0999999999999999e-166Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
Taylor expanded in y around inf
lower-+.f6459.9
Applied rewrites59.9%
if -2.0999999999999999e-166 < y < 5.50000000000000029e-105Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
if 5.50000000000000029e-105 < y < 7e8Initial program 60.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6430.9
Applied rewrites30.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -3.5e+142)
t_1
(if (<= y -2.1e-166)
(- (+ a z) (/ (* b y) (+ t (+ x y))))
(if (<= y 5.5e-105)
(/ (fma a t (* x z)) (+ t x))
(if (<= y 700000000.0) (/ (* y t_1) (+ (+ x t) y)) 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 <= -3.5e+142) {
tmp = t_1;
} else if (y <= -2.1e-166) {
tmp = (a + z) - ((b * y) / (t + (x + y)));
} else if (y <= 5.5e-105) {
tmp = fma(a, t, (x * z)) / (t + x);
} else if (y <= 700000000.0) {
tmp = (y * t_1) / ((x + t) + y);
} 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 <= -3.5e+142) tmp = t_1; elseif (y <= -2.1e-166) tmp = Float64(Float64(a + z) - Float64(Float64(b * y) / Float64(t + Float64(x + y)))); elseif (y <= 5.5e-105) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); elseif (y <= 700000000.0) tmp = Float64(Float64(y * t_1) / Float64(Float64(x + t) + y)); 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, -3.5e+142], t$95$1, If[LessEqual[y, -2.1e-166], N[(N[(a + z), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e-105], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 700000000.0], N[(N[(y * t$95$1), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;\left(a + z\right) - \frac{b \cdot y}{t + \left(x + y\right)}\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{-105}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{elif}\;y \leq 700000000:\\
\;\;\;\;\frac{y \cdot t\_1}{\left(x + t\right) + y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.49999999999999997e142 or 7e8 < y Initial program 60.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.6
Applied rewrites55.6%
if -3.49999999999999997e142 < y < -2.0999999999999999e-166Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
Taylor expanded in y around inf
lower-+.f6459.9
Applied rewrites59.9%
if -2.0999999999999999e-166 < y < 5.50000000000000029e-105Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
if 5.50000000000000029e-105 < y < 7e8Initial program 60.7%
Taylor expanded in y around inf
lower-*.f64N/A
lower--.f64N/A
lower-+.f6430.9
Applied rewrites30.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) (/ (* b y) (+ t (+ x y))))) (t_2 (- (+ a z) b)))
(if (<= y -3.5e+142)
t_2
(if (<= y -2.1e-166)
t_1
(if (<= y 2.55e-102)
(/ (fma a t (* x z)) (+ t x))
(if (<= y 1.12e+14) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + z) - ((b * y) / (t + (x + y)));
double t_2 = (a + z) - b;
double tmp;
if (y <= -3.5e+142) {
tmp = t_2;
} else if (y <= -2.1e-166) {
tmp = t_1;
} else if (y <= 2.55e-102) {
tmp = fma(a, t, (x * z)) / (t + x);
} else if (y <= 1.12e+14) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - Float64(Float64(b * y) / Float64(t + Float64(x + y)))) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (y <= -3.5e+142) tmp = t_2; elseif (y <= -2.1e-166) tmp = t_1; elseif (y <= 2.55e-102) tmp = Float64(fma(a, t, Float64(x * z)) / Float64(t + x)); elseif (y <= 1.12e+14) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] - N[(N[(b * y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[y, -3.5e+142], t$95$2, If[LessEqual[y, -2.1e-166], t$95$1, If[LessEqual[y, 2.55e-102], N[(N[(a * t + N[(x * z), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e+14], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - \frac{b \cdot y}{t + \left(x + y\right)}\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;y \leq -3.5 \cdot 10^{+142}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -2.1 \cdot 10^{-166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{-102}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -3.49999999999999997e142 or 1.12e14 < y Initial program 60.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.6
Applied rewrites55.6%
if -3.49999999999999997e142 < y < -2.0999999999999999e-166 or 2.55e-102 < y < 1.12e14Initial program 60.7%
Taylor expanded in a around 0
lower--.f64N/A
Applied rewrites72.4%
Taylor expanded in y around inf
lower-+.f6459.9
Applied rewrites59.9%
if -2.0999999999999999e-166 < y < 2.55e-102Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)))
(if (<= y -5e-162)
t_1
(if (<= y 2.55e-102) (/ (fma a t (* x z)) (+ 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 <= -5e-162) {
tmp = t_1;
} else if (y <= 2.55e-102) {
tmp = fma(a, t, (x * z)) / (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 <= -5e-162) tmp = t_1; elseif (y <= 2.55e-102) tmp = Float64(fma(a, t, Float64(x * z)) / 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, -5e-162], t$95$1, If[LessEqual[y, 2.55e-102], N[(N[(a * t + N[(x * z), $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 -5 \cdot 10^{-162}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{-102}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, x \cdot z\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.00000000000000014e-162 or 2.55e-102 < y Initial program 60.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.6
Applied rewrites55.6%
if -5.00000000000000014e-162 < y < 2.55e-102Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma (/ (- z a) t) x a))) (if (<= t -2.15e+110) t_1 (if (<= t 2.3e+160) (- (+ a z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(((z - a) / t), x, a);
double tmp;
if (t <= -2.15e+110) {
tmp = t_1;
} else if (t <= 2.3e+160) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(Float64(Float64(z - a) / t), x, a) tmp = 0.0 if (t <= -2.15e+110) tmp = t_1; elseif (t <= 2.3e+160) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision] * x + a), $MachinePrecision]}, If[LessEqual[t, -2.15e+110], t$95$1, If[LessEqual[t, 2.3e+160], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{z - a}{t}, x, a\right)\\
\mathbf{if}\;t \leq -2.15 \cdot 10^{+110}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{+160}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.15000000000000003e110 or 2.29999999999999987e160 < t Initial program 60.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
Taylor expanded in x around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-/.f6429.1
Applied rewrites29.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6429.1
lift--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6429.2
Applied rewrites29.2%
if -2.15000000000000003e110 < t < 2.29999999999999987e160Initial program 60.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.6
Applied rewrites55.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x 3.4e+165) (- (+ a z) b) z))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 3.4e+165) {
tmp = (a + z) - b;
} else {
tmp = z;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= 3.4d+165) then
tmp = (a + z) - b
else
tmp = z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 3.4e+165) {
tmp = (a + z) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 3.4e+165: tmp = (a + z) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 3.4e+165) tmp = Float64(Float64(a + z) - b); else tmp = z; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 3.4e+165) tmp = (a + z) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 3.4e+165], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.4 \cdot 10^{+165}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < 3.40000000000000011e165Initial program 60.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.6
Applied rewrites55.6%
if 3.40000000000000011e165 < x Initial program 60.7%
Taylor expanded in x around inf
Applied rewrites32.6%
(FPCore (x y z t a b) :precision binary64 (if (<= a -31500000.0) a (if (<= a 8.5e+36) (- z b) a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -31500000.0) {
tmp = a;
} else if (a <= 8.5e+36) {
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 <= (-31500000.0d0)) then
tmp = a
else if (a <= 8.5d+36) 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 <= -31500000.0) {
tmp = a;
} else if (a <= 8.5e+36) {
tmp = z - b;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -31500000.0: tmp = a elif a <= 8.5e+36: tmp = z - b else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -31500000.0) tmp = a; elseif (a <= 8.5e+36) 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 <= -31500000.0) tmp = a; elseif (a <= 8.5e+36) tmp = z - b; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -31500000.0], a, If[LessEqual[a, 8.5e+36], N[(z - b), $MachinePrecision], a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -31500000:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 8.5 \cdot 10^{+36}:\\
\;\;\;\;z - b\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -3.15e7 or 8.50000000000000014e36 < a Initial program 60.7%
Taylor expanded in t around inf
Applied rewrites32.8%
if -3.15e7 < a < 8.50000000000000014e36Initial program 60.7%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.6
Applied rewrites55.6%
Taylor expanded in a around 0
lower--.f6437.2
Applied rewrites37.2%
(FPCore (x y z t a b) :precision binary64 (if (<= a -15600000.0) a (if (<= a 4.5e+18) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -15600000.0) {
tmp = a;
} else if (a <= 4.5e+18) {
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 <= (-15600000.0d0)) then
tmp = a
else if (a <= 4.5d+18) 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 <= -15600000.0) {
tmp = a;
} else if (a <= 4.5e+18) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -15600000.0: tmp = a elif a <= 4.5e+18: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -15600000.0) tmp = a; elseif (a <= 4.5e+18) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -15600000.0) tmp = a; elseif (a <= 4.5e+18) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -15600000.0], a, If[LessEqual[a, 4.5e+18], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -15600000:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 4.5 \cdot 10^{+18}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -1.56e7 or 4.5e18 < a Initial program 60.7%
Taylor expanded in t around inf
Applied rewrites32.8%
if -1.56e7 < a < 4.5e18Initial program 60.7%
Taylor expanded in x around inf
Applied rewrites32.6%
(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 60.7%
Taylor expanded in t around inf
Applied rewrites32.8%
herbie shell --seed 2025151
(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)))