
(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 (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
t_1)
INFINITY)
(/
(+
(* (+ (+ (* 27464.7644705 y) (* (* (fma y x z) y) y)) 230661.510616) y)
t)
t_1)
(+ (- (/ (- (- z) (* (- a) x)) y)) x))))
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 = (((((27464.7644705 * y) + ((fma(y, x, z) * y) * y)) + 230661.510616) * y) + t) / t_1;
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
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(27464.7644705 * y) + Float64(Float64(fma(y, x, z) * y) * y)) + 230661.510616) * y) + t) / t_1); else tmp = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x); end return 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[(27464.7644705 * y), $MachinePrecision] + N[(N[(N[(y * x + z), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / t$95$1), $MachinePrecision], N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $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(27464.7644705 \cdot y + \left(\mathsf{fma}\left(y, x, z\right) \cdot y\right) \cdot y\right) + 230661.510616\right) \cdot y + t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\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%
lift-*.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-+.f64N/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
*-commutativeN/A
distribute-rgt-inN/A
lower-+.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
lower-fma.f6490.2
Applied rewrites90.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
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))))
(if (<= t_1 INFINITY) t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = -((-z - (-a * x)) / y) + x return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = -((-z - (-a * x)) / y) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\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%
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
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(fma (* y y) (fma (+ a y) y b) i)))
(t_2 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -3.2e+81)
t_2
(if (<= y -1.7e+31)
(*
-1.0
(*
y
(fma
-1.0
(/ x a)
(* -1.0 (/ (fma 27464.7644705 (/ 1.0 (* a y)) (/ z a)) y)))))
(if (<= y -1.3e-41)
t_1
(if (<= y 5.4e-72)
(/
(+ (* 230661.510616 y) t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(if (<= y 2.2e+54) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / fma((y * y), fma((a + y), y, b), i);
double t_2 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -3.2e+81) {
tmp = t_2;
} else if (y <= -1.7e+31) {
tmp = -1.0 * (y * fma(-1.0, (x / a), (-1.0 * (fma(27464.7644705, (1.0 / (a * y)), (z / a)) / y))));
} else if (y <= -1.3e-41) {
tmp = t_1;
} else if (y <= 5.4e-72) {
tmp = ((230661.510616 * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else if (y <= 2.2e+54) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / fma(Float64(y * y), fma(Float64(a + y), y, b), i)) t_2 = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -3.2e+81) tmp = t_2; elseif (y <= -1.7e+31) tmp = Float64(-1.0 * Float64(y * fma(-1.0, Float64(x / a), Float64(-1.0 * Float64(fma(27464.7644705, Float64(1.0 / Float64(a * y)), Float64(z / a)) / y))))); elseif (y <= -1.3e-41) tmp = t_1; elseif (y <= 5.4e-72) 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 = 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[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 27464.7644705), $MachinePrecision] * y), $MachinePrecision] + 230661.510616), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(y * y), $MachinePrecision] * N[(N[(a + y), $MachinePrecision] * y + b), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -3.2e+81], t$95$2, If[LessEqual[y, -1.7e+31], N[(-1.0 * N[(y * N[(-1.0 * N[(x / a), $MachinePrecision] + N[(-1.0 * N[(N[(27464.7644705 * N[(1.0 / N[(a * y), $MachinePrecision]), $MachinePrecision] + N[(z / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, -1.3e-41], t$95$1, If[LessEqual[y, 5.4e-72], 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], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{\mathsf{fma}\left(y \cdot y, \mathsf{fma}\left(a + y, y, b\right), i\right)}\\
t_2 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+81}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{+31}:\\
\;\;\;\;-1 \cdot \left(y \cdot \mathsf{fma}\left(-1, \frac{x}{a}, -1 \cdot \frac{\mathsf{fma}\left(27464.7644705, \frac{1}{a \cdot y}, \frac{z}{a}\right)}{y}\right)\right)\\
\mathbf{elif}\;y \leq -1.3 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-72}:\\
\;\;\;\;\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}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -3.2e81 or 2.1999999999999999e54 < y Initial program 1.3%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6470.2
Applied rewrites70.2%
if -3.2e81 < y < -1.6999999999999999e31Initial program 29.8%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites8.0%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6430.4
Applied rewrites30.4%
if -1.6999999999999999e31 < y < -1.3e-41 or 5.4e-72 < y < 2.1999999999999999e54Initial program 83.8%
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-+.f6463.5
Applied rewrites63.5%
if -1.3e-41 < y < 5.4e-72Initial program 99.8%
Taylor expanded in y around 0
Applied rewrites96.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -3.2e+81)
t_1
(if (<= y -5.2e+18)
(*
-1.0
(*
y
(fma
-1.0
(/ x a)
(* -1.0 (/ (fma 27464.7644705 (/ 1.0 (* a y)) (/ z a)) y)))))
(if (<= y 6.2e+18)
(/
(fma (fma 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 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -3.2e+81) {
tmp = t_1;
} else if (y <= -5.2e+18) {
tmp = -1.0 * (y * fma(-1.0, (x / a), (-1.0 * (fma(27464.7644705, (1.0 / (a * y)), (z / a)) / y))));
} else if (y <= 6.2e+18) {
tmp = fma(fma(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(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -3.2e+81) tmp = t_1; elseif (y <= -5.2e+18) tmp = Float64(-1.0 * Float64(y * fma(-1.0, Float64(x / a), Float64(-1.0 * Float64(fma(27464.7644705, Float64(1.0 / Float64(a * y)), Float64(z / a)) / y))))); elseif (y <= 6.2e+18) tmp = Float64(fma(fma(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
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -3.2e+81], t$95$1, If[LessEqual[y, -5.2e+18], N[(-1.0 * N[(y * N[(-1.0 * N[(x / a), $MachinePrecision] + N[(-1.0 * N[(N[(27464.7644705 * N[(1.0 / N[(a * y), $MachinePrecision]), $MachinePrecision] + N[(z / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+18], N[(N[(N[(27464.7644705 * y + 230661.510616), $MachinePrecision] * 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], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -5.2 \cdot 10^{+18}:\\
\;\;\;\;-1 \cdot \left(y \cdot \mathsf{fma}\left(-1, \frac{x}{a}, -1 \cdot \frac{\mathsf{fma}\left(27464.7644705, \frac{1}{a \cdot y}, \frac{z}{a}\right)}{y}\right)\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+18}:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(27464.7644705, y, 230661.510616\right), y, t\right)}{\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 < -3.2e81 or 6.2e18 < y Initial program 4.1%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6466.6
Applied rewrites66.6%
if -3.2e81 < y < -5.2e18Initial program 34.2%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites8.4%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6429.3
Applied rewrites29.3%
if -5.2e18 < y < 6.2e18Initial program 98.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6487.0
Applied rewrites87.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -3.2e+81)
t_1
(if (<= y -1460000000000.0)
(* y (+ (/ 27464.7644705 (* a (* y y))) (+ (/ x a) (/ z (* a y)))))
(if (<= y 6.2e+18)
(/
(+ (* 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 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -3.2e+81) {
tmp = t_1;
} else if (y <= -1460000000000.0) {
tmp = y * ((27464.7644705 / (a * (y * y))) + ((x / a) + (z / (a * y))));
} else if (y <= 6.2e+18) {
tmp = ((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 = -((-z - (-a * x)) / y) + x
if (y <= (-3.2d+81)) then
tmp = t_1
else if (y <= (-1460000000000.0d0)) then
tmp = y * ((27464.7644705d0 / (a * (y * y))) + ((x / a) + (z / (a * y))))
else if (y <= 6.2d+18) then
tmp = ((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 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -3.2e+81) {
tmp = t_1;
} else if (y <= -1460000000000.0) {
tmp = y * ((27464.7644705 / (a * (y * y))) + ((x / a) + (z / (a * y))));
} else if (y <= 6.2e+18) {
tmp = ((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 = -((-z - (-a * x)) / y) + x tmp = 0 if y <= -3.2e+81: tmp = t_1 elif y <= -1460000000000.0: tmp = y * ((27464.7644705 / (a * (y * y))) + ((x / a) + (z / (a * y)))) elif y <= 6.2e+18: tmp = ((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(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -3.2e+81) tmp = t_1; elseif (y <= -1460000000000.0) tmp = Float64(y * Float64(Float64(27464.7644705 / Float64(a * Float64(y * y))) + Float64(Float64(x / a) + Float64(z / Float64(a * y))))); elseif (y <= 6.2e+18) tmp = Float64(Float64(Float64(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 = -((-z - (-a * x)) / y) + x; tmp = 0.0; if (y <= -3.2e+81) tmp = t_1; elseif (y <= -1460000000000.0) tmp = y * ((27464.7644705 / (a * (y * y))) + ((x / a) + (z / (a * y)))); elseif (y <= 6.2e+18) tmp = ((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[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -3.2e+81], t$95$1, If[LessEqual[y, -1460000000000.0], N[(y * N[(N[(27464.7644705 / N[(a * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] + N[(z / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+18], 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], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1460000000000:\\
\;\;\;\;y \cdot \left(\frac{27464.7644705}{a \cdot \left(y \cdot y\right)} + \left(\frac{x}{a} + \frac{z}{a \cdot y}\right)\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+18}:\\
\;\;\;\;\frac{230661.510616 \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 < -3.2e81 or 6.2e18 < y Initial program 4.1%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6466.6
Applied rewrites66.6%
if -3.2e81 < y < -1.46e12Initial program 37.2%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites8.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6425.6
Applied rewrites25.6%
if -1.46e12 < y < 6.2e18Initial program 99.1%
Taylor expanded in y around 0
Applied rewrites86.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -3.2e+81)
t_1
(if (<= y -1460000000000.0)
(* y (+ (/ 27464.7644705 (* a (* y y))) (+ (/ x a) (/ z (* a y)))))
(if (<= y 6.2e+18)
(/
(fma 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 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -3.2e+81) {
tmp = t_1;
} else if (y <= -1460000000000.0) {
tmp = y * ((27464.7644705 / (a * (y * y))) + ((x / a) + (z / (a * y))));
} else if (y <= 6.2e+18) {
tmp = fma(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(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -3.2e+81) tmp = t_1; elseif (y <= -1460000000000.0) tmp = Float64(y * Float64(Float64(27464.7644705 / Float64(a * Float64(y * y))) + Float64(Float64(x / a) + Float64(z / Float64(a * y))))); elseif (y <= 6.2e+18) tmp = Float64(fma(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
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -3.2e+81], t$95$1, If[LessEqual[y, -1460000000000.0], N[(y * N[(N[(27464.7644705 / N[(a * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] + N[(z / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.2e+18], 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], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -1460000000000:\\
\;\;\;\;y \cdot \left(\frac{27464.7644705}{a \cdot \left(y \cdot y\right)} + \left(\frac{x}{a} + \frac{z}{a \cdot y}\right)\right)\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{+18}:\\
\;\;\;\;\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{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.2e81 or 6.2e18 < y Initial program 4.1%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6466.6
Applied rewrites66.6%
if -3.2e81 < y < -1.46e12Initial program 37.2%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites8.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6425.6
Applied rewrites25.6%
if -1.46e12 < y < 6.2e18Initial program 99.1%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f6486.6
Applied rewrites86.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
(t_2
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
t_1)))
(if (<= t_2 -2e-105)
(/ (+ (* (* (* y y) z) y) t) t_1)
(if (<= t_2 INFINITY)
(/ (fma (fma 27464.7644705 y 230661.510616) y t) t_1)
(+ (- (/ (- (- z) (* (- a) x)) y)) x)))))
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 t_2 = ((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1;
double tmp;
if (t_2 <= -2e-105) {
tmp = ((((y * y) * z) * y) + t) / t_1;
} else if (t_2 <= ((double) INFINITY)) {
tmp = fma(fma(27464.7644705, y, 230661.510616), y, t) / t_1;
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
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) t_2 = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / t_1) tmp = 0.0 if (t_2 <= -2e-105) tmp = Float64(Float64(Float64(Float64(Float64(y * y) * z) * y) + t) / t_1); elseif (t_2 <= Inf) tmp = Float64(fma(fma(27464.7644705, y, 230661.510616), y, t) / t_1); else tmp = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x); end return 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]}, Block[{t$95$2 = 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]}, If[LessEqual[t$95$2, -2e-105], N[(N[(N[(N[(N[(y * y), $MachinePrecision] * z), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / t$95$1), $MachinePrecision], If[LessEqual[t$95$2, Infinity], N[(N[(N[(27464.7644705 * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / t$95$1), $MachinePrecision], N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $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\\
t_2 := \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + 27464.7644705\right) \cdot y + 230661.510616\right) \cdot y + t}{t\_1}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-105}:\\
\;\;\;\;\frac{\left(\left(y \cdot y\right) \cdot z\right) \cdot y + t}{t\_1}\\
\mathbf{elif}\;t\_2 \leq \infty:\\
\;\;\;\;\frac{\mathsf{fma}\left(\mathsf{fma}\left(27464.7644705, y, 230661.510616\right), y, t\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\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)) < -1.99999999999999993e-105Initial program 92.8%
Taylor expanded in z around inf
lower-*.f64N/A
unpow2N/A
lower-*.f6482.5
Applied rewrites82.5%
if -1.99999999999999993e-105 < (/.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 89.0%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6476.7
Applied rewrites76.7%
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
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -3.2e+81)
t_1
(if (<= y -110000.0)
(* y (+ (/ 27464.7644705 (* a (* y y))) (+ (/ x a) (/ z (* a y)))))
(if (<= y 7.6e+16)
(/ (+ (* 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 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -3.2e+81) {
tmp = t_1;
} else if (y <= -110000.0) {
tmp = y * ((27464.7644705 / (a * (y * y))) + ((x / a) + (z / (a * y))));
} else if (y <= 7.6e+16) {
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 = -((-z - (-a * x)) / y) + x
if (y <= (-3.2d+81)) then
tmp = t_1
else if (y <= (-110000.0d0)) then
tmp = y * ((27464.7644705d0 / (a * (y * y))) + ((x / a) + (z / (a * y))))
else if (y <= 7.6d+16) 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 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -3.2e+81) {
tmp = t_1;
} else if (y <= -110000.0) {
tmp = y * ((27464.7644705 / (a * (y * y))) + ((x / a) + (z / (a * y))));
} else if (y <= 7.6e+16) {
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 = -((-z - (-a * x)) / y) + x tmp = 0 if y <= -3.2e+81: tmp = t_1 elif y <= -110000.0: tmp = y * ((27464.7644705 / (a * (y * y))) + ((x / a) + (z / (a * y)))) elif y <= 7.6e+16: 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(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -3.2e+81) tmp = t_1; elseif (y <= -110000.0) tmp = Float64(y * Float64(Float64(27464.7644705 / Float64(a * Float64(y * y))) + Float64(Float64(x / a) + Float64(z / Float64(a * y))))); elseif (y <= 7.6e+16) 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 = -((-z - (-a * x)) / y) + x; tmp = 0.0; if (y <= -3.2e+81) tmp = t_1; elseif (y <= -110000.0) tmp = y * ((27464.7644705 / (a * (y * y))) + ((x / a) + (z / (a * y)))); elseif (y <= 7.6e+16) 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[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -3.2e+81], t$95$1, If[LessEqual[y, -110000.0], N[(y * N[(N[(27464.7644705 / N[(a * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(x / a), $MachinePrecision] + N[(z / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.6e+16], 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(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+81}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -110000:\\
\;\;\;\;y \cdot \left(\frac{27464.7644705}{a \cdot \left(y \cdot y\right)} + \left(\frac{x}{a} + \frac{z}{a \cdot y}\right)\right)\\
\mathbf{elif}\;y \leq 7.6 \cdot 10^{+16}:\\
\;\;\;\;\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 < -3.2e81 or 7.6e16 < y Initial program 4.3%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6466.4
Applied rewrites66.4%
if -3.2e81 < y < -1.1e5Initial program 42.6%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites10.1%
Taylor expanded in y around inf
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lower-*.f6424.6
Applied rewrites24.6%
if -1.1e5 < y < 7.6e16Initial program 99.3%
Taylor expanded in y around 0
Applied rewrites87.4%
Taylor expanded in y around 0
Applied rewrites84.5%
(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)
(/ (fma (fma 27464.7644705 y 230661.510616) y t) t_1)
(+ (- (/ (- (- z) (* (- a) x)) y)) x))))
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 = fma(fma(27464.7644705, y, 230661.510616), y, t) / t_1;
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
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(fma(fma(27464.7644705, y, 230661.510616), y, t) / t_1); else tmp = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x); end return 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[(27464.7644705 * y + 230661.510616), $MachinePrecision] * y + t), $MachinePrecision] / t$95$1), $MachinePrecision], N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $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{\mathsf{fma}\left(\mathsf{fma}\left(27464.7644705, y, 230661.510616\right), y, t\right)}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\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%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6477.0
Applied rewrites77.0%
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
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
INFINITY)
(/ (+ (* 230661.510616 y) t) (+ (* (+ (* b y) c) y) i))
(+ (- (/ (- (- z) (* (- a) x)) y)) x)))
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 = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= Double.POSITIVE_INFINITY) {
tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i);
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= math.inf: tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i) else: tmp = -((-z - (-a * x)) / y) + x 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(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(Float64(Float64(b * y) + c) * y) + i)); else tmp = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= Inf) tmp = ((230661.510616 * y) + t) / ((((b * y) + c) * y) + i); else tmp = -((-z - (-a * x)) / y) + x; end tmp_2 = 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[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(b * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $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{230661.510616 \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\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%
Taylor expanded in y around 0
Applied rewrites75.5%
Taylor expanded in y around 0
Applied rewrites72.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
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(/
(+
(* (+ (* (+ (* (+ (* x y) z) y) 27464.7644705) y) 230661.510616) y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
INFINITY)
(/ (+ (* 230661.510616 y) t) (+ (* c y) i))
(+ (- (/ (- (- z) (* (- a) x)) y)) x)))
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 = ((230661.510616 * y) + t) / ((c * y) + i);
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= Double.POSITIVE_INFINITY) {
tmp = ((230661.510616 * y) + t) / ((c * y) + i);
} else {
tmp = -((-z - (-a * x)) / y) + x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= math.inf: tmp = ((230661.510616 * y) + t) / ((c * y) + i) else: tmp = -((-z - (-a * x)) / y) + x 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(Float64(Float64(230661.510616 * y) + t) / Float64(Float64(c * y) + i)); else tmp = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((((((((((x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / (((((((y + a) * y) + b) * y) + c) * y) + i)) <= Inf) tmp = ((230661.510616 * y) + t) / ((c * y) + i); else tmp = -((-z - (-a * x)) / y) + x; end tmp_2 = 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[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(c * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision], N[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $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{230661.510616 \cdot y + t}{c \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;\left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\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%
Taylor expanded in y around 0
Applied rewrites75.5%
Taylor expanded in y around 0
Applied rewrites66.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 0.0%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6469.7
Applied rewrites69.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (- (/ (- (- z) (* (- a) x)) y)) x)))
(if (<= y -3.7e-6)
t_1
(if (<= y 0.0004) (/ (+ (* 230661.510616 y) t) i) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -3.7e-6) {
tmp = t_1;
} else if (y <= 0.0004) {
tmp = ((230661.510616 * y) + 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 = -((-z - (-a * x)) / y) + x
if (y <= (-3.7d-6)) then
tmp = t_1
else if (y <= 0.0004d0) then
tmp = ((230661.510616d0 * y) + 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 = -((-z - (-a * x)) / y) + x;
double tmp;
if (y <= -3.7e-6) {
tmp = t_1;
} else if (y <= 0.0004) {
tmp = ((230661.510616 * y) + t) / i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -((-z - (-a * x)) / y) + x tmp = 0 if y <= -3.7e-6: tmp = t_1 elif y <= 0.0004: tmp = ((230661.510616 * y) + t) / i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(-Float64(Float64(Float64(-z) - Float64(Float64(-a) * x)) / y)) + x) tmp = 0.0 if (y <= -3.7e-6) tmp = t_1; elseif (y <= 0.0004) tmp = Float64(Float64(Float64(230661.510616 * y) + t) / i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -((-z - (-a * x)) / y) + x; tmp = 0.0; if (y <= -3.7e-6) tmp = t_1; elseif (y <= 0.0004) tmp = ((230661.510616 * y) + 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[((-N[(N[((-z) - N[((-a) * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]) + x), $MachinePrecision]}, If[LessEqual[y, -3.7e-6], t$95$1, If[LessEqual[y, 0.0004], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-\frac{\left(-z\right) - \left(-a\right) \cdot x}{y}\right) + x\\
\mathbf{if}\;y \leq -3.7 \cdot 10^{-6}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 0.0004:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.7000000000000002e-6 or 4.00000000000000019e-4 < y Initial program 13.2%
Taylor expanded in y around -inf
+-commutativeN/A
lower-+.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6457.6
Applied rewrites57.6%
if -3.7000000000000002e-6 < y < 4.00000000000000019e-4Initial program 99.7%
Taylor expanded in y around 0
Applied rewrites90.2%
Taylor expanded in y around 0
Applied rewrites62.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y -3.05e+81)
x
(if (<= y -6.5e-34)
(/ z a)
(if (<= y 2.65e-12) (/ (+ (* 230661.510616 y) 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 <= -3.05e+81) {
tmp = x;
} else if (y <= -6.5e-34) {
tmp = z / a;
} else if (y <= 2.65e-12) {
tmp = ((230661.510616 * y) + 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 <= (-3.05d+81)) then
tmp = x
else if (y <= (-6.5d-34)) then
tmp = z / a
else if (y <= 2.65d-12) then
tmp = ((230661.510616d0 * y) + 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 <= -3.05e+81) {
tmp = x;
} else if (y <= -6.5e-34) {
tmp = z / a;
} else if (y <= 2.65e-12) {
tmp = ((230661.510616 * y) + t) / i;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -3.05e+81: tmp = x elif y <= -6.5e-34: tmp = z / a elif y <= 2.65e-12: tmp = ((230661.510616 * y) + t) / i else: tmp = x return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -3.05e+81) tmp = x; elseif (y <= -6.5e-34) tmp = Float64(z / a); elseif (y <= 2.65e-12) tmp = Float64(Float64(Float64(230661.510616 * y) + 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 <= -3.05e+81) tmp = x; elseif (y <= -6.5e-34) tmp = z / a; elseif (y <= 2.65e-12) tmp = ((230661.510616 * y) + t) / i; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -3.05e+81], x, If[LessEqual[y, -6.5e-34], N[(z / a), $MachinePrecision], If[LessEqual[y, 2.65e-12], N[(N[(N[(230661.510616 * y), $MachinePrecision] + t), $MachinePrecision] / i), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{+81}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -6.5 \cdot 10^{-34}:\\
\;\;\;\;\frac{z}{a}\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{-12}:\\
\;\;\;\;\frac{230661.510616 \cdot y + t}{i}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.05000000000000019e81 or 2.64999999999999982e-12 < y Initial program 8.9%
Taylor expanded in y around inf
Applied rewrites52.0%
if -3.05000000000000019e81 < y < -6.49999999999999985e-34Initial program 61.6%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites12.9%
Taylor expanded in z around inf
lower-/.f6411.0
Applied rewrites11.0%
if -6.49999999999999985e-34 < y < 2.64999999999999982e-12Initial program 99.7%
Taylor expanded in y around 0
Applied rewrites93.1%
Taylor expanded in y around 0
Applied rewrites65.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -3.05e+81) x (if (<= y -4.5e-43) (/ z a) (if (<= y 2.8e-12) (/ 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 <= -3.05e+81) {
tmp = x;
} else if (y <= -4.5e-43) {
tmp = z / a;
} else if (y <= 2.8e-12) {
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 <= (-3.05d+81)) then
tmp = x
else if (y <= (-4.5d-43)) then
tmp = z / a
else if (y <= 2.8d-12) 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 <= -3.05e+81) {
tmp = x;
} else if (y <= -4.5e-43) {
tmp = z / a;
} else if (y <= 2.8e-12) {
tmp = t / i;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -3.05e+81: tmp = x elif y <= -4.5e-43: tmp = z / a elif y <= 2.8e-12: tmp = t / i else: tmp = x return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -3.05e+81) tmp = x; elseif (y <= -4.5e-43) tmp = Float64(z / a); elseif (y <= 2.8e-12) 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 <= -3.05e+81) tmp = x; elseif (y <= -4.5e-43) tmp = z / a; elseif (y <= 2.8e-12) tmp = t / i; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -3.05e+81], x, If[LessEqual[y, -4.5e-43], N[(z / a), $MachinePrecision], If[LessEqual[y, 2.8e-12], N[(t / i), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{+81}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq -4.5 \cdot 10^{-43}:\\
\;\;\;\;\frac{z}{a}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-12}:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.05000000000000019e81 or 2.8000000000000002e-12 < y Initial program 8.9%
Taylor expanded in y around inf
Applied rewrites52.0%
if -3.05000000000000019e81 < y < -4.50000000000000025e-43Initial program 64.8%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites13.2%
Taylor expanded in z around inf
lower-/.f6410.7
Applied rewrites10.7%
if -4.50000000000000025e-43 < y < 2.8000000000000002e-12Initial program 99.7%
Taylor expanded in y around 0
lower-/.f6458.9
Applied rewrites58.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y -3.05e+81) x (if (<= y 4.6e+18) (/ z a) x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= -3.05e+81) {
tmp = x;
} else if (y <= 4.6e+18) {
tmp = z / a;
} 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 <= (-3.05d+81)) then
tmp = x
else if (y <= 4.6d+18) then
tmp = z / a
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 <= -3.05e+81) {
tmp = x;
} else if (y <= 4.6e+18) {
tmp = z / a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= -3.05e+81: tmp = x elif y <= 4.6e+18: tmp = z / a else: tmp = x return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= -3.05e+81) tmp = x; elseif (y <= 4.6e+18) tmp = Float64(z / a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= -3.05e+81) tmp = x; elseif (y <= 4.6e+18) tmp = z / a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, -3.05e+81], x, If[LessEqual[y, 4.6e+18], N[(z / a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.05 \cdot 10^{+81}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{+18}:\\
\;\;\;\;\frac{z}{a}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -3.05000000000000019e81 or 4.6e18 < y Initial program 4.1%
Taylor expanded in y around inf
Applied rewrites54.6%
if -3.05000000000000019e81 < y < 4.6e18Initial program 93.2%
Taylor expanded in a around inf
lower-/.f64N/A
Applied rewrites9.0%
Taylor expanded in z around inf
lower-/.f646.0
Applied rewrites6.0%
(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.7%
Taylor expanded in y around inf
Applied rewrites25.7%
herbie shell --seed 2025106
(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)))