
(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 16 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 97.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a))) (t_2 (* x (/ (pow a t) y))))
(if (<= t_1 -610.0)
t_2
(if (<= t_1 -5.0)
(* x (pow (* (fma b y y) a) -1.0))
(if (<= t_1 1000.0) (/ (/ 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 * (pow(a, t) / y);
double tmp;
if (t_1 <= -610.0) {
tmp = t_2;
} else if (t_1 <= -5.0) {
tmp = x * pow((fma(b, y, y) * a), -1.0);
} else if (t_1 <= 1000.0) {
tmp = (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(x * Float64((a ^ t) / y)) tmp = 0.0 if (t_1 <= -610.0) tmp = t_2; elseif (t_1 <= -5.0) tmp = Float64(x * (Float64(fma(b, y, y) * a) ^ -1.0)); elseif (t_1 <= 1000.0) tmp = Float64(Float64(x / a) / y); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[(N[Power[a, t], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -610.0], t$95$2, If[LessEqual[t$95$1, -5.0], N[(x * N[Power[N[(N[(b * y + y), $MachinePrecision] * a), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1000.0], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := x \cdot \frac{{a}^{t}}{y}\\
\mathbf{if}\;t\_1 \leq -610:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -5:\\
\;\;\;\;x \cdot {\left(\mathsf{fma}\left(b, y, y\right) \cdot a\right)}^{-1}\\
\mathbf{elif}\;t\_1 \leq 1000:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -610 or 1e3 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) 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--.f6466.4
Applied rewrites66.4%
Taylor expanded in y around 0
pow-to-expN/A
lift-pow.f64N/A
lift--.f6469.8
Applied rewrites69.8%
Taylor expanded in t around inf
Applied rewrites70.5%
if -610 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -5Initial program 86.9%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6474.6
Applied rewrites74.6%
Taylor expanded in t around 0
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6474.6
Applied rewrites74.6%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f6453.2
Applied rewrites53.2%
if -5 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 1e3Initial 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--.f6474.6
Applied rewrites74.6%
lift--.f64N/A
lift-pow.f64N/A
pow-subN/A
unpow1N/A
lower-/.f64N/A
lower-pow.f6474.6
Applied rewrites74.6%
Taylor expanded in y around 0
associate-/r*N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6432.7
Applied rewrites32.7%
Taylor expanded in t around 0
lower-/.f6432.6
Applied rewrites32.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -2.1e+46) (not (<= y 4200000000000.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 <= -2.1e+46) || !(y <= 4200000000000.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 <= (-2.1d+46)) .or. (.not. (y <= 4200000000000.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 <= -2.1e+46) || !(y <= 4200000000000.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 <= -2.1e+46) or not (y <= 4200000000000.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 <= -2.1e+46) || !(y <= 4200000000000.0)) tmp = Float64(x * Float64(Float64((z ^ y) / a) / y)); else tmp = Float64(Float64(x * 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 <= -2.1e+46) || ~((y <= 4200000000000.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, -2.1e+46], N[Not[LessEqual[y, 4200000000000.0]], $MachinePrecision]], N[(x * N[(N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.1 \cdot 10^{+46} \lor \neg \left(y \leq 4200000000000\right):\\
\;\;\;\;x \cdot \frac{\frac{{z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\end{array}
\end{array}
if y < -2.1e46 or 4.2e12 < 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--.f6474.7
Applied rewrites74.7%
Taylor expanded in t around 0
lower-/.f64N/A
lift-pow.f6491.4
Applied rewrites91.4%
if -2.1e46 < y < 4.2e12Initial program 94.7%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6491.8
Applied rewrites91.8%
Final simplification91.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.15e+27)
(* x (/ (exp (- b)) y))
(if (<= b 3e-15)
(* x (/ (* (pow z y) (pow a (- t 1.0))) y))
(/ x (* (* (exp b) y) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+27) {
tmp = x * (exp(-b) / y);
} else if (b <= 3e-15) {
tmp = x * ((pow(z, y) * pow(a, (t - 1.0))) / y);
} else {
tmp = x / ((exp(b) * y) * a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.15d+27)) then
tmp = x * (exp(-b) / y)
else if (b <= 3d-15) then
tmp = x * (((z ** y) * (a ** (t - 1.0d0))) / y)
else
tmp = x / ((exp(b) * y) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+27) {
tmp = x * (Math.exp(-b) / y);
} else if (b <= 3e-15) {
tmp = x * ((Math.pow(z, y) * Math.pow(a, (t - 1.0))) / y);
} else {
tmp = x / ((Math.exp(b) * y) * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.15e+27: tmp = x * (math.exp(-b) / y) elif b <= 3e-15: tmp = x * ((math.pow(z, y) * math.pow(a, (t - 1.0))) / y) else: tmp = x / ((math.exp(b) * y) * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.15e+27) tmp = Float64(x * Float64(exp(Float64(-b)) / y)); elseif (b <= 3e-15) tmp = Float64(x * Float64(Float64((z ^ y) * (a ^ Float64(t - 1.0))) / y)); else tmp = Float64(x / Float64(Float64(exp(b) * y) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.15e+27) tmp = x * (exp(-b) / y); elseif (b <= 3e-15) tmp = x * (((z ^ y) * (a ^ (t - 1.0))) / y); else tmp = x / ((exp(b) * y) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.15e+27], N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-15], 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[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{+27}:\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \frac{{z}^{y} \cdot {a}^{\left(t - 1\right)}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(e^{b} \cdot y\right) \cdot a}\\
\end{array}
\end{array}
if b < -1.15e27Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6485.2
Applied rewrites85.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
if -1.15e27 < b < 3e-15Initial program 94.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--.f6484.3
Applied rewrites84.3%
if 3e-15 < b Initial program 99.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6467.3
Applied rewrites67.3%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6484.7
Applied rewrites84.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.15e+27)
(* x (/ (exp (- b)) y))
(if (<= b 3e-15)
(* x (* (pow z y) (/ (pow a (- t 1.0)) y)))
(/ x (* (* (exp b) y) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+27) {
tmp = x * (exp(-b) / y);
} else if (b <= 3e-15) {
tmp = x * (pow(z, y) * (pow(a, (t - 1.0)) / y));
} else {
tmp = x / ((exp(b) * y) * a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.15d+27)) then
tmp = x * (exp(-b) / y)
else if (b <= 3d-15) then
tmp = x * ((z ** y) * ((a ** (t - 1.0d0)) / y))
else
tmp = x / ((exp(b) * y) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+27) {
tmp = x * (Math.exp(-b) / y);
} else if (b <= 3e-15) {
tmp = x * (Math.pow(z, y) * (Math.pow(a, (t - 1.0)) / y));
} else {
tmp = x / ((Math.exp(b) * y) * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.15e+27: tmp = x * (math.exp(-b) / y) elif b <= 3e-15: tmp = x * (math.pow(z, y) * (math.pow(a, (t - 1.0)) / y)) else: tmp = x / ((math.exp(b) * y) * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.15e+27) tmp = Float64(x * Float64(exp(Float64(-b)) / y)); elseif (b <= 3e-15) tmp = Float64(x * Float64((z ^ y) * Float64((a ^ Float64(t - 1.0)) / y))); else tmp = Float64(x / Float64(Float64(exp(b) * y) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.15e+27) tmp = x * (exp(-b) / y); elseif (b <= 3e-15) tmp = x * ((z ^ y) * ((a ^ (t - 1.0)) / y)); else tmp = x / ((exp(b) * y) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.15e+27], N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-15], N[(x * N[(N[Power[z, y], $MachinePrecision] * N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{+27}:\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-15}:\\
\;\;\;\;x \cdot \left({z}^{y} \cdot \frac{{a}^{\left(t - 1\right)}}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(e^{b} \cdot y\right) \cdot a}\\
\end{array}
\end{array}
if b < -1.15e27Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6485.2
Applied rewrites85.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
if -1.15e27 < b < 3e-15Initial program 94.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--.f6484.3
Applied rewrites84.3%
lift-/.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift--.f64N/A
lift-pow.f64N/A
pow-to-expN/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
lower-/.f64N/A
pow-to-expN/A
lift-pow.f64N/A
lift--.f6481.4
Applied rewrites81.4%
if 3e-15 < b Initial program 99.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6467.3
Applied rewrites67.3%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6484.7
Applied rewrites84.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (/ (pow z y) a) y))))
(if (<= y -1.55e+18)
t_1
(if (<= y 1.6e-173)
(* x (pow (* (* (exp b) y) a) -1.0))
(if (<= y 7.1e-6) (/ (* (pow a (- t 1.0)) x) 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.55e+18) {
tmp = t_1;
} else if (y <= 1.6e-173) {
tmp = x * pow(((exp(b) * y) * a), -1.0);
} else if (y <= 7.1e-6) {
tmp = (pow(a, (t - 1.0)) * x) / 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.55d+18)) then
tmp = t_1
else if (y <= 1.6d-173) then
tmp = x * (((exp(b) * y) * a) ** (-1.0d0))
else if (y <= 7.1d-6) then
tmp = ((a ** (t - 1.0d0)) * x) / 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.55e+18) {
tmp = t_1;
} else if (y <= 1.6e-173) {
tmp = x * Math.pow(((Math.exp(b) * y) * a), -1.0);
} else if (y <= 7.1e-6) {
tmp = (Math.pow(a, (t - 1.0)) * x) / 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.55e+18: tmp = t_1 elif y <= 1.6e-173: tmp = x * math.pow(((math.exp(b) * y) * a), -1.0) elif y <= 7.1e-6: tmp = (math.pow(a, (t - 1.0)) * x) / 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.55e+18) tmp = t_1; elseif (y <= 1.6e-173) tmp = Float64(x * (Float64(Float64(exp(b) * y) * a) ^ -1.0)); elseif (y <= 7.1e-6) tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / 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.55e+18) tmp = t_1; elseif (y <= 1.6e-173) tmp = x * (((exp(b) * y) * a) ^ -1.0); elseif (y <= 7.1e-6) tmp = ((a ^ (t - 1.0)) * x) / 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.55e+18], t$95$1, If[LessEqual[y, 1.6e-173], N[(x * N[Power[N[(N[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision] * a), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.1e-6], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $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.55 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-173}:\\
\;\;\;\;x \cdot {\left(\left(e^{b} \cdot y\right) \cdot a\right)}^{-1}\\
\mathbf{elif}\;y \leq 7.1 \cdot 10^{-6}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.55e18 or 7.0999999999999998e-6 < y Initial program 99.9%
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.3
Applied rewrites71.3%
Taylor expanded in t around 0
lower-/.f64N/A
lift-pow.f6487.4
Applied rewrites87.4%
if -1.55e18 < y < 1.6e-173Initial program 93.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6481.3
Applied rewrites81.3%
Taylor expanded in t around 0
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6474.7
Applied rewrites74.7%
if 1.6e-173 < y < 7.0999999999999998e-6Initial program 95.9%
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.1
Applied rewrites74.1%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-to-expN/A
lift-pow.f64N/A
lift--.f6478.8
Applied rewrites78.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (/ (pow z y) a) y))))
(if (<= y -1.55e+18)
t_1
(if (<= y 1.6e-173)
(/ x (* (* (exp b) y) a))
(if (<= y 7.1e-6) (/ (* (pow a (- t 1.0)) x) 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.55e+18) {
tmp = t_1;
} else if (y <= 1.6e-173) {
tmp = x / ((exp(b) * y) * a);
} else if (y <= 7.1e-6) {
tmp = (pow(a, (t - 1.0)) * x) / 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.55d+18)) then
tmp = t_1
else if (y <= 1.6d-173) then
tmp = x / ((exp(b) * y) * a)
else if (y <= 7.1d-6) then
tmp = ((a ** (t - 1.0d0)) * x) / 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.55e+18) {
tmp = t_1;
} else if (y <= 1.6e-173) {
tmp = x / ((Math.exp(b) * y) * a);
} else if (y <= 7.1e-6) {
tmp = (Math.pow(a, (t - 1.0)) * x) / 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.55e+18: tmp = t_1 elif y <= 1.6e-173: tmp = x / ((math.exp(b) * y) * a) elif y <= 7.1e-6: tmp = (math.pow(a, (t - 1.0)) * x) / 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.55e+18) tmp = t_1; elseif (y <= 1.6e-173) tmp = Float64(x / Float64(Float64(exp(b) * y) * a)); elseif (y <= 7.1e-6) tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / 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.55e+18) tmp = t_1; elseif (y <= 1.6e-173) tmp = x / ((exp(b) * y) * a); elseif (y <= 7.1e-6) tmp = ((a ^ (t - 1.0)) * x) / 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.55e+18], t$95$1, If[LessEqual[y, 1.6e-173], N[(x / N[(N[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.1e-6], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $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.55 \cdot 10^{+18}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.6 \cdot 10^{-173}:\\
\;\;\;\;\frac{x}{\left(e^{b} \cdot y\right) \cdot a}\\
\mathbf{elif}\;y \leq 7.1 \cdot 10^{-6}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.55e18 or 7.0999999999999998e-6 < y Initial program 99.9%
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.3
Applied rewrites71.3%
Taylor expanded in t around 0
lower-/.f64N/A
lift-pow.f6487.4
Applied rewrites87.4%
if -1.55e18 < y < 1.6e-173Initial program 93.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6481.3
Applied rewrites81.3%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6474.7
Applied rewrites74.7%
if 1.6e-173 < y < 7.0999999999999998e-6Initial program 95.9%
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.1
Applied rewrites74.1%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-to-expN/A
lift-pow.f64N/A
lift--.f6478.8
Applied rewrites78.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.15e+18)
(* x (/ (exp (- b)) y))
(if (<= b 9.5e-141)
(* (/ x a) (/ (pow z y) y))
(if (<= b 1.2e-47)
(* x (/ (pow a (- t 1.0)) y))
(/ x (* (* (exp b) y) a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+18) {
tmp = x * (exp(-b) / y);
} else if (b <= 9.5e-141) {
tmp = (x / a) * (pow(z, y) / y);
} else if (b <= 1.2e-47) {
tmp = x * (pow(a, (t - 1.0)) / y);
} else {
tmp = x / ((exp(b) * y) * a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-1.15d+18)) then
tmp = x * (exp(-b) / y)
else if (b <= 9.5d-141) then
tmp = (x / a) * ((z ** y) / y)
else if (b <= 1.2d-47) then
tmp = x * ((a ** (t - 1.0d0)) / y)
else
tmp = x / ((exp(b) * y) * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+18) {
tmp = x * (Math.exp(-b) / y);
} else if (b <= 9.5e-141) {
tmp = (x / a) * (Math.pow(z, y) / y);
} else if (b <= 1.2e-47) {
tmp = x * (Math.pow(a, (t - 1.0)) / y);
} else {
tmp = x / ((Math.exp(b) * y) * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.15e+18: tmp = x * (math.exp(-b) / y) elif b <= 9.5e-141: tmp = (x / a) * (math.pow(z, y) / y) elif b <= 1.2e-47: tmp = x * (math.pow(a, (t - 1.0)) / y) else: tmp = x / ((math.exp(b) * y) * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.15e+18) tmp = Float64(x * Float64(exp(Float64(-b)) / y)); elseif (b <= 9.5e-141) tmp = Float64(Float64(x / a) * Float64((z ^ y) / y)); elseif (b <= 1.2e-47) tmp = Float64(x * Float64((a ^ Float64(t - 1.0)) / y)); else tmp = Float64(x / Float64(Float64(exp(b) * y) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.15e+18) tmp = x * (exp(-b) / y); elseif (b <= 9.5e-141) tmp = (x / a) * ((z ^ y) / y); elseif (b <= 1.2e-47) tmp = x * ((a ^ (t - 1.0)) / y); else tmp = x / ((exp(b) * y) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.15e+18], N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 9.5e-141], N[(N[(x / a), $MachinePrecision] * N[(N[Power[z, y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.2e-47], N[(x * N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(N[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{-141}:\\
\;\;\;\;\frac{x}{a} \cdot \frac{{z}^{y}}{y}\\
\mathbf{elif}\;b \leq 1.2 \cdot 10^{-47}:\\
\;\;\;\;x \cdot \frac{{a}^{\left(t - 1\right)}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(e^{b} \cdot y\right) \cdot a}\\
\end{array}
\end{array}
if b < -1.15e18Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6485.5
Applied rewrites85.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6485.5
Applied rewrites85.5%
if -1.15e18 < b < 9.49999999999999996e-141Initial program 95.3%
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.2
Applied rewrites84.2%
Taylor expanded in t around 0
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f64N/A
lift-pow.f6470.8
Applied rewrites70.8%
if 9.49999999999999996e-141 < b < 1.2e-47Initial program 90.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--.f6480.3
Applied rewrites80.3%
Taylor expanded in y around 0
pow-to-expN/A
lift-pow.f64N/A
lift--.f6481.0
Applied rewrites81.0%
if 1.2e-47 < b Initial program 99.6%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6466.8
Applied rewrites66.8%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6482.9
Applied rewrites82.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4.8e+25) (* x (/ (exp (- b)) y)) (if (<= b 3e-15) (/ (* x (/ (pow a t) a)) y) (/ x (* (* (exp b) y) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.8e+25) {
tmp = x * (exp(-b) / y);
} else if (b <= 3e-15) {
tmp = (x * (pow(a, t) / a)) / y;
} else {
tmp = x / ((exp(b) * y) * a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 <= (-4.8d+25)) then
tmp = x * (exp(-b) / y)
else if (b <= 3d-15) then
tmp = (x * ((a ** t) / a)) / y
else
tmp = x / ((exp(b) * y) * a)
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 <= -4.8e+25) {
tmp = x * (Math.exp(-b) / y);
} else if (b <= 3e-15) {
tmp = (x * (Math.pow(a, t) / a)) / y;
} else {
tmp = x / ((Math.exp(b) * y) * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.8e+25: tmp = x * (math.exp(-b) / y) elif b <= 3e-15: tmp = (x * (math.pow(a, t) / a)) / y else: tmp = x / ((math.exp(b) * y) * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.8e+25) tmp = Float64(x * Float64(exp(Float64(-b)) / y)); elseif (b <= 3e-15) tmp = Float64(Float64(x * Float64((a ^ t) / a)) / y); else tmp = Float64(x / Float64(Float64(exp(b) * y) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4.8e+25) tmp = x * (exp(-b) / y); elseif (b <= 3e-15) tmp = (x * ((a ^ t) / a)) / y; else tmp = x / ((exp(b) * y) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.8e+25], N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-15], N[(N[(x * N[(N[Power[a, t], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(N[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.8 \cdot 10^{+25}:\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-15}:\\
\;\;\;\;\frac{x \cdot \frac{{a}^{t}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(e^{b} \cdot y\right) \cdot a}\\
\end{array}
\end{array}
if b < -4.79999999999999992e25Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6485.2
Applied rewrites85.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
if -4.79999999999999992e25 < b < 3e-15Initial program 94.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--.f6484.3
Applied rewrites84.3%
lift--.f64N/A
lift-pow.f64N/A
pow-subN/A
unpow1N/A
lower-/.f64N/A
lower-pow.f6484.3
Applied rewrites84.3%
Taylor expanded in y around 0
associate-/r*N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6461.2
Applied rewrites61.2%
if 3e-15 < b Initial program 99.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6467.3
Applied rewrites67.3%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6484.7
Applied rewrites84.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b -4.8e+25) (* x (/ (exp (- b)) y)) (if (<= b 3e-15) (/ (* (pow a (- t 1.0)) x) y) (/ x (* (* (exp b) y) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -4.8e+25) {
tmp = x * (exp(-b) / y);
} else if (b <= 3e-15) {
tmp = (pow(a, (t - 1.0)) * x) / y;
} else {
tmp = x / ((exp(b) * y) * a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
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 <= (-4.8d+25)) then
tmp = x * (exp(-b) / y)
else if (b <= 3d-15) then
tmp = ((a ** (t - 1.0d0)) * x) / y
else
tmp = x / ((exp(b) * y) * a)
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 <= -4.8e+25) {
tmp = x * (Math.exp(-b) / y);
} else if (b <= 3e-15) {
tmp = (Math.pow(a, (t - 1.0)) * x) / y;
} else {
tmp = x / ((Math.exp(b) * y) * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -4.8e+25: tmp = x * (math.exp(-b) / y) elif b <= 3e-15: tmp = (math.pow(a, (t - 1.0)) * x) / y else: tmp = x / ((math.exp(b) * y) * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -4.8e+25) tmp = Float64(x * Float64(exp(Float64(-b)) / y)); elseif (b <= 3e-15) tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / y); else tmp = Float64(x / Float64(Float64(exp(b) * y) * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -4.8e+25) tmp = x * (exp(-b) / y); elseif (b <= 3e-15) tmp = ((a ^ (t - 1.0)) * x) / y; else tmp = x / ((exp(b) * y) * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -4.8e+25], N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3e-15], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(N[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4.8 \cdot 10^{+25}:\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-15}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{\left(e^{b} \cdot y\right) \cdot a}\\
\end{array}
\end{array}
if b < -4.79999999999999992e25Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6485.2
Applied rewrites85.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
if -4.79999999999999992e25 < b < 3e-15Initial program 94.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--.f6484.3
Applied rewrites84.3%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-to-expN/A
lift-pow.f64N/A
lift--.f6461.2
Applied rewrites61.2%
if 3e-15 < b Initial program 99.8%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6467.3
Applied rewrites67.3%
Taylor expanded in t around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6484.7
Applied rewrites84.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.8e+25) (not (<= b 14500.0))) (* 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 <= -4.8e+25) || !(b <= 14500.0)) {
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 <= (-4.8d+25)) .or. (.not. (b <= 14500.0d0))) 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 <= -4.8e+25) || !(b <= 14500.0)) {
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 <= -4.8e+25) or not (b <= 14500.0): 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 <= -4.8e+25) || !(b <= 14500.0)) 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 <= -4.8e+25) || ~((b <= 14500.0))) 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, -4.8e+25], N[Not[LessEqual[b, 14500.0]], $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 -4.8 \cdot 10^{+25} \lor \neg \left(b \leq 14500\right):\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\end{array}
\end{array}
if b < -4.79999999999999992e25 or 14500 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6484.6
Applied rewrites84.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.6
Applied rewrites84.6%
if -4.79999999999999992e25 < b < 14500Initial program 94.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--.f6484.6
Applied rewrites84.6%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
pow-to-expN/A
lift-pow.f64N/A
lift--.f6462.0
Applied rewrites62.0%
Final simplification72.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4.5e+25) (not (<= b 15500.0))) (* 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 <= -4.5e+25) || !(b <= 15500.0)) {
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 <= (-4.5d+25)) .or. (.not. (b <= 15500.0d0))) 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 <= -4.5e+25) || !(b <= 15500.0)) {
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 <= -4.5e+25) or not (b <= 15500.0): 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 <= -4.5e+25) || !(b <= 15500.0)) 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 <= -4.5e+25) || ~((b <= 15500.0))) 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, -4.5e+25], N[Not[LessEqual[b, 15500.0]], $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 -4.5 \cdot 10^{+25} \lor \neg \left(b \leq 15500\right):\\
\;\;\;\;x \cdot \frac{e^{-b}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{{a}^{t}}{y}\\
\end{array}
\end{array}
if b < -4.5000000000000003e25 or 15500 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6484.6
Applied rewrites84.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6484.6
Applied rewrites84.6%
if -4.5000000000000003e25 < b < 15500Initial program 94.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--.f6484.6
Applied rewrites84.6%
Taylor expanded in y around 0
pow-to-expN/A
lift-pow.f64N/A
lift--.f6461.1
Applied rewrites61.1%
Taylor expanded in t around inf
Applied rewrites47.6%
Final simplification64.2%
(FPCore (x y z t a b) :precision binary64 (if (<= b 1.15e-165) (/ (/ x a) y) (* x (pow (* (fma b y y) a) -1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 1.15e-165) {
tmp = (x / a) / y;
} else {
tmp = x * pow((fma(b, y, y) * a), -1.0);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 1.15e-165) tmp = Float64(Float64(x / a) / y); else tmp = Float64(x * (Float64(fma(b, y, y) * a) ^ -1.0)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 1.15e-165], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision], N[(x * N[Power[N[(N[(b * y + y), $MachinePrecision] * a), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.15 \cdot 10^{-165}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {\left(\mathsf{fma}\left(b, y, y\right) \cdot a\right)}^{-1}\\
\end{array}
\end{array}
if b < 1.15e-165Initial 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--.f6472.6
Applied rewrites72.6%
lift--.f64N/A
lift-pow.f64N/A
pow-subN/A
unpow1N/A
lower-/.f64N/A
lower-pow.f6472.6
Applied rewrites72.6%
Taylor expanded in y around 0
associate-/r*N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6449.8
Applied rewrites49.8%
Taylor expanded in t around 0
lower-/.f6427.5
Applied rewrites27.5%
if 1.15e-165 < b Initial program 97.0%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6468.6
Applied rewrites68.6%
Taylor expanded in t around 0
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6466.9
Applied rewrites66.9%
Taylor expanded in b around 0
+-commutativeN/A
lower-fma.f6436.0
Applied rewrites36.0%
(FPCore (x y z t a b) :precision binary64 (if (<= x 4e-195) (* x (pow (* y a) -1.0)) (/ (/ x a) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 4e-195) {
tmp = x * pow((y * a), -1.0);
} 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 (x <= 4d-195) then
tmp = x * ((y * a) ** (-1.0d0))
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 (x <= 4e-195) {
tmp = x * Math.pow((y * a), -1.0);
} else {
tmp = (x / a) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 4e-195: tmp = x * math.pow((y * a), -1.0) else: tmp = (x / a) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 4e-195) tmp = Float64(x * (Float64(y * a) ^ -1.0)); 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 (x <= 4e-195) tmp = x * ((y * a) ^ -1.0); else tmp = (x / a) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 4e-195], N[(x * N[Power[N[(y * a), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4 \cdot 10^{-195}:\\
\;\;\;\;x \cdot {\left(y \cdot a\right)}^{-1}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\end{array}
\end{array}
if x < 4.0000000000000004e-195Initial program 95.6%
Taylor expanded in y around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
pow-to-expN/A
lower-/.f64N/A
lower-pow.f64N/A
lift--.f64N/A
lower-exp.f6465.9
Applied rewrites65.9%
Taylor expanded in t around 0
inv-powN/A
lower-pow.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-exp.f6455.0
Applied rewrites55.0%
Taylor expanded in b around 0
Applied rewrites28.7%
if 4.0000000000000004e-195 < x Initial program 99.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--.f6464.4
Applied rewrites64.4%
lift--.f64N/A
lift-pow.f64N/A
pow-subN/A
unpow1N/A
lower-/.f64N/A
lower-pow.f6464.4
Applied rewrites64.4%
Taylor expanded in y around 0
associate-/r*N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6445.3
Applied rewrites45.3%
Taylor expanded in t around 0
lower-/.f6420.2
Applied rewrites20.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x 4.9e-191) (/ x (* a y)) (/ (/ x a) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 4.9e-191) {
tmp = x / (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 (x <= 4.9d-191) then
tmp = x / (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 (x <= 4.9e-191) {
tmp = x / (a * y);
} else {
tmp = (x / a) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 4.9e-191: tmp = x / (a * y) else: tmp = (x / a) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 4.9e-191) tmp = Float64(x / Float64(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 (x <= 4.9e-191) tmp = x / (a * y); else tmp = (x / a) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 4.9e-191], N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 4.9 \cdot 10^{-191}:\\
\;\;\;\;\frac{x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\end{array}
\end{array}
if x < 4.9e-191Initial program 95.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--.f6473.2
Applied rewrites73.2%
lift--.f64N/A
lift-pow.f64N/A
pow-subN/A
unpow1N/A
lower-/.f64N/A
lower-pow.f6473.2
Applied rewrites73.2%
Taylor expanded in y around 0
associate-/r*N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6454.0
Applied rewrites54.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6428.8
Applied rewrites28.8%
if 4.9e-191 < x Initial program 99.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--.f6464.4
Applied rewrites64.4%
lift--.f64N/A
lift-pow.f64N/A
pow-subN/A
unpow1N/A
lower-/.f64N/A
lower-pow.f6464.4
Applied rewrites64.4%
Taylor expanded in y around 0
associate-/r*N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6445.3
Applied rewrites45.3%
Taylor expanded in t around 0
lower-/.f6420.2
Applied rewrites20.2%
(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 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--.f6470.1
Applied rewrites70.1%
lift--.f64N/A
lift-pow.f64N/A
pow-subN/A
unpow1N/A
lower-/.f64N/A
lower-pow.f6470.1
Applied rewrites70.1%
Taylor expanded in y around 0
associate-/r*N/A
lower-/.f64N/A
associate-/l*N/A
lower-*.f64N/A
lift-pow.f64N/A
lift-/.f6450.9
Applied rewrites50.9%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f6424.7
Applied rewrites24.7%
(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 2025037
(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))