
(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 14 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) t))
(t_3 (/ (+ y x) t_2))
(t_4
(fma t_3 z (* a (fma -1.0 (* (/ b a) (/ y t_1)) (/ (+ t y) t_1))))))
(if (<= a -1.8e-71)
t_4
(if (<= a 1e-37) (fma t_3 z (/ (- (* (+ t y) a) (* b y)) t_2)) 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) + t;
double t_3 = (y + x) / t_2;
double t_4 = fma(t_3, z, (a * fma(-1.0, ((b / a) * (y / t_1)), ((t + y) / t_1))));
double tmp;
if (a <= -1.8e-71) {
tmp = t_4;
} else if (a <= 1e-37) {
tmp = fma(t_3, z, ((((t + y) * a) - (b * y)) / t_2));
} 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) + t) t_3 = Float64(Float64(y + x) / t_2) t_4 = fma(t_3, z, Float64(a * fma(-1.0, Float64(Float64(b / a) * Float64(y / t_1)), Float64(Float64(t + y) / t_1)))) tmp = 0.0 if (a <= -1.8e-71) tmp = t_4; elseif (a <= 1e-37) tmp = fma(t_3, z, Float64(Float64(Float64(Float64(t + y) * a) - Float64(b * y)) / t_2)); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$3 = N[(N[(y + x), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$3 * z + N[(a * N[(-1.0 * N[(N[(b / a), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.8e-71], t$95$4, If[LessEqual[a, 1e-37], N[(t$95$3 * z + N[(N[(N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \left(x + y\right)\\
t_2 := \left(y + x\right) + t\\
t_3 := \frac{y + x}{t\_2}\\
t_4 := \mathsf{fma}\left(t\_3, z, a \cdot \mathsf{fma}\left(-1, \frac{b}{a} \cdot \frac{y}{t\_1}, \frac{t + y}{t\_1}\right)\right)\\
\mathbf{if}\;a \leq -1.8 \cdot 10^{-71}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;a \leq 10^{-37}:\\
\;\;\;\;\mathsf{fma}\left(t\_3, z, \frac{\left(t + y\right) \cdot a - b \cdot y}{t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if a < -1.8e-71 or 1.00000000000000007e-37 < a Initial program 60.5%
Applied rewrites72.1%
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-+.f6483.2
Applied rewrites83.2%
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-+.f6487.6
Applied rewrites87.6%
if -1.8e-71 < a < 1.00000000000000007e-37Initial program 60.5%
Applied rewrites72.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (+ (+ x t) y))
(t_3 (/ (- (+ (* (+ x y) z) t_1) (* y b)) t_2))
(t_4 (/ (+ y x) (+ (+ y x) t))))
(if (<= t_3 (- INFINITY))
(fma t_4 z (- a b))
(if (<= t_3 2e+214)
(/ (fma (+ y x) z (- t_1 (* b y))) t_2)
(fma t_4 z (* a (fma -1.0 (* (/ b a) (/ y (+ t (+ x y)))) 1.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = (x + t) + y;
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2;
double t_4 = (y + x) / ((y + x) + t);
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = fma(t_4, z, (a - b));
} else if (t_3 <= 2e+214) {
tmp = fma((y + x), z, (t_1 - (b * y))) / t_2;
} else {
tmp = fma(t_4, z, (a * fma(-1.0, ((b / a) * (y / (t + (x + y)))), 1.0)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / t_2) t_4 = Float64(Float64(y + x) / Float64(Float64(y + x) + t)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = fma(t_4, z, Float64(a - b)); elseif (t_3 <= 2e+214) tmp = Float64(fma(Float64(y + x), z, Float64(t_1 - Float64(b * y))) / t_2); else tmp = fma(t_4, z, Float64(a * fma(-1.0, Float64(Float64(b / a) * Float64(y / Float64(t + Float64(x + y)))), 1.0))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(t$95$4 * z + N[(a - b), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 2e+214], N[(N[(N[(y + x), $MachinePrecision] * z + N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], N[(t$95$4 * z + N[(a * N[(-1.0 * N[(N[(b / a), $MachinePrecision] * N[(y / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{t\_2}\\
t_4 := \frac{y + x}{\left(y + x\right) + t}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\mathsf{fma}\left(t\_4, z, a - b\right)\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+214}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1 - b \cdot y\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_4, z, a \cdot \mathsf{fma}\left(-1, \frac{b}{a} \cdot \frac{y}{t + \left(x + y\right)}, 1\right)\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)) < -inf.0Initial program 60.5%
Applied rewrites72.1%
Taylor expanded in y around inf
lower--.f6464.4
Applied rewrites64.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)) < 1.9999999999999999e214Initial program 60.5%
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
lower-*.f6460.6
Applied rewrites60.6%
if 1.9999999999999999e214 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.5%
Applied rewrites72.1%
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-+.f6483.2
Applied rewrites83.2%
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-+.f6487.6
Applied rewrites87.6%
Taylor expanded in x around 0
Applied rewrites73.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (+ (+ x t) y))
(t_3 (/ (- (+ (* (+ x y) z) t_1) (* y b)) t_2))
(t_4 (fma (/ (+ y x) (+ (+ y x) t)) z (- a b))))
(if (<= t_3 (- INFINITY))
t_4
(if (<= t_3 2e+214) (/ (fma (+ y x) z (- t_1 (* b y))) t_2) t_4))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = (x + t) + y;
double t_3 = ((((x + y) * z) + t_1) - (y * b)) / t_2;
double t_4 = fma(((y + x) / ((y + x) + t)), z, (a - b));
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_3 <= 2e+214) {
tmp = fma((y + x), z, (t_1 - (b * y))) / t_2;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / t_2) t_4 = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, Float64(a - b)) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = t_4; elseif (t_3 <= 2e+214) tmp = Float64(fma(Float64(y + x), z, Float64(t_1 - Float64(b * y))) / t_2); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], t$95$4, If[LessEqual[t$95$3, 2e+214], N[(N[(N[(y + x), $MachinePrecision] * z + N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{t\_2}\\
t_4 := \mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, a - b\right)\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+214}:\\
\;\;\;\;\frac{\mathsf{fma}\left(y + x, z, t\_1 - b \cdot y\right)}{t\_2}\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.9999999999999999e214 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.5%
Applied rewrites72.1%
Taylor expanded in y around inf
lower--.f6464.4
Applied rewrites64.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)) < 1.9999999999999999e214Initial program 60.5%
lift-*.f64N/A
lift--.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate--l+N/A
*-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower--.f64N/A
*-commutativeN/A
lift-+.f64N/A
lift-*.f64N/A
lower-*.f6460.6
Applied rewrites60.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ y x) z))
(t_2 (+ (+ x t) y))
(t_3 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) t_2))
(t_4 (+ (+ y x) t))
(t_5 (/ (fma (+ t y) a t_1) t_4))
(t_6 (fma (/ (+ y x) t_4) z (- a b))))
(if (<= t_3 -2e+262)
t_6
(if (<= t_3 -2e+182)
t_5
(if (<= t_3 -2e-89)
(/ (- t_1 (* b y)) t_2)
(if (<= t_3 2e+214) t_5 t_6))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (y + x) * z;
double t_2 = (x + t) + y;
double t_3 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_2;
double t_4 = (y + x) + t;
double t_5 = fma((t + y), a, t_1) / t_4;
double t_6 = fma(((y + x) / t_4), z, (a - b));
double tmp;
if (t_3 <= -2e+262) {
tmp = t_6;
} else if (t_3 <= -2e+182) {
tmp = t_5;
} else if (t_3 <= -2e-89) {
tmp = (t_1 - (b * y)) / t_2;
} else if (t_3 <= 2e+214) {
tmp = t_5;
} else {
tmp = t_6;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(y + x) * z) 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) t_4 = Float64(Float64(y + x) + t) t_5 = Float64(fma(Float64(t + y), a, t_1) / t_4) t_6 = fma(Float64(Float64(y + x) / t_4), z, Float64(a - b)) tmp = 0.0 if (t_3 <= -2e+262) tmp = t_6; elseif (t_3 <= -2e+182) tmp = t_5; elseif (t_3 <= -2e-89) tmp = Float64(Float64(t_1 - Float64(b * y)) / t_2); elseif (t_3 <= 2e+214) tmp = t_5; else tmp = t_6; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(y + x), $MachinePrecision] * z), $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]}, Block[{t$95$4 = N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(t + y), $MachinePrecision] * a + t$95$1), $MachinePrecision] / t$95$4), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(y + x), $MachinePrecision] / t$95$4), $MachinePrecision] * z + N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e+262], t$95$6, If[LessEqual[t$95$3, -2e+182], t$95$5, If[LessEqual[t$95$3, -2e-89], N[(N[(t$95$1 - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$3, 2e+214], t$95$5, t$95$6]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(y + x\right) \cdot z\\
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}\\
t_4 := \left(y + x\right) + t\\
t_5 := \frac{\mathsf{fma}\left(t + y, a, t\_1\right)}{t\_4}\\
t_6 := \mathsf{fma}\left(\frac{y + x}{t\_4}, z, a - b\right)\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{+262}:\\
\;\;\;\;t\_6\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{+182}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_3 \leq -2 \cdot 10^{-89}:\\
\;\;\;\;\frac{t\_1 - b \cdot y}{t\_2}\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+214}:\\
\;\;\;\;t\_5\\
\mathbf{else}:\\
\;\;\;\;t\_6\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2e262 or 1.9999999999999999e214 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.5%
Applied rewrites72.1%
Taylor expanded in y around inf
lower--.f6464.4
Applied rewrites64.4%
if -2e262 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.0000000000000001e182 or -2.00000000000000008e-89 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.9999999999999999e214Initial program 60.5%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
*-commutativeN/A
lower-/.f64N/A
*-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6448.0
Applied rewrites48.0%
if -2.0000000000000001e182 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.00000000000000008e-89Initial program 60.5%
Taylor expanded in a around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f6437.7
Applied rewrites37.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (+ t y) a))
(t_2 (+ (+ x t) y))
(t_3 (/ (- t_1 (* y b)) t_2))
(t_4 (/ (- (+ (* (+ x y) z) t_1) (* y b)) t_2))
(t_5 (fma (/ (+ y x) (+ (+ y x) t)) z (- a b))))
(if (<= t_4 (- INFINITY))
t_5
(if (<= t_4 -2e+182)
t_3
(if (<= t_4 1e+37)
(/ (- (* (+ y x) z) (* b y)) t_2)
(if (<= t_4 2e+214) t_3 t_5))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t + y) * a;
double t_2 = (x + t) + y;
double t_3 = (t_1 - (y * b)) / t_2;
double t_4 = ((((x + y) * z) + t_1) - (y * b)) / t_2;
double t_5 = fma(((y + x) / ((y + x) + t)), z, (a - b));
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = t_5;
} else if (t_4 <= -2e+182) {
tmp = t_3;
} else if (t_4 <= 1e+37) {
tmp = (((y + x) * z) - (b * y)) / t_2;
} else if (t_4 <= 2e+214) {
tmp = t_3;
} else {
tmp = t_5;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t + y) * a) t_2 = Float64(Float64(x + t) + y) t_3 = Float64(Float64(t_1 - Float64(y * b)) / t_2) t_4 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + t_1) - Float64(y * b)) / t_2) t_5 = fma(Float64(Float64(y + x) / Float64(Float64(y + x) + t)), z, Float64(a - b)) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = t_5; elseif (t_4 <= -2e+182) tmp = t_3; elseif (t_4 <= 1e+37) tmp = Float64(Float64(Float64(Float64(y + x) * z) - Float64(b * y)) / t_2); elseif (t_4 <= 2e+214) tmp = t_3; else tmp = t_5; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(y + x), $MachinePrecision] / N[(N[(y + x), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] * z + N[(a - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], t$95$5, If[LessEqual[t$95$4, -2e+182], t$95$3, If[LessEqual[t$95$4, 1e+37], N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] - N[(b * y), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision], If[LessEqual[t$95$4, 2e+214], t$95$3, t$95$5]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t + y\right) \cdot a\\
t_2 := \left(x + t\right) + y\\
t_3 := \frac{t\_1 - y \cdot b}{t\_2}\\
t_4 := \frac{\left(\left(x + y\right) \cdot z + t\_1\right) - y \cdot b}{t\_2}\\
t_5 := \mathsf{fma}\left(\frac{y + x}{\left(y + x\right) + t}, z, a - b\right)\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_4 \leq -2 \cdot 10^{+182}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 10^{+37}:\\
\;\;\;\;\frac{\left(y + x\right) \cdot z - b \cdot y}{t\_2}\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+214}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -inf.0 or 1.9999999999999999e214 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.5%
Applied rewrites72.1%
Taylor expanded in y around inf
lower--.f6464.4
Applied rewrites64.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.0000000000000001e182 or 9.99999999999999954e36 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 1.9999999999999999e214Initial program 60.5%
Taylor expanded in z around 0
*-commutativeN/A
lift-+.f64N/A
lift-*.f6437.4
Applied rewrites37.4%
if -2.0000000000000001e182 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 9.99999999999999954e36Initial program 60.5%
Taylor expanded in a around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f6437.7
Applied rewrites37.7%
(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 b))))
(if (<= t_2 -2e+262)
t_3
(if (<= t_2 -2e+182)
(* a (/ (+ t y) (+ t (+ x y))))
(if (<= t_2 4e+95) (/ (- (* (+ y x) z) (* b y)) 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 - b));
double tmp;
if (t_2 <= -2e+262) {
tmp = t_3;
} else if (t_2 <= -2e+182) {
tmp = a * ((t + y) / (t + (x + y)));
} else if (t_2 <= 4e+95) {
tmp = (((y + x) * z) - (b * y)) / 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 - b)) tmp = 0.0 if (t_2 <= -2e+262) tmp = t_3; elseif (t_2 <= -2e+182) tmp = Float64(a * Float64(Float64(t + y) / Float64(t + Float64(x + y)))); elseif (t_2 <= 4e+95) tmp = Float64(Float64(Float64(Float64(y + x) * z) - Float64(b * y)) / 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 - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+262], t$95$3, If[LessEqual[t$95$2, -2e+182], N[(a * N[(N[(t + y), $MachinePrecision] / N[(t + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e+95], N[(N[(N[(N[(y + x), $MachinePrecision] * z), $MachinePrecision] - N[(b * y), $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 - b\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+262}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{+182}:\\
\;\;\;\;a \cdot \frac{t + y}{t + \left(x + y\right)}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+95}:\\
\;\;\;\;\frac{\left(y + x\right) \cdot z - b \cdot y}{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)) < -2e262 or 4.00000000000000008e95 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.5%
Applied rewrites72.1%
Taylor expanded in y around inf
lower--.f6464.4
Applied rewrites64.4%
if -2e262 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -2.0000000000000001e182Initial program 60.5%
Applied rewrites72.1%
Taylor expanded in a around inf
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
if -2.0000000000000001e182 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000008e95Initial program 60.5%
Taylor expanded in a around 0
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f6437.7
Applied rewrites37.7%
(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 b))))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -1e-104)
(/ (* (- (+ a z) b) y) t_1)
(if (<= t_2 4e+95) (/ (fma a t (* z x)) (+ t x)) 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 - b));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -1e-104) {
tmp = (((a + z) - b) * y) / t_1;
} else if (t_2 <= 4e+95) {
tmp = fma(a, t, (z * x)) / (t + x);
} 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 - b)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -1e-104) tmp = Float64(Float64(Float64(Float64(a + z) - b) * y) / t_1); elseif (t_2 <= 4e+95) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); 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 - b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -1e-104], N[(N[(N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision] * y), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 4e+95], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $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 - b\right)\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-104}:\\
\;\;\;\;\frac{\left(\left(a + z\right) - b\right) \cdot y}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+95}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\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 4.00000000000000008e95 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.5%
Applied rewrites72.1%
Taylor expanded in y around inf
lower--.f6464.4
Applied rewrites64.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)) < -9.99999999999999927e-105Initial program 60.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6430.4
Applied rewrites30.4%
if -9.99999999999999927e-105 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000008e95Initial program 60.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6440.8
Applied rewrites40.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (- (+ a z) b)) (t_2 (+ t (+ x y))) (t_3 (* a (/ (+ t y) t_2))))
(if (<= a -2.65e+141)
t_3
(if (<= a -3.4e-105)
t_1
(if (<= a 1.4e-94)
(* z (/ (+ x y) t_2))
(if (<= a 1.25e+92) t_1 t_3))))))
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 t_3 = a * ((t + y) / t_2);
double tmp;
if (a <= -2.65e+141) {
tmp = t_3;
} else if (a <= -3.4e-105) {
tmp = t_1;
} else if (a <= 1.4e-94) {
tmp = z * ((x + y) / t_2);
} else if (a <= 1.25e+92) {
tmp = t_1;
} else {
tmp = t_3;
}
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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (a + z) - b
t_2 = t + (x + y)
t_3 = a * ((t + y) / t_2)
if (a <= (-2.65d+141)) then
tmp = t_3
else if (a <= (-3.4d-105)) then
tmp = t_1
else if (a <= 1.4d-94) then
tmp = z * ((x + y) / t_2)
else if (a <= 1.25d+92) then
tmp = t_1
else
tmp = t_3
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 t_2 = t + (x + y);
double t_3 = a * ((t + y) / t_2);
double tmp;
if (a <= -2.65e+141) {
tmp = t_3;
} else if (a <= -3.4e-105) {
tmp = t_1;
} else if (a <= 1.4e-94) {
tmp = z * ((x + y) / t_2);
} else if (a <= 1.25e+92) {
tmp = t_1;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + z) - b t_2 = t + (x + y) t_3 = a * ((t + y) / t_2) tmp = 0 if a <= -2.65e+141: tmp = t_3 elif a <= -3.4e-105: tmp = t_1 elif a <= 1.4e-94: tmp = z * ((x + y) / t_2) elif a <= 1.25e+92: tmp = t_1 else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + z) - b) t_2 = Float64(t + Float64(x + y)) t_3 = Float64(a * Float64(Float64(t + y) / t_2)) tmp = 0.0 if (a <= -2.65e+141) tmp = t_3; elseif (a <= -3.4e-105) tmp = t_1; elseif (a <= 1.4e-94) tmp = Float64(z * Float64(Float64(x + y) / t_2)); elseif (a <= 1.25e+92) tmp = t_1; else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + z) - b; t_2 = t + (x + y); t_3 = a * ((t + y) / t_2); tmp = 0.0; if (a <= -2.65e+141) tmp = t_3; elseif (a <= -3.4e-105) tmp = t_1; elseif (a <= 1.4e-94) tmp = z * ((x + y) / t_2); elseif (a <= 1.25e+92) tmp = t_1; else tmp = t_3; end tmp_2 = 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]}, Block[{t$95$3 = N[(a * N[(N[(t + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.65e+141], t$95$3, If[LessEqual[a, -3.4e-105], t$95$1, If[LessEqual[a, 1.4e-94], N[(z * N[(N[(x + y), $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.25e+92], t$95$1, t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + z\right) - b\\
t_2 := t + \left(x + y\right)\\
t_3 := a \cdot \frac{t + y}{t\_2}\\
\mathbf{if}\;a \leq -2.65 \cdot 10^{+141}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;a \leq -3.4 \cdot 10^{-105}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 1.4 \cdot 10^{-94}:\\
\;\;\;\;z \cdot \frac{x + y}{t\_2}\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if a < -2.65e141 or 1.25000000000000005e92 < a Initial program 60.5%
Applied rewrites72.1%
Taylor expanded in a around inf
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lift-+.f64N/A
lower-+.f64N/A
lower-+.f6440.2
Applied rewrites40.2%
if -2.65e141 < a < -3.39999999999999992e-105 or 1.3999999999999999e-94 < a < 1.25000000000000005e92Initial program 60.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.9
Applied rewrites55.9%
if -3.39999999999999992e-105 < a < 1.3999999999999999e-94Initial program 60.5%
Applied rewrites72.1%
Taylor expanded in z around inf
lower-*.f64N/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-+.f6440.4
Applied rewrites40.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 (- (+ a z) b)))
(if (<= t_2 (- INFINITY))
t_3
(if (<= t_2 -1e-104)
(/ (* t_3 y) t_1)
(if (<= t_2 4e+95) (/ (fma a t (* z x)) (+ t x)) t_3)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x + t) + y;
double t_2 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / t_1;
double t_3 = (a + z) - b;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= -1e-104) {
tmp = (t_3 * y) / t_1;
} else if (t_2 <= 4e+95) {
tmp = fma(a, t, (z * x)) / (t + x);
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x + t) + y) t_2 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / t_1) t_3 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= -1e-104) tmp = Float64(Float64(t_3 * y) / t_1); elseif (t_2 <= 4e+95) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, -1e-104], N[(N[(t$95$3 * y), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 4e+95], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + t\right) + y\\
t_2 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{t\_1}\\
t_3 := \left(a + z\right) - b\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-104}:\\
\;\;\;\;\frac{t\_3 \cdot y}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{+95}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\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 4.00000000000000008e95 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.9
Applied rewrites55.9%
if -inf.0 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -9.99999999999999927e-105Initial program 60.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f6430.4
Applied rewrites30.4%
if -9.99999999999999927e-105 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000008e95Initial program 60.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6440.8
Applied rewrites40.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (- (+ (* (+ x y) z) (* (+ t y) a)) (* y b)) (+ (+ x t) y)))
(t_2 (- (+ a z) b)))
(if (<= t_1 -2e+131)
t_2
(if (<= t_1 4e+95) (/ (fma a t (* z x)) (+ t x)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((((x + y) * z) + ((t + y) * a)) - (y * b)) / ((x + t) + y);
double t_2 = (a + z) - b;
double tmp;
if (t_1 <= -2e+131) {
tmp = t_2;
} else if (t_1 <= 4e+95) {
tmp = fma(a, t, (z * x)) / (t + x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(Float64(Float64(x + y) * z) + Float64(Float64(t + y) * a)) - Float64(y * b)) / Float64(Float64(x + t) + y)) t_2 = Float64(Float64(a + z) - b) tmp = 0.0 if (t_1 <= -2e+131) tmp = t_2; elseif (t_1 <= 4e+95) tmp = Float64(fma(a, t, Float64(z * x)) / Float64(t + x)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(N[(N[(x + y), $MachinePrecision] * z), $MachinePrecision] + N[(N[(t + y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] - N[(y * b), $MachinePrecision]), $MachinePrecision] / N[(N[(x + t), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+131], t$95$2, If[LessEqual[t$95$1, 4e+95], N[(N[(a * t + N[(z * x), $MachinePrecision]), $MachinePrecision] / N[(t + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(x + y\right) \cdot z + \left(t + y\right) \cdot a\right) - y \cdot b}{\left(x + t\right) + y}\\
t_2 := \left(a + z\right) - b\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+131}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+95}:\\
\;\;\;\;\frac{\mathsf{fma}\left(a, t, z \cdot x\right)}{t + x}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < -1.9999999999999998e131 or 4.00000000000000008e95 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) Initial program 60.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.9
Applied rewrites55.9%
if -1.9999999999999998e131 < (/.f64 (-.f64 (+.f64 (*.f64 (+.f64 x y) z) (*.f64 (+.f64 t y) a)) (*.f64 y b)) (+.f64 (+.f64 x t) y)) < 4.00000000000000008e95Initial program 60.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6440.8
Applied rewrites40.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ z (* t (/ (- a z) x))))) (if (<= x -1e+88) t_1 (if (<= x 9.2e+109) (- (+ a z) b) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (t * ((a - z) / x));
double tmp;
if (x <= -1e+88) {
tmp = t_1;
} else if (x <= 9.2e+109) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z + (t * ((a - z) / x))
if (x <= (-1d+88)) then
tmp = t_1
else if (x <= 9.2d+109) then
tmp = (a + z) - b
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z + (t * ((a - z) / x));
double tmp;
if (x <= -1e+88) {
tmp = t_1;
} else if (x <= 9.2e+109) {
tmp = (a + z) - b;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z + (t * ((a - z) / x)) tmp = 0 if x <= -1e+88: tmp = t_1 elif x <= 9.2e+109: tmp = (a + z) - b else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z + Float64(t * Float64(Float64(a - z) / x))) tmp = 0.0 if (x <= -1e+88) tmp = t_1; elseif (x <= 9.2e+109) tmp = Float64(Float64(a + z) - b); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z + (t * ((a - z) / x)); tmp = 0.0; if (x <= -1e+88) tmp = t_1; elseif (x <= 9.2e+109) tmp = (a + z) - b; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z + N[(t * N[(N[(a - z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e+88], t$95$1, If[LessEqual[x, 9.2e+109], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + t \cdot \frac{a - z}{x}\\
\mathbf{if}\;x \leq -1 \cdot 10^{+88}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+109}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.99999999999999959e87 or 9.20000000000000042e109 < x Initial program 60.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-+.f6440.8
Applied rewrites40.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-*.f64N/A
sub-divN/A
lower-/.f64N/A
lower--.f6429.4
Applied rewrites29.4%
if -9.99999999999999959e87 < x < 9.20000000000000042e109Initial program 60.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.9
Applied rewrites55.9%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1e+88) z (if (<= x 4.2e+116) (- (+ a z) b) z)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1e+88) {
tmp = z;
} else if (x <= 4.2e+116) {
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 <= (-1d+88)) then
tmp = z
else if (x <= 4.2d+116) 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 <= -1e+88) {
tmp = z;
} else if (x <= 4.2e+116) {
tmp = (a + z) - b;
} else {
tmp = z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1e+88: tmp = z elif x <= 4.2e+116: tmp = (a + z) - b else: tmp = z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1e+88) tmp = z; elseif (x <= 4.2e+116) 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 <= -1e+88) tmp = z; elseif (x <= 4.2e+116) tmp = (a + z) - b; else tmp = z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1e+88], z, If[LessEqual[x, 4.2e+116], N[(N[(a + z), $MachinePrecision] - b), $MachinePrecision], z]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{+88}:\\
\;\;\;\;z\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+116}:\\
\;\;\;\;\left(a + z\right) - b\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if x < -9.99999999999999959e87 or 4.2000000000000002e116 < x Initial program 60.5%
Taylor expanded in x around inf
Applied rewrites32.8%
if -9.99999999999999959e87 < x < 4.2000000000000002e116Initial program 60.5%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f6455.9
Applied rewrites55.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -3.4e+122) a (if (<= a 7.5e+91) z a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -3.4e+122) {
tmp = a;
} else if (a <= 7.5e+91) {
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 <= (-3.4d+122)) then
tmp = a
else if (a <= 7.5d+91) 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 <= -3.4e+122) {
tmp = a;
} else if (a <= 7.5e+91) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -3.4e+122: tmp = a elif a <= 7.5e+91: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -3.4e+122) tmp = a; elseif (a <= 7.5e+91) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -3.4e+122) tmp = a; elseif (a <= 7.5e+91) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -3.4e+122], a, If[LessEqual[a, 7.5e+91], z, a]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.4 \cdot 10^{+122}:\\
\;\;\;\;a\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{+91}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < -3.4e122 or 7.50000000000000033e91 < a Initial program 60.5%
Taylor expanded in t around inf
Applied rewrites32.9%
if -3.4e122 < a < 7.50000000000000033e91Initial program 60.5%
Taylor expanded in x around inf
Applied rewrites32.8%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return a;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 60.5%
Taylor expanded in t around inf
Applied rewrites32.9%
herbie shell --seed 2025142
(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)))