
(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 18 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 (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 x y z) y 27464.7644705) (/ y t_1) (/ 230661.510616 t_1))
(/ t t_1))
(- (+ x (/ z y)) (/ (* a x) 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(x, y, z), y, 27464.7644705), (y / t_1), (230661.510616 / t_1)), (t / t_1));
} else {
tmp = (x + (z / y)) - ((a * x) / 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, fma(fma(fma(x, y, z), y, 27464.7644705), Float64(y / t_1), Float64(230661.510616 / t_1)), Float64(t / t_1)); else tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / 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[(x * y + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * N[(y / t$95$1), $MachinePrecision] + N[(230661.510616 / t$95$1), $MachinePrecision]), $MachinePrecision] + N[(t / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / 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, \mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, 27464.7644705\right), \frac{y}{t\_1}, \frac{230661.510616}{t\_1}\right), \frac{t}{t\_1}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{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 55.4%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites56.2%
lift-/.f64N/A
lift-fma.f64N/A
div-addN/A
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
lower-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites57.1%
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 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.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)) (/ (* a x) 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)) - ((a * x) / 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(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / 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[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / 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}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{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 55.4%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites56.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 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
INFINITY)
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
(+ (* (+ (fma (* (+ a y) y) y (* b y)) c) y) i))
(- (+ x (/ z y)) (/ (* a x) y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= ((double) INFINITY)) {
tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / (((fma(((a + y) * y), y, (b * y)) + c) * y) + i);
} else {
tmp = (x + (z / y)) - ((a * x) / y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) <= Inf) tmp = Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / Float64(Float64(Float64(fma(Float64(Float64(a + y) * y), y, Float64(b * y)) + c) * y) + i)); else tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(a + y), $MachinePrecision] * y), $MachinePrecision] * y + N[(b * y), $MachinePrecision]), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \leq \infty:\\
\;\;\;\;\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)}{\left(\mathsf{fma}\left(\left(a + y\right) \cdot y, y, b \cdot y\right) + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{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 55.4%
lift-*.f64N/A
*-commutativeN/A
lift-+.f64N/A
distribute-rgt-inN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f6455.4
Applied rewrites55.4%
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites55.4%
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 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
INFINITY)
(/
(fma (fma (fma (fma y x z) y 27464.7644705) y 230661.510616) y t)
(fma (fma (fma (+ a y) y b) y c) y i))
(- (+ x (/ z y)) (/ (* a x) y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= ((double) INFINITY)) {
tmp = fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else {
tmp = (x + (z / y)) - ((a * x) / y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) <= Inf) tmp = Float64(fma(fma(fma(fma(y, x, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); else tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, 27464.7644705\right), y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{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 55.4%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6455.4
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6455.4
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6455.4
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6455.4
lift-+.f64N/A
Applied rewrites55.4%
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 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y -7e+47)
(- (+ x (/ z y)) (/ (* a x) y))
(if (<= y 2.8e+57)
(/
(+ (* (fma (fma (fma x y z) y 27464.7644705) y 230661.510616) y) t)
(+ (* (+ (* b y) c) y) i))
(+ x (* -1.0 (/ (- (* -1.0 z) (* -1.0 (* a x))) y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -7e+47) {
tmp = (x + (z / y)) - ((a * x) / y);
} else if (y <= 2.8e+57) {
tmp = ((fma(fma(fma(x, y, z), y, 27464.7644705), y, 230661.510616) * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = x + (-1.0 * (((-1.0 * z) - (-1.0 * (a * x))) / y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -7e+47) tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)); elseif (y <= 2.8e+57) tmp = Float64(Float64(Float64(fma(fma(fma(x, y, z), y, 27464.7644705), y, 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); else tmp = Float64(x + Float64(-1.0 * Float64(Float64(Float64(-1.0 * z) - Float64(-1.0 * Float64(a * x))) / y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -7e+47], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+57], N[(N[(N[(N[(N[(N[(x * y + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 * N[(N[(N[(-1.0 * z), $MachinePrecision] - N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+47}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+57}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, y, z\right), y, 27464.7644705\right), y, 230661.510616\right) \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{-1 \cdot z - -1 \cdot \left(a \cdot x\right)}{y}\\
\end{array}
\end{array}
if y < -7.00000000000000031e47Initial program 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if -7.00000000000000031e47 < y < 2.8e57Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6450.3
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6450.3
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6450.3
Applied rewrites50.3%
if 2.8e57 < y Initial program 55.4%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6432.6
Applied rewrites32.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y -7e+47)
(- (+ x (/ z y)) (/ (* a x) y))
(if (<= y 2.8e+57)
(/
(fma (fma (fma (fma x y z) y 27464.7644705) y 230661.510616) y t)
(fma (fma b y c) y i))
(+ x (* -1.0 (/ (- (* -1.0 z) (* -1.0 (* a x))) y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -7e+47) {
tmp = (x + (z / y)) - ((a * x) / y);
} else if (y <= 2.8e+57) {
tmp = fma(fma(fma(fma(x, y, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(b, y, c), y, i);
} else {
tmp = x + (-1.0 * (((-1.0 * z) - (-1.0 * (a * x))) / y));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -7e+47) tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)); elseif (y <= 2.8e+57) tmp = Float64(fma(fma(fma(fma(x, y, z), y, 27464.7644705), y, 230661.510616), y, t) / fma(fma(b, y, c), y, i)); else tmp = Float64(x + Float64(-1.0 * Float64(Float64(Float64(-1.0 * z) - Float64(-1.0 * Float64(a * x))) / y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -7e+47], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e+57], N[(N[(N[(N[(N[(x * y + z), $MachinePrecision] * y + 27464.7644705), $MachinePrecision] * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(b * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 * N[(N[(N[(-1.0 * z), $MachinePrecision] - N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7 \cdot 10^{+47}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+57}:\\
\;\;\;\;\frac{\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)}{\mathsf{fma}\left(\mathsf{fma}\left(b, y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{-1 \cdot z - -1 \cdot \left(a \cdot x\right)}{y}\\
\end{array}
\end{array}
if y < -7.00000000000000031e47Initial program 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if -7.00000000000000031e47 < y < 2.8e57Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
Applied rewrites50.3%
if 2.8e57 < y Initial program 55.4%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6432.6
Applied rewrites32.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
t_1)
INFINITY)
(/ (+ (* (+ (* (+ (* z y) 27464.7644705) y) 230661.510616) y) t) t_1)
(- (+ x (/ z y)) (/ (* a x) y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((y + a) * y) + b) * y) + c) * y) + i;
double tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1) <= ((double) INFINITY)) {
tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1;
} else {
tmp = (x + (z / y)) - ((a * x) / y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((y + a) * y) + b) * y) + c) * y) + i;
double tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1) <= Double.POSITIVE_INFINITY) {
tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1;
} else {
tmp = (x + (z / y)) - ((a * x) / y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((((((y + a) * y) + b) * y) + c) * y) + i tmp = 0 if (((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1) <= math.inf: tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1 else: tmp = (x + (z / y)) - ((a * x) / y) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * 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) / t_1) <= Inf) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1); else tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((((((y + a) * y) + b) * y) + c) * y) + i; tmp = 0.0; if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1) <= Inf) tmp = ((((((z * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1; else tmp = (x + (z / y)) - ((a * x) / y); 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[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + 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] / t$95$1), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(N[(z * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / t$95$1), $MachinePrecision], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i\\
\mathbf{if}\;\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{t\_1} \leq \infty:\\
\;\;\;\;\frac{\left(\left(z \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{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 55.4%
Taylor expanded in x around 0
Applied rewrites51.9%
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 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -7.2e-7)
t_1
(if (<= y 7.8e-10)
(/
(+ (* 230661.510616 y) t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(if (<= y 2.2e+54)
(/
(-
(+ (fma (fma y x z) y (/ t (* y y))) (/ 230661.510616 y))
-27464.7644705)
b)
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -7.2e-7) {
tmp = t_1;
} else if (y <= 7.8e-10) {
tmp = ((230661.510616 * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else if (y <= 2.2e+54) {
tmp = ((fma(fma(y, x, z), y, (t / (y * y))) + (230661.510616 / y)) - -27464.7644705) / b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -7.2e-7) tmp = t_1; elseif (y <= 7.8e-10) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)); elseif (y <= 2.2e+54) tmp = Float64(Float64(Float64(fma(fma(y, x, z), y, Float64(t / Float64(y * y))) + Float64(230661.510616 / y)) - -27464.7644705) / b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e-7], t$95$1, If[LessEqual[y, 7.8e-10], N[(N[(N[(230661.510616 * 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, 2.2e+54], N[(N[(N[(N[(N[(y * x + z), $MachinePrecision] * y + N[(t / N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(230661.510616 / y), $MachinePrecision]), $MachinePrecision] - -27464.7644705), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7.8 \cdot 10^{-10}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{elif}\;y \leq 2.2 \cdot 10^{+54}:\\
\;\;\;\;\frac{\left(\mathsf{fma}\left(\mathsf{fma}\left(y, x, z\right), y, \frac{t}{y \cdot y}\right) + \frac{230661.510616}{y}\right) - -27464.7644705}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.19999999999999989e-7 or 2.1999999999999999e54 < y Initial program 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if -7.19999999999999989e-7 < y < 7.7999999999999999e-10Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites47.3%
if 7.7999999999999999e-10 < y < 2.1999999999999999e54Initial program 55.4%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites56.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f649.7
Applied rewrites9.7%
Applied rewrites9.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y -4.2e-6)
(- (+ x (/ z y)) (/ (* a x) y))
(if (<= y 1.05e+57)
(/
(+ (* (+ (* (+ (* y z) 27464.7644705) y) 230661.510616) y) t)
(+ (* (+ (* b y) c) y) i))
(+ x (* -1.0 (/ (- (* -1.0 z) (* -1.0 (* a x))) y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -4.2e-6) {
tmp = (x + (z / y)) - ((a * x) / y);
} else if (y <= 1.05e+57) {
tmp = ((((((y * z) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = x + (-1.0 * (((-1.0 * z) - (-1.0 * (a * x))) / 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 <= (-4.2d-6)) then
tmp = (x + (z / y)) - ((a * x) / y)
else if (y <= 1.05d+57) then
tmp = ((((((y * z) + 27464.7644705d0) * y) + 230661.510616d0) * y) + t) / ((((b * y) + c) * y) + i)
else
tmp = x + ((-1.0d0) * ((((-1.0d0) * z) - ((-1.0d0) * (a * x))) / 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 <= -4.2e-6) {
tmp = (x + (z / y)) - ((a * x) / y);
} else if (y <= 1.05e+57) {
tmp = ((((((y * z) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = x + (-1.0 * (((-1.0 * z) - (-1.0 * (a * x))) / y));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -4.2e-6: tmp = (x + (z / y)) - ((a * x) / y) elif y <= 1.05e+57: tmp = ((((((y * z) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i) else: tmp = x + (-1.0 * (((-1.0 * z) - (-1.0 * (a * x))) / y)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -4.2e-6) tmp = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)); elseif (y <= 1.05e+57) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(y * z) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); else tmp = Float64(x + Float64(-1.0 * Float64(Float64(Float64(-1.0 * z) - Float64(-1.0 * Float64(a * x))) / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -4.2e-6) tmp = (x + (z / y)) - ((a * x) / y); elseif (y <= 1.05e+57) tmp = ((((((y * z) + 27464.7644705) * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i); else tmp = x + (-1.0 * (((-1.0 * z) - (-1.0 * (a * x))) / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -4.2e-6], N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.05e+57], N[(N[(N[(N[(N[(N[(N[(y * z), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], N[(x + N[(-1.0 * N[(N[(N[(-1.0 * z), $MachinePrecision] - N[(-1.0 * N[(a * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-6}:\\
\;\;\;\;\left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{+57}:\\
\;\;\;\;\frac{\left(\left(y \cdot z + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{-1 \cdot z - -1 \cdot \left(a \cdot x\right)}{y}\\
\end{array}
\end{array}
if y < -4.1999999999999996e-6Initial program 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if -4.1999999999999996e-6 < y < 1.04999999999999995e57Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
Taylor expanded in x around 0
lower-*.f6448.1
Applied rewrites48.1%
if 1.04999999999999995e57 < y Initial program 55.4%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6432.6
Applied rewrites32.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -7.2e-7)
t_1
(if (<= y 1.16e+27)
(/
(fma (fma 27464.7644705 y 230661.510616) y t)
(fma (fma (fma (+ a y) y b) y c) y i))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -7.2e-7) {
tmp = t_1;
} else if (y <= 1.16e+27) {
tmp = fma(fma(27464.7644705, y, 230661.510616), y, t) / fma(fma(fma((a + y), y, b), y, c), y, i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -7.2e-7) tmp = t_1; elseif (y <= 1.16e+27) tmp = Float64(fma(fma(27464.7644705, y, 230661.510616), y, t) / fma(fma(fma(Float64(a + y), y, b), y, c), y, i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e-7], t$95$1, If[LessEqual[y, 1.16e+27], N[(N[(N[(27464.7644705 * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / N[(N[(N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] * y + c), $MachinePrecision] * y + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.16 \cdot 10^{+27}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(27464.7644705, y, 230661.510616\right), y, t\right)}{\mathsf{fma}\left(\mathsf{fma}\left(\mathsf{fma}\left(a + y, y, b\right), y, c\right), y, i\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.19999999999999989e-7 or 1.16e27 < y Initial program 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if -7.19999999999999989e-7 < y < 1.16e27Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites47.4%
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6447.4
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6447.4
lift-+.f64N/A
lift-*.f64N/A
lower-fma.f6447.4
Applied rewrites47.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -7.2e-7)
t_1
(if (<= y 0.000215)
(/ (+ (* 230661.510616 y) t) (+ (* (+ (* b y) c) y) i))
(if (<= y 2.1e+54)
(/
(+ 27464.7644705 (fma y (+ z (* x y)) (* 230661.510616 (/ 1.0 y))))
b)
t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -7.2e-7) {
tmp = t_1;
} else if (y <= 0.000215) {
tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i);
} else if (y <= 2.1e+54) {
tmp = (27464.7644705 + fma(y, (z + (x * y)), (230661.510616 * (1.0 / y)))) / b;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -7.2e-7) tmp = t_1; elseif (y <= 0.000215) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); elseif (y <= 2.1e+54) tmp = Float64(Float64(27464.7644705 + fma(y, Float64(z + Float64(x * y)), Float64(230661.510616 * Float64(1.0 / y)))) / b); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e-7], t$95$1, If[LessEqual[y, 0.000215], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.1e+54], N[(N[(27464.7644705 + N[(y * N[(z + N[(x * y), $MachinePrecision]), $MachinePrecision] + N[(230661.510616 * N[(1.0 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.000215:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{+54}:\\
\;\;\;\;\frac{27464.7644705 + \mathsf{fma}\left(y, z + x \cdot y, 230661.510616 \cdot \frac{1}{y}\right)}{b}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.19999999999999989e-7 or 2.09999999999999986e54 < y Initial program 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if -7.19999999999999989e-7 < y < 2.14999999999999995e-4Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
Taylor expanded in y around 0
lower-*.f6445.2
Applied rewrites45.2%
if 2.14999999999999995e-4 < y < 2.09999999999999986e54Initial program 55.4%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites56.2%
Taylor expanded in b around inf
lower-/.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f649.7
Applied rewrites9.7%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f647.2
Applied rewrites7.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -7.2e-7)
t_1
(if (<= y 8e+26)
(/
(+ (* (+ (* 27464.7644705 y) 230661.510616) y) t)
(+ (* (+ (* b y) c) y) i))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -7.2e-7) {
tmp = t_1;
} else if (y <= 8e+26) {
tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (z / y)) - ((a * x) / y)
if (y <= (-7.2d-7)) then
tmp = t_1
else if (y <= 8d+26) then
tmp = ((((27464.7644705d0 * y) + 230661.510616d0) * y) + t) / ((((b * y) + c) * y) + i)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -7.2e-7) {
tmp = t_1;
} else if (y <= 8e+26) {
tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x + (z / y)) - ((a * x) / y) tmp = 0 if y <= -7.2e-7: tmp = t_1 elif y <= 8e+26: tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -7.2e-7) tmp = t_1; elseif (y <= 8e+26) tmp = Float64(Float64(Float64(Float64(Float64(27464.7644705 * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x + (z / y)) - ((a * x) / y); tmp = 0.0; if (y <= -7.2e-7) tmp = t_1; elseif (y <= 8e+26) tmp = ((((27464.7644705 * y) + 230661.510616) * y) + t) / ((((b * y) + c) * y) + i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e-7], t$95$1, If[LessEqual[y, 8e+26], N[(N[(N[(N[(N[(27464.7644705 * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+26}:\\
\;\;\;\;\frac{\left(27464.7644705 \cdot y + 230661.510616\right) \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.19999999999999989e-7 or 8.00000000000000038e26 < y Initial program 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if -7.19999999999999989e-7 < y < 8.00000000000000038e26Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
Taylor expanded in y around 0
lower-*.f6444.9
Applied rewrites44.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -7.2e-7)
t_1
(if (<= y 4.8e+26)
(/ (+ (* 230661.510616 y) t) (+ (* (+ (* b y) c) y) i))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -7.2e-7) {
tmp = t_1;
} else if (y <= 4.8e+26) {
tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (z / y)) - ((a * x) / y)
if (y <= (-7.2d-7)) then
tmp = t_1
else if (y <= 4.8d+26) then
tmp = ((230661.510616d0 * y) + t) / ((((b * y) + c) * y) + i)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -7.2e-7) {
tmp = t_1;
} else if (y <= 4.8e+26) {
tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x + (z / y)) - ((a * x) / y) tmp = 0 if y <= -7.2e-7: tmp = t_1 elif y <= 4.8e+26: tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -7.2e-7) tmp = t_1; elseif (y <= 4.8e+26) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x + (z / y)) - ((a * x) / y); tmp = 0.0; if (y <= -7.2e-7) tmp = t_1; elseif (y <= 4.8e+26) tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e-7], t$95$1, If[LessEqual[y, 4.8e+26], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+26}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.19999999999999989e-7 or 4.80000000000000009e26 < y Initial program 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if -7.19999999999999989e-7 < y < 4.80000000000000009e26Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
Taylor expanded in y around 0
lower-*.f6445.2
Applied rewrites45.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (+ x (/ z y)) (/ (* a x) y))))
(if (<= y -7.2e-7)
t_1
(if (<= y 4.8e+26) (/ t (+ (* (+ (* b y) c) y) i)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -7.2e-7) {
tmp = t_1;
} else if (y <= 4.8e+26) {
tmp = t / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (x + (z / y)) - ((a * x) / y)
if (y <= (-7.2d-7)) then
tmp = t_1
else if (y <= 4.8d+26) then
tmp = t / ((((b * y) + c) * y) + i)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x + (z / y)) - ((a * x) / y);
double tmp;
if (y <= -7.2e-7) {
tmp = t_1;
} else if (y <= 4.8e+26) {
tmp = t / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (x + (z / y)) - ((a * x) / y) tmp = 0 if y <= -7.2e-7: tmp = t_1 elif y <= 4.8e+26: tmp = t / ((((b * y) + c) * y) + i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x + Float64(z / y)) - Float64(Float64(a * x) / y)) tmp = 0.0 if (y <= -7.2e-7) tmp = t_1; elseif (y <= 4.8e+26) tmp = Float64(t / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (x + (z / y)) - ((a * x) / y); tmp = 0.0; if (y <= -7.2e-7) tmp = t_1; elseif (y <= 4.8e+26) tmp = t / ((((b * y) + c) * y) + i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x + N[(z / y), $MachinePrecision]), $MachinePrecision] - N[(N[(a * x), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.2e-7], t$95$1, If[LessEqual[y, 4.8e+26], N[(t / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x + \frac{z}{y}\right) - \frac{a \cdot x}{y}\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-7}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+26}:\\
\;\;\;\;\frac{t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.19999999999999989e-7 or 4.80000000000000009e26 < y Initial program 55.4%
Taylor expanded in y around inf
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if -7.19999999999999989e-7 < y < 4.80000000000000009e26Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
Taylor expanded in y around 0
Applied rewrites38.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (/ 1.0 (/ 1.0 x))))
(if (<= y -1.26e-21)
t_1
(if (<= y 7e+54) (/ t (+ (* (+ (* b y) c) y) i)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 1.0 / (1.0 / x);
double tmp;
if (y <= -1.26e-21) {
tmp = t_1;
} else if (y <= 7e+54) {
tmp = t / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / (1.0d0 / x)
if (y <= (-1.26d-21)) then
tmp = t_1
else if (y <= 7d+54) then
tmp = t / ((((b * y) + c) * y) + i)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = 1.0 / (1.0 / x);
double tmp;
if (y <= -1.26e-21) {
tmp = t_1;
} else if (y <= 7e+54) {
tmp = t / ((((b * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 1.0 / (1.0 / x) tmp = 0 if y <= -1.26e-21: tmp = t_1 elif y <= 7e+54: tmp = t / ((((b * y) + c) * y) + i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(1.0 / Float64(1.0 / x)) tmp = 0.0 if (y <= -1.26e-21) tmp = t_1; elseif (y <= 7e+54) tmp = Float64(t / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = 1.0 / (1.0 / x); tmp = 0.0; if (y <= -1.26e-21) tmp = t_1; elseif (y <= 7e+54) tmp = t / ((((b * y) + c) * y) + i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.26e-21], t$95$1, If[LessEqual[y, 7e+54], N[(t / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{1}{x}}\\
\mathbf{if}\;y \leq -1.26 \cdot 10^{-21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 7 \cdot 10^{+54}:\\
\;\;\;\;\frac{t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.26e-21 or 7.0000000000000002e54 < y Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
lower-/.f6450.0
Applied rewrites50.0%
Taylor expanded in y around inf
lower-/.f6425.9
Applied rewrites25.9%
if -1.26e-21 < y < 7.0000000000000002e54Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
Taylor expanded in y around 0
Applied rewrites38.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (/ 1.0 (/ 1.0 x))))
(if (<= y -6e-31)
t_1
(if (<= y 6.6e+42) (fma y (/ 230661.510616 i) (/ 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 = 1.0 / (1.0 / x);
double tmp;
if (y <= -6e-31) {
tmp = t_1;
} else if (y <= 6.6e+42) {
tmp = fma(y, (230661.510616 / i), (t / i));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(1.0 / Float64(1.0 / x)) tmp = 0.0 if (y <= -6e-31) tmp = t_1; elseif (y <= 6.6e+42) tmp = fma(y, Float64(230661.510616 / i), Float64(t / i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6e-31], t$95$1, If[LessEqual[y, 6.6e+42], N[(y * N[(230661.510616 / i), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{1}{x}}\\
\mathbf{if}\;y \leq -6 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.6 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{230661.510616}{i}, \frac{t}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.99999999999999962e-31 or 6.5999999999999998e42 < y Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
lower-/.f6450.0
Applied rewrites50.0%
Taylor expanded in y around inf
lower-/.f6425.9
Applied rewrites25.9%
if -5.99999999999999962e-31 < y < 6.5999999999999998e42Initial program 55.4%
lift-/.f64N/A
lift-+.f64N/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites56.2%
Taylor expanded in y around 0
Applied rewrites39.6%
Taylor expanded in y around 0
Applied rewrites33.1%
Taylor expanded in y around 0
Applied rewrites31.0%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (/ 1.0 (/ 1.0 x)))) (if (<= y -6.2e-31) t_1 (if (<= y 1.46e+44) (/ 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 = 1.0 / (1.0 / x);
double tmp;
if (y <= -6.2e-31) {
tmp = t_1;
} else if (y <= 1.46e+44) {
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 = 1.0d0 / (1.0d0 / x)
if (y <= (-6.2d-31)) then
tmp = t_1
else if (y <= 1.46d+44) 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 = 1.0 / (1.0 / x);
double tmp;
if (y <= -6.2e-31) {
tmp = t_1;
} else if (y <= 1.46e+44) {
tmp = t / i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = 1.0 / (1.0 / x) tmp = 0 if y <= -6.2e-31: tmp = t_1 elif y <= 1.46e+44: tmp = t / i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(1.0 / Float64(1.0 / x)) tmp = 0.0 if (y <= -6.2e-31) tmp = t_1; elseif (y <= 1.46e+44) 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 = 1.0 / (1.0 / x); tmp = 0.0; if (y <= -6.2e-31) tmp = t_1; elseif (y <= 1.46e+44) 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[(1.0 / N[(1.0 / x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.2e-31], t$95$1, If[LessEqual[y, 1.46e+44], N[(t / i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{1}{x}}\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{-31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.46 \cdot 10^{+44}:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.19999999999999999e-31 or 1.4599999999999999e44 < y Initial program 55.4%
Taylor expanded in y around 0
Applied rewrites50.3%
lift-/.f64N/A
div-flipN/A
lower-/.f64N/A
lower-/.f6450.0
Applied rewrites50.0%
Taylor expanded in y around inf
lower-/.f6425.9
Applied rewrites25.9%
if -6.19999999999999999e-31 < y < 1.4599999999999999e44Initial program 55.4%
Taylor expanded in y around 0
lower-/.f6428.0
Applied rewrites28.0%
(FPCore (x y z t a b c i) :precision binary64 (/ t i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t / i;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = t / i
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t / i;
}
def code(x, y, z, t, a, b, c, i): return t / i
function code(x, y, z, t, a, b, c, i) return Float64(t / i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t / i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t / i), $MachinePrecision]
\begin{array}{l}
\\
\frac{t}{i}
\end{array}
Initial program 55.4%
Taylor expanded in y around 0
lower-/.f6428.0
Applied rewrites28.0%
herbie shell --seed 2025156
(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)))