
(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 10 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 (let* ((t_1 (+ (+ (+ (* x y) (* z t)) (* a b)) (* c i)))) (if (<= t_1 INFINITY) t_1 (+ (* c i) (* x y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((x * y) + (z * t)) + (a * b)) + (c * i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (c * i) + (x * y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((x * y) + (z * t)) + (a * b)) + (c * i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (c * i) + (x * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (((x * y) + (z * t)) + (a * b)) + (c * i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (c * i) + (x * y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(x * y) + Float64(z * t)) + Float64(a * b)) + Float64(c * i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(c * i) + Float64(x * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (((x * y) + (z * t)) + (a * b)) + (c * i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (c * i) + (x * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(x * y), $MachinePrecision] + N[(z * t), $MachinePrecision]), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \left(\left(x \cdot y + z \cdot t\right) + a \cdot b\right) + c \cdot i\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\end{array}
if (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) < +inf.0Initial program 96.0%
if +inf.0 < (+.f64 (+.f64 (+.f64 (*.f64 x y) (*.f64 z t)) (*.f64 a b)) (*.f64 c i)) Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6451.1%
Applied rewrites51.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (* x y) -2e+63)
(+ (* c i) (+ (* t z) (* x y)))
(if (<= (* x y) 2e-68)
(+ (+ (* t z) (* a b)) (* c i))
(+ (+ (* a b) (* x y)) (* c i)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x * y) <= -2e+63) {
tmp = (c * i) + ((t * z) + (x * y));
} else if ((x * y) <= 2e-68) {
tmp = ((t * z) + (a * b)) + (c * i);
} else {
tmp = ((a * b) + (x * y)) + (c * i);
}
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 ((x * y) <= (-2d+63)) then
tmp = (c * i) + ((t * z) + (x * y))
else if ((x * y) <= 2d-68) then
tmp = ((t * z) + (a * b)) + (c * i)
else
tmp = ((a * b) + (x * y)) + (c * i)
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 ((x * y) <= -2e+63) {
tmp = (c * i) + ((t * z) + (x * y));
} else if ((x * y) <= 2e-68) {
tmp = ((t * z) + (a * b)) + (c * i);
} else {
tmp = ((a * b) + (x * y)) + (c * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x * y) <= -2e+63: tmp = (c * i) + ((t * z) + (x * y)) elif (x * y) <= 2e-68: tmp = ((t * z) + (a * b)) + (c * i) else: tmp = ((a * b) + (x * y)) + (c * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(x * y) <= -2e+63) tmp = Float64(Float64(c * i) + Float64(Float64(t * z) + Float64(x * y))); elseif (Float64(x * y) <= 2e-68) tmp = Float64(Float64(Float64(t * z) + Float64(a * b)) + Float64(c * i)); else tmp = Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(c * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x * y) <= -2e+63) tmp = (c * i) + ((t * z) + (x * y)); elseif ((x * y) <= 2e-68) tmp = ((t * z) + (a * b)) + (c * i); else tmp = ((a * b) + (x * y)) + (c * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(x * y), $MachinePrecision], -2e+63], N[(N[(c * i), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e-68], N[(N[(N[(t * z), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+63}:\\
\;\;\;\;c \cdot i + \left(t \cdot z + x \cdot y\right)\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{-68}:\\
\;\;\;\;\left(t \cdot z + a \cdot b\right) + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot b + x \cdot y\right) + c \cdot i\\
\end{array}
if (*.f64 x y) < -2.0000000000000001e63Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
if -2.0000000000000001e63 < (*.f64 x y) < 2.0000000000000001e-68Initial program 96.0%
Taylor expanded in x around 0
lower-*.f6474.1%
Applied rewrites74.1%
if 2.0000000000000001e-68 < (*.f64 x y) Initial program 96.0%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6474.0%
Applied rewrites74.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (+ (* a b) (* x y)) (* c i))))
(if (<= (* a b) -3.9e+207)
t_1
(if (<= (* a b) 7.2e+18) (+ (* c i) (+ (* t z) (* x y))) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((a * b) + (x * y)) + (c * i);
double tmp;
if ((a * b) <= -3.9e+207) {
tmp = t_1;
} else if ((a * b) <= 7.2e+18) {
tmp = (c * i) + ((t * z) + (x * y));
} 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, 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) :: t_1
real(8) :: tmp
t_1 = ((a * b) + (x * y)) + (c * i)
if ((a * b) <= (-3.9d+207)) then
tmp = t_1
else if ((a * b) <= 7.2d+18) then
tmp = (c * i) + ((t * z) + (x * y))
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 c, double i) {
double t_1 = ((a * b) + (x * y)) + (c * i);
double tmp;
if ((a * b) <= -3.9e+207) {
tmp = t_1;
} else if ((a * b) <= 7.2e+18) {
tmp = (c * i) + ((t * z) + (x * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((a * b) + (x * y)) + (c * i) tmp = 0 if (a * b) <= -3.9e+207: tmp = t_1 elif (a * b) <= 7.2e+18: tmp = (c * i) + ((t * z) + (x * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(a * b) + Float64(x * y)) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -3.9e+207) tmp = t_1; elseif (Float64(a * b) <= 7.2e+18) tmp = Float64(Float64(c * i) + Float64(Float64(t * z) + Float64(x * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((a * b) + (x * y)) + (c * i); tmp = 0.0; if ((a * b) <= -3.9e+207) tmp = t_1; elseif ((a * b) <= 7.2e+18) tmp = (c * i) + ((t * z) + (x * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a * b), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -3.9e+207], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 7.2e+18], N[(N[(c * i), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(a \cdot b + x \cdot y\right) + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -3.9 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 7.2 \cdot 10^{+18}:\\
\;\;\;\;c \cdot i + \left(t \cdot z + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 a b) < -3.8999999999999997e207 or 7.2e18 < (*.f64 a b) Initial program 96.0%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6474.0%
Applied rewrites74.0%
if -3.8999999999999997e207 < (*.f64 a b) < 7.2e18Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* a b) (* c i))))
(if (<= (* a b) -3.9e+207)
t_1
(if (<= (* a b) 2.3e+25) (+ (* c i) (+ (* t z) (* x y))) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -3.9e+207) {
tmp = t_1;
} else if ((a * b) <= 2.3e+25) {
tmp = (c * i) + ((t * z) + (x * y));
} 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, 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) :: t_1
real(8) :: tmp
t_1 = (a * b) + (c * i)
if ((a * b) <= (-3.9d+207)) then
tmp = t_1
else if ((a * b) <= 2.3d+25) then
tmp = (c * i) + ((t * z) + (x * y))
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 c, double i) {
double t_1 = (a * b) + (c * i);
double tmp;
if ((a * b) <= -3.9e+207) {
tmp = t_1;
} else if ((a * b) <= 2.3e+25) {
tmp = (c * i) + ((t * z) + (x * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (a * b) + (c * i) tmp = 0 if (a * b) <= -3.9e+207: tmp = t_1 elif (a * b) <= 2.3e+25: tmp = (c * i) + ((t * z) + (x * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a * b) + Float64(c * i)) tmp = 0.0 if (Float64(a * b) <= -3.9e+207) tmp = t_1; elseif (Float64(a * b) <= 2.3e+25) tmp = Float64(Float64(c * i) + Float64(Float64(t * z) + Float64(x * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (a * b) + (c * i); tmp = 0.0; if ((a * b) <= -3.9e+207) tmp = t_1; elseif ((a * b) <= 2.3e+25) tmp = (c * i) + ((t * z) + (x * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(a * b), $MachinePrecision], -3.9e+207], t$95$1, If[LessEqual[N[(a * b), $MachinePrecision], 2.3e+25], N[(N[(c * i), $MachinePrecision] + N[(N[(t * z), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := a \cdot b + c \cdot i\\
\mathbf{if}\;a \cdot b \leq -3.9 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \cdot b \leq 2.3 \cdot 10^{+25}:\\
\;\;\;\;c \cdot i + \left(t \cdot z + x \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 a b) < -3.8999999999999997e207 or 2.2999999999999998e25 < (*.f64 a b) Initial program 96.0%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6474.0%
Applied rewrites74.0%
Taylor expanded in x around 0
lower-*.f6451.2%
Applied rewrites51.2%
if -3.8999999999999997e207 < (*.f64 a b) < 2.2999999999999998e25Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* x y))))
(if (<= (* x y) -2e+159)
t_1
(if (<= (* x y) -1e-36)
(+ (* c i) (* t z))
(if (<= (* x y) 2e+79) (+ (* a b) (* c i)) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (x * y);
double tmp;
if ((x * y) <= -2e+159) {
tmp = t_1;
} else if ((x * y) <= -1e-36) {
tmp = (c * i) + (t * z);
} else if ((x * y) <= 2e+79) {
tmp = (a * b) + (c * i);
} 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, 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) :: t_1
real(8) :: tmp
t_1 = (c * i) + (x * y)
if ((x * y) <= (-2d+159)) then
tmp = t_1
else if ((x * y) <= (-1d-36)) then
tmp = (c * i) + (t * z)
else if ((x * y) <= 2d+79) then
tmp = (a * b) + (c * i)
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 c, double i) {
double t_1 = (c * i) + (x * y);
double tmp;
if ((x * y) <= -2e+159) {
tmp = t_1;
} else if ((x * y) <= -1e-36) {
tmp = (c * i) + (t * z);
} else if ((x * y) <= 2e+79) {
tmp = (a * b) + (c * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (x * y) tmp = 0 if (x * y) <= -2e+159: tmp = t_1 elif (x * y) <= -1e-36: tmp = (c * i) + (t * z) elif (x * y) <= 2e+79: tmp = (a * b) + (c * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2e+159) tmp = t_1; elseif (Float64(x * y) <= -1e-36) tmp = Float64(Float64(c * i) + Float64(t * z)); elseif (Float64(x * y) <= 2e+79) tmp = Float64(Float64(a * b) + Float64(c * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (x * y); tmp = 0.0; if ((x * y) <= -2e+159) tmp = t_1; elseif ((x * y) <= -1e-36) tmp = (c * i) + (t * z); elseif ((x * y) <= 2e+79) tmp = (a * b) + (c * i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+159], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], -1e-36], N[(N[(c * i), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(x * y), $MachinePrecision], 2e+79], N[(N[(a * b), $MachinePrecision] + N[(c * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := c \cdot i + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq -1 \cdot 10^{-36}:\\
\;\;\;\;c \cdot i + t \cdot z\\
\mathbf{elif}\;x \cdot y \leq 2 \cdot 10^{+79}:\\
\;\;\;\;a \cdot b + c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 x y) < -1.9999999999999999e159 or 1.9999999999999999e79 < (*.f64 x y) Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6451.1%
Applied rewrites51.1%
if -1.9999999999999999e159 < (*.f64 x y) < -9.9999999999999994e-37Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
Taylor expanded in x around 0
lower-*.f6451.1%
Applied rewrites51.1%
if -9.9999999999999994e-37 < (*.f64 x y) < 1.9999999999999999e79Initial program 96.0%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6474.0%
Applied rewrites74.0%
Taylor expanded in x around 0
lower-*.f6451.2%
Applied rewrites51.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* c i) (* x y))))
(if (<= (* x y) -2e+159)
t_1
(if (<= (* x y) 1e-41) (+ (* 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 = (c * i) + (x * y);
double tmp;
if ((x * y) <= -2e+159) {
tmp = t_1;
} else if ((x * y) <= 1e-41) {
tmp = (c * i) + (t * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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) :: t_1
real(8) :: tmp
t_1 = (c * i) + (x * y)
if ((x * y) <= (-2d+159)) then
tmp = t_1
else if ((x * y) <= 1d-41) then
tmp = (c * i) + (t * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (c * i) + (x * y);
double tmp;
if ((x * y) <= -2e+159) {
tmp = t_1;
} else if ((x * y) <= 1e-41) {
tmp = (c * i) + (t * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (c * i) + (x * y) tmp = 0 if (x * y) <= -2e+159: tmp = t_1 elif (x * y) <= 1e-41: tmp = (c * i) + (t * z) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(c * i) + Float64(x * y)) tmp = 0.0 if (Float64(x * y) <= -2e+159) tmp = t_1; elseif (Float64(x * y) <= 1e-41) tmp = Float64(Float64(c * i) + Float64(t * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (c * i) + (x * y); tmp = 0.0; if ((x * y) <= -2e+159) tmp = t_1; elseif ((x * y) <= 1e-41) tmp = (c * i) + (t * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x * y), $MachinePrecision], -2e+159], t$95$1, If[LessEqual[N[(x * y), $MachinePrecision], 1e-41], N[(N[(c * i), $MachinePrecision] + N[(t * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := c \cdot i + x \cdot y\\
\mathbf{if}\;x \cdot y \leq -2 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \cdot y \leq 10^{-41}:\\
\;\;\;\;c \cdot i + t \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 x y) < -1.9999999999999999e159 or 1e-41 < (*.f64 x y) Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6451.1%
Applied rewrites51.1%
if -1.9999999999999999e159 < (*.f64 x y) < 1e-41Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
Taylor expanded in x around 0
lower-*.f6451.1%
Applied rewrites51.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (* (- t) z))))
(if (<= (* z t) -2e+75)
t_1
(if (<= (* z t) 1e+190) (+ (* c i) (* x y)) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -(-t * z);
double tmp;
if ((z * t) <= -2e+75) {
tmp = t_1;
} else if ((z * t) <= 1e+190) {
tmp = (c * i) + (x * y);
} 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, 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) :: t_1
real(8) :: tmp
t_1 = -(-t * z)
if ((z * t) <= (-2d+75)) then
tmp = t_1
else if ((z * t) <= 1d+190) then
tmp = (c * i) + (x * y)
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 c, double i) {
double t_1 = -(-t * z);
double tmp;
if ((z * t) <= -2e+75) {
tmp = t_1;
} else if ((z * t) <= 1e+190) {
tmp = (c * i) + (x * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -(-t * z) tmp = 0 if (z * t) <= -2e+75: tmp = t_1 elif (z * t) <= 1e+190: tmp = (c * i) + (x * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-Float64(Float64(-t) * z)) tmp = 0.0 if (Float64(z * t) <= -2e+75) tmp = t_1; elseif (Float64(z * t) <= 1e+190) tmp = Float64(Float64(c * i) + Float64(x * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -(-t * z); tmp = 0.0; if ((z * t) <= -2e+75) tmp = t_1; elseif ((z * t) <= 1e+190) tmp = (c * i) + (x * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = (-N[((-t) * z), $MachinePrecision])}, If[LessEqual[N[(z * t), $MachinePrecision], -2e+75], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e+190], N[(N[(c * i), $MachinePrecision] + N[(x * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -\left(-t\right) \cdot z\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 10^{+190}:\\
\;\;\;\;c \cdot i + x \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 z t) < -1.9999999999999999e75 or 1.0000000000000001e190 < (*.f64 z t) Initial program 96.0%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6483.4%
Applied rewrites83.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6427.7%
Applied rewrites27.7%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6427.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6427.7%
Applied rewrites27.7%
if -1.9999999999999999e75 < (*.f64 z t) < 1.0000000000000001e190Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6451.1%
Applied rewrites51.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (* (- t) z))))
(if (<= (* z t) -2e+64)
t_1
(if (<= (* z t) -4e-133)
(- (* (- y) x))
(if (<= (* z t) 1e+104) (* c i) t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -(-t * z);
double tmp;
if ((z * t) <= -2e+64) {
tmp = t_1;
} else if ((z * t) <= -4e-133) {
tmp = -(-y * x);
} else if ((z * t) <= 1e+104) {
tmp = c * i;
} 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, 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) :: t_1
real(8) :: tmp
t_1 = -(-t * z)
if ((z * t) <= (-2d+64)) then
tmp = t_1
else if ((z * t) <= (-4d-133)) then
tmp = -(-y * x)
else if ((z * t) <= 1d+104) then
tmp = c * i
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 c, double i) {
double t_1 = -(-t * z);
double tmp;
if ((z * t) <= -2e+64) {
tmp = t_1;
} else if ((z * t) <= -4e-133) {
tmp = -(-y * x);
} else if ((z * t) <= 1e+104) {
tmp = c * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -(-t * z) tmp = 0 if (z * t) <= -2e+64: tmp = t_1 elif (z * t) <= -4e-133: tmp = -(-y * x) elif (z * t) <= 1e+104: tmp = c * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-Float64(Float64(-t) * z)) tmp = 0.0 if (Float64(z * t) <= -2e+64) tmp = t_1; elseif (Float64(z * t) <= -4e-133) tmp = Float64(-Float64(Float64(-y) * x)); elseif (Float64(z * t) <= 1e+104) tmp = Float64(c * i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -(-t * z); tmp = 0.0; if ((z * t) <= -2e+64) tmp = t_1; elseif ((z * t) <= -4e-133) tmp = -(-y * x); elseif ((z * t) <= 1e+104) tmp = c * i; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = (-N[((-t) * z), $MachinePrecision])}, If[LessEqual[N[(z * t), $MachinePrecision], -2e+64], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], -4e-133], (-N[((-y) * x), $MachinePrecision]), If[LessEqual[N[(z * t), $MachinePrecision], 1e+104], N[(c * i), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := -\left(-t\right) \cdot z\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq -4 \cdot 10^{-133}:\\
\;\;\;\;-\left(-y\right) \cdot x\\
\mathbf{elif}\;z \cdot t \leq 10^{+104}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 z t) < -2e64 or 1e104 < (*.f64 z t) Initial program 96.0%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6483.4%
Applied rewrites83.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6427.7%
Applied rewrites27.7%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6427.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6427.7%
Applied rewrites27.7%
if -2e64 < (*.f64 z t) < -4.0000000000000003e-133Initial program 96.0%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6483.4%
Applied rewrites83.4%
lift-*.f64N/A
mul-1-negN/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
+-commutativeN/A
lift-*.f64N/A
distribute-neg-frac2N/A
mult-flipN/A
lower-*.f64N/A
Applied rewrites83.4%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f6427.3%
Applied rewrites27.3%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6427.3%
lift-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-outN/A
lower-*.f64N/A
lower-neg.f6427.3%
Applied rewrites27.3%
if -4.0000000000000003e-133 < (*.f64 z t) < 1e104Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6451.1%
Applied rewrites51.1%
Taylor expanded in x around 0
lower-*.f6427.1%
Applied rewrites27.1%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (- (* (- t) z)))) (if (<= (* z t) -2e+75) t_1 (if (<= (* z t) 1e+104) (* c i) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -(-t * z);
double tmp;
if ((z * t) <= -2e+75) {
tmp = t_1;
} else if ((z * t) <= 1e+104) {
tmp = c * i;
} 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, 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) :: t_1
real(8) :: tmp
t_1 = -(-t * z)
if ((z * t) <= (-2d+75)) then
tmp = t_1
else if ((z * t) <= 1d+104) then
tmp = c * i
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 c, double i) {
double t_1 = -(-t * z);
double tmp;
if ((z * t) <= -2e+75) {
tmp = t_1;
} else if ((z * t) <= 1e+104) {
tmp = c * i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -(-t * z) tmp = 0 if (z * t) <= -2e+75: tmp = t_1 elif (z * t) <= 1e+104: tmp = c * i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-Float64(Float64(-t) * z)) tmp = 0.0 if (Float64(z * t) <= -2e+75) tmp = t_1; elseif (Float64(z * t) <= 1e+104) tmp = Float64(c * i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -(-t * z); tmp = 0.0; if ((z * t) <= -2e+75) tmp = t_1; elseif ((z * t) <= 1e+104) tmp = c * i; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = (-N[((-t) * z), $MachinePrecision])}, If[LessEqual[N[(z * t), $MachinePrecision], -2e+75], t$95$1, If[LessEqual[N[(z * t), $MachinePrecision], 1e+104], N[(c * i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -\left(-t\right) \cdot z\\
\mathbf{if}\;z \cdot t \leq -2 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \cdot t \leq 10^{+104}:\\
\;\;\;\;c \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 z t) < -1.9999999999999999e75 or 1e104 < (*.f64 z t) Initial program 96.0%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6483.4%
Applied rewrites83.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6427.7%
Applied rewrites27.7%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6427.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f6427.7%
Applied rewrites27.7%
if -1.9999999999999999e75 < (*.f64 z t) < 1e104Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6451.1%
Applied rewrites51.1%
Taylor expanded in x around 0
lower-*.f6427.1%
Applied rewrites27.1%
(FPCore (x y z t a b c i) :precision binary64 (* c i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 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 = 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 c * i;
}
def code(x, y, z, t, a, b, c, i): return c * i
function code(x, y, z, t, a, b, c, i) return Float64(c * i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = c * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(c * i), $MachinePrecision]
c \cdot i
Initial program 96.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6473.9%
Applied rewrites73.9%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6451.1%
Applied rewrites51.1%
Taylor expanded in x around 0
lower-*.f6427.1%
Applied rewrites27.1%
herbie shell --seed 2025258
(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)))