
(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}
Sampling outcomes in binary64 precision:
Herbie found 13 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.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -4e+139) (not (<= y 980000.0))) (* x (/ (/ (pow z y) a) y)) (* x (/ (exp (- (* (log a) (- t 1.0)) b)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -4e+139) || !(y <= 980000.0)) {
tmp = x * ((pow(z, y) / a) / y);
} else {
tmp = x * (exp(((log(a) * (t - 1.0)) - 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 ((y <= (-4d+139)) .or. (.not. (y <= 980000.0d0))) then
tmp = x * (((z ** y) / a) / y)
else
tmp = x * (exp(((log(a) * (t - 1.0d0)) - 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 ((y <= -4e+139) || !(y <= 980000.0)) {
tmp = x * ((Math.pow(z, y) / a) / y);
} else {
tmp = x * (Math.exp(((Math.log(a) * (t - 1.0)) - b)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -4e+139) or not (y <= 980000.0): tmp = x * ((math.pow(z, y) / a) / y) else: tmp = x * (math.exp(((math.log(a) * (t - 1.0)) - b)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -4e+139) || !(y <= 980000.0)) tmp = Float64(x * Float64(Float64((z ^ y) / a) / y)); else tmp = Float64(x * Float64(exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -4e+139) || ~((y <= 980000.0))) tmp = x * (((z ^ y) / a) / y); else tmp = x * (exp(((log(a) * (t - 1.0)) - b)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -4e+139], N[Not[LessEqual[y, 980000.0]], $MachinePrecision]], N[(x * N[(N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4 \cdot 10^{+139} \lor \neg \left(y \leq 980000\right):\\
\;\;\;\;x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\end{array}
\end{array}
if y < -4.00000000000000013e139 or 9.8e5 < y Initial program 100.0%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6479.4
Applied rewrites79.4%
Taylor expanded in t around 0
lower-/.f64N/A
lift-pow.f6489.9
Applied rewrites89.9%
if -4.00000000000000013e139 < y < 9.8e5Initial program 98.0%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6494.9
Applied rewrites94.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6495.0
Applied rewrites95.0%
Final simplification93.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (/ (pow z y) a) y))))
(if (<= y -1.85e+34)
t_1
(if (<= y -7.6e-211)
(/ (* (pow a (- t 1.0)) x) y)
(if (<= y 24000.0) (* x (/ (exp (- (- (log a)) 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.85e+34) {
tmp = t_1;
} else if (y <= -7.6e-211) {
tmp = (pow(a, (t - 1.0)) * x) / y;
} else if (y <= 24000.0) {
tmp = x * (exp((-log(a) - 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.85d+34)) then
tmp = t_1
else if (y <= (-7.6d-211)) then
tmp = ((a ** (t - 1.0d0)) * x) / y
else if (y <= 24000.0d0) then
tmp = x * (exp((-log(a) - 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.85e+34) {
tmp = t_1;
} else if (y <= -7.6e-211) {
tmp = (Math.pow(a, (t - 1.0)) * x) / y;
} else if (y <= 24000.0) {
tmp = x * (Math.exp((-Math.log(a) - 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.85e+34: tmp = t_1 elif y <= -7.6e-211: tmp = (math.pow(a, (t - 1.0)) * x) / y elif y <= 24000.0: tmp = x * (math.exp((-math.log(a) - b)) / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(Float64((z ^ y) / a) / y)) tmp = 0.0 if (y <= -1.85e+34) tmp = t_1; elseif (y <= -7.6e-211) tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / y); elseif (y <= 24000.0) tmp = Float64(x * Float64(exp(Float64(Float64(-log(a)) - 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.85e+34) tmp = t_1; elseif (y <= -7.6e-211) tmp = ((a ^ (t - 1.0)) * x) / y; elseif (y <= 24000.0) tmp = x * (exp((-log(a) - 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[Power[z, y], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.85e+34], t$95$1, If[LessEqual[y, -7.6e-211], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 24000.0], N[(x * N[(N[Exp[N[((-N[Log[a], $MachinePrecision]) - b), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\
\mathbf{if}\;y \leq -1.85 \cdot 10^{+34}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -7.6 \cdot 10^{-211}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{elif}\;y \leq 24000:\\
\;\;\;\;x \cdot \frac{e^{\left(-\log a\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.85000000000000004e34 or 24000 < y Initial program 100.0%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6475.9
Applied rewrites75.9%
Taylor expanded in t around 0
lower-/.f64N/A
lift-pow.f6485.2
Applied rewrites85.2%
if -1.85000000000000004e34 < y < -7.60000000000000023e-211Initial program 99.1%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6474.4
Applied rewrites74.4%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-to-expN/A
lift-pow.f64N/A
lift--.f6474.7
Applied rewrites74.7%
if -7.60000000000000023e-211 < y < 24000Initial program 97.0%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6497.0
Applied rewrites97.0%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6497.2
Applied rewrites97.2%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f64N/A
lift-log.f6475.9
Applied rewrites75.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -5.6e+189)
(* x (/ (exp (- b)) y))
(if (<= b 4e+57)
(* x (/ (* (pow z y) (pow a (- t 1.0))) y))
(* x (/ (exp (- (- (log a)) b)) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -5.6e+189) {
tmp = x * (exp(-b) / y);
} else if (b <= 4e+57) {
tmp = x * ((pow(z, y) * pow(a, (t - 1.0))) / y);
} else {
tmp = x * (exp((-log(a) - 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 (b <= (-5.6d+189)) then
tmp = x * (exp(-b) / y)
else if (b <= 4d+57) then
tmp = x * (((z ** y) * (a ** (t - 1.0d0))) / y)
else
tmp = x * (exp((-log(a) - 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 (b <= -5.6e+189) {
tmp = x * (Math.exp(-b) / y);
} else if (b <= 4e+57) {
tmp = x * ((Math.pow(z, y) * Math.pow(a, (t - 1.0))) / y);
} else {
tmp = x * (Math.exp((-Math.log(a) - b)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -5.6e+189: tmp = x * (math.exp(-b) / y) elif b <= 4e+57: tmp = x * ((math.pow(z, y) * math.pow(a, (t - 1.0))) / y) else: tmp = x * (math.exp((-math.log(a) - b)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -5.6e+189) tmp = Float64(x * Float64(exp(Float64(-b)) / y)); elseif (b <= 4e+57) tmp = Float64(x * Float64(Float64((z ^ y) * (a ^ Float64(t - 1.0))) / y)); else tmp = Float64(x * Float64(exp(Float64(Float64(-log(a)) - b)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -5.6e+189) tmp = x * (exp(-b) / y); elseif (b <= 4e+57) tmp = x * (((z ^ y) * (a ^ (t - 1.0))) / y); else tmp = x * (exp((-log(a) - b)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -5.6e+189], N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4e+57], N[(x * N[(N[(N[Power[z, y], $MachinePrecision] * N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Exp[N[((-N[Log[a], $MachinePrecision]) - b), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{+189}:\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{elif}\;b \leq 4 \cdot 10^{+57}:\\
\;\;\;\;x \cdot \frac{{z}^{y} \cdot {a}^{\left(t - 1\right)}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{e^{\left(-\log a\right) - b}}{y}\\
\end{array}
\end{array}
if b < -5.60000000000000013e189Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6496.2
Applied rewrites96.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6496.2
Applied rewrites96.2%
if -5.60000000000000013e189 < b < 4.00000000000000019e57Initial program 98.2%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6484.3
Applied rewrites84.3%
if 4.00000000000000019e57 < b Initial program 100.0%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6491.4
Applied rewrites91.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6491.4
Applied rewrites91.4%
Taylor expanded in t around 0
mul-1-negN/A
lower-neg.f64N/A
lift-log.f6484.5
Applied rewrites84.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -1.55e+43)
t_1
(if (<= b -4.9e-79)
(* x (/ (/ (pow z y) a) y))
(if (<= b 1.05e+50) (/ (* x (/ (pow a (- t 1.0)) (+ b 1.0))) 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.55e+43) {
tmp = t_1;
} else if (b <= -4.9e-79) {
tmp = x * ((pow(z, y) / a) / y);
} else if (b <= 1.05e+50) {
tmp = (x * (pow(a, (t - 1.0)) / (b + 1.0))) / 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.55d+43)) then
tmp = t_1
else if (b <= (-4.9d-79)) then
tmp = x * (((z ** y) / a) / y)
else if (b <= 1.05d+50) then
tmp = (x * ((a ** (t - 1.0d0)) / (b + 1.0d0))) / 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.55e+43) {
tmp = t_1;
} else if (b <= -4.9e-79) {
tmp = x * ((Math.pow(z, y) / a) / y);
} else if (b <= 1.05e+50) {
tmp = (x * (Math.pow(a, (t - 1.0)) / (b + 1.0))) / 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.55e+43: tmp = t_1 elif b <= -4.9e-79: tmp = x * ((math.pow(z, y) / a) / y) elif b <= 1.05e+50: tmp = (x * (math.pow(a, (t - 1.0)) / (b + 1.0))) / 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.55e+43) tmp = t_1; elseif (b <= -4.9e-79) tmp = Float64(x * Float64(Float64((z ^ y) / a) / y)); elseif (b <= 1.05e+50) tmp = Float64(Float64(x * Float64((a ^ Float64(t - 1.0)) / Float64(b + 1.0))) / 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.55e+43) tmp = t_1; elseif (b <= -4.9e-79) tmp = x * (((z ^ y) / a) / y); elseif (b <= 1.05e+50) tmp = (x * ((a ^ (t - 1.0)) / (b + 1.0))) / 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.55e+43], t$95$1, If[LessEqual[b, -4.9e-79], N[(x * N[(N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.05e+50], N[(N[(x * N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / N[(b + 1.0), $MachinePrecision]), $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.55 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -4.9 \cdot 10^{-79}:\\
\;\;\;\;x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{+50}:\\
\;\;\;\;\frac{x \cdot \frac{{a}^{\left(t - 1\right)}}{b + 1}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.5500000000000001e43 or 1.05e50 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6482.7
Applied rewrites82.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.7
Applied rewrites82.7%
if -1.5500000000000001e43 < b < -4.9000000000000001e-79Initial program 99.6%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6495.7
Applied rewrites95.7%
Taylor expanded in t around 0
lower-/.f64N/A
lift-pow.f6495.9
Applied rewrites95.9%
if -4.9000000000000001e-79 < b < 1.05e50Initial program 97.4%
Taylor expanded in y around 0
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6472.0
Applied rewrites72.0%
Taylor expanded in b around 0
+-commutativeN/A
lower-+.f6472.9
Applied rewrites72.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -1.55e+43)
t_1
(if (<= b -4.9e-79)
(* x (/ (/ (pow z y) a) y))
(if (<= b 6e+49) (* x (/ (/ (pow a t) 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.55e+43) {
tmp = t_1;
} else if (b <= -4.9e-79) {
tmp = x * ((pow(z, y) / a) / y);
} else if (b <= 6e+49) {
tmp = x * ((pow(a, t) / 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.55d+43)) then
tmp = t_1
else if (b <= (-4.9d-79)) then
tmp = x * (((z ** y) / a) / y)
else if (b <= 6d+49) then
tmp = x * (((a ** t) / 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.55e+43) {
tmp = t_1;
} else if (b <= -4.9e-79) {
tmp = x * ((Math.pow(z, y) / a) / y);
} else if (b <= 6e+49) {
tmp = x * ((Math.pow(a, t) / 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.55e+43: tmp = t_1 elif b <= -4.9e-79: tmp = x * ((math.pow(z, y) / a) / y) elif b <= 6e+49: tmp = x * ((math.pow(a, t) / 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.55e+43) tmp = t_1; elseif (b <= -4.9e-79) tmp = Float64(x * Float64(Float64((z ^ y) / a) / y)); elseif (b <= 6e+49) tmp = Float64(x * Float64(Float64((a ^ t) / 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.55e+43) tmp = t_1; elseif (b <= -4.9e-79) tmp = x * (((z ^ y) / a) / y); elseif (b <= 6e+49) tmp = x * (((a ^ t) / 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.55e+43], t$95$1, If[LessEqual[b, -4.9e-79], N[(x * N[(N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e+49], N[(x * N[(N[(N[Power[a, t], $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 -1.55 \cdot 10^{+43}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -4.9 \cdot 10^{-79}:\\
\;\;\;\;x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.5500000000000001e43 or 6.0000000000000005e49 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6482.7
Applied rewrites82.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.7
Applied rewrites82.7%
if -1.5500000000000001e43 < b < -4.9000000000000001e-79Initial program 99.6%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6495.7
Applied rewrites95.7%
Taylor expanded in t around 0
lower-/.f64N/A
lift-pow.f6495.9
Applied rewrites95.9%
if -4.9000000000000001e-79 < b < 6.0000000000000005e49Initial program 97.4%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6485.4
Applied rewrites85.4%
Taylor expanded in y around 0
pow-to-expN/A
lift-pow.f64N/A
lift--.f6472.6
Applied rewrites72.6%
lift--.f64N/A
lift-pow.f64N/A
pow-subN/A
unpow1N/A
lower-/.f64N/A
lower-pow.f6472.7
Applied rewrites72.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -5.6e+42)
t_1
(if (<= b -9e-209)
(* (/ x a) (/ (pow z y) y))
(if (<= b 6e+49) (* x (/ (/ (pow a t) 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 <= -5.6e+42) {
tmp = t_1;
} else if (b <= -9e-209) {
tmp = (x / a) * (pow(z, y) / y);
} else if (b <= 6e+49) {
tmp = x * ((pow(a, t) / 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 <= (-5.6d+42)) then
tmp = t_1
else if (b <= (-9d-209)) then
tmp = (x / a) * ((z ** y) / y)
else if (b <= 6d+49) then
tmp = x * (((a ** t) / 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 <= -5.6e+42) {
tmp = t_1;
} else if (b <= -9e-209) {
tmp = (x / a) * (Math.pow(z, y) / y);
} else if (b <= 6e+49) {
tmp = x * ((Math.pow(a, t) / 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 <= -5.6e+42: tmp = t_1 elif b <= -9e-209: tmp = (x / a) * (math.pow(z, y) / y) elif b <= 6e+49: tmp = x * ((math.pow(a, t) / 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 <= -5.6e+42) tmp = t_1; elseif (b <= -9e-209) tmp = Float64(Float64(x / a) * Float64((z ^ y) / y)); elseif (b <= 6e+49) tmp = Float64(x * Float64(Float64((a ^ t) / 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 <= -5.6e+42) tmp = t_1; elseif (b <= -9e-209) tmp = (x / a) * ((z ^ y) / y); elseif (b <= 6e+49) tmp = x * (((a ^ t) / 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, -5.6e+42], t$95$1, If[LessEqual[b, -9e-209], N[(N[(x / a), $MachinePrecision] * N[(N[Power[z, y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e+49], N[(x * N[(N[(N[Power[a, t], $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 -5.6 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -9 \cdot 10^{-209}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{{z}^{y}}{y}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \frac{\frac{{a}^{t}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.5999999999999999e42 or 6.0000000000000005e49 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6482.7
Applied rewrites82.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.7
Applied rewrites82.7%
if -5.5999999999999999e42 < b < -8.9999999999999996e-209Initial program 99.0%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6484.4
Applied rewrites84.4%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift-pow.f6478.7
Applied rewrites78.7%
if -8.9999999999999996e-209 < b < 6.0000000000000005e49Initial program 97.1%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6488.6
Applied rewrites88.6%
Taylor expanded in y around 0
pow-to-expN/A
lift-pow.f64N/A
lift--.f6472.8
Applied rewrites72.8%
lift--.f64N/A
lift-pow.f64N/A
pow-subN/A
unpow1N/A
lower-/.f64N/A
lower-pow.f6472.8
Applied rewrites72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -5.6e+42)
t_1
(if (<= b -9e-209)
(* (/ x a) (/ (pow z y) y))
(if (<= b 6e+49) (* x (/ (pow a (- t 1.0)) 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 <= -5.6e+42) {
tmp = t_1;
} else if (b <= -9e-209) {
tmp = (x / a) * (pow(z, y) / y);
} else if (b <= 6e+49) {
tmp = x * (pow(a, (t - 1.0)) / 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 <= (-5.6d+42)) then
tmp = t_1
else if (b <= (-9d-209)) then
tmp = (x / a) * ((z ** y) / y)
else if (b <= 6d+49) then
tmp = x * ((a ** (t - 1.0d0)) / 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 <= -5.6e+42) {
tmp = t_1;
} else if (b <= -9e-209) {
tmp = (x / a) * (Math.pow(z, y) / y);
} else if (b <= 6e+49) {
tmp = x * (Math.pow(a, (t - 1.0)) / 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 <= -5.6e+42: tmp = t_1 elif b <= -9e-209: tmp = (x / a) * (math.pow(z, y) / y) elif b <= 6e+49: tmp = x * (math.pow(a, (t - 1.0)) / 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 <= -5.6e+42) tmp = t_1; elseif (b <= -9e-209) tmp = Float64(Float64(x / a) * Float64((z ^ y) / y)); elseif (b <= 6e+49) tmp = Float64(x * Float64((a ^ Float64(t - 1.0)) / 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 <= -5.6e+42) tmp = t_1; elseif (b <= -9e-209) tmp = (x / a) * ((z ^ y) / y); elseif (b <= 6e+49) tmp = x * ((a ^ (t - 1.0)) / 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, -5.6e+42], t$95$1, If[LessEqual[b, -9e-209], N[(N[(x / a), $MachinePrecision] * N[(N[Power[z, y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e+49], N[(x * N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $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 -5.6 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -9 \cdot 10^{-209}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{{z}^{y}}{y}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+49}:\\
\;\;\;\;x \cdot \frac{{a}^{\left(t - 1\right)}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.5999999999999999e42 or 6.0000000000000005e49 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6482.7
Applied rewrites82.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.7
Applied rewrites82.7%
if -5.5999999999999999e42 < b < -8.9999999999999996e-209Initial program 99.0%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6484.4
Applied rewrites84.4%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift-pow.f6478.7
Applied rewrites78.7%
if -8.9999999999999996e-209 < b < 6.0000000000000005e49Initial program 97.1%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6488.6
Applied rewrites88.6%
Taylor expanded in y around 0
pow-to-expN/A
lift-pow.f64N/A
lift--.f6472.8
Applied rewrites72.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -7.5e+42) (not (<= b 6e+49))) (* x (/ (exp (- b)) y)) (* x (/ (pow a (- t 1.0)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7.5e+42) || !(b <= 6e+49)) {
tmp = x * (exp(-b) / y);
} else {
tmp = x * (pow(a, (t - 1.0)) / 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 <= (-7.5d+42)) .or. (.not. (b <= 6d+49))) then
tmp = x * (exp(-b) / y)
else
tmp = x * ((a ** (t - 1.0d0)) / 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 <= -7.5e+42) || !(b <= 6e+49)) {
tmp = x * (Math.exp(-b) / y);
} else {
tmp = x * (Math.pow(a, (t - 1.0)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -7.5e+42) or not (b <= 6e+49): tmp = x * (math.exp(-b) / y) else: tmp = x * (math.pow(a, (t - 1.0)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -7.5e+42) || !(b <= 6e+49)) tmp = Float64(x * Float64(exp(Float64(-b)) / y)); else tmp = Float64(x * Float64((a ^ Float64(t - 1.0)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -7.5e+42) || ~((b <= 6e+49))) tmp = x * (exp(-b) / y); else tmp = x * ((a ^ (t - 1.0)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -7.5e+42], N[Not[LessEqual[b, 6e+49]], $MachinePrecision]], N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.5 \cdot 10^{+42} \lor \neg \left(b \leq 6 \cdot 10^{+49}\right):\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{{a}^{\left(t - 1\right)}}{y}\\
\end{array}
\end{array}
if b < -7.50000000000000041e42 or 6.0000000000000005e49 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6482.7
Applied rewrites82.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.7
Applied rewrites82.7%
if -7.50000000000000041e42 < b < 6.0000000000000005e49Initial program 97.8%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6487.1
Applied rewrites87.1%
Taylor expanded in y around 0
pow-to-expN/A
lift-pow.f64N/A
lift--.f6471.7
Applied rewrites71.7%
Final simplification76.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.6e+42) (not (<= b 6e+49))) (* x (/ (exp (- b)) y)) (/ (* (pow a (- t 1.0)) x) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.6e+42) || !(b <= 6e+49)) {
tmp = x * (exp(-b) / y);
} else {
tmp = (pow(a, (t - 1.0)) * x) / 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 <= (-5.6d+42)) .or. (.not. (b <= 6d+49))) then
tmp = x * (exp(-b) / y)
else
tmp = ((a ** (t - 1.0d0)) * x) / 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 <= -5.6e+42) || !(b <= 6e+49)) {
tmp = x * (Math.exp(-b) / y);
} else {
tmp = (Math.pow(a, (t - 1.0)) * x) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.6e+42) or not (b <= 6e+49): tmp = x * (math.exp(-b) / y) else: tmp = (math.pow(a, (t - 1.0)) * x) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.6e+42) || !(b <= 6e+49)) tmp = Float64(x * Float64(exp(Float64(-b)) / y)); else tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -5.6e+42) || ~((b <= 6e+49))) tmp = x * (exp(-b) / y); else tmp = ((a ^ (t - 1.0)) * x) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5.6e+42], N[Not[LessEqual[b, 6e+49]], $MachinePrecision]], N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.6 \cdot 10^{+42} \lor \neg \left(b \leq 6 \cdot 10^{+49}\right):\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\end{array}
\end{array}
if b < -5.5999999999999999e42 or 6.0000000000000005e49 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6482.7
Applied rewrites82.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.7
Applied rewrites82.7%
if -5.5999999999999999e42 < b < 6.0000000000000005e49Initial program 97.8%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6487.1
Applied rewrites87.1%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-to-expN/A
lift-pow.f64N/A
lift--.f6471.0
Applied rewrites71.0%
Final simplification76.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.9e+44) (not (<= b 6e+49))) (* x (/ (exp (- b)) y)) (* x (/ (pow a t) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.9e+44) || !(b <= 6e+49)) {
tmp = x * (exp(-b) / y);
} else {
tmp = x * (pow(a, t) / 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 <= (-2.9d+44)) .or. (.not. (b <= 6d+49))) then
tmp = x * (exp(-b) / y)
else
tmp = x * ((a ** t) / 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 <= -2.9e+44) || !(b <= 6e+49)) {
tmp = x * (Math.exp(-b) / y);
} else {
tmp = x * (Math.pow(a, t) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.9e+44) or not (b <= 6e+49): tmp = x * (math.exp(-b) / y) else: tmp = x * (math.pow(a, t) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.9e+44) || !(b <= 6e+49)) tmp = Float64(x * Float64(exp(Float64(-b)) / y)); else tmp = Float64(x * Float64((a ^ t) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.9e+44) || ~((b <= 6e+49))) tmp = x * (exp(-b) / y); else tmp = x * ((a ^ t) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.9e+44], N[Not[LessEqual[b, 6e+49]], $MachinePrecision]], N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[Power[a, t], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.9 \cdot 10^{+44} \lor \neg \left(b \leq 6 \cdot 10^{+49}\right):\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{{a}^{t}}{y}\\
\end{array}
\end{array}
if b < -2.9000000000000002e44 or 6.0000000000000005e49 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6482.7
Applied rewrites82.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.7
Applied rewrites82.7%
if -2.9000000000000002e44 < b < 6.0000000000000005e49Initial program 97.8%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6487.1
Applied rewrites87.1%
Taylor expanded in y around 0
pow-to-expN/A
lift-pow.f64N/A
lift--.f6471.7
Applied rewrites71.7%
Taylor expanded in t around inf
Applied rewrites58.5%
Final simplification69.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.55e-16) (not (<= t 1.75))) (* x (/ (pow a t) y)) (* x (/ (/ 1.0 a) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.55e-16) || !(t <= 1.75)) {
tmp = x * (pow(a, t) / 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 ((t <= (-1.55d-16)) .or. (.not. (t <= 1.75d0))) then
tmp = x * ((a ** t) / 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 ((t <= -1.55e-16) || !(t <= 1.75)) {
tmp = x * (Math.pow(a, t) / y);
} else {
tmp = x * ((1.0 / a) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.55e-16) or not (t <= 1.75): tmp = x * (math.pow(a, t) / y) else: tmp = x * ((1.0 / a) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.55e-16) || !(t <= 1.75)) tmp = Float64(x * Float64((a ^ t) / 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 ((t <= -1.55e-16) || ~((t <= 1.75))) tmp = x * ((a ^ t) / y); else tmp = x * ((1.0 / a) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.55e-16], N[Not[LessEqual[t, 1.75]], $MachinePrecision]], N[(x * N[(N[Power[a, t], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(N[(1.0 / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.55 \cdot 10^{-16} \lor \neg \left(t \leq 1.75\right):\\
\;\;\;\;x \cdot \frac{{a}^{t}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{\frac{1}{a}}{y}\\
\end{array}
\end{array}
if t < -1.55e-16 or 1.75 < t Initial program 100.0%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6468.8
Applied rewrites68.8%
Taylor expanded in y around 0
pow-to-expN/A
lift-pow.f64N/A
lift--.f6480.5
Applied rewrites80.5%
Taylor expanded in t around inf
Applied rewrites80.5%
if -1.55e-16 < t < 1.75Initial program 97.7%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6473.1
Applied rewrites73.1%
Taylor expanded in t around 0
lower-/.f64N/A
lift-pow.f6472.7
Applied rewrites72.7%
Taylor expanded in y around 0
Applied rewrites36.3%
Final simplification57.2%
(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.8%
Taylor expanded in b around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
pow-to-expN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-pow.f64N/A
lift--.f6471.0
Applied rewrites71.0%
Taylor expanded in t around 0
lower-/.f64N/A
lift-pow.f6460.5
Applied rewrites60.5%
Taylor expanded in y around 0
Applied rewrites30.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow a (- t 1.0)))
(t_2 (/ (* x (/ t_1 y)) (- (+ b 1.0) (* y (log z))))))
(if (< t -0.8845848504127471)
t_2
(if (< t 852031.2288374073)
(/ (* (/ x y) t_1) (exp (- b (* (log z) y))))
t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = pow(a, (t - 1.0));
double t_2 = (x * (t_1 / y)) / ((b + 1.0) - (y * log(z)));
double tmp;
if (t < -0.8845848504127471) {
tmp = t_2;
} else if (t < 852031.2288374073) {
tmp = ((x / y) * t_1) / exp((b - (log(z) * 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 = a ** (t - 1.0d0)
t_2 = (x * (t_1 / y)) / ((b + 1.0d0) - (y * log(z)))
if (t < (-0.8845848504127471d0)) then
tmp = t_2
else if (t < 852031.2288374073d0) then
tmp = ((x / y) * t_1) / exp((b - (log(z) * 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.pow(a, (t - 1.0));
double t_2 = (x * (t_1 / y)) / ((b + 1.0) - (y * Math.log(z)));
double tmp;
if (t < -0.8845848504127471) {
tmp = t_2;
} else if (t < 852031.2288374073) {
tmp = ((x / y) * t_1) / Math.exp((b - (Math.log(z) * y)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.pow(a, (t - 1.0)) t_2 = (x * (t_1 / y)) / ((b + 1.0) - (y * math.log(z))) tmp = 0 if t < -0.8845848504127471: tmp = t_2 elif t < 852031.2288374073: tmp = ((x / y) * t_1) / math.exp((b - (math.log(z) * y))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = a ^ Float64(t - 1.0) t_2 = Float64(Float64(x * Float64(t_1 / y)) / Float64(Float64(b + 1.0) - Float64(y * log(z)))) tmp = 0.0 if (t < -0.8845848504127471) tmp = t_2; elseif (t < 852031.2288374073) tmp = Float64(Float64(Float64(x / y) * t_1) / exp(Float64(b - Float64(log(z) * y)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a ^ (t - 1.0); t_2 = (x * (t_1 / y)) / ((b + 1.0) - (y * log(z))); tmp = 0.0; if (t < -0.8845848504127471) tmp = t_2; elseif (t < 852031.2288374073) tmp = ((x / y) * t_1) / exp((b - (log(z) * y))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] / N[(N[(b + 1.0), $MachinePrecision] - N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -0.8845848504127471], t$95$2, If[Less[t, 852031.2288374073], N[(N[(N[(x / y), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Exp[N[(b - N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {a}^{\left(t - 1\right)}\\
t_2 := \frac{x \cdot \frac{t\_1}{y}}{\left(b + 1\right) - y \cdot \log z}\\
\mathbf{if}\;t < -0.8845848504127471:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 852031.2288374073:\\
\;\;\;\;\frac{\frac{x}{y} \cdot t\_1}{e^{b - \log z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2025051
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -8845848504127471/10000000000000000) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))) (if (< t 8520312288374073/10000000000) (/ (* (/ x y) (pow a (- t 1))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))))))
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))