
(FPCore (x y z t a b c i)
:precision binary64
(/
(+
(*
(+
(* (+ (* (+ (* x y) z) y) 54929528941/2000000) y)
28832688827/125000)
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] + 54929528941/2000000), $MachinePrecision] * y), $MachinePrecision] + 28832688827/125000), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i)
:precision binary64
(/
(+
(*
(+
(* (+ (* (+ (* x y) z) y) 54929528941/2000000) y)
28832688827/125000)
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] + 54929528941/2000000), $MachinePrecision] * y), $MachinePrecision] + 28832688827/125000), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / N[(N[(N[(N[(N[(N[(N[(y + a), $MachinePrecision] * y), $MachinePrecision] + b), $MachinePrecision] * y), $MachinePrecision] + c), $MachinePrecision] * y), $MachinePrecision] + i), $MachinePrecision]), $MachinePrecision]
\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(/
(+
(*
(+
(* (+ (* (+ (* x y) z) y) 54929528941/2000000) y)
28832688827/125000)
y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
INFINITY)
(134-z0z1z2z3z4
(/ 1 (+ i (* (+ c (* (+ b (* (+ a y) y)) y)) y)))
(-
(* (- (* (+ z (* x y)) y) -54929528941/2000000) y)
-28832688827/125000)
y
t
-1)
(+ x (* -1 (/ (* z (- (/ a y) 1)) y)))))\begin{array}{l}
\mathbf{if}\;\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i} \leq \infty:\\
\;\;\;\;\mathsf{134\_z0z1z2z3z4}\left(\left(\frac{1}{i + \left(c + \left(b + \left(a + y\right) \cdot y\right) \cdot y\right) \cdot y}\right), \left(\left(\left(z + x \cdot y\right) \cdot y - \frac{-54929528941}{2000000}\right) \cdot y - \frac{-28832688827}{125000}\right), y, t, -1\right)\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\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.5%
Applied rewrites56.0%
Applied rewrites55.1%
Applied rewrites56.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.5%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4%
Applied rewrites33.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(/
(+
(*
(+
(* (+ (* (+ (* x y) z) y) 54929528941/2000000) y)
28832688827/125000)
y)
t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))))
(if (<= t_1 INFINITY) t_1 (+ x (* -1 (/ (* z (- (/ a y) 1)) y))))))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 = x + (-1.0 * ((z * ((a / y) - 1.0)) / 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 = ((((((((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 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y));
}
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 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)) 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(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))); 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 = x + (-1.0 * ((z * ((a / y) - 1.0)) / 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[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 54929528941/2000000), $MachinePrecision] * y), $MachinePrecision] + 28832688827/125000), $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[(x + N[(-1 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{\left(\left(\left(x \cdot y + z\right) \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\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}:\\
\;\;\;\;x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\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.5%
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.5%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4%
Applied rewrites33.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1 (/ (* z (- (/ a y) 1)) y)))))
(if (<= y -2200000000000000000000)
t_1
(if (<= y 131999999999999993854998690473563335426048)
(/
(+
(*
(+
(* (+ (* (+ (* x y) z) y) 54929528941/2000000) y)
28832688827/125000)
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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.2e+21) {
tmp = t_1;
} else if (y <= 1.32e+41) {
tmp = ((((((((x * y) + z) * y) + 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 + ((-1.0d0) * ((z * ((a / y) - 1.0d0)) / y))
if (y <= (-2.2d+21)) then
tmp = t_1
else if (y <= 1.32d+41) then
tmp = ((((((((x * y) + z) * y) + 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 + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2.2e+21) {
tmp = t_1;
} else if (y <= 1.32e+41) {
tmp = ((((((((x * y) + z) * y) + 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 + (-1.0 * ((z * ((a / y) - 1.0)) / y)) tmp = 0 if y <= -2.2e+21: tmp = t_1 elif y <= 1.32e+41: tmp = ((((((((x * y) + z) * y) + 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(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -2.2e+21) tmp = t_1; elseif (y <= 1.32e+41) tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(Float64(x * y) + z) * y) + 27464.7644705) * y) + 230661.510616) * y) + t) / Float64(Float64(Float64(Float64(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 + (-1.0 * ((z * ((a / y) - 1.0)) / y)); tmp = 0.0; if (y <= -2.2e+21) tmp = t_1; elseif (y <= 1.32e+41) tmp = ((((((((x * y) + z) * y) + 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[(x + N[(-1 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2200000000000000000000], t$95$1, If[LessEqual[y, 131999999999999993854998690473563335426048], N[(N[(N[(N[(N[(N[(N[(N[(N[(x * y), $MachinePrecision] + z), $MachinePrecision] * y), $MachinePrecision] + 54929528941/2000000), $MachinePrecision] * y), $MachinePrecision] + 28832688827/125000), $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}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq -2200000000000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 131999999999999993854998690473563335426048:\\
\;\;\;\;\frac{\left(\left(\left(x \cdot y + z\right) \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{\left(b \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.2e21 or 1.3199999999999999e41 < y Initial program 55.5%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4%
Applied rewrites33.4%
if -2.2e21 < y < 1.3199999999999999e41Initial program 55.5%
Taylor expanded in y around 0
Applied rewrites50.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) 54929528941/2000000) y)
28832688827/125000)
y)
t)
t_1)
INFINITY)
(/
(+
(*
(+ (* (+ (* z y) 54929528941/2000000) y) 28832688827/125000)
y)
t)
t_1)
(+ x (* -1 (/ (* z (- (/ a y) 1)) 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 + (-1.0 * ((z * ((a / y) - 1.0)) / 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 + (-1.0 * ((z * ((a / y) - 1.0)) / 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 + (-1.0 * ((z * ((a / y) - 1.0)) / 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(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / 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 + (-1.0 * ((z * ((a / y) - 1.0)) / 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] + 54929528941/2000000), $MachinePrecision] * y), $MachinePrecision] + 28832688827/125000), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / t$95$1), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(N[(N[(z * y), $MachinePrecision] + 54929528941/2000000), $MachinePrecision] * y), $MachinePrecision] + 28832688827/125000), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / t$95$1), $MachinePrecision], N[(x + N[(-1 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\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 + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{t\_1} \leq \infty:\\
\;\;\;\;\frac{\left(\left(z \cdot y + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\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.5%
Taylor expanded in x around 0
Applied rewrites51.8%
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.5%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4%
Applied rewrites33.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1 (/ (* z (- (/ a y) 1)) y)))))
(if (<=
y
-8275667163517223/43556142965880123323311949751266331066368)
t_1
(if (<= y 131999999999999993854998690473563335426048)
(/
(+ (* 28832688827/125000 y) t)
(+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -1.9e-25) {
tmp = t_1;
} else if (y <= 1.32e+41) {
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 = x + ((-1.0d0) * ((z * ((a / y) - 1.0d0)) / y))
if (y <= (-1.9d-25)) then
tmp = t_1
else if (y <= 1.32d+41) 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 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -1.9e-25) {
tmp = t_1;
} else if (y <= 1.32e+41) {
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 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)) tmp = 0 if y <= -1.9e-25: tmp = t_1 elif y <= 1.32e+41: 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(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -1.9e-25) tmp = t_1; elseif (y <= 1.32e+41) 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 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)); tmp = 0.0; if (y <= -1.9e-25) tmp = t_1; elseif (y <= 1.32e+41) 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[(x + N[(-1 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8275667163517223/43556142965880123323311949751266331066368], t$95$1, If[LessEqual[y, 131999999999999993854998690473563335426048], N[(N[(N[(28832688827/125000 * 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}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq \frac{-8275667163517223}{43556142965880123323311949751266331066368}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 131999999999999993854998690473563335426048:\\
\;\;\;\;\frac{\frac{28832688827}{125000} \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}
if y < -1.8999999999999999e-25 or 1.3199999999999999e41 < y Initial program 55.5%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4%
Applied rewrites33.4%
if -1.8999999999999999e-25 < y < 1.3199999999999999e41Initial program 55.5%
Taylor expanded in y around 0
Applied rewrites47.3%
Taylor expanded in y around 0
Applied rewrites47.1%
(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) 54929528941/2000000) y)
28832688827/125000)
y)
t)
t_1)
INFINITY)
(/
(+ (* (+ (* 54929528941/2000000 y) 28832688827/125000) y) t)
t_1)
(+ x (* -1 (/ (* z (- (/ a y) 1)) 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 = ((((27464.7644705 * y) + 230661.510616) * y) + t) / t_1;
} else {
tmp = x + (-1.0 * ((z * ((a / y) - 1.0)) / 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 = ((((27464.7644705 * y) + 230661.510616) * y) + t) / t_1;
} else {
tmp = x + (-1.0 * ((z * ((a / y) - 1.0)) / 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 = ((((27464.7644705 * y) + 230661.510616) * y) + t) / t_1 else: tmp = x + (-1.0 * ((z * ((a / y) - 1.0)) / 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(27464.7644705 * y) + 230661.510616) * y) + t) / t_1); else tmp = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / 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 = ((((27464.7644705 * y) + 230661.510616) * y) + t) / t_1; else tmp = x + (-1.0 * ((z * ((a / y) - 1.0)) / 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] + 54929528941/2000000), $MachinePrecision] * y), $MachinePrecision] + 28832688827/125000), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / t$95$1), $MachinePrecision], Infinity], N[(N[(N[(N[(N[(54929528941/2000000 * y), $MachinePrecision] + 28832688827/125000), $MachinePrecision] * y), $MachinePrecision] + t), $MachinePrecision] / t$95$1), $MachinePrecision], N[(x + N[(-1 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\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 + \frac{54929528941}{2000000}\right) \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{t\_1} \leq \infty:\\
\;\;\;\;\frac{\left(\frac{54929528941}{2000000} \cdot y + \frac{28832688827}{125000}\right) \cdot y + t}{t\_1}\\
\mathbf{else}:\\
\;\;\;\;x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\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.5%
Taylor expanded in y around 0
Applied rewrites47.3%
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.5%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4%
Applied rewrites33.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1 (/ (* z (- (/ a y) 1)) y)))))
(if (<=
y
-8275667163517223/43556142965880123323311949751266331066368)
t_1
(if (<= y 131999999999999993854998690473563335426048)
(/ t (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -1.9e-25) {
tmp = t_1;
} else if (y <= 1.32e+41) {
tmp = t / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((-1.0d0) * ((z * ((a / y) - 1.0d0)) / y))
if (y <= (-1.9d-25)) then
tmp = t_1
else if (y <= 1.32d+41) then
tmp = t / (((((((y + a) * y) + b) * y) + c) * y) + i)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -1.9e-25) {
tmp = t_1;
} else if (y <= 1.32e+41) {
tmp = t / (((((((y + a) * y) + b) * y) + c) * y) + i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)) tmp = 0 if y <= -1.9e-25: tmp = t_1 elif y <= 1.32e+41: tmp = t / (((((((y + a) * y) + b) * y) + c) * y) + i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -1.9e-25) tmp = t_1; elseif (y <= 1.32e+41) tmp = Float64(t / Float64(Float64(Float64(Float64(Float64(Float64(Float64(y + a) * y) + b) * y) + c) * y) + i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)); tmp = 0.0; if (y <= -1.9e-25) tmp = t_1; elseif (y <= 1.32e+41) tmp = t / (((((((y + a) * y) + b) * y) + c) * y) + i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(-1 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -8275667163517223/43556142965880123323311949751266331066368], t$95$1, If[LessEqual[y, 131999999999999993854998690473563335426048], N[(t / 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}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq \frac{-8275667163517223}{43556142965880123323311949751266331066368}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 131999999999999993854998690473563335426048:\\
\;\;\;\;\frac{t}{\left(\left(\left(y + a\right) \cdot y + b\right) \cdot y + c\right) \cdot y + i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.8999999999999999e-25 or 1.3199999999999999e41 < y Initial program 55.5%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4%
Applied rewrites33.4%
if -1.8999999999999999e-25 < y < 1.3199999999999999e41Initial program 55.5%
Taylor expanded in y around 0
Applied rewrites47.3%
Taylor expanded in y around 0
Applied rewrites39.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (* -1 (/ (* z (- (/ a y) 1)) y)))))
(if (<=
y
-5444517870735015/2722258935367507707706996859454145691648)
t_1
(if (<= y 20499999999999999986131350259736876692371668992)
(/ t i)
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2e-24) {
tmp = t_1;
} else if (y <= 2.05e+46) {
tmp = t / i;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((-1.0d0) * ((z * ((a / y) - 1.0d0)) / y))
if (y <= (-2d-24)) then
tmp = t_1
else if (y <= 2.05d+46) then
tmp = t / i
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y));
double tmp;
if (y <= -2e-24) {
tmp = t_1;
} else if (y <= 2.05e+46) {
tmp = t / i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)) tmp = 0 if y <= -2e-24: tmp = t_1 elif y <= 2.05e+46: tmp = t / i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(-1.0 * Float64(Float64(z * Float64(Float64(a / y) - 1.0)) / y))) tmp = 0.0 if (y <= -2e-24) tmp = t_1; elseif (y <= 2.05e+46) tmp = Float64(t / i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x + (-1.0 * ((z * ((a / y) - 1.0)) / y)); tmp = 0.0; if (y <= -2e-24) tmp = t_1; elseif (y <= 2.05e+46) tmp = t / i; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(-1 * N[(N[(z * N[(N[(a / y), $MachinePrecision] - 1), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5444517870735015/2722258935367507707706996859454145691648], t$95$1, If[LessEqual[y, 20499999999999999986131350259736876692371668992], N[(t / i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + -1 \cdot \frac{z \cdot \left(\frac{a}{y} - 1\right)}{y}\\
\mathbf{if}\;y \leq \frac{-5444517870735015}{2722258935367507707706996859454145691648}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 20499999999999999986131350259736876692371668992:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.9999999999999998e-24 or 2.05e46 < y Initial program 55.5%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f6433.4%
Applied rewrites33.4%
if -1.9999999999999998e-24 < y < 2.05e46Initial program 55.5%
Taylor expanded in y around 0
lower-/.f6428.3%
Applied rewrites28.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ x (/ (- z (* a x)) y))))
(if (<=
y
-4738908354687757/5575186299632655785383929568162090376495104)
t_1
(if (<= y 1649999999999999855891765734205098870781112901173248)
(/ t i)
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x + ((z - (a * x)) / y);
double tmp;
if (y <= -8.5e-28) {
tmp = t_1;
} else if (y <= 1.65e+51) {
tmp = t / i;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = x + ((z - (a * x)) / y)
if (y <= (-8.5d-28)) then
tmp = t_1
else if (y <= 1.65d+51) then
tmp = t / i
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x + ((z - (a * x)) / y);
double tmp;
if (y <= -8.5e-28) {
tmp = t_1;
} else if (y <= 1.65e+51) {
tmp = t / i;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = x + ((z - (a * x)) / y) tmp = 0 if y <= -8.5e-28: tmp = t_1 elif y <= 1.65e+51: tmp = t / i else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x + Float64(Float64(z - Float64(a * x)) / y)) tmp = 0.0 if (y <= -8.5e-28) tmp = t_1; elseif (y <= 1.65e+51) tmp = Float64(t / i); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = x + ((z - (a * x)) / y); tmp = 0.0; if (y <= -8.5e-28) tmp = t_1; elseif (y <= 1.65e+51) tmp = t / i; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x + N[(N[(z - N[(a * x), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -4738908354687757/5575186299632655785383929568162090376495104], t$95$1, If[LessEqual[y, 1649999999999999855891765734205098870781112901173248], N[(t / i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \frac{z - a \cdot x}{y}\\
\mathbf{if}\;y \leq \frac{-4738908354687757}{5575186299632655785383929568162090376495104}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1649999999999999855891765734205098870781112901173248:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -8.4999999999999993e-28 or 1.6499999999999999e51 < y Initial program 55.5%
lift-+.f64N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites46.1%
Taylor expanded in y around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites26.8%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f64N/A
lower-*.f6431.5%
Applied rewrites31.5%
if -8.4999999999999993e-28 < y < 1.6499999999999999e51Initial program 55.5%
Taylor expanded in y around 0
lower-/.f6428.3%
Applied rewrites28.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
c
539999999999999991694515579716069775339900875769553645781471547701820229645610440184144461360016568693244798992243850939959162875737667188198393165225891063010619944422157145334873141203173376)
(/ t i)
(/ t (* c y))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (c <= 5.4e+191) {
tmp = t / i;
} else {
tmp = t / (c * 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 (c <= 5.4d+191) then
tmp = t / i
else
tmp = t / (c * 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 (c <= 5.4e+191) {
tmp = t / i;
} else {
tmp = t / (c * y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if c <= 5.4e+191: tmp = t / i else: tmp = t / (c * y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (c <= 5.4e+191) tmp = Float64(t / i); else tmp = Float64(t / Float64(c * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (c <= 5.4e+191) tmp = t / i; else tmp = t / (c * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[c, 539999999999999991694515579716069775339900875769553645781471547701820229645610440184144461360016568693244798992243850939959162875737667188198393165225891063010619944422157145334873141203173376], N[(t / i), $MachinePrecision], N[(t / N[(c * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;c \leq 539999999999999991694515579716069775339900875769553645781471547701820229645610440184144461360016568693244798992243850939959162875737667188198393165225891063010619944422157145334873141203173376:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{t}{c \cdot y}\\
\end{array}
if c < 5.3999999999999999e191Initial program 55.5%
Taylor expanded in y around 0
lower-/.f6428.3%
Applied rewrites28.3%
if 5.3999999999999999e191 < c Initial program 55.5%
Applied rewrites56.0%
Taylor expanded in c around inf
lower-/.f64N/A
Applied rewrites14.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f6412.0%
Applied rewrites12.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 4958484807013127/2361183241434822606848) (/ t i) (* (/ z b) y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 2.1e-6) {
tmp = t / i;
} else {
tmp = (z / b) * 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 <= 2.1d-6) then
tmp = t / i
else
tmp = (z / b) * 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 <= 2.1e-6) {
tmp = t / i;
} else {
tmp = (z / b) * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 2.1e-6: tmp = t / i else: tmp = (z / b) * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 2.1e-6) tmp = Float64(t / i); else tmp = Float64(Float64(z / b) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 2.1e-6) tmp = t / i; else tmp = (z / b) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 4958484807013127/2361183241434822606848], N[(t / i), $MachinePrecision], N[(N[(z / b), $MachinePrecision] * y), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;y \leq \frac{4958484807013127}{2361183241434822606848}:\\
\;\;\;\;\frac{t}{i}\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{b} \cdot y\\
\end{array}
if y < 2.0999999999999998e-6Initial program 55.5%
Taylor expanded in y around 0
lower-/.f6428.3%
Applied rewrites28.3%
if 2.0999999999999998e-6 < y Initial program 55.5%
Applied rewrites56.0%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites9.4%
Taylor expanded in z around inf
lower-/.f64N/A
lower-*.f645.9%
Applied rewrites5.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f646.1%
Applied rewrites6.1%
(FPCore (x y z t a b c i) :precision binary64 (/ t i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t / i;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = t / i
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t / i;
}
def code(x, y, z, t, a, b, c, i): return t / i
function code(x, y, z, t, a, b, c, i) return Float64(t / i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = t / i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(t / i), $MachinePrecision]
\frac{t}{i}
Initial program 55.5%
Taylor expanded in y around 0
lower-/.f6428.3%
Applied rewrites28.3%
herbie shell --seed 2025271 -o generate:evaluate
(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) 54929528941/2000000) y) 28832688827/125000) y) t) (+ (* (+ (* (+ (* (+ y a) y) b) y) c) y) i)))