
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
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)
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
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
Herbie found 18 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
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)
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
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
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)
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
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
Initial program 98.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (* (/ 1.0 a) (exp (- (* (log z) y) b))) y))))
(if (<= y -6.5e+27)
t_1
(if (<= y 180000.0) (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (((1.0 / a) * exp(((log(z) * y) - b))) / y);
double tmp;
if (y <= -6.5e+27) {
tmp = t_1;
} else if (y <= 180000.0) {
tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y;
} 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)
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) :: t_1
real(8) :: tmp
t_1 = x * (((1.0d0 / a) * exp(((log(z) * y) - b))) / y)
if (y <= (-6.5d+27)) then
tmp = t_1
else if (y <= 180000.0d0) then
tmp = (x * exp(((log(a) * (t - 1.0d0)) - b))) / y
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 t_1 = x * (((1.0 / a) * Math.exp(((Math.log(z) * y) - b))) / y);
double tmp;
if (y <= -6.5e+27) {
tmp = t_1;
} else if (y <= 180000.0) {
tmp = (x * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (((1.0 / a) * math.exp(((math.log(z) * y) - b))) / y) tmp = 0 if y <= -6.5e+27: tmp = t_1 elif y <= 180000.0: tmp = (x * math.exp(((math.log(a) * (t - 1.0)) - b))) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(Float64(Float64(1.0 / a) * exp(Float64(Float64(log(z) * y) - b))) / y)) tmp = 0.0 if (y <= -6.5e+27) tmp = t_1; elseif (y <= 180000.0) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (((1.0 / a) * exp(((log(z) * y) - b))) / y); tmp = 0.0; if (y <= -6.5e+27) tmp = t_1; elseif (y <= 180000.0) tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[(N[(1.0 / a), $MachinePrecision] * N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -6.5e+27], t$95$1, If[LessEqual[y, 180000.0], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{1}{a} \cdot e^{\log z \cdot y - b}}{y}\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 180000:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.5000000000000005e27 or 1.8e5 < y Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
if -6.5000000000000005e27 < y < 1.8e5Initial program 98.7%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6480.2
Applied rewrites80.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (/ (pow z y) a)) y)))
(if (<= y -6e+159)
t_1
(if (<= y 1.9e+34) (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * (pow(z, y) / a)) / y;
double tmp;
if (y <= -6e+159) {
tmp = t_1;
} else if (y <= 1.9e+34) {
tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y;
} 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)
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) :: t_1
real(8) :: tmp
t_1 = (x * ((z ** y) / a)) / y
if (y <= (-6d+159)) then
tmp = t_1
else if (y <= 1.9d+34) then
tmp = (x * exp(((log(a) * (t - 1.0d0)) - b))) / y
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 t_1 = (x * (Math.pow(z, y) / a)) / y;
double tmp;
if (y <= -6e+159) {
tmp = t_1;
} else if (y <= 1.9e+34) {
tmp = (x * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * (math.pow(z, y) / a)) / y tmp = 0 if y <= -6e+159: tmp = t_1 elif y <= 1.9e+34: tmp = (x * math.exp(((math.log(a) * (t - 1.0)) - b))) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * Float64((z ^ y) / a)) / y) tmp = 0.0 if (y <= -6e+159) tmp = t_1; elseif (y <= 1.9e+34) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * ((z ^ y) / a)) / y; tmp = 0.0; if (y <= -6e+159) tmp = t_1; elseif (y <= 1.9e+34) tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -6e+159], t$95$1, If[LessEqual[y, 1.9e+34], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{if}\;y \leq -6 \cdot 10^{+159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{+34}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.0000000000000004e159 or 1.9000000000000001e34 < y Initial program 98.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6481.6
Applied rewrites81.6%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6460.5
Applied rewrites60.5%
if -6.0000000000000004e159 < y < 1.9000000000000001e34Initial program 98.7%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6480.2
Applied rewrites80.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (pow z y) a)))
(if (<= y -5.1e+14)
(/ (* x t_1) y)
(if (<= y 9.2e-15) (* x (/ (/ (exp (- b)) a) y)) (* x (/ t_1 y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = pow(z, y) / a;
double tmp;
if (y <= -5.1e+14) {
tmp = (x * t_1) / y;
} else if (y <= 9.2e-15) {
tmp = x * ((exp(-b) / a) / y);
} else {
tmp = x * (t_1 / 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)
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) :: t_1
real(8) :: tmp
t_1 = (z ** y) / a
if (y <= (-5.1d+14)) then
tmp = (x * t_1) / y
else if (y <= 9.2d-15) then
tmp = x * ((exp(-b) / a) / y)
else
tmp = x * (t_1 / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.pow(z, y) / a;
double tmp;
if (y <= -5.1e+14) {
tmp = (x * t_1) / y;
} else if (y <= 9.2e-15) {
tmp = x * ((Math.exp(-b) / a) / y);
} else {
tmp = x * (t_1 / y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.pow(z, y) / a tmp = 0 if y <= -5.1e+14: tmp = (x * t_1) / y elif y <= 9.2e-15: tmp = x * ((math.exp(-b) / a) / y) else: tmp = x * (t_1 / y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64((z ^ y) / a) tmp = 0.0 if (y <= -5.1e+14) tmp = Float64(Float64(x * t_1) / y); elseif (y <= 9.2e-15) tmp = Float64(x * Float64(Float64(exp(Float64(-b)) / a) / y)); else tmp = Float64(x * Float64(t_1 / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z ^ y) / a; tmp = 0.0; if (y <= -5.1e+14) tmp = (x * t_1) / y; elseif (y <= 9.2e-15) tmp = x * ((exp(-b) / a) / y); else tmp = x * (t_1 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[y, -5.1e+14], N[(N[(x * t$95$1), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 9.2e-15], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{{z}^{y}}{a}\\
\mathbf{if}\;y \leq -5.1 \cdot 10^{+14}:\\
\;\;\;\;\frac{x \cdot t\_1}{y}\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{\frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t\_1}{y}\\
\end{array}
\end{array}
if y < -5.1e14Initial program 98.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6481.6
Applied rewrites81.6%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6460.5
Applied rewrites60.5%
if -5.1e14 < y < 9.19999999999999961e-15Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
if 9.19999999999999961e-15 < y Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6460.3
Applied rewrites60.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (/ (pow z y) a)) y)))
(if (<= y -5.1e+14)
t_1
(if (<= y 9.2e-15) (* x (/ (/ (exp (- b)) a) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * (pow(z, y) / a)) / y;
double tmp;
if (y <= -5.1e+14) {
tmp = t_1;
} else if (y <= 9.2e-15) {
tmp = x * ((exp(-b) / a) / y);
} 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)
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) :: t_1
real(8) :: tmp
t_1 = (x * ((z ** y) / a)) / y
if (y <= (-5.1d+14)) then
tmp = t_1
else if (y <= 9.2d-15) then
tmp = x * ((exp(-b) / a) / y)
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 t_1 = (x * (Math.pow(z, y) / a)) / y;
double tmp;
if (y <= -5.1e+14) {
tmp = t_1;
} else if (y <= 9.2e-15) {
tmp = x * ((Math.exp(-b) / a) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * (math.pow(z, y) / a)) / y tmp = 0 if y <= -5.1e+14: tmp = t_1 elif y <= 9.2e-15: tmp = x * ((math.exp(-b) / a) / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * Float64((z ^ y) / a)) / y) tmp = 0.0 if (y <= -5.1e+14) tmp = t_1; elseif (y <= 9.2e-15) tmp = Float64(x * Float64(Float64(exp(Float64(-b)) / a) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * ((z ^ y) / a)) / y; tmp = 0.0; if (y <= -5.1e+14) tmp = t_1; elseif (y <= 9.2e-15) tmp = x * ((exp(-b) / a) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -5.1e+14], t$95$1, If[LessEqual[y, 9.2e-15], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{if}\;y \leq -5.1 \cdot 10^{+14}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{\frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.1e14 or 9.19999999999999961e-15 < y Initial program 98.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6481.6
Applied rewrites81.6%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6460.5
Applied rewrites60.5%
if -5.1e14 < y < 9.19999999999999961e-15Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -3.2e+53)
t_1
(if (<= b 22000000000.0) (/ (* (pow z y) x) (* a y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (exp(-b) / y);
double tmp;
if (b <= -3.2e+53) {
tmp = t_1;
} else if (b <= 22000000000.0) {
tmp = (pow(z, y) * x) / (a * y);
} 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)
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) :: t_1
real(8) :: tmp
t_1 = x * (exp(-b) / y)
if (b <= (-3.2d+53)) then
tmp = t_1
else if (b <= 22000000000.0d0) then
tmp = ((z ** y) * x) / (a * y)
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 t_1 = x * (Math.exp(-b) / y);
double tmp;
if (b <= -3.2e+53) {
tmp = t_1;
} else if (b <= 22000000000.0) {
tmp = (Math.pow(z, y) * x) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (math.exp(-b) / y) tmp = 0 if b <= -3.2e+53: tmp = t_1 elif b <= 22000000000.0: tmp = (math.pow(z, y) * x) / (a * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(exp(Float64(-b)) / y)) tmp = 0.0 if (b <= -3.2e+53) tmp = t_1; elseif (b <= 22000000000.0) tmp = Float64(Float64((z ^ y) * x) / Float64(a * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (exp(-b) / y); tmp = 0.0; if (b <= -3.2e+53) tmp = t_1; elseif (b <= 22000000000.0) tmp = ((z ^ y) * x) / (a * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -3.2e+53], t$95$1, If[LessEqual[b, 22000000000.0], N[(N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -3.2 \cdot 10^{+53}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 22000000000:\\
\;\;\;\;\frac{{z}^{y} \cdot x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.2e53 or 2.2e10 < b Initial program 98.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.1
Applied rewrites48.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.1
Applied rewrites48.1%
if -3.2e53 < b < 2.2e10Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.8
Applied rewrites54.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (/ (fma (log z) y 1.0) a)) y))
(t_2 (* x (/ (exp (- b)) y))))
(if (<= b -8300000.0)
t_2
(if (<= b -7.2e-243)
t_1
(if (<= b 4.4e-215)
(* x (/ (/ (* (* b b) 0.5) a) y))
(if (<= b 14500000000.0) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * (fma(log(z), y, 1.0) / a)) / y;
double t_2 = x * (exp(-b) / y);
double tmp;
if (b <= -8300000.0) {
tmp = t_2;
} else if (b <= -7.2e-243) {
tmp = t_1;
} else if (b <= 4.4e-215) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else if (b <= 14500000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * Float64(fma(log(z), y, 1.0) / a)) / y) t_2 = Float64(x * Float64(exp(Float64(-b)) / y)) tmp = 0.0 if (b <= -8300000.0) tmp = t_2; elseif (b <= -7.2e-243) tmp = t_1; elseif (b <= 4.4e-215) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); elseif (b <= 14500000000.0) tmp = t_1; else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[(N[(N[Log[z], $MachinePrecision] * y + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8300000.0], t$95$2, If[LessEqual[b, -7.2e-243], t$95$1, If[LessEqual[b, 4.4e-215], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 14500000000.0], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \frac{\mathsf{fma}\left(\log z, y, 1\right)}{a}}{y}\\
t_2 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -8300000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -7.2 \cdot 10^{-243}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{-215}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{elif}\;b \leq 14500000000:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -8.3e6 or 1.45e10 < b Initial program 98.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.1
Applied rewrites48.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.1
Applied rewrites48.1%
if -8.3e6 < b < -7.2000000000000003e-243 or 4.39999999999999993e-215 < b < 1.45e10Initial program 98.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6481.6
Applied rewrites81.6%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6460.5
Applied rewrites60.5%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lift-log.f64N/A
lift-fma.f6432.3
Applied rewrites32.3%
if -7.2000000000000003e-243 < b < 4.39999999999999993e-215Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.8
Applied rewrites37.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) -1e+108) (* x (/ (/ (* (* b b) 0.5) a) y)) (/ (* x (* (/ 1.0 a) (exp (- b)))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= -1e+108) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else {
tmp = (x * ((1.0 / a) * exp(-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)
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) :: tmp
if (((t - 1.0d0) * log(a)) <= (-1d+108)) then
tmp = x * ((((b * b) * 0.5d0) / a) / y)
else
tmp = (x * ((1.0d0 / a) * exp(-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 tmp;
if (((t - 1.0) * Math.log(a)) <= -1e+108) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else {
tmp = (x * ((1.0 / a) * Math.exp(-b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= -1e+108: tmp = x * ((((b * b) * 0.5) / a) / y) else: tmp = (x * ((1.0 / a) * math.exp(-b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= -1e+108) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); else tmp = Float64(Float64(x * Float64(Float64(1.0 / a) * exp(Float64(-b)))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((t - 1.0) * log(a)) <= -1e+108) tmp = x * ((((b * b) * 0.5) / a) / y); else tmp = (x * ((1.0 / a) * exp(-b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], -1e+108], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(1.0 / a), $MachinePrecision] * N[Exp[(-b)], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq -1 \cdot 10^{+108}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\frac{1}{a} \cdot e^{-b}\right)}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e108Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.8
Applied rewrites37.8%
if -1e108 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6481.6
Applied rewrites81.6%
Taylor expanded in y around 0
mul-1-negN/A
lift-neg.f6459.3
Applied rewrites59.3%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) -1e+108) (* x (/ (/ (* (* b b) 0.5) a) y)) (/ (* x (/ (exp (- b)) a)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= -1e+108) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else {
tmp = (x * (exp(-b) / a)) / 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)
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) :: tmp
if (((t - 1.0d0) * log(a)) <= (-1d+108)) then
tmp = x * ((((b * b) * 0.5d0) / a) / y)
else
tmp = (x * (exp(-b) / a)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * Math.log(a)) <= -1e+108) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else {
tmp = (x * (Math.exp(-b) / a)) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= -1e+108: tmp = x * ((((b * b) * 0.5) / a) / y) else: tmp = (x * (math.exp(-b) / a)) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= -1e+108) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); else tmp = Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((t - 1.0) * log(a)) <= -1e+108) tmp = x * ((((b * b) * 0.5) / a) / y); else tmp = (x * (exp(-b) / a)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], -1e+108], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq -1 \cdot 10^{+108}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e108Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.8
Applied rewrites37.8%
if -1e108 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6481.6
Applied rewrites81.6%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6459.3
Applied rewrites59.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (- b))) (t_2 (* x (/ t_1 y))))
(if (<= b -0.00088)
t_2
(if (<= b -7.2e-243)
(* x (/ t_1 (* a y)))
(if (<= b 2.3e-15) (* x (/ (/ (* (* b b) 0.5) a) y)) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double t_2 = x * (t_1 / y);
double tmp;
if (b <= -0.00088) {
tmp = t_2;
} else if (b <= -7.2e-243) {
tmp = x * (t_1 / (a * y));
} else if (b <= 2.3e-15) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} 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)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = exp(-b)
t_2 = x * (t_1 / y)
if (b <= (-0.00088d0)) then
tmp = t_2
else if (b <= (-7.2d-243)) then
tmp = x * (t_1 / (a * y))
else if (b <= 2.3d-15) then
tmp = x * ((((b * b) * 0.5d0) / a) / y)
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 t_1 = Math.exp(-b);
double t_2 = x * (t_1 / y);
double tmp;
if (b <= -0.00088) {
tmp = t_2;
} else if (b <= -7.2e-243) {
tmp = x * (t_1 / (a * y));
} else if (b <= 2.3e-15) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(-b) t_2 = x * (t_1 / y) tmp = 0 if b <= -0.00088: tmp = t_2 elif b <= -7.2e-243: tmp = x * (t_1 / (a * y)) elif b <= 2.3e-15: tmp = x * ((((b * b) * 0.5) / a) / y) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) t_2 = Float64(x * Float64(t_1 / y)) tmp = 0.0 if (b <= -0.00088) tmp = t_2; elseif (b <= -7.2e-243) tmp = Float64(x * Float64(t_1 / Float64(a * y))); elseif (b <= 2.3e-15) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(-b); t_2 = x * (t_1 / y); tmp = 0.0; if (b <= -0.00088) tmp = t_2; elseif (b <= -7.2e-243) tmp = x * (t_1 / (a * y)); elseif (b <= 2.3e-15) tmp = x * ((((b * b) * 0.5) / a) / y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -0.00088], t$95$2, If[LessEqual[b, -7.2e-243], N[(x * N[(t$95$1 / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e-15], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
t_2 := x \cdot \frac{t\_1}{y}\\
\mathbf{if}\;b \leq -0.00088:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq -7.2 \cdot 10^{-243}:\\
\;\;\;\;x \cdot \frac{t\_1}{a \cdot y}\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -8.80000000000000031e-4 or 2.2999999999999999e-15 < b Initial program 98.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.1
Applied rewrites48.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.1
Applied rewrites48.1%
if -8.80000000000000031e-4 < b < -7.2000000000000003e-243Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f64N/A
lower-*.f6454.5
Applied rewrites54.5%
if -7.2000000000000003e-243 < b < 2.2999999999999999e-15Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.8
Applied rewrites37.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -8300000.0)
t_1
(if (<= b -7.2e-243)
(* (/ (/ (fma (- (* 0.5 b) 1.0) b 1.0) a) y) x)
(if (<= b 2.3e-15) (* x (/ (/ (* (* b b) 0.5) a) y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (exp(-b) / y);
double tmp;
if (b <= -8300000.0) {
tmp = t_1;
} else if (b <= -7.2e-243) {
tmp = ((fma(((0.5 * b) - 1.0), b, 1.0) / a) / y) * x;
} else if (b <= 2.3e-15) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(exp(Float64(-b)) / y)) tmp = 0.0 if (b <= -8300000.0) tmp = t_1; elseif (b <= -7.2e-243) tmp = Float64(Float64(Float64(fma(Float64(Float64(0.5 * b) - 1.0), b, 1.0) / a) / y) * x); elseif (b <= 2.3e-15) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8300000.0], t$95$1, If[LessEqual[b, -7.2e-243], N[(N[(N[(N[(N[(N[(0.5 * b), $MachinePrecision] - 1.0), $MachinePrecision] * b + 1.0), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[b, 2.3e-15], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -8300000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -7.2 \cdot 10^{-243}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(0.5 \cdot b - 1, b, 1\right)}{a}}{y} \cdot x\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -8.3e6 or 2.2999999999999999e-15 < b Initial program 98.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.1
Applied rewrites48.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.1
Applied rewrites48.1%
if -8.3e6 < b < -7.2000000000000003e-243Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6439.5
Applied rewrites39.5%
if -7.2000000000000003e-243 < b < 2.2999999999999999e-15Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.8
Applied rewrites37.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -8300000.0)
t_1
(if (<= b -7.2e-243)
(* x (/ (- (/ (- b 1.0) a)) y))
(if (<= b 2.3e-15) (* x (/ (/ (* (* b b) 0.5) a) y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (exp(-b) / y);
double tmp;
if (b <= -8300000.0) {
tmp = t_1;
} else if (b <= -7.2e-243) {
tmp = x * (-((b - 1.0) / a) / y);
} else if (b <= 2.3e-15) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} 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)
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) :: t_1
real(8) :: tmp
t_1 = x * (exp(-b) / y)
if (b <= (-8300000.0d0)) then
tmp = t_1
else if (b <= (-7.2d-243)) then
tmp = x * (-((b - 1.0d0) / a) / y)
else if (b <= 2.3d-15) then
tmp = x * ((((b * b) * 0.5d0) / a) / y)
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 t_1 = x * (Math.exp(-b) / y);
double tmp;
if (b <= -8300000.0) {
tmp = t_1;
} else if (b <= -7.2e-243) {
tmp = x * (-((b - 1.0) / a) / y);
} else if (b <= 2.3e-15) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (math.exp(-b) / y) tmp = 0 if b <= -8300000.0: tmp = t_1 elif b <= -7.2e-243: tmp = x * (-((b - 1.0) / a) / y) elif b <= 2.3e-15: tmp = x * ((((b * b) * 0.5) / a) / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(exp(Float64(-b)) / y)) tmp = 0.0 if (b <= -8300000.0) tmp = t_1; elseif (b <= -7.2e-243) tmp = Float64(x * Float64(Float64(-Float64(Float64(b - 1.0) / a)) / y)); elseif (b <= 2.3e-15) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (exp(-b) / y); tmp = 0.0; if (b <= -8300000.0) tmp = t_1; elseif (b <= -7.2e-243) tmp = x * (-((b - 1.0) / a) / y); elseif (b <= 2.3e-15) tmp = x * ((((b * b) * 0.5) / a) / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -8300000.0], t$95$1, If[LessEqual[b, -7.2e-243], N[(x * N[((-N[(N[(b - 1.0), $MachinePrecision] / a), $MachinePrecision]) / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.3e-15], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -8300000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -7.2 \cdot 10^{-243}:\\
\;\;\;\;x \cdot \frac{-\frac{b - 1}{a}}{y}\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -8.3e6 or 2.2999999999999999e-15 < b Initial program 98.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.1
Applied rewrites48.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.1
Applied rewrites48.1%
if -8.3e6 < b < -7.2000000000000003e-243Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
lower-+.f64N/A
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-/.f6431.9
Applied rewrites31.9%
Taylor expanded in a around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6431.9
Applied rewrites31.9%
if -7.2000000000000003e-243 < b < 2.2999999999999999e-15Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.8
Applied rewrites37.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) -1e+108) (* x (/ (/ (* (* b b) 0.5) a) y)) (* x (/ (/ (exp (- b)) a) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= -1e+108) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else {
tmp = x * ((exp(-b) / a) / 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)
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) :: tmp
if (((t - 1.0d0) * log(a)) <= (-1d+108)) then
tmp = x * ((((b * b) * 0.5d0) / a) / y)
else
tmp = x * ((exp(-b) / a) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * Math.log(a)) <= -1e+108) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else {
tmp = x * ((Math.exp(-b) / a) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= -1e+108: tmp = x * ((((b * b) * 0.5) / a) / y) else: tmp = x * ((math.exp(-b) / a) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= -1e+108) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); else tmp = Float64(x * Float64(Float64(exp(Float64(-b)) / a) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((t - 1.0) * log(a)) <= -1e+108) tmp = x * ((((b * b) * 0.5) / a) / y); else tmp = x * ((exp(-b) / a) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], -1e+108], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq -1 \cdot 10^{+108}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{e^{-b}}{a}}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e108Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.8
Applied rewrites37.8%
if -1e108 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (- t 1.0) (log a))) (t_2 (* x (/ (/ (* (* b b) 0.5) a) y)))) (if (<= t_1 20.0) t_2 (if (<= t_1 1e+39) (/ (* x (/ 1.0 a)) y) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * log(a);
double t_2 = x * ((((b * b) * 0.5) / a) / y);
double tmp;
if (t_1 <= 20.0) {
tmp = t_2;
} else if (t_1 <= 1e+39) {
tmp = (x * (1.0 / a)) / y;
} 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)
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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - 1.0d0) * log(a)
t_2 = x * ((((b * b) * 0.5d0) / a) / y)
if (t_1 <= 20.0d0) then
tmp = t_2
else if (t_1 <= 1d+39) then
tmp = (x * (1.0d0 / a)) / y
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 t_1 = (t - 1.0) * Math.log(a);
double t_2 = x * ((((b * b) * 0.5) / a) / y);
double tmp;
if (t_1 <= 20.0) {
tmp = t_2;
} else if (t_1 <= 1e+39) {
tmp = (x * (1.0 / a)) / y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 1.0) * math.log(a) t_2 = x * ((((b * b) * 0.5) / a) / y) tmp = 0 if t_1 <= 20.0: tmp = t_2 elif t_1 <= 1e+39: tmp = (x * (1.0 / a)) / y else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * log(a)) t_2 = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)) tmp = 0.0 if (t_1 <= 20.0) tmp = t_2; elseif (t_1 <= 1e+39) tmp = Float64(Float64(x * Float64(1.0 / a)) / y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - 1.0) * log(a); t_2 = x * ((((b * b) * 0.5) / a) / y); tmp = 0.0; if (t_1 <= 20.0) tmp = t_2; elseif (t_1 <= 1e+39) tmp = (x * (1.0 / a)) / y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 20.0], t$95$2, If[LessEqual[t$95$1, 1e+39], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{if}\;t\_1 \leq 20:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+39}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 20 or 9.9999999999999994e38 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.5
Applied rewrites39.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6437.8
Applied rewrites37.8%
if 20 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 9.9999999999999994e38Initial program 98.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6481.6
Applied rewrites81.6%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6460.5
Applied rewrites60.5%
Taylor expanded in y around 0
lift-/.f6431.3
Applied rewrites31.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b 1.5e-234) (* x (/ (- (/ (- b 1.0) a)) y)) (/ (* x (/ 1.0 a)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 1.5e-234) {
tmp = x * (-((b - 1.0) / a) / y);
} else {
tmp = (x * (1.0 / a)) / 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)
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) :: tmp
if (b <= 1.5d-234) then
tmp = x * (-((b - 1.0d0) / a) / y)
else
tmp = (x * (1.0d0 / a)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 1.5e-234) {
tmp = x * (-((b - 1.0) / a) / y);
} else {
tmp = (x * (1.0 / a)) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 1.5e-234: tmp = x * (-((b - 1.0) / a) / y) else: tmp = (x * (1.0 / a)) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 1.5e-234) tmp = Float64(x * Float64(Float64(-Float64(Float64(b - 1.0) / a)) / y)); else tmp = Float64(Float64(x * Float64(1.0 / a)) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 1.5e-234) tmp = x * (-((b - 1.0) / a) / y); else tmp = (x * (1.0 / a)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 1.5e-234], N[(x * N[((-N[(N[(b - 1.0), $MachinePrecision] / a), $MachinePrecision]) / y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.5 \cdot 10^{-234}:\\
\;\;\;\;x \cdot \frac{-\frac{b - 1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\end{array}
\end{array}
if b < 1.49999999999999994e-234Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
Taylor expanded in b around 0
lower-+.f64N/A
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
lower-/.f64N/A
lift-/.f6431.9
Applied rewrites31.9%
Taylor expanded in a around -inf
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower--.f6431.9
Applied rewrites31.9%
if 1.49999999999999994e-234 < b Initial program 98.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6481.6
Applied rewrites81.6%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6460.5
Applied rewrites60.5%
Taylor expanded in y around 0
lift-/.f6431.3
Applied rewrites31.3%
(FPCore (x y z t a b) :precision binary64 (if (<= a 7e-70) (/ (* x (/ 1.0 a)) y) (* x (/ (/ 1.0 a) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 7e-70) {
tmp = (x * (1.0 / a)) / y;
} else {
tmp = x * ((1.0 / a) / 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)
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) :: tmp
if (a <= 7d-70) then
tmp = (x * (1.0d0 / a)) / y
else
tmp = x * ((1.0d0 / a) / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= 7e-70) {
tmp = (x * (1.0 / a)) / y;
} else {
tmp = x * ((1.0 / a) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= 7e-70: tmp = (x * (1.0 / a)) / y else: tmp = x * ((1.0 / a) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= 7e-70) tmp = Float64(Float64(x * Float64(1.0 / a)) / y); else tmp = Float64(x * Float64(Float64(1.0 / a) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= 7e-70) tmp = (x * (1.0 / a)) / y; else tmp = x * ((1.0 / a) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, 7e-70], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x * N[(N[(1.0 / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7 \cdot 10^{-70}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{a}}{y}\\
\end{array}
\end{array}
if a < 6.99999999999999949e-70Initial program 98.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6481.6
Applied rewrites81.6%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6460.5
Applied rewrites60.5%
Taylor expanded in y around 0
lift-/.f6431.3
Applied rewrites31.3%
if 6.99999999999999949e-70 < a Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f6455.0
Applied rewrites55.0%
Taylor expanded in y around 0
Applied rewrites30.8%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6430.5
Applied rewrites30.5%
(FPCore (x y z t a b) :precision binary64 (* x (/ (/ 1.0 a) y)))
double code(double x, double y, double z, double t, double a, double b) {
return x * ((1.0 / a) / y);
}
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)
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
code = x * ((1.0d0 / a) / y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * ((1.0 / a) / y);
}
def code(x, y, z, t, a, b): return x * ((1.0 / a) / y)
function code(x, y, z, t, a, b) return Float64(x * Float64(Float64(1.0 / a) / y)) end
function tmp = code(x, y, z, t, a, b) tmp = x * ((1.0 / a) / y); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[(N[(1.0 / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{\frac{1}{a}}{y}
\end{array}
Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f6455.0
Applied rewrites55.0%
Taylor expanded in y around 0
Applied rewrites30.8%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6430.5
Applied rewrites30.5%
(FPCore (x y z t a b) :precision binary64 (* x (/ 1.0 (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
return x * (1.0 / (a * y));
}
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)
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
code = x * (1.0d0 / (a * y))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * (1.0 / (a * y));
}
def code(x, y, z, t, a, b): return x * (1.0 / (a * y))
function code(x, y, z, t, a, b) return Float64(x * Float64(1.0 / Float64(a * y))) end
function tmp = code(x, y, z, t, a, b) tmp = x * (1.0 / (a * y)); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[(1.0 / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \frac{1}{a \cdot y}
\end{array}
Initial program 98.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.2%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f6455.0
Applied rewrites55.0%
Taylor expanded in y around 0
Applied rewrites30.8%
herbie shell --seed 2025127
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
:precision binary64
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))