
(FPCore (x y z t a b c)
:precision binary64
(/
x
(+
x
(*
y
(exp
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return x / (x + (y * exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))));
}
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)
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
code = x / (x + (y * exp((2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))))))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return x / (x + (y * Math.exp((2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))));
}
def code(x, y, z, t, a, b, c): return x / (x + (y * math.exp((2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))))
function code(x, y, z, t, a, b, c) return Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))))))) end
function tmp = code(x, y, z, t, a, b, c) tmp = x / (x + (y * exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))))); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}
\end{array}
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c)
:precision binary64
(/
x
(+
x
(*
y
(exp
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
return x / (x + (y * exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))));
}
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)
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
code = x / (x + (y * exp((2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))))))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return x / (x + (y * Math.exp((2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))));
}
def code(x, y, z, t, a, b, c): return x / (x + (y * math.exp((2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))))
function code(x, y, z, t, a, b, c) return Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))))))) end
function tmp = code(x, y, z, t, a, b, c) tmp = x / (x + (y * exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))))); end
code[x_, y_, z_, t_, a_, b_, c_] := N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}
\end{array}
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(/
x
(+
x
(*
y
(exp
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))))))))
(if (<= t_1 1.0) t_1 (/ x (+ x (* y (exp (* 2.0 (* b (* -1.0 a))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = x / (x + (y * exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))));
double tmp;
if (t_1 <= 1.0) {
tmp = t_1;
} else {
tmp = x / (x + (y * exp((2.0 * (b * (-1.0 * a))))));
}
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)
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) :: t_1
real(8) :: tmp
t_1 = x / (x + (y * exp((2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))))))
if (t_1 <= 1.0d0) then
tmp = t_1
else
tmp = x / (x + (y * exp((2.0d0 * (b * ((-1.0d0) * a))))))
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 t_1 = x / (x + (y * Math.exp((2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))))));
double tmp;
if (t_1 <= 1.0) {
tmp = t_1;
} else {
tmp = x / (x + (y * Math.exp((2.0 * (b * (-1.0 * a))))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = x / (x + (y * math.exp((2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))))) tmp = 0 if t_1 <= 1.0: tmp = t_1 else: tmp = x / (x + (y * math.exp((2.0 * (b * (-1.0 * a)))))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))))))) tmp = 0.0 if (t_1 <= 1.0) tmp = t_1; else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(b * Float64(-1.0 * a))))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = x / (x + (y * exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))))); tmp = 0.0; if (t_1 <= 1.0) tmp = t_1; else tmp = x / (x + (y * exp((2.0 * (b * (-1.0 * a)))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1.0], t$95$1, N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(b * N[(-1.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)}}\\
\mathbf{if}\;t\_1 \leq 1:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(b \cdot \left(-1 \cdot a\right)\right)}}\\
\end{array}
\end{array}
if (/.f64 x (+.f64 x (*.f64 y (exp.f64 (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))))))) < 1Initial program 98.8%
if 1 < (/.f64 x (+.f64 x (*.f64 y (exp.f64 (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))))))) Initial program 1.5%
Taylor expanded in b around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
metadata-eval54.0
Applied rewrites54.0%
Taylor expanded in a around inf
lower-*.f6453.5
Applied rewrites53.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1 (* 0.6666666666666666 (pow t -1.0)))
(t_2
(/
x
(+ x (* y (exp (* 2.0 (* c (- (+ 0.8333333333333334 a) t_1)))))))))
(if (<= c -1.65e+46)
t_2
(if (<= c 2.2e+128)
(/ x (+ x (* y (exp (* 2.0 (* b (- t_1 (+ 0.8333333333333334 a))))))))
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.6666666666666666 * pow(t, -1.0);
double t_2 = x / (x + (y * exp((2.0 * (c * ((0.8333333333333334 + a) - t_1))))));
double tmp;
if (c <= -1.65e+46) {
tmp = t_2;
} else if (c <= 2.2e+128) {
tmp = x / (x + (y * exp((2.0 * (b * (t_1 - (0.8333333333333334 + a)))))));
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 0.6666666666666666d0 * (t ** (-1.0d0))
t_2 = x / (x + (y * exp((2.0d0 * (c * ((0.8333333333333334d0 + a) - t_1))))))
if (c <= (-1.65d+46)) then
tmp = t_2
else if (c <= 2.2d+128) then
tmp = x / (x + (y * exp((2.0d0 * (b * (t_1 - (0.8333333333333334d0 + a)))))))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 0.6666666666666666 * Math.pow(t, -1.0);
double t_2 = x / (x + (y * Math.exp((2.0 * (c * ((0.8333333333333334 + a) - t_1))))));
double tmp;
if (c <= -1.65e+46) {
tmp = t_2;
} else if (c <= 2.2e+128) {
tmp = x / (x + (y * Math.exp((2.0 * (b * (t_1 - (0.8333333333333334 + a)))))));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 0.6666666666666666 * math.pow(t, -1.0) t_2 = x / (x + (y * math.exp((2.0 * (c * ((0.8333333333333334 + a) - t_1)))))) tmp = 0 if c <= -1.65e+46: tmp = t_2 elif c <= 2.2e+128: tmp = x / (x + (y * math.exp((2.0 * (b * (t_1 - (0.8333333333333334 + a))))))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(0.6666666666666666 * (t ^ -1.0)) t_2 = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(c * Float64(Float64(0.8333333333333334 + a) - t_1))))))) tmp = 0.0 if (c <= -1.65e+46) tmp = t_2; elseif (c <= 2.2e+128) tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(b * Float64(t_1 - Float64(0.8333333333333334 + a)))))))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 0.6666666666666666 * (t ^ -1.0); t_2 = x / (x + (y * exp((2.0 * (c * ((0.8333333333333334 + a) - t_1)))))); tmp = 0.0; if (c <= -1.65e+46) tmp = t_2; elseif (c <= 2.2e+128) tmp = x / (x + (y * exp((2.0 * (b * (t_1 - (0.8333333333333334 + a))))))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(0.6666666666666666 * N[Power[t, -1.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(c * N[(N[(0.8333333333333334 + a), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[c, -1.65e+46], t$95$2, If[LessEqual[c, 2.2e+128], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(b * N[(t$95$1 - N[(0.8333333333333334 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 0.6666666666666666 \cdot {t}^{-1}\\
t_2 := \frac{x}{x + y \cdot e^{2 \cdot \left(c \cdot \left(\left(0.8333333333333334 + a\right) - t\_1\right)\right)}}\\
\mathbf{if}\;c \leq -1.65 \cdot 10^{+46}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;c \leq 2.2 \cdot 10^{+128}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(b \cdot \left(t\_1 - \left(0.8333333333333334 + a\right)\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if c < -1.6499999999999999e46 or 2.20000000000000017e128 < c Initial program 91.1%
Taylor expanded in c around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
metadata-evalN/A
lower-*.f64N/A
inv-powN/A
lower-pow.f6487.2
Applied rewrites87.2%
if -1.6499999999999999e46 < c < 2.20000000000000017e128Initial program 95.5%
Taylor expanded in b around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
metadata-eval74.8
Applied rewrites74.8%
(FPCore (x y z t a b c)
:precision binary64
(if (<=
(exp
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))
0.0)
1.0
(/
x
(+
x
(*
y
(exp
(*
2.0
(*
b
(-
(* 0.6666666666666666 (pow t -1.0))
(+ 0.8333333333333334 a))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if (exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))) <= 0.0) {
tmp = 1.0;
} else {
tmp = x / (x + (y * exp((2.0 * (b * ((0.6666666666666666 * pow(t, -1.0)) - (0.8333333333333334 + a)))))));
}
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)
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) :: tmp
if (exp((2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0))))))) <= 0.0d0) then
tmp = 1.0d0
else
tmp = x / (x + (y * exp((2.0d0 * (b * ((0.6666666666666666d0 * (t ** (-1.0d0))) - (0.8333333333333334d0 + a)))))))
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 tmp;
if (Math.exp((2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))) <= 0.0) {
tmp = 1.0;
} else {
tmp = x / (x + (y * Math.exp((2.0 * (b * ((0.6666666666666666 * Math.pow(t, -1.0)) - (0.8333333333333334 + a)))))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if math.exp((2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))) <= 0.0: tmp = 1.0 else: tmp = x / (x + (y * math.exp((2.0 * (b * ((0.6666666666666666 * math.pow(t, -1.0)) - (0.8333333333333334 + a))))))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (exp(Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0))))))) <= 0.0) tmp = 1.0; else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(b * Float64(Float64(0.6666666666666666 * (t ^ -1.0)) - Float64(0.8333333333333334 + a)))))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if (exp((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))))) <= 0.0) tmp = 1.0; else tmp = x / (x + (y * exp((2.0 * (b * ((0.6666666666666666 * (t ^ -1.0)) - (0.8333333333333334 + a))))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[Exp[N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], 0.0], 1.0, N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(b * N[(N[(0.6666666666666666 * N[Power[t, -1.0], $MachinePrecision]), $MachinePrecision] - N[(0.8333333333333334 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;e^{2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)} \leq 0:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(b \cdot \left(0.6666666666666666 \cdot {t}^{-1} - \left(0.8333333333333334 + a\right)\right)\right)}}\\
\end{array}
\end{array}
if (exp.f64 (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64)))))))) < 0.0Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites98.8%
if 0.0 < (exp.f64 (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64)))))))) Initial program 90.1%
Taylor expanded in b around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
metadata-eval64.9
Applied rewrites64.9%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))))
(if (<= t_1 -2000000000.0)
1.0
(if (<= t_1 2e+306)
(/ x (+ x (* y (exp (* 2.0 (* b (* -1.0 (+ 0.8333333333333334 a))))))))
(/ x (+ x (* y (exp (* 2.0 (* (/ z t) (sqrt (+ a t))))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -2000000000.0) {
tmp = 1.0;
} else if (t_1 <= 2e+306) {
tmp = x / (x + (y * exp((2.0 * (b * (-1.0 * (0.8333333333333334 + a)))))));
} else {
tmp = x / (x + (y * exp((2.0 * ((z / t) * sqrt((a + t)))))));
}
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)
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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))
if (t_1 <= (-2000000000.0d0)) then
tmp = 1.0d0
else if (t_1 <= 2d+306) then
tmp = x / (x + (y * exp((2.0d0 * (b * ((-1.0d0) * (0.8333333333333334d0 + a)))))))
else
tmp = x / (x + (y * exp((2.0d0 * ((z / t) * sqrt((a + t)))))))
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 t_1 = 2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -2000000000.0) {
tmp = 1.0;
} else if (t_1 <= 2e+306) {
tmp = x / (x + (y * Math.exp((2.0 * (b * (-1.0 * (0.8333333333333334 + a)))))));
} else {
tmp = x / (x + (y * Math.exp((2.0 * ((z / t) * Math.sqrt((a + t)))))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))) tmp = 0 if t_1 <= -2000000000.0: tmp = 1.0 elif t_1 <= 2e+306: tmp = x / (x + (y * math.exp((2.0 * (b * (-1.0 * (0.8333333333333334 + a))))))) else: tmp = x / (x + (y * math.exp((2.0 * ((z / t) * math.sqrt((a + t))))))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))) tmp = 0.0 if (t_1 <= -2000000000.0) tmp = 1.0; elseif (t_1 <= 2e+306) tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(b * Float64(-1.0 * Float64(0.8333333333333334 + a)))))))); else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(Float64(z / t) * sqrt(Float64(a + t)))))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))); tmp = 0.0; if (t_1 <= -2000000000.0) tmp = 1.0; elseif (t_1 <= 2e+306) tmp = x / (x + (y * exp((2.0 * (b * (-1.0 * (0.8333333333333334 + a))))))); else tmp = x / (x + (y * exp((2.0 * ((z / t) * sqrt((a + t))))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2000000000.0], 1.0, If[LessEqual[t$95$1, 2e+306], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(b * N[(-1.0 * N[(0.8333333333333334 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(N[(z / t), $MachinePrecision] * N[Sqrt[N[(a + t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)\\
\mathbf{if}\;t\_1 \leq -2000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(b \cdot \left(-1 \cdot \left(0.8333333333333334 + a\right)\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(\frac{z}{t} \cdot \sqrt{a + t}\right)}}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < -2e9Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites98.8%
if -2e9 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < 2.00000000000000003e306Initial program 100.0%
Taylor expanded in b around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
metadata-eval66.4
Applied rewrites66.4%
Taylor expanded in t around inf
metadata-evalN/A
lower-*.f64N/A
lift-+.f64N/A
metadata-eval58.9
Applied rewrites58.9%
if 2.00000000000000003e306 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) Initial program 78.0%
Taylor expanded in z around inf
lower-*.f64N/A
lower-/.f64N/A
lower-sqrt.f64N/A
lower-+.f6453.5
Applied rewrites53.5%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))))
(if (<= t_1 -2000000000.0)
1.0
(if (<= t_1 2e+306)
(/ x (+ x (* y (exp (* 2.0 (* b (* -1.0 (+ 0.8333333333333334 a))))))))
(/ x (+ x (* y (exp (* 2.0 (* c (/ -0.6666666666666666 t)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -2000000000.0) {
tmp = 1.0;
} else if (t_1 <= 2e+306) {
tmp = x / (x + (y * exp((2.0 * (b * (-1.0 * (0.8333333333333334 + a)))))));
} else {
tmp = x / (x + (y * exp((2.0 * (c * (-0.6666666666666666 / t))))));
}
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)
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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))
if (t_1 <= (-2000000000.0d0)) then
tmp = 1.0d0
else if (t_1 <= 2d+306) then
tmp = x / (x + (y * exp((2.0d0 * (b * ((-1.0d0) * (0.8333333333333334d0 + a)))))))
else
tmp = x / (x + (y * exp((2.0d0 * (c * ((-0.6666666666666666d0) / t))))))
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 t_1 = 2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -2000000000.0) {
tmp = 1.0;
} else if (t_1 <= 2e+306) {
tmp = x / (x + (y * Math.exp((2.0 * (b * (-1.0 * (0.8333333333333334 + a)))))));
} else {
tmp = x / (x + (y * Math.exp((2.0 * (c * (-0.6666666666666666 / t))))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))) tmp = 0 if t_1 <= -2000000000.0: tmp = 1.0 elif t_1 <= 2e+306: tmp = x / (x + (y * math.exp((2.0 * (b * (-1.0 * (0.8333333333333334 + a))))))) else: tmp = x / (x + (y * math.exp((2.0 * (c * (-0.6666666666666666 / t)))))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))) tmp = 0.0 if (t_1 <= -2000000000.0) tmp = 1.0; elseif (t_1 <= 2e+306) tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(b * Float64(-1.0 * Float64(0.8333333333333334 + a)))))))); else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(c * Float64(-0.6666666666666666 / t))))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))); tmp = 0.0; if (t_1 <= -2000000000.0) tmp = 1.0; elseif (t_1 <= 2e+306) tmp = x / (x + (y * exp((2.0 * (b * (-1.0 * (0.8333333333333334 + a))))))); else tmp = x / (x + (y * exp((2.0 * (c * (-0.6666666666666666 / t)))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2000000000.0], 1.0, If[LessEqual[t$95$1, 2e+306], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(b * N[(-1.0 * N[(0.8333333333333334 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(c * N[(-0.6666666666666666 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)\\
\mathbf{if}\;t\_1 \leq -2000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(b \cdot \left(-1 \cdot \left(0.8333333333333334 + a\right)\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(c \cdot \frac{-0.6666666666666666}{t}\right)}}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < -2e9Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites98.8%
if -2e9 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < 2.00000000000000003e306Initial program 100.0%
Taylor expanded in b around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
metadata-eval66.4
Applied rewrites66.4%
Taylor expanded in t around inf
metadata-evalN/A
lower-*.f64N/A
lift-+.f64N/A
metadata-eval58.9
Applied rewrites58.9%
if 2.00000000000000003e306 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) Initial program 78.0%
Taylor expanded in c around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
metadata-evalN/A
lower-*.f64N/A
inv-powN/A
lower-pow.f6463.1
Applied rewrites63.1%
Taylor expanded in t around 0
lower-/.f6448.7
Applied rewrites48.7%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))))
(if (<= t_1 -1e+39)
1.0
(if (<= t_1 2e+215)
(/ x (+ x (* y (exp (* 2.0 (* c (+ 0.8333333333333334 a)))))))
(/ x (+ x (* y (exp (* 2.0 (* c (/ -0.6666666666666666 t)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -1e+39) {
tmp = 1.0;
} else if (t_1 <= 2e+215) {
tmp = x / (x + (y * exp((2.0 * (c * (0.8333333333333334 + a))))));
} else {
tmp = x / (x + (y * exp((2.0 * (c * (-0.6666666666666666 / t))))));
}
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)
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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))
if (t_1 <= (-1d+39)) then
tmp = 1.0d0
else if (t_1 <= 2d+215) then
tmp = x / (x + (y * exp((2.0d0 * (c * (0.8333333333333334d0 + a))))))
else
tmp = x / (x + (y * exp((2.0d0 * (c * ((-0.6666666666666666d0) / t))))))
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 t_1 = 2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -1e+39) {
tmp = 1.0;
} else if (t_1 <= 2e+215) {
tmp = x / (x + (y * Math.exp((2.0 * (c * (0.8333333333333334 + a))))));
} else {
tmp = x / (x + (y * Math.exp((2.0 * (c * (-0.6666666666666666 / t))))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))) tmp = 0 if t_1 <= -1e+39: tmp = 1.0 elif t_1 <= 2e+215: tmp = x / (x + (y * math.exp((2.0 * (c * (0.8333333333333334 + a)))))) else: tmp = x / (x + (y * math.exp((2.0 * (c * (-0.6666666666666666 / t)))))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))) tmp = 0.0 if (t_1 <= -1e+39) tmp = 1.0; elseif (t_1 <= 2e+215) tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(c * Float64(0.8333333333333334 + a))))))); else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(c * Float64(-0.6666666666666666 / t))))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))); tmp = 0.0; if (t_1 <= -1e+39) tmp = 1.0; elseif (t_1 <= 2e+215) tmp = x / (x + (y * exp((2.0 * (c * (0.8333333333333334 + a)))))); else tmp = x / (x + (y * exp((2.0 * (c * (-0.6666666666666666 / t)))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+39], 1.0, If[LessEqual[t$95$1, 2e+215], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(c * N[(0.8333333333333334 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(c * N[(-0.6666666666666666 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+39}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+215}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(c \cdot \left(0.8333333333333334 + a\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(c \cdot \frac{-0.6666666666666666}{t}\right)}}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < -9.9999999999999994e38Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites98.8%
if -9.9999999999999994e38 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < 1.99999999999999981e215Initial program 100.0%
Taylor expanded in c around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
metadata-evalN/A
lower-*.f64N/A
inv-powN/A
lower-pow.f6469.0
Applied rewrites69.0%
Taylor expanded in t around inf
metadata-evalN/A
lift-+.f64N/A
metadata-eval62.5
Applied rewrites62.5%
if 1.99999999999999981e215 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) Initial program 84.4%
Taylor expanded in c around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
metadata-evalN/A
lower-*.f64N/A
inv-powN/A
lower-pow.f6462.6
Applied rewrites62.6%
Taylor expanded in t around 0
lower-/.f6444.6
Applied rewrites44.6%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))))
(if (<= t_1 -1e+39)
1.0
(if (<= t_1 1e+300)
(/ x (+ x (* y (exp (* 2.0 (* c (+ 0.8333333333333334 a)))))))
(/ x (+ x (* y (exp (* 2.0 (* b (/ 0.6666666666666666 t)))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -1e+39) {
tmp = 1.0;
} else if (t_1 <= 1e+300) {
tmp = x / (x + (y * exp((2.0 * (c * (0.8333333333333334 + a))))));
} else {
tmp = x / (x + (y * exp((2.0 * (b * (0.6666666666666666 / t))))));
}
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)
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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))
if (t_1 <= (-1d+39)) then
tmp = 1.0d0
else if (t_1 <= 1d+300) then
tmp = x / (x + (y * exp((2.0d0 * (c * (0.8333333333333334d0 + a))))))
else
tmp = x / (x + (y * exp((2.0d0 * (b * (0.6666666666666666d0 / t))))))
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 t_1 = 2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -1e+39) {
tmp = 1.0;
} else if (t_1 <= 1e+300) {
tmp = x / (x + (y * Math.exp((2.0 * (c * (0.8333333333333334 + a))))));
} else {
tmp = x / (x + (y * Math.exp((2.0 * (b * (0.6666666666666666 / t))))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))) tmp = 0 if t_1 <= -1e+39: tmp = 1.0 elif t_1 <= 1e+300: tmp = x / (x + (y * math.exp((2.0 * (c * (0.8333333333333334 + a)))))) else: tmp = x / (x + (y * math.exp((2.0 * (b * (0.6666666666666666 / t)))))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))) tmp = 0.0 if (t_1 <= -1e+39) tmp = 1.0; elseif (t_1 <= 1e+300) tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(c * Float64(0.8333333333333334 + a))))))); else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(b * Float64(0.6666666666666666 / t))))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))); tmp = 0.0; if (t_1 <= -1e+39) tmp = 1.0; elseif (t_1 <= 1e+300) tmp = x / (x + (y * exp((2.0 * (c * (0.8333333333333334 + a)))))); else tmp = x / (x + (y * exp((2.0 * (b * (0.6666666666666666 / t)))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+39], 1.0, If[LessEqual[t$95$1, 1e+300], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(c * N[(0.8333333333333334 + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(b * N[(0.6666666666666666 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+39}:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_1 \leq 10^{+300}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(c \cdot \left(0.8333333333333334 + a\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(b \cdot \frac{0.6666666666666666}{t}\right)}}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < -9.9999999999999994e38Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites98.8%
if -9.9999999999999994e38 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < 1.0000000000000001e300Initial program 100.0%
Taylor expanded in c around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
metadata-evalN/A
lower-*.f64N/A
inv-powN/A
lower-pow.f6466.5
Applied rewrites66.5%
Taylor expanded in t around inf
metadata-evalN/A
lift-+.f64N/A
metadata-eval59.2
Applied rewrites59.2%
if 1.0000000000000001e300 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) Initial program 78.8%
Taylor expanded in b around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
metadata-eval63.0
Applied rewrites63.0%
Taylor expanded in t around 0
lower-/.f6447.1
Applied rewrites47.1%
(FPCore (x y z t a b c)
:precision binary64
(let* ((t_1
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))))
(if (<= t_1 -2000000000.0)
1.0
(if (<= t_1 4e+244)
(/ x (+ x (* y (exp (* 2.0 (* b (* -1.0 a)))))))
(/ x (+ x (* y (exp (* 2.0 (* c a))))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -2000000000.0) {
tmp = 1.0;
} else if (t_1 <= 4e+244) {
tmp = x / (x + (y * exp((2.0 * (b * (-1.0 * a))))));
} else {
tmp = x / (x + (y * exp((2.0 * (c * a)))));
}
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)
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) :: t_1
real(8) :: tmp
t_1 = 2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))
if (t_1 <= (-2000000000.0d0)) then
tmp = 1.0d0
else if (t_1 <= 4d+244) then
tmp = x / (x + (y * exp((2.0d0 * (b * ((-1.0d0) * a))))))
else
tmp = x / (x + (y * exp((2.0d0 * (c * a)))))
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 t_1 = 2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))));
double tmp;
if (t_1 <= -2000000000.0) {
tmp = 1.0;
} else if (t_1 <= 4e+244) {
tmp = x / (x + (y * Math.exp((2.0 * (b * (-1.0 * a))))));
} else {
tmp = x / (x + (y * Math.exp((2.0 * (c * a)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): t_1 = 2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))) tmp = 0 if t_1 <= -2000000000.0: tmp = 1.0 elif t_1 <= 4e+244: tmp = x / (x + (y * math.exp((2.0 * (b * (-1.0 * a)))))) else: tmp = x / (x + (y * math.exp((2.0 * (c * a))))) return tmp
function code(x, y, z, t, a, b, c) t_1 = Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))) tmp = 0.0 if (t_1 <= -2000000000.0) tmp = 1.0; elseif (t_1 <= 4e+244) tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(b * Float64(-1.0 * a))))))); else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(c * a)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) t_1 = 2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0))))); tmp = 0.0; if (t_1 <= -2000000000.0) tmp = 1.0; elseif (t_1 <= 4e+244) tmp = x / (x + (y * exp((2.0 * (b * (-1.0 * a)))))); else tmp = x / (x + (y * exp((2.0 * (c * a))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := Block[{t$95$1 = N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2000000000.0], 1.0, If[LessEqual[t$95$1, 4e+244], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(b * N[(-1.0 * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(c * a), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := 2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right)\\
\mathbf{if}\;t\_1 \leq -2000000000:\\
\;\;\;\;1\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+244}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(b \cdot \left(-1 \cdot a\right)\right)}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(c \cdot a\right)}}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < -2e9Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites98.8%
if -2e9 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < 4.0000000000000003e244Initial program 100.0%
Taylor expanded in b around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
metadata-eval67.6
Applied rewrites67.6%
Taylor expanded in a around inf
lower-*.f6450.6
Applied rewrites50.6%
if 4.0000000000000003e244 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) Initial program 83.0%
Taylor expanded in c around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-+.f64N/A
metadata-evalN/A
lower-*.f64N/A
inv-powN/A
lower-pow.f6462.9
Applied rewrites62.9%
Taylor expanded in a around inf
Applied rewrites48.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<=
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))
-2000000000.0)
1.0
(/ x (+ x (* y (exp (* 2.0 (* b (/ 0.6666666666666666 t)))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))) <= -2000000000.0) {
tmp = 1.0;
} else {
tmp = x / (x + (y * exp((2.0 * (b * (0.6666666666666666 / t))))));
}
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)
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) :: tmp
if ((2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))) <= (-2000000000.0d0)) then
tmp = 1.0d0
else
tmp = x / (x + (y * exp((2.0d0 * (b * (0.6666666666666666d0 / t))))))
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 tmp;
if ((2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))) <= -2000000000.0) {
tmp = 1.0;
} else {
tmp = x / (x + (y * Math.exp((2.0 * (b * (0.6666666666666666 / t))))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))) <= -2000000000.0: tmp = 1.0 else: tmp = x / (x + (y * math.exp((2.0 * (b * (0.6666666666666666 / t)))))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))) <= -2000000000.0) tmp = 1.0; else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(b * Float64(0.6666666666666666 / t))))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))) <= -2000000000.0) tmp = 1.0; else tmp = x / (x + (y * exp((2.0 * (b * (0.6666666666666666 / t)))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2000000000.0], 1.0, N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(b * N[(0.6666666666666666 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right) \leq -2000000000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(b \cdot \frac{0.6666666666666666}{t}\right)}}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < -2e9Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites98.8%
if -2e9 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) Initial program 90.1%
Taylor expanded in b around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
metadata-eval64.9
Applied rewrites64.9%
Taylor expanded in t around 0
lower-/.f6445.9
Applied rewrites45.9%
(FPCore (x y z t a b c)
:precision binary64
(if (<=
(*
2.0
(-
(/ (* z (sqrt (+ t a))) t)
(* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0))))))
-2000000000.0)
1.0
(/ x (+ x (* y (exp (* 2.0 (* b -0.8333333333333334))))))))
double code(double x, double y, double z, double t, double a, double b, double c) {
double tmp;
if ((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))) <= -2000000000.0) {
tmp = 1.0;
} else {
tmp = x / (x + (y * exp((2.0 * (b * -0.8333333333333334)))));
}
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)
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) :: tmp
if ((2.0d0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0d0 / 6.0d0)) - (2.0d0 / (t * 3.0d0)))))) <= (-2000000000.0d0)) then
tmp = 1.0d0
else
tmp = x / (x + (y * exp((2.0d0 * (b * (-0.8333333333333334d0))))))
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 tmp;
if ((2.0 * (((z * Math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))) <= -2000000000.0) {
tmp = 1.0;
} else {
tmp = x / (x + (y * Math.exp((2.0 * (b * -0.8333333333333334)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c): tmp = 0 if (2.0 * (((z * math.sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))) <= -2000000000.0: tmp = 1.0 else: tmp = x / (x + (y * math.exp((2.0 * (b * -0.8333333333333334))))) return tmp
function code(x, y, z, t, a, b, c) tmp = 0.0 if (Float64(2.0 * Float64(Float64(Float64(z * sqrt(Float64(t + a))) / t) - Float64(Float64(b - c) * Float64(Float64(a + Float64(5.0 / 6.0)) - Float64(2.0 / Float64(t * 3.0)))))) <= -2000000000.0) tmp = 1.0; else tmp = Float64(x / Float64(x + Float64(y * exp(Float64(2.0 * Float64(b * -0.8333333333333334)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c) tmp = 0.0; if ((2.0 * (((z * sqrt((t + a))) / t) - ((b - c) * ((a + (5.0 / 6.0)) - (2.0 / (t * 3.0)))))) <= -2000000000.0) tmp = 1.0; else tmp = x / (x + (y * exp((2.0 * (b * -0.8333333333333334))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_] := If[LessEqual[N[(2.0 * N[(N[(N[(z * N[Sqrt[N[(t + a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision] - N[(N[(b - c), $MachinePrecision] * N[(N[(a + N[(5.0 / 6.0), $MachinePrecision]), $MachinePrecision] - N[(2.0 / N[(t * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -2000000000.0], 1.0, N[(x / N[(x + N[(y * N[Exp[N[(2.0 * N[(b * -0.8333333333333334), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;2 \cdot \left(\frac{z \cdot \sqrt{t + a}}{t} - \left(b - c\right) \cdot \left(\left(a + \frac{5}{6}\right) - \frac{2}{t \cdot 3}\right)\right) \leq -2000000000:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{x + y \cdot e^{2 \cdot \left(b \cdot -0.8333333333333334\right)}}\\
\end{array}
\end{array}
if (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) < -2e9Initial program 98.8%
Taylor expanded in x around inf
Applied rewrites98.8%
if -2e9 < (*.f64 #s(literal 2 binary64) (-.f64 (/.f64 (*.f64 z (sqrt.f64 (+.f64 t a))) t) (*.f64 (-.f64 b c) (-.f64 (+.f64 a (/.f64 #s(literal 5 binary64) #s(literal 6 binary64))) (/.f64 #s(literal 2 binary64) (*.f64 t #s(literal 3 binary64))))))) Initial program 90.1%
Taylor expanded in b around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
metadata-eval64.9
Applied rewrites64.9%
Taylor expanded in t around inf
metadata-evalN/A
lower-*.f64N/A
lift-+.f64N/A
metadata-eval56.0
Applied rewrites56.0%
Taylor expanded in a around 0
Applied rewrites49.0%
(FPCore (x y z t a b c) :precision binary64 1.0)
double code(double x, double y, double z, double t, double a, double b, double c) {
return 1.0;
}
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)
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
code = 1.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b, double c) {
return 1.0;
}
def code(x, y, z, t, a, b, c): return 1.0
function code(x, y, z, t, a, b, c) return 1.0 end
function tmp = code(x, y, z, t, a, b, c) tmp = 1.0; end
code[x_, y_, z_, t_, a_, b_, c_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 93.9%
Taylor expanded in x around inf
Applied rewrites51.3%
herbie shell --seed 2025101
(FPCore (x y z t a b c)
:name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, I"
:precision binary64
(/ x (+ x (* y (exp (* 2.0 (- (/ (* z (sqrt (+ t a))) t) (* (- b c) (- (+ a (/ 5.0 6.0)) (/ 2.0 (* t 3.0)))))))))))