
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + 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) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + 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) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
Herbie found 17 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + 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) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + 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) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
}
def code(x, y, z, t, a, b, c, i): return ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (fma (fma (+ a y) y b) y c) y i))
(t_2 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -1.9e+52)
t_2
(if (<= y 7.8e+43)
(-
(/ t t_1)
(/
(* (- -230661.510616 (* (fma (fma y x z) y 27464.7644705) y)) y)
t_1))
t_2))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(fma(fma((a + y), y, b), y, c), y, i);
double t_2 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -1.9e+52) {
tmp = t_2;
} else if (y <= 7.8e+43) {
tmp = (t / t_1) - (((-230661.510616 - (fma(fma(y, x, z), y, 27464.7644705) * y)) * y) / t_1);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(fma(fma(Float64(a + y), y, b), y, c), y, i) t_2 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -1.9e+52) tmp = t_2; elseif (y <= 7.8e+43) tmp = Float64(Float64(t / t_1) - Float64(Float64(Float64(-230661.510616 - Float64(fma(fma(y, x, z), y, 27464.7644705) * y)) * y) / t_1)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+52], t$95$2, If[LessEqual[y, 7.8e+43], N[(N[(t / t$95$1), $MachinePrecision] - N[(N[(N[(-230661.510616 - N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)\\
t_2 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+52}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+43}:\\
\;\;\;\;\frac{t}{t\_1} - \frac{\left(-230661.510616 - \mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right) \cdot y\right) \cdot y}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if y < -1.9e52 or 7.8000000000000001e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -1.9e52 < y < 7.8000000000000001e43Initial program 56.0%
Applied rewrites56.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y)))
(t_2 (fma (fma (fma (+ a y) y b) y c) y i)))
(if (<= y -1.25e+53)
t_1
(if (<= y 8e+43)
(fma
(/ (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) t_2)
y
(/ t t_2))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double t_2 = fma(fma(fma((a + y), y, b), y, c), y, i);
double tmp;
if (y <= -1.25e+53) {
tmp = t_1;
} else if (y <= 8e+43) {
tmp = fma((fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_2), y, (t / t_2));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) t_2 = fma(fma(fma(Float64(a + y), y, b), y, c), y, i) tmp = 0.0 if (y <= -1.25e+53) tmp = t_1; elseif (y <= 8e+43) tmp = fma(Float64(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_2), y, Float64(t / t_2)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]}, If[LessEqual[y, -1.25e+53], t$95$1, If[LessEqual[y, 8e+43], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] / t$95$2), $MachinePrecision] * y + N[(t / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
t_2 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+43}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right)}{t\_2}, y, \frac{t}{t\_2}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.2500000000000001e53 or 8.00000000000000011e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -1.2500000000000001e53 < y < 8.00000000000000011e43Initial program 56.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites56.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -1.9e+52)
t_1
(if (<= y 7.8e+43)
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
(fma (fma (fma y a (fma y y b)) y c) y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -1.9e+52) {
tmp = t_1;
} else if (y <= 7.8e+43) {
tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(y, a, fma(y, y, b)), y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -1.9e+52) tmp = t_1; elseif (y <= 7.8e+43) tmp = Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(y, a, fma(y, y, b)), y, c), y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+52], t$95$1, If[LessEqual[y, 7.8e+43], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(y * a + N[(y * y + b), $MachinePrecision]), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+43}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, a, \mathsf{fma}\left(y, y, b\right)\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.9e52 or 7.8000000000000001e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -1.9e52 < y < 7.8000000000000001e43Initial program 56.0%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.0
lift-+.f64N/A
Applied rewrites56.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-pow.f6456.0
Applied rewrites56.0%
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
lift-pow.f64N/A
unpow2N/A
lower-fma.f6456.0
Applied rewrites56.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -1.9e+52)
t_1
(if (<= y 7.8e+43)
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
(fma (fma (fma (+ a y) y b) y c) y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -1.9e+52) {
tmp = t_1;
} else if (y <= 7.8e+43) {
tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -1.9e+52) tmp = t_1; elseif (y <= 7.8e+43) tmp = Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+52], t$95$1, If[LessEqual[y, 7.8e+43], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{+43}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.9e52 or 7.8000000000000001e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -1.9e52 < y < 7.8000000000000001e43Initial program 56.0%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.0
lift-+.f64N/A
Applied rewrites56.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -1.9e+52)
t_1
(if (<= y 9.2e+43)
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
(fma (fma (fma a y b) y c) y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -1.9e+52) {
tmp = t_1;
} else if (y <= 9.2e+43) {
tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(a, y, b), y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -1.9e+52) tmp = t_1; elseif (y <= 9.2e+43) tmp = Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(a, y, b), y, c), y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+52], t$95$1, If[LessEqual[y, 9.2e+43], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(a * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+43}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.9e52 or 9.200000000000001e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -1.9e52 < y < 9.200000000000001e43Initial program 56.0%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.0
lift-+.f64N/A
Applied rewrites56.0%
Taylor expanded in y around 0
Applied rewrites54.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -1.9e+52)
t_1
(if (<= y 8e+43)
(/
(fma (fma (fma z y 27464.7644705) y 230661.510616) y t)
(fma (fma (fma (+ a y) y b) y c) y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -1.9e+52) {
tmp = t_1;
} else if (y <= 8e+43) {
tmp = fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -1.9e+52) tmp = t_1; elseif (y <= 8e+43) tmp = Float64(fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+52], t$95$1, If[LessEqual[y, 8e+43], N[(N[(N[(N[(z * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+43}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.9e52 or 8.00000000000000011e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -1.9e52 < y < 8.00000000000000011e43Initial program 56.0%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.0
lift-+.f64N/A
Applied rewrites56.0%
Taylor expanded in x around 0
Applied rewrites52.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -1.9e+52)
t_1
(if (<= y -2.65e-13)
(/
(fma (fma 27464.7644705 y 230661.510616) y t)
(fma (fma (fma (+ a y) y b) y c) y i))
(if (<= y 8e+43)
(/
(fma (fma (fma z y 27464.7644705) y 230661.510616) y t)
(fma (+ (* b y) c) y i))
t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -1.9e+52) {
tmp = t_1;
} else if (y <= -2.65e-13) {
tmp = fma(fma(27464.7644705, y, 230661.510616), y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else if (y <= 8e+43) {
tmp = fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(((b * y) + c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -1.9e+52) tmp = t_1; elseif (y <= -2.65e-13) tmp = Float64(fma(fma(27464.7644705, y, 230661.510616), y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); elseif (y <= 8e+43) tmp = Float64(fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(Float64(Float64(b * y) + c), y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.9e+52], t$95$1, If[LessEqual[y, -2.65e-13], N[(N[(N[(27464.7644705 * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8e+43], N[(N[(N[(N[(z * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -1.9 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.65 \cdot 10^{-13}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(27464.7644705, y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+43}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(b \cdot y + c, y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.9e52 or 8.00000000000000011e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -1.9e52 < y < -2.6499999999999998e-13Initial program 56.0%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.0
lift-+.f64N/A
Applied rewrites56.0%
Taylor expanded in y around 0
Applied rewrites48.3%
if -2.6499999999999998e-13 < y < 8.00000000000000011e43Initial program 56.0%
Taylor expanded in x around 0
Applied rewrites52.7%
Taylor expanded in y around 0
lower-*.f6448.9
Applied rewrites48.9%
Applied rewrites48.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -4.7e+17)
t_1
(if (<= y 8e+43)
(/
(fma (fma (fma z y 27464.7644705) y 230661.510616) y t)
(fma (+ (* b y) c) y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -4.7e+17) {
tmp = t_1;
} else if (y <= 8e+43) {
tmp = fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(((b * y) + c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -4.7e+17) tmp = t_1; elseif (y <= 8e+43) tmp = Float64(fma(fma(fma(z, y, 27464.7644705), y, 230661.510616), y, t) / fma(Float64(Float64(b * y) + c), y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4.7e+17], t$95$1, If[LessEqual[y, 8e+43], N[(N[(N[(N[(z * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -4.7 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+43}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(z, y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(b \cdot y + c, y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.7e17 or 8.00000000000000011e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -4.7e17 < y < 8.00000000000000011e43Initial program 56.0%
Taylor expanded in x around 0
Applied rewrites52.7%
Taylor expanded in y around 0
lower-*.f6448.9
Applied rewrites48.9%
Applied rewrites48.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -6.5e+39)
t_1
(if (<= y 1.1e+43)
(/ (fma 230661.510616 y t) (fma (fma (fma (+ a y) y b) y c) y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -6.5e+39) {
tmp = t_1;
} else if (y <= 1.1e+43) {
tmp = fma(230661.510616, y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -6.5e+39) tmp = t_1; elseif (y <= 1.1e+43) tmp = Float64(fma(230661.510616, y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.5e+39], t$95$1, If[LessEqual[y, 1.1e+43], N[(N[(230661.510616 * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{+43}:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -6.5000000000000001e39 or 1.1e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -6.5000000000000001e39 < y < 1.1e43Initial program 56.0%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6456.0
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6456.0
lift-+.f64N/A
Applied rewrites56.0%
Taylor expanded in y around 0
Applied rewrites48.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -320000000.0)
t_1
(if (<= y 1.26e-38)
(/ (+ (* 230661.510616 y) t) (+ (* (+ (* b y) c) y) i))
(if (<= y 3.5e+43)
(/
(+
230661.510616
(fma y (+ 27464.7644705 (* y (+ z (* x y)))) (/ t y)))
c)
t_1)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -320000000.0) {
tmp = t_1;
} else if (y <= 1.26e-38) {
tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i);
} else if (y <= 3.5e+43) {
tmp = (230661.510616 + fma(y, (27464.7644705 + (y * (z + (x * y)))), (t / y))) / c;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -320000000.0) tmp = t_1; elseif (y <= 1.26e-38) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); elseif (y <= 3.5e+43) tmp = Float64(Float64(230661.510616 + fma(y, Float64(27464.7644705 + Float64(y * Float64(z + Float64(x * y)))), Float64(t / y))) / c); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -320000000.0], t$95$1, If[LessEqual[y, 1.26e-38], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.5e+43], N[(N[(230661.510616 + N[(y * N[(27464.7644705 + N[(y * N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / c), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -320000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.26 \cdot 10^{-38}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{+43}:\\
\;\;\;\;\frac{230661.510616 + \mathsf{fma}\left(y, 27464.7644705 + y \cdot \left(z + x \cdot y\right), \frac{t}{y}\right)}{c}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -3.2e8 or 3.5000000000000001e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -3.2e8 < y < 1.26e-38Initial program 56.0%
Taylor expanded in x around 0
Applied rewrites52.7%
Taylor expanded in y around 0
lower-*.f6448.9
Applied rewrites48.9%
Taylor expanded in y around 0
lower-*.f6446.0
Applied rewrites46.0%
if 1.26e-38 < y < 3.5000000000000001e43Initial program 56.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites56.7%
Taylor expanded in c around inf
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f6414.0
Applied rewrites14.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -320000000.0)
t_1
(if (<= y 1.12e+43)
(/ (+ (* 230661.510616 y) t) (+ (* (+ (* b y) c) y) i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -320000000.0) {
tmp = t_1;
} else if (y <= 1.12e+43) {
tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + 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 = (x + (z / y)) - ((a * x) / y)
if (y <= (-320000000.0d0)) then
tmp = t_1
else if (y <= 1.12d+43) then
tmp = ((230661.510616d0 * y) + t) / ((((b * y) + c) * y) + 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 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -320000000.0) {
tmp = t_1;
} else if (y <= 1.12e+43) {
tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x + (z / y)) - ((a * x) / y) tmp = 0 if y <= -320000000.0: tmp = t_1 elif y <= 1.12e+43: tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -320000000.0) tmp = t_1; elseif (y <= 1.12e+43) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x + (z / y)) - ((a * x) / y); tmp = 0.0; if (y <= -320000000.0) tmp = t_1; elseif (y <= 1.12e+43) tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + 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[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -320000000.0], t$95$1, If[LessEqual[y, 1.12e+43], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -320000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+43}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -3.2e8 or 1.12e43 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -3.2e8 < y < 1.12e43Initial program 56.0%
Taylor expanded in x around 0
Applied rewrites52.7%
Taylor expanded in y around 0
lower-*.f6448.9
Applied rewrites48.9%
Taylor expanded in y around 0
lower-*.f6446.0
Applied rewrites46.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -2600000000.0)
t_1
(if (<= y 7.2e+21)
(fma (/ (fma 27464.7644705 y 230661.510616) i) y (/ t i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -2600000000.0) {
tmp = t_1;
} else if (y <= 7.2e+21) {
tmp = fma((fma(27464.7644705, y, 230661.510616) / i), y, (t / i));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -2600000000.0) tmp = t_1; elseif (y <= 7.2e+21) tmp = fma(Float64(fma(27464.7644705, y, 230661.510616) / i), y, Float64(t / i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2600000000.0], t$95$1, If[LessEqual[y, 7.2e+21], N[(N[(N[(27464.7644705 * y + 230661.510616), $MachinePrecision] / i), $MachinePrecision] * y + N[(t / i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -2600000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{fma}\left(27464.7644705, y, 230661.510616\right)}{i}, y, \frac{t}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.6e9 or 7.2e21 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -2.6e9 < y < 7.2e21Initial program 56.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites56.7%
Taylor expanded in y around 0
Applied rewrites40.5%
Taylor expanded in y around 0
Applied rewrites34.1%
Taylor expanded in y around 0
Applied rewrites32.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -2600000000.0)
t_1
(if (<= y 7.2e+21) (fma (/ 230661.510616 i) y (/ t i)) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -2600000000.0) {
tmp = t_1;
} else if (y <= 7.2e+21) {
tmp = fma((230661.510616 / i), y, (t / i));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -2600000000.0) tmp = t_1; elseif (y <= 7.2e+21) tmp = fma(Float64(230661.510616 / i), y, Float64(t / i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2600000000.0], t$95$1, If[LessEqual[y, 7.2e+21], N[(N[(230661.510616 / i), $MachinePrecision] * y + N[(t / i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -2600000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+21}:\\
\;\;\;\;\mathsf{fma}\left(\frac{230661.510616}{i}, y, \frac{t}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.6e9 or 7.2e21 < y Initial program 56.0%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6430.5
Applied rewrites30.5%
if -2.6e9 < y < 7.2e21Initial program 56.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites56.7%
Taylor expanded in y around 0
Applied rewrites40.5%
Taylor expanded in y around 0
Applied rewrites34.1%
Taylor expanded in y around 0
Applied rewrites32.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
5e+95)
(fma (/ 230661.510616 i) y (/ t i))
(fma (/ x y) y (/ t i))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= 5e+95) {
tmp = fma((230661.510616 / i), y, (t / i));
} else {
tmp = fma((x / y), y, (t / i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) <= 5e+95) tmp = fma(Float64(230661.510616 / i), y, Float64(t / i)); else tmp = fma(Float64(x / y), y, Float64(t / i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], 5e+95], N[(N[(230661.510616 / i), $MachinePrecision] * y + N[(t / i), $MachinePrecision]), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * y + N[(t / i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \leq 5 \cdot 10^{+95}:\\
\;\;\;\;\mathsf{fma}\left(\frac{230661.510616}{i}, y, \frac{t}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y}, y, \frac{t}{i}\right)\\
\end{array}
if (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < 5.00000000000000025e95Initial program 56.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites56.7%
Taylor expanded in y around 0
Applied rewrites40.5%
Taylor expanded in y around 0
Applied rewrites34.1%
Taylor expanded in y around 0
Applied rewrites32.1%
if 5.00000000000000025e95 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) Initial program 56.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites56.7%
Taylor expanded in y around 0
Applied rewrites40.5%
Taylor expanded in y around 0
Applied rewrites34.1%
Taylor expanded in y around inf
lower-/.f6424.7
Applied rewrites24.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
5e+95)
(/ (+ t (* 230661.510616 y)) i)
(fma (/ x y) y (/ t i))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= 5e+95) {
tmp = (t + (230661.510616 * y)) / i;
} else {
tmp = fma((x / y), y, (t / i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) <= 5e+95) tmp = Float64(Float64(t + Float64(230661.510616 * y)) / i); else tmp = fma(Float64(x / y), y, Float64(t / i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], 5e+95], N[(N[(t + N[(230661.510616 * y), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision], N[(N[(x / y), $MachinePrecision] * y + N[(t / i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \leq 5 \cdot 10^{+95}:\\
\;\;\;\;\frac{t + 230661.510616 \cdot y}{i}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y}, y, \frac{t}{i}\right)\\
\end{array}
if (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) < 5.00000000000000025e95Initial program 56.0%
Taylor expanded in y around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6426.0
Applied rewrites26.0%
Taylor expanded in i around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f6432.2
Applied rewrites32.2%
if 5.00000000000000025e95 < (/.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 x y) z) y) #s(literal 54929528941/2000000 binary64)) y) #s(literal 28832688827/125000 binary64)) y) t) (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 (*.f64 (+.f64 y a) y) b) y) c) y) i)) Initial program 56.0%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
Applied rewrites56.7%
Taylor expanded in y around 0
Applied rewrites40.5%
Taylor expanded in y around 0
Applied rewrites34.1%
Taylor expanded in y around inf
lower-/.f6424.7
Applied rewrites24.7%
(FPCore (x y z t a b c i) :precision binary64 (/ (+ t (* 230661.510616 y)) i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + (230661.510616 * y)) / 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 = (t + (230661.510616d0 * y)) / i
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (t + (230661.510616 * y)) / i;
}
def code(x, y, z, t, a, b, c, i): return (t + (230661.510616 * y)) / i
function code(x, y, z, t, a, b, c, i) return Float64(Float64(t + Float64(230661.510616 * y)) / i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (t + (230661.510616 * y)) / i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(t + N[(230661.510616 * y), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]
\frac{t + 230661.510616 \cdot y}{i}
Initial program 56.0%
Taylor expanded in y around 0
lower-fma.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f6426.0
Applied rewrites26.0%
Taylor expanded in i around inf
lower-/.f64N/A
lower-+.f64N/A
lower-*.f6432.2
Applied rewrites32.2%
(FPCore (x y z t a b c i) :precision binary64 (/ t i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t / 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 = t / i
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t / i;
}
def code(x, y, z, t, a, b, c, i): return t / i
function code(x, y, z, t, a, b, c, i) return Float64(t / i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t / i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t / i), $MachinePrecision]
\frac{t}{i}
Initial program 56.0%
Taylor expanded in y around 0
lower-/.f6429.2
Applied rewrites29.2%
herbie shell --seed 2025172
(FPCore (x y z t a b c i)
:name "Numeric.SpecFunctions:logGamma from math-functions-0.1.5.2"
:precision binary64
(/ (+ (* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))