
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((x * y) + (z * t)) + (a * b)) + (c * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((x * y) + (z * t)) + (a * b)) + (c * i);
}
def code(x, y, z, t, a, b, c, i): return (((x * y) + (z * t)) + (a * b)) + (c * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((x * y) + (z * t)) + (a * b)) + (c * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]
\left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i
(FPCore (x y z t a b c i) :precision binary64 (fma z t (fma i c (fma b a (* y x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(z, t, fma(i, c, fma(b, a, (y * x))));
}
function code(x, y, z, t, a, b, c, i) return fma(z, t, fma(i, c, fma(b, a, Float64(y * x)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z * t + N[(i * c + N[(b * a + N[(y * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(z, t, \mathsf{fma}\left(i, c, \mathsf{fma}\left(b, a, y \cdot x\right)\right)\right)
Initial program 95.9%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
lower-fma.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
add-flipN/A
sub-flipN/A
lift-*.f64N/A
*-commutativeN/A
remove-double-negN/A
lower-fma.f6498.0%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.0%
Applied rewrites98.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* z t) -5e+115)
(fma a b (fma c i (* t z)))
(if (<= (* z t) 2e+122)
(fma a b (fma c i (* x y)))
(fma c i (fma t z (* x y))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -5e+115) {
tmp = fma(a, b, fma(c, i, (t * z)));
} else if ((z * t) <= 2e+122) {
tmp = fma(a, b, fma(c, i, (x * y)));
} else {
tmp = fma(c, i, fma(t, z, (x * y)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -5e+115) tmp = fma(a, b, fma(c, i, Float64(t * z))); elseif (Float64(z * t) <= 2e+122) tmp = fma(a, b, fma(c, i, Float64(x * y))); else tmp = fma(c, i, fma(t, z, Float64(x * y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -5e+115], N[(a * b + N[(c * i + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+122], N[(a * b + N[(c * i + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(c * i + N[(t * z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{fma}\left(a, b, \mathsf{fma}\left(c, i, t \cdot z\right)\right)\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+122}:\\
\;\;\;\;\mathsf{fma}\left(a, b, \mathsf{fma}\left(c, i, x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, \mathsf{fma}\left(t, z, x \cdot y\right)\right)\\
\end{array}
if (*.f64 z t) < -5.00000000000000008e115Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
if -5.00000000000000008e115 < (*.f64 z t) < 2.00000000000000003e122Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
if 2.00000000000000003e122 < (*.f64 z t) Initial program 95.9%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.4%
Applied rewrites75.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* z t) -5e+115) (fma a b (fma c i (* t z))) (if (<= (* z t) 1e+261) (fma a b (fma c i (* x y))) (* t z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -5e+115) {
tmp = fma(a, b, fma(c, i, (t * z)));
} else if ((z * t) <= 1e+261) {
tmp = fma(a, b, fma(c, i, (x * y)));
} else {
tmp = t * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -5e+115) tmp = fma(a, b, fma(c, i, Float64(t * z))); elseif (Float64(z * t) <= 1e+261) tmp = fma(a, b, fma(c, i, Float64(x * y))); else tmp = Float64(t * z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -5e+115], N[(a * b + N[(c * i + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e+261], N[(a * b + N[(c * i + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t * z), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{fma}\left(a, b, \mathsf{fma}\left(c, i, t \cdot z\right)\right)\\
\mathbf{elif}\;z \cdot t \leq 10^{+261}:\\
\;\;\;\;\mathsf{fma}\left(a, b, \mathsf{fma}\left(c, i, x \cdot y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot z\\
\end{array}
if (*.f64 z t) < -5.00000000000000008e115Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
if -5.00000000000000008e115 < (*.f64 z t) < 9.9999999999999993e260Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
if 9.9999999999999993e260 < (*.f64 z t) Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
Taylor expanded in z around inf
lower-*.f6426.6%
Applied rewrites26.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma a b (* x y))))
(if (<= (* x y) -3.4e+50)
t_1
(if (<= (* x y) 6e+158) (fma a b (fma c i (* t z))) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(a, b, (x * y));
double tmp;
if ((x * y) <= -3.4e+50) {
tmp = t_1;
} else if ((x * y) <= 6e+158) {
tmp = fma(a, b, fma(c, i, (t * z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(a, b, Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -3.4e+50) tmp = t_1; elseif (Float64(x * y) <= 6e+158) tmp = fma(a, b, fma(c, i, Float64(t * z))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a * b + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -3.4e+50], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 6e+158], N[(a * b + N[(c * i + N[(t * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, b, x \cdot y\right)\\
\mathbf{if}\;x \cdot y \leq -3.4 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(a, b, \mathsf{fma}\left(c, i, t \cdot z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 x y) < -3.3999999999999998e50 or 6e158 < (*.f64 x y) Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
Taylor expanded in x around 0
lower-*.f6451.6%
Applied rewrites51.6%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
if -3.3999999999999998e50 < (*.f64 x y) < 6e158Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* z t) -1.5e+193)
(fma a b (* t z))
(if (<= (* z t) -2e-29)
(fma a b (* c i))
(if (<= (* z t) 1e+261) (fma a b (* x y)) (* t z)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -1.5e+193) {
tmp = fma(a, b, (t * z));
} else if ((z * t) <= -2e-29) {
tmp = fma(a, b, (c * i));
} else if ((z * t) <= 1e+261) {
tmp = fma(a, b, (x * y));
} else {
tmp = t * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -1.5e+193) tmp = fma(a, b, Float64(t * z)); elseif (Float64(z * t) <= -2e-29) tmp = fma(a, b, Float64(c * i)); elseif (Float64(z * t) <= 1e+261) tmp = fma(a, b, Float64(x * y)); else tmp = Float64(t * z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -1.5e+193], N[(a * b + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], -2e-29], N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e+261], N[(a * b + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(t * z), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -1.5 \cdot 10^{+193}:\\
\;\;\;\;\mathsf{fma}\left(a, b, t \cdot z\right)\\
\mathbf{elif}\;z \cdot t \leq -2 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(a, b, c \cdot i\right)\\
\mathbf{elif}\;z \cdot t \leq 10^{+261}:\\
\;\;\;\;\mathsf{fma}\left(a, b, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot z\\
\end{array}
if (*.f64 z t) < -1.5e193Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
if -1.5e193 < (*.f64 z t) < -1.99999999999999989e-29Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
Taylor expanded in x around 0
lower-*.f6451.6%
Applied rewrites51.6%
if -1.99999999999999989e-29 < (*.f64 z t) < 9.9999999999999993e260Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
Taylor expanded in x around 0
lower-*.f6451.6%
Applied rewrites51.6%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
if 9.9999999999999993e260 < (*.f64 z t) Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
Taylor expanded in z around inf
lower-*.f6426.6%
Applied rewrites26.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* c i) -5e+208) (fma a b (* c i)) (if (<= (* c i) 2e+113) (fma a b (* x y)) (fma c i (* t z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((c * i) <= -5e+208) {
tmp = fma(a, b, (c * i));
} else if ((c * i) <= 2e+113) {
tmp = fma(a, b, (x * y));
} else {
tmp = fma(c, i, (t * z));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(c * i) <= -5e+208) tmp = fma(a, b, Float64(c * i)); elseif (Float64(c * i) <= 2e+113) tmp = fma(a, b, Float64(x * y)); else tmp = fma(c, i, Float64(t * z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(c * i), $MachinePrecision], -5e+208], N[(a * b + N[(c * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(c * i), $MachinePrecision], 2e+113], N[(a * b + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(c * i + N[(t * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;c \cdot i \leq -5 \cdot 10^{+208}:\\
\;\;\;\;\mathsf{fma}\left(a, b, c \cdot i\right)\\
\mathbf{elif}\;c \cdot i \leq 2 \cdot 10^{+113}:\\
\;\;\;\;\mathsf{fma}\left(a, b, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(c, i, t \cdot z\right)\\
\end{array}
if (*.f64 c i) < -5.0000000000000004e208Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
Taylor expanded in x around 0
lower-*.f6451.6%
Applied rewrites51.6%
if -5.0000000000000004e208 < (*.f64 c i) < 2e113Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
Taylor expanded in x around 0
lower-*.f6451.6%
Applied rewrites51.6%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
if 2e113 < (*.f64 c i) Initial program 95.9%
Taylor expanded in a around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.4%
Applied rewrites75.4%
Taylor expanded in x around 0
lower-*.f6451.2%
Applied rewrites51.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* z t) -5e+115) (fma a b (* t z)) (if (<= (* z t) 1e+261) (fma a b (* x y)) (* t z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((z * t) <= -5e+115) {
tmp = fma(a, b, (t * z));
} else if ((z * t) <= 1e+261) {
tmp = fma(a, b, (x * y));
} else {
tmp = t * z;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(z * t) <= -5e+115) tmp = fma(a, b, Float64(t * z)); elseif (Float64(z * t) <= 1e+261) tmp = fma(a, b, Float64(x * y)); else tmp = Float64(t * z); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(z * t), $MachinePrecision], -5e+115], N[(a * b + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e+261], N[(a * b + N[(x * y), $MachinePrecision]), $MachinePrecision], N[(t * z), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -5 \cdot 10^{+115}:\\
\;\;\;\;\mathsf{fma}\left(a, b, t \cdot z\right)\\
\mathbf{elif}\;z \cdot t \leq 10^{+261}:\\
\;\;\;\;\mathsf{fma}\left(a, b, x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t \cdot z\\
\end{array}
if (*.f64 z t) < -5.00000000000000008e115Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
if -5.00000000000000008e115 < (*.f64 z t) < 9.9999999999999993e260Initial program 95.9%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6475.5%
Applied rewrites75.5%
Taylor expanded in x around 0
lower-*.f6451.6%
Applied rewrites51.6%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
if 9.9999999999999993e260 < (*.f64 z t) Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
Taylor expanded in z around inf
lower-*.f6426.6%
Applied rewrites26.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* x y) -5.5e+161) (* x y) (if (<= (* x y) 6e+158) (fma a b (* t z)) (* x y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -5.5e+161) {
tmp = x * y;
} else if ((x * y) <= 6e+158) {
tmp = fma(a, b, (t * z));
} else {
tmp = x * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -5.5e+161) tmp = Float64(x * y); elseif (Float64(x * y) <= 6e+158) tmp = fma(a, b, Float64(t * z)); else tmp = Float64(x * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -5.5e+161], N[(x * y), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 6e+158], N[(a * b + N[(t * z), $MachinePrecision]), $MachinePrecision], N[(x * y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -5.5 \cdot 10^{+161}:\\
\;\;\;\;x \cdot y\\
\mathbf{elif}\;x \cdot y \leq 6 \cdot 10^{+158}:\\
\;\;\;\;\mathsf{fma}\left(a, b, t \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot y\\
\end{array}
if (*.f64 x y) < -5.5000000000000005e161 or 6e158 < (*.f64 x y) Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in x around inf
lower-*.f6428.0%
Applied rewrites28.0%
if -5.5000000000000005e161 < (*.f64 x y) < 6e158Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -2.7e+102) (* a b) (if (<= (* a b) 1.8e+182) (* x y) (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.7e+102) {
tmp = a * b;
} else if ((a * b) <= 1.8e+182) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-2.7d+102)) then
tmp = a * b
else if ((a * b) <= 1.8d+182) then
tmp = x * y
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.7e+102) {
tmp = a * b;
} else if ((a * b) <= 1.8e+182) {
tmp = x * y;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.7e+102: tmp = a * b elif (a * b) <= 1.8e+182: tmp = x * y else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.7e+102) tmp = Float64(a * b); elseif (Float64(a * b) <= 1.8e+182) tmp = Float64(x * y); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -2.7e+102) tmp = a * b; elseif ((a * b) <= 1.8e+182) tmp = x * y; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.7e+102], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 1.8e+182], N[(x * y), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.7 \cdot 10^{+102}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 1.8 \cdot 10^{+182}:\\
\;\;\;\;x \cdot y\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
if (*.f64 a b) < -2.7000000000000001e102 or 1.8e182 < (*.f64 a b) Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
if -2.7000000000000001e102 < (*.f64 a b) < 1.8e182Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in x around inf
lower-*.f6428.0%
Applied rewrites28.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* a b) -2.25e+114)
(* a b)
(if (<= (* a b) -3.05e-111)
(* c i)
(if (<= (* a b) -8e-305)
(* t z)
(if (<= (* a b) 175000000000.0) (* c i) (* a b))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.25e+114) {
tmp = a * b;
} else if ((a * b) <= -3.05e-111) {
tmp = c * i;
} else if ((a * b) <= -8e-305) {
tmp = t * z;
} else if ((a * b) <= 175000000000.0) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-2.25d+114)) then
tmp = a * b
else if ((a * b) <= (-3.05d-111)) then
tmp = c * i
else if ((a * b) <= (-8d-305)) then
tmp = t * z
else if ((a * b) <= 175000000000.0d0) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.25e+114) {
tmp = a * b;
} else if ((a * b) <= -3.05e-111) {
tmp = c * i;
} else if ((a * b) <= -8e-305) {
tmp = t * z;
} else if ((a * b) <= 175000000000.0) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.25e+114: tmp = a * b elif (a * b) <= -3.05e-111: tmp = c * i elif (a * b) <= -8e-305: tmp = t * z elif (a * b) <= 175000000000.0: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.25e+114) tmp = Float64(a * b); elseif (Float64(a * b) <= -3.05e-111) tmp = Float64(c * i); elseif (Float64(a * b) <= -8e-305) tmp = Float64(t * z); elseif (Float64(a * b) <= 175000000000.0) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -2.25e+114) tmp = a * b; elseif ((a * b) <= -3.05e-111) tmp = c * i; elseif ((a * b) <= -8e-305) tmp = t * z; elseif ((a * b) <= 175000000000.0) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.25e+114], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -3.05e-111], N[(c * i), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], -8e-305], N[(t * z), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 175000000000.0], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.25 \cdot 10^{+114}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq -3.05 \cdot 10^{-111}:\\
\;\;\;\;c \cdot i\\
\mathbf{elif}\;a \cdot b \leq -8 \cdot 10^{-305}:\\
\;\;\;\;t \cdot z\\
\mathbf{elif}\;a \cdot b \leq 175000000000:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
if (*.f64 a b) < -2.25e114 or 1.75e11 < (*.f64 a b) Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
if -2.25e114 < (*.f64 a b) < -3.0500000000000001e-111 or -7.99999999999999997e-305 < (*.f64 a b) < 1.75e11Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
Taylor expanded in c around inf
lower-*.f6427.7%
Applied rewrites27.7%
if -3.0500000000000001e-111 < (*.f64 a b) < -7.99999999999999997e-305Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
Taylor expanded in z around inf
lower-*.f6426.6%
Applied rewrites26.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* a b) -2.25e+114) (* a b) (if (<= (* a b) 175000000000.0) (* c i) (* a b))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.25e+114) {
tmp = a * b;
} else if ((a * b) <= 175000000000.0) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((a * b) <= (-2.25d+114)) then
tmp = a * b
else if ((a * b) <= 175000000000.0d0) then
tmp = c * i
else
tmp = a * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((a * b) <= -2.25e+114) {
tmp = a * b;
} else if ((a * b) <= 175000000000.0) {
tmp = c * i;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (a * b) <= -2.25e+114: tmp = a * b elif (a * b) <= 175000000000.0: tmp = c * i else: tmp = a * b return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(a * b) <= -2.25e+114) tmp = Float64(a * b); elseif (Float64(a * b) <= 175000000000.0) tmp = Float64(c * i); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((a * b) <= -2.25e+114) tmp = a * b; elseif ((a * b) <= 175000000000.0) tmp = c * i; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(a * b), $MachinePrecision], -2.25e+114], N[(a * b), $MachinePrecision], If[LessEqual[N[(a * b), $MachinePrecision], 175000000000.0], N[(c * i), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;a \cdot b \leq -2.25 \cdot 10^{+114}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \cdot b \leq 175000000000:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
if (*.f64 a b) < -2.25e114 or 1.75e11 < (*.f64 a b) Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
if -2.25e114 < (*.f64 a b) < 1.75e11Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
Taylor expanded in c around inf
lower-*.f6427.7%
Applied rewrites27.7%
(FPCore (x y z t a b c i) :precision binary64 (* a b))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = a * b
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a * b;
}
def code(x, y, z, t, a, b, c, i): return a * b
function code(x, y, z, t, a, b, c, i) return Float64(a * b) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a * b; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a * b), $MachinePrecision]
a \cdot b
Initial program 95.9%
Taylor expanded in x around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-*.f6474.4%
Applied rewrites74.4%
Taylor expanded in c around 0
lower-fma.f64N/A
lower-*.f6450.7%
Applied rewrites50.7%
Taylor expanded in z around 0
lower-*.f6426.9%
Applied rewrites26.9%
herbie shell --seed 2025188
(FPCore (x y z t a b c i)
:name "Linear.V4:$cdot from linear-1.19.1.3, C"
:precision binary64
(+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))