
(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 16 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 -2.35e+48)
t_1
(if (<= y 7e+61)
(/
(+
(* (+ (* (+ (* (+ (* 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 <= -2.35e+48) {
tmp = t_1;
} else if (y <= 7e+61) {
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 <= (-2.35d+48)) then
tmp = t_1
else if (y <= 7d+61) 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 <= -2.35e+48) {
tmp = t_1;
} else if (y <= 7e+61) {
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 <= -2.35e+48: tmp = t_1 elif y <= 7e+61: 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 <= -2.35e+48) tmp = t_1; elseif (y <= 7e+61) 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 <= -2.35e+48) tmp = t_1; elseif (y <= 7e+61) 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, -2.35e+48], t$95$1, If[LessEqual[y, 7e+61], 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.35 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+61}:\\
\;\;\;\;\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.35000000000000006e48 or 7.00000000000000036e61 < y Initial program 2.7%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6472.4
Applied rewrites72.4%
if -2.35000000000000006e48 < y < 7.00000000000000036e61Initial program 93.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -2.35e+48)
t_1
(if (<= y 7e+61)
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (fma (* y y) (fma (+ a y) y b) (* 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.35e+48) {
tmp = t_1;
} else if (y <= 7e+61) {
tmp = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (fma((y * y), fma((a + y), y, b), (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.35e+48) tmp = t_1; elseif (y <= 7e+61) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(fma(Float64(y * y), fma(Float64(a + y), y, b), Float64(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.35e+48], t$95$1, If[LessEqual[y, 7e+61], 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[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] + N[(c * y), $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.35 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+61}:\\
\;\;\;\;\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(a + y, y, b\right), c \cdot y\right) + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.35000000000000006e48 or 7.00000000000000036e61 < y Initial program 2.7%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6472.4
Applied rewrites72.4%
if -2.35000000000000006e48 < y < 7.00000000000000036e61Initial program 93.3%
Taylor expanded in c around 0
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
unpow2N/A
lower-*.f64N/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f6492.4
Applied rewrites92.4%
(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)))
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
INFINITY)
(fma
y
(/ (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) t_1)
(/ t t_1))
(+ x (/ z y)))))
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 tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= ((double) INFINITY)) {
tmp = fma(y, (fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_1), (t / t_1));
} else {
tmp = x + (z / y);
}
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) 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)) <= Inf) tmp = fma(y, Float64(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) / t_1), Float64(t / t_1)); else tmp = Float64(x + Float64(z / y)); 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]}, 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], Infinity], N[(y * N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] / t$95$1), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\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)\\
\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 \infty:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right)}{t\_1}, \frac{t}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{y}\\
\end{array}
\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)) < +inf.0Initial program 90.2%
Applied rewrites91.2%
if +inf.0 < (/.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 0.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6469.1
Applied rewrites69.1%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6474.7
Applied rewrites74.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (fma (fma y x z) y 27464.7644705) y 230661.510616))
(t_2 (+ x (/ z y)))
(t_3 (fma (fma (+ a y) y b) y c)))
(if (<= y -2.6e+48)
t_2
(if (<= y -1.5e-62)
(/ (/ (fma t_1 y t) y) t_3)
(if (<= y 1.8e-29)
(/
(fma 230661.510616 y t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(if (<= y 2.6e+58) (fma y (/ t_1 (fma t_3 y i)) (/ t i)) 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(y, x, z), y, 27464.7644705), y, 230661.510616);
double t_2 = x + (z / y);
double t_3 = fma(fma((a + y), y, b), y, c);
double tmp;
if (y <= -2.6e+48) {
tmp = t_2;
} else if (y <= -1.5e-62) {
tmp = (fma(t_1, y, t) / y) / t_3;
} else if (y <= 1.8e-29) {
tmp = fma(230661.510616, y, t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else if (y <= 2.6e+58) {
tmp = fma(y, (t_1 / fma(t_3, y, i)), (t / i));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616) t_2 = Float64(x + Float64(z / y)) t_3 = fma(fma(Float64(a + y), y, b), y, c) tmp = 0.0 if (y <= -2.6e+48) tmp = t_2; elseif (y <= -1.5e-62) tmp = Float64(Float64(fma(t_1, y, t) / y) / t_3); elseif (y <= 1.8e-29) tmp = Float64(fma(230661.510616, y, t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)); elseif (y <= 2.6e+58) tmp = fma(y, Float64(t_1 / fma(t_3, y, i)), Float64(t / i)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision]}, If[LessEqual[y, -2.6e+48], t$95$2, If[LessEqual[y, -1.5e-62], N[(N[(N[(t$95$1 * y + t), $MachinePrecision] / y), $MachinePrecision] / t$95$3), $MachinePrecision], If[LessEqual[y, 1.8e-29], N[(N[(230661.510616 * y + 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, 2.6e+58], N[(y * N[(t$95$1 / N[(t$95$3 * y + i), $MachinePrecision]), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right)\\
t_2 := x + \frac{z}{y}\\
t_3 := \mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right)\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(t\_1, y, t\right)}{y}}{t\_3}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-29}:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{elif}\;y \leq 2.6 \cdot 10^{+58}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{t\_1}{\mathsf{fma}\left(t\_3, y, i\right)}, \frac{t}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.59999999999999995e48 or 2.59999999999999988e58 < y Initial program 2.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6466.9
Applied rewrites66.9%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6472.1
Applied rewrites72.1%
if -2.59999999999999995e48 < y < -1.5000000000000001e-62Initial program 83.8%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites60.5%
if -1.5000000000000001e-62 < y < 1.79999999999999987e-29Initial program 99.8%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6494.9
Applied rewrites94.9%
if 1.79999999999999987e-29 < y < 2.59999999999999988e58Initial program 70.8%
Applied rewrites73.8%
Taylor expanded in y around 0
Applied rewrites37.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(/
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
y)
(fma (fma (+ a y) y b) y c)))
(t_2 (+ x (/ z y))))
(if (<= y -2.6e+48)
t_2
(if (<= y -1.5e-62)
t_1
(if (<= y 210.0)
(/
(fma 230661.510616 y t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(if (<= y 7.4e+64) 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(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / y) / fma(fma((a + y), y, b), y, c);
double t_2 = x + (z / y);
double tmp;
if (y <= -2.6e+48) {
tmp = t_2;
} else if (y <= -1.5e-62) {
tmp = t_1;
} else if (y <= 210.0) {
tmp = fma(230661.510616, y, t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else if (y <= 7.4e+64) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / y) / fma(fma(Float64(a + y), y, b), y, c)) t_2 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -2.6e+48) tmp = t_2; elseif (y <= -1.5e-62) tmp = t_1; elseif (y <= 210.0) tmp = Float64(fma(230661.510616, y, t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)); elseif (y <= 7.4e+64) tmp = 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[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / y), $MachinePrecision] / N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.6e+48], t$95$2, If[LessEqual[y, -1.5e-62], t$95$1, If[LessEqual[y, 210.0], N[(N[(230661.510616 * y + 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, 7.4e+64], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\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)}{y}}{\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right)}\\
t_2 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2.6 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 210:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{elif}\;y \leq 7.4 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.59999999999999995e48 or 7.39999999999999966e64 < y Initial program 2.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6467.5
Applied rewrites67.5%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6472.8
Applied rewrites72.8%
if -2.59999999999999995e48 < y < -1.5000000000000001e-62 or 210 < y < 7.39999999999999966e64Initial program 71.5%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites55.6%
if -1.5000000000000001e-62 < y < 210Initial program 99.7%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6492.2
Applied rewrites92.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (fma (+ a y) y b) y c)) (t_2 (+ x (/ z y))))
(if (<= y -2.15e+31)
t_2
(if (<= y -1.18e-51)
(/ (* (pow y 4.0) x) (fma t_1 y i))
(if (<= y 1600.0)
(/
(fma 230661.510616 y t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(if (<= y 1.62e+65) (/ (* x (pow y 3.0)) 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((a + y), y, b), y, c);
double t_2 = x + (z / y);
double tmp;
if (y <= -2.15e+31) {
tmp = t_2;
} else if (y <= -1.18e-51) {
tmp = (pow(y, 4.0) * x) / fma(t_1, y, i);
} else if (y <= 1600.0) {
tmp = fma(230661.510616, y, t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else if (y <= 1.62e+65) {
tmp = (x * pow(y, 3.0)) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(fma(Float64(a + y), y, b), y, c) t_2 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -2.15e+31) tmp = t_2; elseif (y <= -1.18e-51) tmp = Float64(Float64((y ^ 4.0) * x) / fma(t_1, y, i)); elseif (y <= 1600.0) tmp = Float64(fma(230661.510616, y, t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)); elseif (y <= 1.62e+65) tmp = Float64(Float64(x * (y ^ 3.0)) / 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[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.15e+31], t$95$2, If[LessEqual[y, -1.18e-51], N[(N[(N[Power[y, 4.0], $MachinePrecision] * x), $MachinePrecision] / N[(t$95$1 * y + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1600.0], N[(N[(230661.510616 * y + 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, 1.62e+65], N[(N[(x * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right)\\
t_2 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2.15 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.18 \cdot 10^{-51}:\\
\;\;\;\;\frac{{y}^{4} \cdot x}{\mathsf{fma}\left(t\_1, y, i\right)}\\
\mathbf{elif}\;y \leq 1600:\\
\;\;\;\;\frac{\mathsf{fma}\left(230661.510616, y, t\right)}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{elif}\;y \leq 1.62 \cdot 10^{+65}:\\
\;\;\;\;\frac{x \cdot {y}^{3}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.14999999999999994e31 or 1.61999999999999997e65 < y Initial program 3.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6466.0
Applied rewrites66.0%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6471.1
Applied rewrites71.1%
if -2.14999999999999994e31 < y < -1.18000000000000004e-51Initial program 88.7%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites23.4%
if -1.18000000000000004e-51 < y < 1600Initial program 99.7%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6491.6
Applied rewrites91.6%
if 1600 < y < 1.61999999999999997e65Initial program 50.6%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites47.1%
Taylor expanded in x around inf
lower-*.f64N/A
lift-pow.f6419.8
Applied rewrites19.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (fma (+ a y) y b) y c)) (t_2 (+ x (/ z y))))
(if (<= y -2.15e+31)
t_2
(if (<= y -1.5e-62)
(/ (* (pow y 4.0) x) (fma t_1 y i))
(if (<= y 900.0)
(/ (+ (* 230661.510616 y) t) (+ (* (/ (* c y) a) a) i))
(if (<= y 1.62e+65) (/ (* x (pow y 3.0)) 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((a + y), y, b), y, c);
double t_2 = x + (z / y);
double tmp;
if (y <= -2.15e+31) {
tmp = t_2;
} else if (y <= -1.5e-62) {
tmp = (pow(y, 4.0) * x) / fma(t_1, y, i);
} else if (y <= 900.0) {
tmp = ((230661.510616 * y) + t) / ((((c * y) / a) * a) + i);
} else if (y <= 1.62e+65) {
tmp = (x * pow(y, 3.0)) / t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(fma(Float64(a + y), y, b), y, c) t_2 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -2.15e+31) tmp = t_2; elseif (y <= -1.5e-62) tmp = Float64(Float64((y ^ 4.0) * x) / fma(t_1, y, i)); elseif (y <= 900.0) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(c * y) / a) * a) + i)); elseif (y <= 1.62e+65) tmp = Float64(Float64(x * (y ^ 3.0)) / 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[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.15e+31], t$95$2, If[LessEqual[y, -1.5e-62], N[(N[(N[Power[y, 4.0], $MachinePrecision] * x), $MachinePrecision] / N[(t$95$1 * y + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 900.0], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(c * y), $MachinePrecision] / a), $MachinePrecision] * a), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.62e+65], N[(N[(x * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right)\\
t_2 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -2.15 \cdot 10^{+31}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.5 \cdot 10^{-62}:\\
\;\;\;\;\frac{{y}^{4} \cdot x}{\mathsf{fma}\left(t\_1, y, i\right)}\\
\mathbf{elif}\;y \leq 900:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{\frac{c \cdot y}{a} \cdot a + i}\\
\mathbf{elif}\;y \leq 1.62 \cdot 10^{+65}:\\
\;\;\;\;\frac{x \cdot {y}^{3}}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.14999999999999994e31 or 1.61999999999999997e65 < y Initial program 3.9%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6466.0
Applied rewrites66.0%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6471.1
Applied rewrites71.1%
if -2.14999999999999994e31 < y < -1.5000000000000001e-62Initial program 90.0%
Taylor expanded in x around inf
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites22.4%
if -1.5000000000000001e-62 < y < 900Initial program 99.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-pow.f6485.0
Applied rewrites85.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f6484.4
Applied rewrites84.4%
Taylor expanded in y around 0
Applied rewrites80.0%
if 900 < y < 1.61999999999999997e65Initial program 50.7%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites47.3%
Taylor expanded in x around inf
lower-*.f64N/A
lift-pow.f6419.7
Applied rewrites19.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (/ (* x (pow y 3.0)) (fma (fma (+ a y) y b) y c)))
(t_2 (+ x (/ z y))))
(if (<= y -1.05e+33)
t_2
(if (<= y -1.46e-43)
t_1
(if (<= y 900.0)
(/ (+ (* 230661.510616 y) t) (+ (* (/ (* c y) a) a) i))
(if (<= y 1.62e+65) 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 * pow(y, 3.0)) / fma(fma((a + y), y, b), y, c);
double t_2 = x + (z / y);
double tmp;
if (y <= -1.05e+33) {
tmp = t_2;
} else if (y <= -1.46e-43) {
tmp = t_1;
} else if (y <= 900.0) {
tmp = ((230661.510616 * y) + t) / ((((c * y) / a) * a) + i);
} else if (y <= 1.62e+65) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * (y ^ 3.0)) / fma(fma(Float64(a + y), y, b), y, c)) t_2 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -1.05e+33) tmp = t_2; elseif (y <= -1.46e-43) tmp = t_1; elseif (y <= 900.0) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(c * y) / a) * a) + i)); elseif (y <= 1.62e+65) tmp = 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[(x * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.05e+33], t$95$2, If[LessEqual[y, -1.46e-43], t$95$1, If[LessEqual[y, 900.0], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(c * y), $MachinePrecision] / a), $MachinePrecision] * a), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.62e+65], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot {y}^{3}}{\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right)}\\
t_2 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+33}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.46 \cdot 10^{-43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 900:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{\frac{c \cdot y}{a} \cdot a + i}\\
\mathbf{elif}\;y \leq 1.62 \cdot 10^{+65}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -1.05e33 or 1.61999999999999997e65 < y Initial program 3.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6466.1
Applied rewrites66.1%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6471.2
Applied rewrites71.2%
if -1.05e33 < y < -1.45999999999999997e-43 or 900 < y < 1.61999999999999997e65Initial program 70.4%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites57.3%
Taylor expanded in x around inf
lower-*.f64N/A
lift-pow.f6420.4
Applied rewrites20.4%
if -1.45999999999999997e-43 < y < 900Initial program 99.7%
Taylor expanded in a around inf
*-commutativeN/A
lower-*.f64N/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
unpow2N/A
lower-fma.f64N/A
lower-pow.f6485.0
Applied rewrites85.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f6483.9
Applied rewrites83.9%
Taylor expanded in y around 0
Applied rewrites79.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (fma (+ a y) y b) y c))
(t_2 (/ (* x (pow y 3.0)) t_1))
(t_3 (+ x (/ z y))))
(if (<= y -1.05e+33)
t_3
(if (<= y -4.6e-12)
t_2
(if (<= y 2e-29)
(/ t (fma t_1 y i))
(if (<= y 240000.0)
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
i)
(if (<= y 1.62e+65) t_2 t_3)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(fma((a + y), y, b), y, c);
double t_2 = (x * pow(y, 3.0)) / t_1;
double t_3 = x + (z / y);
double tmp;
if (y <= -1.05e+33) {
tmp = t_3;
} else if (y <= -4.6e-12) {
tmp = t_2;
} else if (y <= 2e-29) {
tmp = t / fma(t_1, y, i);
} else if (y <= 240000.0) {
tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / i;
} else if (y <= 1.62e+65) {
tmp = t_2;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(fma(Float64(a + y), y, b), y, c) t_2 = Float64(Float64(x * (y ^ 3.0)) / t_1) t_3 = Float64(x + Float64(z / y)) tmp = 0.0 if (y <= -1.05e+33) tmp = t_3; elseif (y <= -4.6e-12) tmp = t_2; elseif (y <= 2e-29) tmp = Float64(t / fma(t_1, y, i)); elseif (y <= 240000.0) tmp = Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / i); elseif (y <= 1.62e+65) tmp = t_2; else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.05e+33], t$95$3, If[LessEqual[y, -4.6e-12], t$95$2, If[LessEqual[y, 2e-29], N[(t / N[(t$95$1 * y + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 240000.0], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / i), $MachinePrecision], If[LessEqual[y, 1.62e+65], t$95$2, t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right)\\
t_2 := \frac{x \cdot {y}^{3}}{t\_1}\\
t_3 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -1.05 \cdot 10^{+33}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;y \leq -4.6 \cdot 10^{-12}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-29}:\\
\;\;\;\;\frac{t}{\mathsf{fma}\left(t\_1, y, i\right)}\\
\mathbf{elif}\;y \leq 240000:\\
\;\;\;\;\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)}{i}\\
\mathbf{elif}\;y \leq 1.62 \cdot 10^{+65}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if y < -1.05e33 or 1.61999999999999997e65 < y Initial program 3.8%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6466.1
Applied rewrites66.1%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6471.2
Applied rewrites71.2%
if -1.05e33 < y < -4.59999999999999979e-12 or 2.4e5 < y < 1.61999999999999997e65Initial program 60.6%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites55.5%
Taylor expanded in x around inf
lower-*.f64N/A
lift-pow.f6421.6
Applied rewrites21.6%
if -4.59999999999999979e-12 < y < 1.99999999999999989e-29Initial program 99.7%
Taylor expanded in t around inf
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6477.7
Applied rewrites77.7%
if 1.99999999999999989e-29 < y < 2.4e5Initial program 97.8%
Taylor expanded in i around inf
lower-/.f64N/A
Applied rewrites30.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -1.05e+33)
t_1
(if (<= y -1.46e-43)
(/ (* x (pow y 3.0)) (fma (fma (+ a y) y b) y c))
(if (<= y 2.75e+38) (/ (+ (* (pow y 3.0) z) 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.05e+33) {
tmp = t_1;
} else if (y <= -1.46e-43) {
tmp = (x * pow(y, 3.0)) / fma(fma((a + y), y, b), y, c);
} else if (y <= 2.75e+38) {
tmp = ((pow(y, 3.0) * z) + 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.05e+33) tmp = t_1; elseif (y <= -1.46e-43) tmp = Float64(Float64(x * (y ^ 3.0)) / fma(fma(Float64(a + y), y, b), y, c)); elseif (y <= 2.75e+38) tmp = Float64(Float64(Float64((y ^ 3.0) * z) + t) / Float64(Float64(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.05e+33], t$95$1, If[LessEqual[y, -1.46e-43], N[(N[(x * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.75e+38], N[(N[(N[(N[Power[y, 3.0], $MachinePrecision] * z), $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.05 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1.46 \cdot 10^{-43}:\\
\;\;\;\;\frac{x \cdot {y}^{3}}{\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right)}\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{+38}:\\
\;\;\;\;\frac{{y}^{3} \cdot z + t}{c \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.05e33 or 2.7500000000000002e38 < y Initial program 5.2%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6463.8
Applied rewrites63.8%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6468.7
Applied rewrites68.7%
if -1.05e33 < y < -1.45999999999999997e-43Initial program 87.4%
Taylor expanded in i around 0
associate-/r*N/A
lower-/.f64N/A
Applied rewrites66.0%
Taylor expanded in x around inf
lower-*.f64N/A
lift-pow.f6420.9
Applied rewrites20.9%
if -1.45999999999999997e-43 < y < 2.7500000000000002e38Initial program 97.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f6479.2
Applied rewrites79.2%
Taylor expanded in y around 0
Applied rewrites70.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -4.2e+30)
t_1
(if (<= y 2.75e+38) (/ (+ (* (pow y 3.0) z) 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 <= -4.2e+30) {
tmp = t_1;
} else if (y <= 2.75e+38) {
tmp = ((pow(y, 3.0) * z) + 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 <= (-4.2d+30)) then
tmp = t_1
else if (y <= 2.75d+38) then
tmp = (((y ** 3.0d0) * z) + 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 <= -4.2e+30) {
tmp = t_1;
} else if (y <= 2.75e+38) {
tmp = ((Math.pow(y, 3.0) * z) + 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 <= -4.2e+30: tmp = t_1 elif y <= 2.75e+38: tmp = ((math.pow(y, 3.0) * z) + 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 <= -4.2e+30) tmp = t_1; elseif (y <= 2.75e+38) tmp = Float64(Float64(Float64((y ^ 3.0) * z) + 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 <= -4.2e+30) tmp = t_1; elseif (y <= 2.75e+38) tmp = (((y ^ 3.0) * z) + 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, -4.2e+30], t$95$1, If[LessEqual[y, 2.75e+38], N[(N[(N[(N[Power[y, 3.0], $MachinePrecision] * z), $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 -4.2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{+38}:\\
\;\;\;\;\frac{{y}^{3} \cdot z + t}{c \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.2e30 or 2.7500000000000002e38 < y Initial program 5.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6463.6
Applied rewrites63.6%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6468.5
Applied rewrites68.5%
if -4.2e30 < y < 2.7500000000000002e38Initial program 96.5%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f6476.3
Applied rewrites76.3%
Taylor expanded in y around 0
Applied rewrites66.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ z y))))
(if (<= y -8e+44)
t_1
(if (<= y 1.6e+42) (/ (+ (* (pow y 3.0) z) t) (+ (pow y 4.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 <= -8e+44) {
tmp = t_1;
} else if (y <= 1.6e+42) {
tmp = ((pow(y, 3.0) * z) + t) / (pow(y, 4.0) + 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 <= (-8d+44)) then
tmp = t_1
else if (y <= 1.6d+42) then
tmp = (((y ** 3.0d0) * z) + t) / ((y ** 4.0d0) + 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 <= -8e+44) {
tmp = t_1;
} else if (y <= 1.6e+42) {
tmp = ((Math.pow(y, 3.0) * z) + t) / (Math.pow(y, 4.0) + 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 <= -8e+44: tmp = t_1 elif y <= 1.6e+42: tmp = ((math.pow(y, 3.0) * z) + t) / (math.pow(y, 4.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 <= -8e+44) tmp = t_1; elseif (y <= 1.6e+42) tmp = Float64(Float64(Float64((y ^ 3.0) * z) + t) / Float64((y ^ 4.0) + 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 <= -8e+44) tmp = t_1; elseif (y <= 1.6e+42) tmp = (((y ^ 3.0) * z) + t) / ((y ^ 4.0) + 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, -8e+44], t$95$1, If[LessEqual[y, 1.6e+42], N[(N[(N[(N[Power[y, 3.0], $MachinePrecision] * z), $MachinePrecision] + t), $MachinePrecision] / N[(N[Power[y, 4.0], $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -8 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{+42}:\\
\;\;\;\;\frac{{y}^{3} \cdot z + t}{{y}^{4} + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -8.0000000000000007e44 or 1.60000000000000001e42 < y Initial program 4.0%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6465.2
Applied rewrites65.2%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6470.2
Applied rewrites70.2%
if -8.0000000000000007e44 < y < 1.60000000000000001e42Initial program 95.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-pow.f6475.2
Applied rewrites75.2%
Taylor expanded in y around inf
lower-pow.f6450.8
Applied rewrites50.8%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (+ x (/ z y)))) (if (<= y -4.2e+30) t_1 (if (<= y 2.75e+38) (/ 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 <= -4.2e+30) {
tmp = t_1;
} else if (y <= 2.75e+38) {
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 <= (-4.2d+30)) then
tmp = t_1
else if (y <= 2.75d+38) 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 <= -4.2e+30) {
tmp = t_1;
} else if (y <= 2.75e+38) {
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 <= -4.2e+30: tmp = t_1 elif y <= 2.75e+38: 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 <= -4.2e+30) tmp = t_1; elseif (y <= 2.75e+38) 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 <= -4.2e+30) tmp = t_1; elseif (y <= 2.75e+38) 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, -4.2e+30], t$95$1, If[LessEqual[y, 2.75e+38], N[(t / i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z}{y}\\
\mathbf{if}\;y \leq -4.2 \cdot 10^{+30}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.75 \cdot 10^{+38}:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -4.2e30 or 2.7500000000000002e38 < y Initial program 5.4%
Taylor expanded in y around inf
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6463.6
Applied rewrites63.6%
Taylor expanded in a around 0
lower-+.f64N/A
lift-/.f6468.5
Applied rewrites68.5%
if -4.2e30 < y < 2.7500000000000002e38Initial program 96.5%
Taylor expanded in y around 0
lower-/.f6448.8
Applied rewrites48.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -2.6e-23) x (if (<= y 1.35e+41) (/ t i) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -2.6e-23) {
tmp = x;
} else if (y <= 1.35e+41) {
tmp = t / i;
} else {
tmp = x;
}
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 <= (-2.6d-23)) then
tmp = x
else if (y <= 1.35d+41) then
tmp = t / i
else
tmp = x
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 <= -2.6e-23) {
tmp = x;
} else if (y <= 1.35e+41) {
tmp = t / i;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -2.6e-23: tmp = x elif y <= 1.35e+41: tmp = t / i else: tmp = x return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -2.6e-23) tmp = x; elseif (y <= 1.35e+41) tmp = Float64(t / i); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -2.6e-23) tmp = x; elseif (y <= 1.35e+41) tmp = t / i; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -2.6e-23], x, If[LessEqual[y, 1.35e+41], N[(t / i), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.6 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{+41}:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -2.6e-23 or 1.35e41 < y Initial program 12.1%
Taylor expanded in y around inf
Applied rewrites49.5%
if -2.6e-23 < y < 1.35e41Initial program 97.4%
Taylor expanded in y around 0
lower-/.f6451.9
Applied rewrites51.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z 5.6e+196) x (/ z y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= 5.6e+196) {
tmp = x;
} 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 (z <= 5.6d+196) then
tmp = x
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 (z <= 5.6e+196) {
tmp = x;
} else {
tmp = z / y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= 5.6e+196: tmp = x else: tmp = z / y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= 5.6e+196) tmp = x; 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 (z <= 5.6e+196) tmp = x; else tmp = z / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, 5.6e+196], x, N[(z / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.6 \cdot 10^{+196}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{y}\\
\end{array}
\end{array}
if z < 5.6000000000000004e196Initial program 56.0%
Taylor expanded in y around inf
Applied rewrites27.2%
if 5.6000000000000004e196 < z Initial program 51.4%
Taylor expanded in z around inf
associate-/l*N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites20.3%
Taylor expanded in y around inf
lower-/.f6421.5
Applied rewrites21.5%
(FPCore (x y z t a b c i) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return x;
}
def code(x, y, z, t, a, b, c, i): return x
function code(x, y, z, t, a, b, c, i) return x end
function tmp = code(x, y, z, t, a, b, c, i) tmp = x; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 55.6%
Taylor expanded in y around inf
Applied rewrites26.2%
herbie shell --seed 2025101
(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)))