
(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]
\begin{array}{l}
\\
\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}
\end{array}
Herbie found 15 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]
\begin{array}{l}
\\
\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}
\end{array}
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2e+64)
t_1
(if (<= y 5.6e+33)
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(if (<= y 6.2e+101)
(/
(*
t
(fma
27464.7644705
(/ 1.0 (* t y))
(fma
230661.510616
(/ 1.0 (* t (* y y)))
(+ (/ 1.0 (* (* y y) y)) (/ (+ z (* x y)) t)))))
a)
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);
double tmp;
if (y <= -2e+64) {
tmp = t_1;
} else if (y <= 5.6e+33) {
tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else if (y <= 6.2e+101) {
tmp = (t * fma(27464.7644705, (1.0 / (t * y)), fma(230661.510616, (1.0 / (t * (y * y))), ((1.0 / ((y * y) * y)) + ((z + (x * y)) / t))))) / a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -2e+64) tmp = t_1; elseif (y <= 5.6e+33) tmp = 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)); elseif (y <= 6.2e+101) tmp = Float64(Float64(t * fma(27464.7644705, Float64(1.0 / Float64(t * y)), fma(230661.510616, Float64(1.0 / Float64(t * Float64(y * y))), Float64(Float64(1.0 / Float64(Float64(y * y) * y)) + Float64(Float64(z + Float64(x * y)) / t))))) / a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+64], t$95$1, If[LessEqual[y, 5.6e+33], 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], If[LessEqual[y, 6.2e+101], N[(N[(t * N[(27464.7644705 * N[(1.0 / N[(t * y), $MachinePrecision]), $MachinePrecision] + N[(230661.510616 * N[(1.0 / N[(t * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(1.0 / N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.6 \cdot 10^{+33}:\\
\;\;\;\;\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}\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+101}:\\
\;\;\;\;\frac{t \cdot \mathsf{fma}\left(27464.7644705, \frac{1}{t \cdot y}, \mathsf{fma}\left(230661.510616, \frac{1}{t \cdot \left(y \cdot y\right)}, \frac{1}{\left(y \cdot y\right) \cdot y} + \frac{z + x \cdot y}{t}\right)\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.00000000000000004e64 or 6.19999999999999998e101 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -2.00000000000000004e64 < y < 5.6000000000000002e33Initial program 56.4%
if 5.6000000000000002e33 < y < 6.19999999999999998e101Initial program 56.4%
Taylor expanded in t around inf
Applied rewrites52.4%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites10.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2e+64)
t_1
(if (<= y 3e+79)
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y 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);
double tmp;
if (y <= -2e+64) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + 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)
if (y <= (-2d+64)) then
tmp = t_1
else if (y <= 3d+79) then
tmp = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((((((y + a) * y) + 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);
double tmp;
if (y <= -2e+64) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + 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) tmp = 0 if y <= -2e+64: tmp = t_1 elif y <= 3e+79: tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + 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(x + Float64(z / y)) tmp = 0.0 if (y <= -2e+64) tmp = t_1; elseif (y <= 3e+79) tmp = 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)); 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); tmp = 0.0; if (y <= -2e+64) tmp = t_1; elseif (y <= 3e+79) tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + 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[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+64], t$95$1, If[LessEqual[y, 3e+79], 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], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+79}:\\
\;\;\;\;\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}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.00000000000000004e64 or 2.99999999999999974e79 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -2.00000000000000004e64 < y < 2.99999999999999974e79Initial program 56.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2e+64)
t_1
(if (<= y 3e+79)
(*
(fma (fma (fma (fma x y z) y 27464.7644705) y 230661.510616) y t)
(/ 1.0 (fma (fma (fma (+ y 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);
double tmp;
if (y <= -2e+64) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = fma(fma(fma(fma(x, y, z), y, 27464.7644705), y, 230661.510616), y, t) * (1.0 / fma(fma(fma((y + 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(x + Float64(z / y)) tmp = 0.0 if (y <= -2e+64) tmp = t_1; elseif (y <= 3e+79) tmp = Float64(fma(fma(fma(fma(x, y, z), y, 27464.7644705), y, 230661.510616), y, t) * Float64(1.0 / fma(fma(fma(Float64(y + 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[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e+64], t$95$1, If[LessEqual[y, 3e+79], N[(N[(N[(N[(N[(x * y + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] * N[(1.0 / N[(N[(N[(N[(y + a), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right) \cdot \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.00000000000000004e64 or 2.99999999999999974e79 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -2.00000000000000004e64 < y < 2.99999999999999974e79Initial program 56.4%
Applied rewrites56.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (* y y) (+ b (* y (+ a y)))) i)))
(t_2 (+ x (/ z y))))
(if (<= y -8e+63)
t_2
(if (<= y -9e-7)
t_1
(if (<= y 2.3e-59)
(/
(+ (* (- 230661.510616 (* -27464.7644705 y)) y) t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(if (<= y 3e+79) 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 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((y * y) * (b + (y * (a + y)))) + i);
double t_2 = x + (z / y);
double tmp;
if (y <= -8e+63) {
tmp = t_2;
} else if (y <= -9e-7) {
tmp = t_1;
} else if (y <= 2.3e-59) {
tmp = (((230661.510616 - (-27464.7644705 * y)) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else if (y <= 3e+79) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_2
real(8) :: tmp
t_1 = ((((((((x * y) + z) * y) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / (((y * y) * (b + (y * (a + y)))) + i)
t_2 = x + (z / y)
if (y <= (-8d+63)) then
tmp = t_2
else if (y <= (-9d-7)) then
tmp = t_1
else if (y <= 2.3d-59) then
tmp = (((230661.510616d0 - ((-27464.7644705d0) * y)) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)
else if (y <= 3d+79) then
tmp = t_1
else
tmp = t_2
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 * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((y * y) * (b + (y * (a + y)))) + i);
double t_2 = x + (z / y);
double tmp;
if (y <= -8e+63) {
tmp = t_2;
} else if (y <= -9e-7) {
tmp = t_1;
} else if (y <= 2.3e-59) {
tmp = (((230661.510616 - (-27464.7644705 * y)) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else if (y <= 3e+79) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((y * y) * (b + (y * (a + y)))) + i) t_2 = x + (z / y) tmp = 0 if y <= -8e+63: tmp = t_2 elif y <= -9e-7: tmp = t_1 elif y <= 2.3e-59: tmp = (((230661.510616 - (-27464.7644705 * y)) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i) elif y <= 3e+79: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(y * y) * Float64(b + Float64(y * Float64(a + y)))) + i)) t_2 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -8e+63) tmp = t_2; elseif (y <= -9e-7) tmp = t_1; elseif (y <= 2.3e-59) tmp = Float64(Float64(Float64(Float64(230661.510616 - Float64(-27464.7644705 * y)) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)); elseif (y <= 3e+79) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((y * y) * (b + (y * (a + y)))) + i); t_2 = x + (z / y); tmp = 0.0; if (y <= -8e+63) tmp = t_2; elseif (y <= -9e-7) tmp = t_1; elseif (y <= 2.3e-59) tmp = (((230661.510616 - (-27464.7644705 * y)) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); elseif (y <= 3e+79) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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[(y * y), $MachinePrecision] * N[(b + N[(y * N[(a + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8e+63], t$95$2, If[LessEqual[y, -9e-7], t$95$1, If[LessEqual[y, 2.3e-59], N[(N[(N[(N[(230661.510616 - N[(-27464.7644705 * y), $MachinePrecision]), $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], If[LessEqual[y, 3e+79], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(y \cdot y\right) \cdot \left(b + y \cdot \left(a + y\right)\right) + i}\\
t_2 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -8 \cdot 10^{+63}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -9 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-59}:\\
\;\;\;\;\frac{\left(230661.510616 - -27464.7644705 \cdot y\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+79}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -8.00000000000000046e63 or 2.99999999999999974e79 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -8.00000000000000046e63 < y < -8.99999999999999959e-7 or 2.29999999999999979e-59 < y < 2.99999999999999974e79Initial program 56.4%
Taylor expanded in c around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6443.7
Applied rewrites43.7%
if -8.99999999999999959e-7 < y < 2.29999999999999979e-59Initial program 56.4%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
metadata-eval48.1
Applied rewrites48.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2.2e+19)
t_1
(if (<= y 3e+79)
(/
(+ (* (- 230661.510616 (* -27464.7644705 y)) y) t)
(+ (* (+ (* (+ (* (+ y 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);
double tmp;
if (y <= -2.2e+19) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = (((230661.510616 - (-27464.7644705 * y)) * y) + t) / (((((((y + a) * y) + 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)
if (y <= (-2.2d+19)) then
tmp = t_1
else if (y <= 3d+79) then
tmp = (((230661.510616d0 - ((-27464.7644705d0) * y)) * y) + t) / (((((((y + a) * y) + 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);
double tmp;
if (y <= -2.2e+19) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = (((230661.510616 - (-27464.7644705 * y)) * y) + t) / (((((((y + a) * y) + 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) tmp = 0 if y <= -2.2e+19: tmp = t_1 elif y <= 3e+79: tmp = (((230661.510616 - (-27464.7644705 * y)) * y) + t) / (((((((y + 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(x + Float64(z / y)) tmp = 0.0 if (y <= -2.2e+19) tmp = t_1; elseif (y <= 3e+79) tmp = Float64(Float64(Float64(Float64(230661.510616 - Float64(-27464.7644705 * y)) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + 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); tmp = 0.0; if (y <= -2.2e+19) tmp = t_1; elseif (y <= 3e+79) tmp = (((230661.510616 - (-27464.7644705 * y)) * y) + t) / (((((((y + a) * y) + 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[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+19], t$95$1, If[LessEqual[y, 3e+79], N[(N[(N[(N[(230661.510616 - N[(-27464.7644705 * y), $MachinePrecision]), $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], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+79}:\\
\;\;\;\;\frac{\left(230661.510616 - -27464.7644705 \cdot y\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2e19 or 2.99999999999999974e79 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -2.2e19 < y < 2.99999999999999974e79Initial program 56.4%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
metadata-eval48.1
Applied rewrites48.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2.2e+19)
t_1
(if (<= y 3e+79)
(*
(fma (fma 27464.7644705 y 230661.510616) y t)
(/ 1.0 (fma (fma (fma (+ y 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);
double tmp;
if (y <= -2.2e+19) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = fma(fma(27464.7644705, y, 230661.510616), y, t) * (1.0 / fma(fma(fma((y + 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(x + Float64(z / y)) tmp = 0.0 if (y <= -2.2e+19) tmp = t_1; elseif (y <= 3e+79) tmp = Float64(fma(fma(27464.7644705, y, 230661.510616), y, t) * Float64(1.0 / fma(fma(fma(Float64(y + 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[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+19], t$95$1, If[LessEqual[y, 3e+79], N[(N[(N[(27464.7644705 * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] * N[(1.0 / N[(N[(N[(N[(y + a), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(\mathsf{fma}\left(27464.7644705, y, 230661.510616\right), y, t\right) \cdot \frac{1}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2e19 or 2.99999999999999974e79 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -2.2e19 < y < 2.99999999999999974e79Initial program 56.4%
Applied rewrites56.3%
Taylor expanded in y around 0
Applied rewrites48.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2.2e+19)
t_1
(if (<= y 3e+79)
(/
(- t (* -230661.510616 y))
(+ (* (+ (* (+ (* (+ y 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);
double tmp;
if (y <= -2.2e+19) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = (t - (-230661.510616 * y)) / (((((((y + a) * y) + 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)
if (y <= (-2.2d+19)) then
tmp = t_1
else if (y <= 3d+79) then
tmp = (t - ((-230661.510616d0) * y)) / (((((((y + a) * y) + 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);
double tmp;
if (y <= -2.2e+19) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = (t - (-230661.510616 * y)) / (((((((y + a) * y) + 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) tmp = 0 if y <= -2.2e+19: tmp = t_1 elif y <= 3e+79: tmp = (t - (-230661.510616 * y)) / (((((((y + 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(x + Float64(z / y)) tmp = 0.0 if (y <= -2.2e+19) tmp = t_1; elseif (y <= 3e+79) tmp = Float64(Float64(t - Float64(-230661.510616 * y)) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + 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); tmp = 0.0; if (y <= -2.2e+19) tmp = t_1; elseif (y <= 3e+79) tmp = (t - (-230661.510616 * y)) / (((((((y + a) * y) + 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[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+19], t$95$1, If[LessEqual[y, 3e+79], N[(N[(t - N[(-230661.510616 * y), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+79}:\\
\;\;\;\;\frac{t - -230661.510616 \cdot y}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2e19 or 2.99999999999999974e79 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -2.2e19 < y < 2.99999999999999974e79Initial program 56.4%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
lower-*.f64N/A
metadata-eval48.1
Applied rewrites48.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -1.5e+19)
t_1
(if (<= y 3e+79)
(* (fma 230661.510616 y t) (/ 1.0 (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);
double tmp;
if (y <= -1.5e+19) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = fma(230661.510616, y, t) * (1.0 / 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(x + Float64(z / y)) tmp = 0.0 if (y <= -1.5e+19) tmp = t_1; elseif (y <= 3e+79) tmp = Float64(fma(230661.510616, y, t) * Float64(1.0 / 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[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.5e+19], t$95$1, If[LessEqual[y, 3e+79], N[(N[(230661.510616 * y + t), $MachinePrecision] * N[(1.0 / N[(N[(N[(a * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+79}:\\
\;\;\;\;\mathsf{fma}\left(230661.510616, y, t\right) \cdot \frac{1}{\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}
\end{array}
if y < -1.5e19 or 2.99999999999999974e79 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -1.5e19 < y < 2.99999999999999974e79Initial program 56.4%
Applied rewrites56.3%
Taylor expanded in y around 0
Applied rewrites48.0%
Taylor expanded in y around 0
Applied rewrites47.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2.2e+19)
t_1
(if (<= y 1.1e-126)
(/ t (fma (fma (fma (+ y a) y b) y c) y i))
(if (<= y 3e+79)
(/ (+ (* 230661.510616 y) t) (+ (* (* y y) (+ b (* y (+ a 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);
double tmp;
if (y <= -2.2e+19) {
tmp = t_1;
} else if (y <= 1.1e-126) {
tmp = t / fma(fma(fma((y + a), y, b), y, c), y, i);
} else if (y <= 3e+79) {
tmp = ((230661.510616 * y) + t) / (((y * y) * (b + (y * (a + y)))) + i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -2.2e+19) tmp = t_1; elseif (y <= 1.1e-126) tmp = Float64(t / fma(fma(fma(Float64(y + a), y, b), y, c), y, i)); elseif (y <= 3e+79) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(y * y) * Float64(b + Float64(y * Float64(a + y)))) + i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+19], t$95$1, If[LessEqual[y, 1.1e-126], N[(t / N[(N[(N[(N[(y + a), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3e+79], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(y * y), $MachinePrecision] * N[(b + N[(y * N[(a + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.1 \cdot 10^{-126}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\right)}\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+79}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{\left(y \cdot y\right) \cdot \left(b + y \cdot \left(a + y\right)\right) + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2e19 or 2.99999999999999974e79 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -2.2e19 < y < 1.10000000000000007e-126Initial program 56.4%
Taylor expanded in y around 0
Applied rewrites41.0%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6441.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6441.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6441.0
Applied rewrites41.0%
if 1.10000000000000007e-126 < y < 2.99999999999999974e79Initial program 56.4%
Taylor expanded in c around 0
lower-*.f64N/A
unpow2N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f6443.7
Applied rewrites43.7%
Taylor expanded in y around 0
lower-*.f6437.6
Applied rewrites37.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2.2e+19)
t_1
(if (<= y 3e+79) (/ t (fma (fma (fma (+ y 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);
double tmp;
if (y <= -2.2e+19) {
tmp = t_1;
} else if (y <= 3e+79) {
tmp = t / fma(fma(fma((y + 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(x + Float64(z / y)) tmp = 0.0 if (y <= -2.2e+19) tmp = t_1; elseif (y <= 3e+79) tmp = Float64(t / fma(fma(fma(Float64(y + 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[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.2e+19], t$95$1, If[LessEqual[y, 3e+79], N[(t / N[(N[(N[(N[(y + a), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2.2 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+79}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y + a, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.2e19 or 2.99999999999999974e79 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -2.2e19 < y < 2.99999999999999974e79Initial program 56.4%
Taylor expanded in y around 0
Applied rewrites41.0%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6441.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6441.0
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6441.0
Applied rewrites41.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -1.5e+19)
t_1
(if (<= y 9.2e+68) (/ (+ (* (* (* y y) z) y) t) (+ (* 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);
double tmp;
if (y <= -1.5e+19) {
tmp = t_1;
} else if (y <= 9.2e+68) {
tmp = ((((y * y) * z) * y) + t) / ((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)
if (y <= (-1.5d+19)) then
tmp = t_1
else if (y <= 9.2d+68) then
tmp = ((((y * y) * z) * y) + t) / ((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);
double tmp;
if (y <= -1.5e+19) {
tmp = t_1;
} else if (y <= 9.2e+68) {
tmp = ((((y * y) * z) * y) + t) / ((c * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x + (z / y) tmp = 0 if y <= -1.5e+19: tmp = t_1 elif y <= 9.2e+68: tmp = ((((y * y) * z) * y) + t) / ((c * y) + i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -1.5e+19) tmp = t_1; elseif (y <= 9.2e+68) tmp = Float64(Float64(Float64(Float64(Float64(y * y) * z) * y) + t) / Float64(Float64(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); tmp = 0.0; if (y <= -1.5e+19) tmp = t_1; elseif (y <= 9.2e+68) tmp = ((((y * y) * z) * y) + t) / ((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[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.5e+19], t$95$1, If[LessEqual[y, 9.2e+68], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(c * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -1.5 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+68}:\\
\;\;\;\;\frac{\left(\left(y \cdot y\right) \cdot z\right) \cdot y + t}{c \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.5e19 or 9.1999999999999999e68 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -1.5e19 < y < 9.1999999999999999e68Initial program 56.4%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f6444.7
Applied rewrites44.7%
Taylor expanded in y around 0
Applied rewrites38.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2.7e+14)
t_1
(if (<= y 1.7e+45) (* (fma 230661.510616 y t) (/ 1.0 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);
double tmp;
if (y <= -2.7e+14) {
tmp = t_1;
} else if (y <= 1.7e+45) {
tmp = fma(230661.510616, y, t) * (1.0 / i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -2.7e+14) tmp = t_1; elseif (y <= 1.7e+45) tmp = Float64(fma(230661.510616, y, t) * Float64(1.0 / i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.7e+14], t$95$1, If[LessEqual[y, 1.7e+45], N[(N[(230661.510616 * y + t), $MachinePrecision] * N[(1.0 / i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2.7 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+45}:\\
\;\;\;\;\mathsf{fma}\left(230661.510616, y, t\right) \cdot \frac{1}{i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.7e14 or 1.7e45 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -2.7e14 < y < 1.7e45Initial program 56.4%
Applied rewrites56.3%
Taylor expanded in y around 0
Applied rewrites48.0%
Taylor expanded in y around 0
lower-/.f6431.9
Applied rewrites31.9%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ x (/ z y)))) (if (<= y -5.2e+19) t_1 (if (<= y 9.2e+68) (/ 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);
double tmp;
if (y <= -5.2e+19) {
tmp = t_1;
} else if (y <= 9.2e+68) {
tmp = t / 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)
if (y <= (-5.2d+19)) then
tmp = t_1
else if (y <= 9.2d+68) then
tmp = t / 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);
double tmp;
if (y <= -5.2e+19) {
tmp = t_1;
} else if (y <= 9.2e+68) {
tmp = t / i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x + (z / y) tmp = 0 if y <= -5.2e+19: tmp = t_1 elif y <= 9.2e+68: tmp = t / i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -5.2e+19) tmp = t_1; elseif (y <= 9.2e+68) tmp = Float64(t / 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); tmp = 0.0; if (y <= -5.2e+19) tmp = t_1; elseif (y <= 9.2e+68) tmp = t / i; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.2e+19], t$95$1, If[LessEqual[y, 9.2e+68], N[(t / i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{+68}:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.2e19 or 9.1999999999999999e68 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
if -5.2e19 < y < 9.1999999999999999e68Initial program 56.4%
Taylor expanded in y around 0
lower-/.f6428.9
Applied rewrites28.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -6.7e+19) (/ z y) (if (<= y 0.0069) (/ t i) (/ z y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -6.7e+19) {
tmp = z / y;
} else if (y <= 0.0069) {
tmp = t / i;
} else {
tmp = z / y;
}
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 (y <= (-6.7d+19)) then
tmp = z / y
else if (y <= 0.0069d0) then
tmp = t / i
else
tmp = z / y
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 (y <= -6.7e+19) {
tmp = z / y;
} else if (y <= 0.0069) {
tmp = t / i;
} else {
tmp = z / y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -6.7e+19: tmp = z / y elif y <= 0.0069: tmp = t / i else: tmp = z / y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -6.7e+19) tmp = Float64(z / y); elseif (y <= 0.0069) tmp = Float64(t / i); else tmp = Float64(z / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -6.7e+19) tmp = z / y; elseif (y <= 0.0069) tmp = t / i; else tmp = z / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -6.7e+19], N[(z / y), $MachinePrecision], If[LessEqual[y, 0.0069], N[(t / i), $MachinePrecision], N[(z / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.7 \cdot 10^{+19}:\\
\;\;\;\;\frac{z}{y}\\
\mathbf{elif}\;y \leq 0.0069:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{y}\\
\end{array}
\end{array}
if y < -6.7e19 or 0.0068999999999999999 < y Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in x around 0
lower-/.f6410.3
Applied rewrites10.3%
if -6.7e19 < y < 0.0068999999999999999Initial program 56.4%
Taylor expanded in y around 0
lower-/.f6428.9
Applied rewrites28.9%
(FPCore (x y z t a b c i) :precision binary64 (/ z y))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return z / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 = z / y
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return z / y;
}
def code(x, y, z, t, a, b, c, i): return z / y
function code(x, y, z, t, a, b, c, i) return Float64(z / y) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = z / y; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(z / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{z}{y}
\end{array}
Initial program 56.4%
Taylor expanded in y around -inf
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-*.f6430.8
Applied rewrites30.8%
Taylor expanded in x around 0
lower-/.f6410.3
Applied rewrites10.3%
herbie shell --seed 2025134
(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)))