
(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 17 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.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a)))
(t_2 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= t_1 -2e+27)
t_2
(if (<= t_1 4e+65)
(* x (/ (* (/ 1.0 a) (exp (- (* (log z) y) b))) 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 * exp(((log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t_1 <= -2e+27) {
tmp = t_2;
} else if (t_1 <= 4e+65) {
tmp = x * (((1.0 / a) * exp(((log(z) * y) - b))) / 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 * exp(((log(a) * (t - 1.0d0)) - b))) / y
if (t_1 <= (-2d+27)) then
tmp = t_2
else if (t_1 <= 4d+65) then
tmp = x * (((1.0d0 / a) * exp(((log(z) * y) - b))) / 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 * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t_1 <= -2e+27) {
tmp = t_2;
} else if (t_1 <= 4e+65) {
tmp = x * (((1.0 / a) * Math.exp(((Math.log(z) * y) - b))) / 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 * math.exp(((math.log(a) * (t - 1.0)) - b))) / y tmp = 0 if t_1 <= -2e+27: tmp = t_2 elif t_1 <= 4e+65: tmp = x * (((1.0 / a) * math.exp(((math.log(z) * y) - b))) / 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(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y) tmp = 0.0 if (t_1 <= -2e+27) tmp = t_2; elseif (t_1 <= 4e+65) tmp = Float64(x * Float64(Float64(Float64(1.0 / a) * exp(Float64(Float64(log(z) * y) - b))) / 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 * exp(((log(a) * (t - 1.0)) - b))) / y; tmp = 0.0; if (t_1 <= -2e+27) tmp = t_2; elseif (t_1 <= 4e+65) tmp = x * (((1.0 / a) * exp(((log(z) * y) - b))) / 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[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+27], t$95$2, If[LessEqual[t$95$1, 4e+65], 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], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := \frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+65}:\\
\;\;\;\;x \cdot \frac{\frac{1}{a} \cdot e^{\log z \cdot y - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -2e27 or 4e65 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.2%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6479.7
Applied rewrites79.7%
if -2e27 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 4e65Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a)))
(t_2 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= t_1 -2e+27)
t_2
(if (<= t_1 4e+65) (/ (* x (/ (exp (- (* (log z) y) b)) 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 * exp(((log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t_1 <= -2e+27) {
tmp = t_2;
} else if (t_1 <= 4e+65) {
tmp = (x * (exp(((log(z) * y) - b)) / 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 * exp(((log(a) * (t - 1.0d0)) - b))) / y
if (t_1 <= (-2d+27)) then
tmp = t_2
else if (t_1 <= 4d+65) then
tmp = (x * (exp(((log(z) * y) - b)) / 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 * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t_1 <= -2e+27) {
tmp = t_2;
} else if (t_1 <= 4e+65) {
tmp = (x * (Math.exp(((Math.log(z) * y) - b)) / 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 * math.exp(((math.log(a) * (t - 1.0)) - b))) / y tmp = 0 if t_1 <= -2e+27: tmp = t_2 elif t_1 <= 4e+65: tmp = (x * (math.exp(((math.log(z) * y) - b)) / 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(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y) tmp = 0.0 if (t_1 <= -2e+27) tmp = t_2; elseif (t_1 <= 4e+65) tmp = Float64(Float64(x * Float64(exp(Float64(Float64(log(z) * y) - b)) / 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 * exp(((log(a) * (t - 1.0)) - b))) / y; tmp = 0.0; if (t_1 <= -2e+27) tmp = t_2; elseif (t_1 <= 4e+65) tmp = (x * (exp(((log(z) * y) - b)) / 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[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+27], t$95$2, If[LessEqual[t$95$1, 4e+65], N[(N[(x * N[(N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] / 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 := \frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+65}:\\
\;\;\;\;\frac{x \cdot \frac{e^{\log z \cdot y - b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -2e27 or 4e65 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.2%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6479.7
Applied rewrites79.7%
if -2e27 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 4e65Initial program 98.2%
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.f6479.7
Applied rewrites79.7%
Taylor expanded in y around inf
exp-diffN/A
*-commutativeN/A
exp-diffN/A
lower-/.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-exp.f6479.7
Applied rewrites79.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a)))
(t_2 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= t_1 -2e+27)
t_2
(if (<= t_1 4e+65) (/ (* (exp (- (* (log z) y) b)) x) (* 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 * exp(((log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t_1 <= -2e+27) {
tmp = t_2;
} else if (t_1 <= 4e+65) {
tmp = (exp(((log(z) * y) - b)) * x) / (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 * exp(((log(a) * (t - 1.0d0)) - b))) / y
if (t_1 <= (-2d+27)) then
tmp = t_2
else if (t_1 <= 4d+65) then
tmp = (exp(((log(z) * y) - b)) * x) / (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 * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t_1 <= -2e+27) {
tmp = t_2;
} else if (t_1 <= 4e+65) {
tmp = (Math.exp(((Math.log(z) * y) - b)) * x) / (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 * math.exp(((math.log(a) * (t - 1.0)) - b))) / y tmp = 0 if t_1 <= -2e+27: tmp = t_2 elif t_1 <= 4e+65: tmp = (math.exp(((math.log(z) * y) - b)) * x) / (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(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y) tmp = 0.0 if (t_1 <= -2e+27) tmp = t_2; elseif (t_1 <= 4e+65) tmp = Float64(Float64(exp(Float64(Float64(log(z) * y) - b)) * x) / Float64(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 * exp(((log(a) * (t - 1.0)) - b))) / y; tmp = 0.0; if (t_1 <= -2e+27) tmp = t_2; elseif (t_1 <= 4e+65) tmp = (exp(((log(z) * y) - b)) * x) / (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[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+27], t$95$2, If[LessEqual[t$95$1, 4e+65], N[(N[(N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := \frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+65}:\\
\;\;\;\;\frac{e^{\log z \cdot y - b} \cdot x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -2e27 or 4e65 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.2%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6479.7
Applied rewrites79.7%
if -2e27 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 4e65Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in x around 0
lower-/.f64N/A
*-commutativeN/A
exp-diffN/A
*-commutativeN/A
exp-diffN/A
lower-*.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-exp.f64N/A
lower-*.f6472.0
Applied rewrites72.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (/ (pow z y) a)) y)))
(if (<= y -1.1e+111)
t_1
(if (<= y 2.8e+123) (/ (* 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 <= -1.1e+111) {
tmp = t_1;
} else if (y <= 2.8e+123) {
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 <= (-1.1d+111)) then
tmp = t_1
else if (y <= 2.8d+123) 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 <= -1.1e+111) {
tmp = t_1;
} else if (y <= 2.8e+123) {
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 <= -1.1e+111: tmp = t_1 elif y <= 2.8e+123: 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 <= -1.1e+111) tmp = t_1; elseif (y <= 2.8e+123) 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 <= -1.1e+111) tmp = t_1; elseif (y <= 2.8e+123) 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, -1.1e+111], t$95$1, If[LessEqual[y, 2.8e+123], 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 -1.1 \cdot 10^{+111}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{+123}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.09999999999999999e111 or 2.80000000000000011e123 < y Initial program 98.2%
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.f6479.7
Applied rewrites79.7%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6458.9
Applied rewrites58.9%
if -1.09999999999999999e111 < y < 2.80000000000000011e123Initial program 98.2%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6479.7
Applied rewrites79.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a))) (t_2 (/ (* x (exp (* (log a) t))) y)))
(if (<= t_1 -2e+27)
t_2
(if (<= t_1 -250.0)
(* x (/ (/ (exp (- b)) a) y))
(if (<= t_1 4e+116) (/ (* (pow z y) x) (* 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 * exp((log(a) * t))) / y;
double tmp;
if (t_1 <= -2e+27) {
tmp = t_2;
} else if (t_1 <= -250.0) {
tmp = x * ((exp(-b) / a) / y);
} else if (t_1 <= 4e+116) {
tmp = (pow(z, y) * x) / (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 * exp((log(a) * t))) / y
if (t_1 <= (-2d+27)) then
tmp = t_2
else if (t_1 <= (-250.0d0)) then
tmp = x * ((exp(-b) / a) / y)
else if (t_1 <= 4d+116) then
tmp = ((z ** y) * x) / (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 * Math.exp((Math.log(a) * t))) / y;
double tmp;
if (t_1 <= -2e+27) {
tmp = t_2;
} else if (t_1 <= -250.0) {
tmp = x * ((Math.exp(-b) / a) / y);
} else if (t_1 <= 4e+116) {
tmp = (Math.pow(z, y) * x) / (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 * math.exp((math.log(a) * t))) / y tmp = 0 if t_1 <= -2e+27: tmp = t_2 elif t_1 <= -250.0: tmp = x * ((math.exp(-b) / a) / y) elif t_1 <= 4e+116: tmp = (math.pow(z, y) * x) / (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(Float64(x * exp(Float64(log(a) * t))) / y) tmp = 0.0 if (t_1 <= -2e+27) tmp = t_2; elseif (t_1 <= -250.0) tmp = Float64(x * Float64(Float64(exp(Float64(-b)) / a) / y)); elseif (t_1 <= 4e+116) tmp = Float64(Float64((z ^ y) * x) / Float64(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 * exp((log(a) * t))) / y; tmp = 0.0; if (t_1 <= -2e+27) tmp = t_2; elseif (t_1 <= -250.0) tmp = x * ((exp(-b) / a) / y); elseif (t_1 <= 4e+116) tmp = ((z ^ y) * x) / (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[(N[(x * N[Exp[N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+27], t$95$2, If[LessEqual[t$95$1, -250.0], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 4e+116], N[(N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := \frac{x \cdot e^{\log a \cdot t}}{y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -250:\\
\;\;\;\;x \cdot \frac{\frac{e^{-b}}{a}}{y}\\
\mathbf{elif}\;t\_1 \leq 4 \cdot 10^{+116}:\\
\;\;\;\;\frac{{z}^{y} \cdot x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -2e27 or 4.00000000000000006e116 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.2%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6448.4
Applied rewrites48.4%
if -2e27 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -250Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
if -250 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 4.00000000000000006e116Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.0
Applied rewrites54.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (- b))))
(if (<= b -4.6e+21)
(* x (/ t_1 y))
(if (<= b 2.9e-10) (/ (* (pow z y) x) (* a y)) (* x (/ (/ t_1 a) y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double tmp;
if (b <= -4.6e+21) {
tmp = x * (t_1 / y);
} else if (b <= 2.9e-10) {
tmp = (pow(z, y) * x) / (a * y);
} else {
tmp = x * ((t_1 / 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) :: t_1
real(8) :: tmp
t_1 = exp(-b)
if (b <= (-4.6d+21)) then
tmp = x * (t_1 / y)
else if (b <= 2.9d-10) then
tmp = ((z ** y) * x) / (a * y)
else
tmp = x * ((t_1 / 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 t_1 = Math.exp(-b);
double tmp;
if (b <= -4.6e+21) {
tmp = x * (t_1 / y);
} else if (b <= 2.9e-10) {
tmp = (Math.pow(z, y) * x) / (a * y);
} else {
tmp = x * ((t_1 / a) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(-b) tmp = 0 if b <= -4.6e+21: tmp = x * (t_1 / y) elif b <= 2.9e-10: tmp = (math.pow(z, y) * x) / (a * y) else: tmp = x * ((t_1 / a) / y) return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) tmp = 0.0 if (b <= -4.6e+21) tmp = Float64(x * Float64(t_1 / y)); elseif (b <= 2.9e-10) tmp = Float64(Float64((z ^ y) * x) / Float64(a * y)); else tmp = Float64(x * Float64(Float64(t_1 / a) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(-b); tmp = 0.0; if (b <= -4.6e+21) tmp = x * (t_1 / y); elseif (b <= 2.9e-10) tmp = ((z ^ y) * x) / (a * y); else tmp = x * ((t_1 / a) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, If[LessEqual[b, -4.6e+21], N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.9e-10], N[(N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(t$95$1 / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
\mathbf{if}\;b \leq -4.6 \cdot 10^{+21}:\\
\;\;\;\;x \cdot \frac{t\_1}{y}\\
\mathbf{elif}\;b \leq 2.9 \cdot 10^{-10}:\\
\;\;\;\;\frac{{z}^{y} \cdot x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{t\_1}{a}}{y}\\
\end{array}
\end{array}
if b < -4.6e21Initial program 98.2%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6447.1
Applied rewrites47.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6447.1
Applied rewrites47.1%
if -4.6e21 < b < 2.89999999999999981e-10Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.0
Applied rewrites54.0%
if 2.89999999999999981e-10 < b Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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)) a)) y)))
(if (<= b -1.02e-234)
t_1
(if (<= b 1.6e-211) (* 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) / a)) / y;
double tmp;
if (b <= -1.02e-234) {
tmp = t_1;
} else if (b <= 1.6e-211) {
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) / a)) / y
if (b <= (-1.02d-234)) then
tmp = t_1
else if (b <= 1.6d-211) 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) / a)) / y;
double tmp;
if (b <= -1.02e-234) {
tmp = t_1;
} else if (b <= 1.6e-211) {
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) / a)) / y tmp = 0 if b <= -1.02e-234: tmp = t_1 elif b <= 1.6e-211: 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(Float64(x * Float64(exp(Float64(-b)) / a)) / y) tmp = 0.0 if (b <= -1.02e-234) tmp = t_1; elseif (b <= 1.6e-211) 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) / a)) / y; tmp = 0.0; if (b <= -1.02e-234) tmp = t_1; elseif (b <= 1.6e-211) 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[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[b, -1.02e-234], t$95$1, If[LessEqual[b, 1.6e-211], 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 := \frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{if}\;b \leq -1.02 \cdot 10^{-234}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{-211}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.01999999999999999e-234 or 1.59999999999999993e-211 < b Initial program 98.2%
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.f6479.7
Applied rewrites79.7%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.0
Applied rewrites58.0%
if -1.01999999999999999e-234 < b < 1.59999999999999993e-211Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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.2
Applied rewrites37.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -1.05e-58)
t_1
(if (<= b -1.02e-234)
(/ (/ x a) y)
(if (<= b 1.6e-211)
(* x (/ (/ (* (* b b) 0.5) a) y))
(if (<= b 200000000.0) (/ (* x (/ 1.0 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 <= -1.05e-58) {
tmp = t_1;
} else if (b <= -1.02e-234) {
tmp = (x / a) / y;
} else if (b <= 1.6e-211) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else if (b <= 200000000.0) {
tmp = (x * (1.0 / 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 <= (-1.05d-58)) then
tmp = t_1
else if (b <= (-1.02d-234)) then
tmp = (x / a) / y
else if (b <= 1.6d-211) then
tmp = x * ((((b * b) * 0.5d0) / a) / y)
else if (b <= 200000000.0d0) then
tmp = (x * (1.0d0 / 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 <= -1.05e-58) {
tmp = t_1;
} else if (b <= -1.02e-234) {
tmp = (x / a) / y;
} else if (b <= 1.6e-211) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else if (b <= 200000000.0) {
tmp = (x * (1.0 / 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 <= -1.05e-58: tmp = t_1 elif b <= -1.02e-234: tmp = (x / a) / y elif b <= 1.6e-211: tmp = x * ((((b * b) * 0.5) / a) / y) elif b <= 200000000.0: tmp = (x * (1.0 / 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 <= -1.05e-58) tmp = t_1; elseif (b <= -1.02e-234) tmp = Float64(Float64(x / a) / y); elseif (b <= 1.6e-211) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); elseif (b <= 200000000.0) tmp = Float64(Float64(x * Float64(1.0 / 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 <= -1.05e-58) tmp = t_1; elseif (b <= -1.02e-234) tmp = (x / a) / y; elseif (b <= 1.6e-211) tmp = x * ((((b * b) * 0.5) / a) / y); elseif (b <= 200000000.0) tmp = (x * (1.0 / 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, -1.05e-58], t$95$1, If[LessEqual[b, -1.02e-234], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[b, 1.6e-211], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 200000000.0], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -1.05 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.02 \cdot 10^{-234}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{-211}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{elif}\;b \leq 200000000:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.04999999999999994e-58 or 2e8 < b Initial program 98.2%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6447.1
Applied rewrites47.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6447.1
Applied rewrites47.1%
if -1.04999999999999994e-58 < b < -1.01999999999999999e-234Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.0
Applied rewrites54.0%
Taylor expanded in y around 0
lower-/.f64N/A
lift-*.f6431.2
Applied rewrites31.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6430.6
Applied rewrites30.6%
if -1.01999999999999999e-234 < b < 1.59999999999999993e-211Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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.2
Applied rewrites37.2%
if 1.59999999999999993e-211 < b < 2e8Initial program 98.2%
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.f6479.7
Applied rewrites79.7%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6458.9
Applied rewrites58.9%
Taylor expanded in y around 0
Applied rewrites30.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (/ (exp (- b)) a) y))))
(if (<= b -9.2e-235)
t_1
(if (<= b 1.6e-211)
(* x (/ (/ (* (* b b) 0.5) a) y))
(if (<= b 7.7e-25) (/ (* x (/ 1.0 a)) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * ((exp(-b) / a) / y);
double tmp;
if (b <= -9.2e-235) {
tmp = t_1;
} else if (b <= 1.6e-211) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else if (b <= 7.7e-25) {
tmp = (x * (1.0 / 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) / a) / y)
if (b <= (-9.2d-235)) then
tmp = t_1
else if (b <= 1.6d-211) then
tmp = x * ((((b * b) * 0.5d0) / a) / y)
else if (b <= 7.7d-25) then
tmp = (x * (1.0d0 / 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) / a) / y);
double tmp;
if (b <= -9.2e-235) {
tmp = t_1;
} else if (b <= 1.6e-211) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else if (b <= 7.7e-25) {
tmp = (x * (1.0 / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * ((math.exp(-b) / a) / y) tmp = 0 if b <= -9.2e-235: tmp = t_1 elif b <= 1.6e-211: tmp = x * ((((b * b) * 0.5) / a) / y) elif b <= 7.7e-25: tmp = (x * (1.0 / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(Float64(exp(Float64(-b)) / a) / y)) tmp = 0.0 if (b <= -9.2e-235) tmp = t_1; elseif (b <= 1.6e-211) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); elseif (b <= 7.7e-25) tmp = Float64(Float64(x * Float64(1.0 / 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) / a) / y); tmp = 0.0; if (b <= -9.2e-235) tmp = t_1; elseif (b <= 1.6e-211) tmp = x * ((((b * b) * 0.5) / a) / y); elseif (b <= 7.7e-25) tmp = (x * (1.0 / 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[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9.2e-235], t$95$1, If[LessEqual[b, 1.6e-211], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 7.7e-25], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{e^{-b}}{a}}{y}\\
\mathbf{if}\;b \leq -9.2 \cdot 10^{-235}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{-211}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{elif}\;b \leq 7.7 \cdot 10^{-25}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.19999999999999989e-235 or 7.7000000000000002e-25 < b Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f6458.6
Applied rewrites58.6%
if -9.19999999999999989e-235 < b < 1.59999999999999993e-211Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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.2
Applied rewrites37.2%
if 1.59999999999999993e-211 < b < 7.7000000000000002e-25Initial program 98.2%
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.f6479.7
Applied rewrites79.7%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6458.9
Applied rewrites58.9%
Taylor expanded in y around 0
Applied rewrites30.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (- b))))
(if (<= b -9.2e-235)
(* x (/ t_1 (* a y)))
(if (<= b 1.66e-211)
(* x (/ (/ (* (* b b) 0.5) a) y))
(if (<= b 200000000.0)
(/ (* x (/ (fma (log z) y 1.0) a)) y)
(* x (/ t_1 y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double tmp;
if (b <= -9.2e-235) {
tmp = x * (t_1 / (a * y));
} else if (b <= 1.66e-211) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else if (b <= 200000000.0) {
tmp = (x * (fma(log(z), y, 1.0) / a)) / y;
} else {
tmp = x * (t_1 / y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) tmp = 0.0 if (b <= -9.2e-235) tmp = Float64(x * Float64(t_1 / Float64(a * y))); elseif (b <= 1.66e-211) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); elseif (b <= 200000000.0) tmp = Float64(Float64(x * Float64(fma(log(z), y, 1.0) / a)) / y); else tmp = Float64(x * Float64(t_1 / y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, If[LessEqual[b, -9.2e-235], N[(x * N[(t$95$1 / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.66e-211], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 200000000.0], N[(N[(x * N[(N[(N[Log[z], $MachinePrecision] * y + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
\mathbf{if}\;b \leq -9.2 \cdot 10^{-235}:\\
\;\;\;\;x \cdot \frac{t\_1}{a \cdot y}\\
\mathbf{elif}\;b \leq 1.66 \cdot 10^{-211}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{elif}\;b \leq 200000000:\\
\;\;\;\;\frac{x \cdot \frac{\mathsf{fma}\left(\log z, y, 1\right)}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t\_1}{y}\\
\end{array}
\end{array}
if b < -9.19999999999999989e-235Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f64N/A
lower-*.f6454.3
Applied rewrites54.3%
if -9.19999999999999989e-235 < b < 1.6599999999999999e-211Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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.2
Applied rewrites37.2%
if 1.6599999999999999e-211 < b < 2e8Initial program 98.2%
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.f6479.7
Applied rewrites79.7%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6458.9
Applied rewrites58.9%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-log.f6431.1
Applied rewrites31.1%
if 2e8 < b Initial program 98.2%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6447.1
Applied rewrites47.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6447.1
Applied rewrites47.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (- b))))
(if (<= b -9.2e-235)
(* x (/ t_1 (* a y)))
(if (<= b 1.6e-211)
(* x (/ (/ (* (* b b) 0.5) a) y))
(if (<= b 200000000.0) (/ (* x (/ 1.0 a)) y) (* x (/ t_1 y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double tmp;
if (b <= -9.2e-235) {
tmp = x * (t_1 / (a * y));
} else if (b <= 1.6e-211) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else if (b <= 200000000.0) {
tmp = (x * (1.0 / 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 = exp(-b)
if (b <= (-9.2d-235)) then
tmp = x * (t_1 / (a * y))
else if (b <= 1.6d-211) then
tmp = x * ((((b * b) * 0.5d0) / a) / y)
else if (b <= 200000000.0d0) then
tmp = (x * (1.0d0 / 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.exp(-b);
double tmp;
if (b <= -9.2e-235) {
tmp = x * (t_1 / (a * y));
} else if (b <= 1.6e-211) {
tmp = x * ((((b * b) * 0.5) / a) / y);
} else if (b <= 200000000.0) {
tmp = (x * (1.0 / a)) / y;
} else {
tmp = x * (t_1 / y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(-b) tmp = 0 if b <= -9.2e-235: tmp = x * (t_1 / (a * y)) elif b <= 1.6e-211: tmp = x * ((((b * b) * 0.5) / a) / y) elif b <= 200000000.0: tmp = (x * (1.0 / a)) / y else: tmp = x * (t_1 / y) return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) tmp = 0.0 if (b <= -9.2e-235) tmp = Float64(x * Float64(t_1 / Float64(a * y))); elseif (b <= 1.6e-211) tmp = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)); elseif (b <= 200000000.0) tmp = Float64(Float64(x * Float64(1.0 / 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 = exp(-b); tmp = 0.0; if (b <= -9.2e-235) tmp = x * (t_1 / (a * y)); elseif (b <= 1.6e-211) tmp = x * ((((b * b) * 0.5) / a) / y); elseif (b <= 200000000.0) tmp = (x * (1.0 / 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[Exp[(-b)], $MachinePrecision]}, If[LessEqual[b, -9.2e-235], N[(x * N[(t$95$1 / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.6e-211], N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 200000000.0], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
\mathbf{if}\;b \leq -9.2 \cdot 10^{-235}:\\
\;\;\;\;x \cdot \frac{t\_1}{a \cdot y}\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{-211}:\\
\;\;\;\;x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{elif}\;b \leq 200000000:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t\_1}{y}\\
\end{array}
\end{array}
if b < -9.19999999999999989e-235Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in y around 0
lower-/.f64N/A
lift-neg.f64N/A
lower-exp.f64N/A
lower-*.f6454.3
Applied rewrites54.3%
if -9.19999999999999989e-235 < b < 1.59999999999999993e-211Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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.2
Applied rewrites37.2%
if 1.59999999999999993e-211 < b < 2e8Initial program 98.2%
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.f6479.7
Applied rewrites79.7%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6458.9
Applied rewrites58.9%
Taylor expanded in y around 0
Applied rewrites30.6%
if 2e8 < b Initial program 98.2%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6447.1
Applied rewrites47.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6447.1
Applied rewrites47.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (/ (* (* b b) 0.5) a) y))))
(if (<= b -1.05e+170)
t_1
(if (<= b -1.02e-234)
(/ (* x (/ (+ (- b) 1.0) a)) y)
(if (<= b 1.6e-211) t_1 (/ (/ x a) y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * ((((b * b) * 0.5) / a) / y);
double tmp;
if (b <= -1.05e+170) {
tmp = t_1;
} else if (b <= -1.02e-234) {
tmp = (x * ((-b + 1.0) / a)) / y;
} else if (b <= 1.6e-211) {
tmp = t_1;
} else {
tmp = (x / 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) :: t_1
real(8) :: tmp
t_1 = x * ((((b * b) * 0.5d0) / a) / y)
if (b <= (-1.05d+170)) then
tmp = t_1
else if (b <= (-1.02d-234)) then
tmp = (x * ((-b + 1.0d0) / a)) / y
else if (b <= 1.6d-211) then
tmp = t_1
else
tmp = (x / 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 t_1 = x * ((((b * b) * 0.5) / a) / y);
double tmp;
if (b <= -1.05e+170) {
tmp = t_1;
} else if (b <= -1.02e-234) {
tmp = (x * ((-b + 1.0) / a)) / y;
} else if (b <= 1.6e-211) {
tmp = t_1;
} else {
tmp = (x / a) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * ((((b * b) * 0.5) / a) / y) tmp = 0 if b <= -1.05e+170: tmp = t_1 elif b <= -1.02e-234: tmp = (x * ((-b + 1.0) / a)) / y elif b <= 1.6e-211: tmp = t_1 else: tmp = (x / a) / y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(Float64(Float64(Float64(b * b) * 0.5) / a) / y)) tmp = 0.0 if (b <= -1.05e+170) tmp = t_1; elseif (b <= -1.02e-234) tmp = Float64(Float64(x * Float64(Float64(Float64(-b) + 1.0) / a)) / y); elseif (b <= 1.6e-211) tmp = t_1; else tmp = Float64(Float64(x / a) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * ((((b * b) * 0.5) / a) / y); tmp = 0.0; if (b <= -1.05e+170) tmp = t_1; elseif (b <= -1.02e-234) tmp = (x * ((-b + 1.0) / a)) / y; elseif (b <= 1.6e-211) tmp = t_1; else tmp = (x / a) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.05e+170], t$95$1, If[LessEqual[b, -1.02e-234], N[(N[(x * N[(N[((-b) + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[b, 1.6e-211], t$95$1, N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{if}\;b \leq -1.05 \cdot 10^{+170}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -1.02 \cdot 10^{-234}:\\
\;\;\;\;\frac{x \cdot \frac{\left(-b\right) + 1}{a}}{y}\\
\mathbf{elif}\;b \leq 1.6 \cdot 10^{-211}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\end{array}
\end{array}
if b < -1.04999999999999999e170 or -1.01999999999999999e-234 < b < 1.59999999999999993e-211Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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.2
Applied rewrites37.2%
if -1.04999999999999999e170 < b < -1.01999999999999999e-234Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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
mul-1-negN/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f6432.5
Applied rewrites32.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6431.7
Applied rewrites31.7%
if 1.59999999999999993e-211 < b Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.0
Applied rewrites54.0%
Taylor expanded in y around 0
lower-/.f64N/A
lift-*.f6431.2
Applied rewrites31.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6430.6
Applied rewrites30.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b 0.0105) (/ (* x (/ (+ (- b) 1.0) a)) y) (/ x (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 0.0105) {
tmp = (x * ((-b + 1.0) / a)) / y;
} else {
tmp = x / (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 <= 0.0105d0) then
tmp = (x * ((-b + 1.0d0) / a)) / y
else
tmp = x / (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 <= 0.0105) {
tmp = (x * ((-b + 1.0) / a)) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 0.0105: tmp = (x * ((-b + 1.0) / a)) / y else: tmp = x / (a * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 0.0105) tmp = Float64(Float64(x * Float64(Float64(Float64(-b) + 1.0) / a)) / y); else tmp = Float64(x / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 0.0105) tmp = (x * ((-b + 1.0) / a)) / y; else tmp = x / (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 0.0105], N[(N[(x * N[(N[((-b) + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.0105:\\
\;\;\;\;\frac{x \cdot \frac{\left(-b\right) + 1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a \cdot y}\\
\end{array}
\end{array}
if b < 0.0105000000000000007Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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
mul-1-negN/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f6432.5
Applied rewrites32.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6431.7
Applied rewrites31.7%
if 0.0105000000000000007 < b Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.0
Applied rewrites54.0%
Taylor expanded in y around 0
lower-/.f64N/A
lift-*.f6431.2
Applied rewrites31.2%
(FPCore (x y z t a b) :precision binary64 (if (<= b -6e+87) (* x (/ (/ (+ (- b) 1.0) a) y)) (/ (/ x a) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6e+87) {
tmp = x * (((-b + 1.0) / a) / y);
} else {
tmp = (x / 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 <= (-6d+87)) then
tmp = x * (((-b + 1.0d0) / a) / y)
else
tmp = (x / 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 <= -6e+87) {
tmp = x * (((-b + 1.0) / a) / y);
} else {
tmp = (x / a) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -6e+87: tmp = x * (((-b + 1.0) / a) / y) else: tmp = (x / a) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6e+87) tmp = Float64(x * Float64(Float64(Float64(Float64(-b) + 1.0) / a) / y)); else tmp = Float64(Float64(x / a) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -6e+87) tmp = x * (((-b + 1.0) / a) / y); else tmp = (x / a) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6e+87], N[(x * N[(N[(N[((-b) + 1.0), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6 \cdot 10^{+87}:\\
\;\;\;\;x \cdot \frac{\frac{\left(-b\right) + 1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\end{array}
\end{array}
if b < -5.9999999999999998e87Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
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
mul-1-negN/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f6432.5
Applied rewrites32.5%
if -5.9999999999999998e87 < b Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.0
Applied rewrites54.0%
Taylor expanded in y around 0
lower-/.f64N/A
lift-*.f6431.2
Applied rewrites31.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6430.6
Applied rewrites30.6%
(FPCore (x y z t a b) :precision binary64 (/ (/ x a) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x / 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 / a) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x / a) / y;
}
def code(x, y, z, t, a, b): return (x / a) / y
function code(x, y, z, t, a, b) return Float64(Float64(x / a) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x / a) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{a}}{y}
\end{array}
Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.0
Applied rewrites54.0%
Taylor expanded in y around 0
lower-/.f64N/A
lift-*.f6431.2
Applied rewrites31.2%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6430.6
Applied rewrites30.6%
(FPCore (x y z t a b) :precision binary64 (/ x (* a y)))
double code(double x, double y, double z, double t, double a, double b) {
return x / (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 / (a * y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / (a * y);
}
def code(x, y, z, t, a, b): return x / (a * y)
function code(x, y, z, t, a, b) return Float64(x / Float64(a * y)) end
function tmp = code(x, y, z, t, a, b) tmp = x / (a * y); end
code[x_, y_, z_, t_, a_, b_] := N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a \cdot y}
\end{array}
Initial program 98.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.0
Applied rewrites54.0%
Taylor expanded in y around 0
lower-/.f64N/A
lift-*.f6431.2
Applied rewrites31.2%
herbie shell --seed 2025142
(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))