
(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.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a))))
(if (or (<= t_1 -640.0) (not (<= t_1 331.2)))
(/ (* x (exp (- (* (log a) t) b))) y)
(* (/ (/ (pow z y) y) a) x))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * log(a);
double tmp;
if ((t_1 <= -640.0) || !(t_1 <= 331.2)) {
tmp = (x * exp(((log(a) * t) - b))) / y;
} else {
tmp = ((pow(z, y) / y) / a) * x;
}
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 = (t - 1.0d0) * log(a)
if ((t_1 <= (-640.0d0)) .or. (.not. (t_1 <= 331.2d0))) then
tmp = (x * exp(((log(a) * t) - b))) / y
else
tmp = (((z ** y) / y) / a) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * Math.log(a);
double tmp;
if ((t_1 <= -640.0) || !(t_1 <= 331.2)) {
tmp = (x * Math.exp(((Math.log(a) * t) - b))) / y;
} else {
tmp = ((Math.pow(z, y) / y) / a) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 1.0) * math.log(a) tmp = 0 if (t_1 <= -640.0) or not (t_1 <= 331.2): tmp = (x * math.exp(((math.log(a) * t) - b))) / y else: tmp = ((math.pow(z, y) / y) / a) * x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * log(a)) tmp = 0.0 if ((t_1 <= -640.0) || !(t_1 <= 331.2)) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * t) - b))) / y); else tmp = Float64(Float64(Float64((z ^ y) / y) / a) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - 1.0) * log(a); tmp = 0.0; if ((t_1 <= -640.0) || ~((t_1 <= 331.2))) tmp = (x * exp(((log(a) * t) - b))) / y; else tmp = (((z ^ y) / y) / a) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -640.0], N[Not[LessEqual[t$95$1, 331.2]], $MachinePrecision]], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(N[Power[z, y], $MachinePrecision] / y), $MachinePrecision] / a), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
\mathbf{if}\;t\_1 \leq -640 \lor \neg \left(t\_1 \leq 331.2\right):\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot t - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{z}^{y}}{y}}{a} \cdot x\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -640 or 331.199999999999989 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 99.6%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6484.8
Applied rewrites84.8%
if -640 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 331.199999999999989Initial program 94.4%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6473.4
Applied rewrites73.4%
Taylor expanded in y around 0
exp-to-powN/A
lower-pow.f64N/A
lower--.f6443.6
Applied rewrites43.6%
Taylor expanded in t around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lower-pow.f6479.6
Applied rewrites79.6%
Final simplification83.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9.5e+26) (not (<= b 1.0))) (/ (* x (exp (- (* (log z) y) b))) y) (/ (* x (* (fma -1.0 b 1.0) (* (pow a (- t 1.0)) (pow z y)))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.5e+26) || !(b <= 1.0)) {
tmp = (x * exp(((log(z) * y) - b))) / y;
} else {
tmp = (x * (fma(-1.0, b, 1.0) * (pow(a, (t - 1.0)) * pow(z, y)))) / y;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9.5e+26) || !(b <= 1.0)) tmp = Float64(Float64(x * exp(Float64(Float64(log(z) * y) - b))) / y); else tmp = Float64(Float64(x * Float64(fma(-1.0, b, 1.0) * Float64((a ^ Float64(t - 1.0)) * (z ^ y)))) / y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9.5e+26], N[Not[LessEqual[b, 1.0]], $MachinePrecision]], N[(N[(x * N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[(N[(-1.0 * b + 1.0), $MachinePrecision] * N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * N[Power[z, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.5 \cdot 10^{+26} \lor \neg \left(b \leq 1\right):\\
\;\;\;\;\frac{x \cdot e^{\log z \cdot y - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(\mathsf{fma}\left(-1, b, 1\right) \cdot \left({a}^{\left(t - 1\right)} \cdot {z}^{y}\right)\right)}{y}\\
\end{array}
\end{array}
if b < -9.50000000000000054e26 or 1 < b Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6491.3
Applied rewrites91.3%
if -9.50000000000000054e26 < b < 1Initial program 96.2%
Taylor expanded in b around 0
associate-*r*N/A
mul-1-negN/A
distribute-rgt1-inN/A
lower-*.f64N/A
mul-1-negN/A
lower-fma.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
Applied rewrites84.7%
Final simplification88.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow a (- t 1.0))) (t_2 (/ (* x (exp (- (* (log z) y) b))) y)))
(if (<= b -5e+68)
t_2
(if (<= b 3.5e-222)
(/ (* t_1 x) y)
(if (<= b 1.8) (* (* t_1 (pow z y)) (/ x 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 * exp(((log(z) * y) - b))) / y;
double tmp;
if (b <= -5e+68) {
tmp = t_2;
} else if (b <= 3.5e-222) {
tmp = (t_1 * x) / y;
} else if (b <= 1.8) {
tmp = (t_1 * pow(z, y)) * (x / 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 * exp(((log(z) * y) - b))) / y
if (b <= (-5d+68)) then
tmp = t_2
else if (b <= 3.5d-222) then
tmp = (t_1 * x) / y
else if (b <= 1.8d0) then
tmp = (t_1 * (z ** y)) * (x / 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 * Math.exp(((Math.log(z) * y) - b))) / y;
double tmp;
if (b <= -5e+68) {
tmp = t_2;
} else if (b <= 3.5e-222) {
tmp = (t_1 * x) / y;
} else if (b <= 1.8) {
tmp = (t_1 * Math.pow(z, y)) * (x / 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 * math.exp(((math.log(z) * y) - b))) / y tmp = 0 if b <= -5e+68: tmp = t_2 elif b <= 3.5e-222: tmp = (t_1 * x) / y elif b <= 1.8: tmp = (t_1 * math.pow(z, y)) * (x / 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 * exp(Float64(Float64(log(z) * y) - b))) / y) tmp = 0.0 if (b <= -5e+68) tmp = t_2; elseif (b <= 3.5e-222) tmp = Float64(Float64(t_1 * x) / y); elseif (b <= 1.8) tmp = Float64(Float64(t_1 * (z ^ y)) * Float64(x / 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 * exp(((log(z) * y) - b))) / y; tmp = 0.0; if (b <= -5e+68) tmp = t_2; elseif (b <= 3.5e-222) tmp = (t_1 * x) / y; elseif (b <= 1.8) tmp = (t_1 * (z ^ y)) * (x / 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[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[b, -5e+68], t$95$2, If[LessEqual[b, 3.5e-222], N[(N[(t$95$1 * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[b, 1.8], N[(N[(t$95$1 * N[Power[z, y], $MachinePrecision]), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {a}^{\left(t - 1\right)}\\
t_2 := \frac{x \cdot e^{\log z \cdot y - b}}{y}\\
\mathbf{if}\;b \leq -5 \cdot 10^{+68}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{-222}:\\
\;\;\;\;\frac{t\_1 \cdot x}{y}\\
\mathbf{elif}\;b \leq 1.8:\\
\;\;\;\;\left(t\_1 \cdot {z}^{y}\right) \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -5.0000000000000004e68 or 1.80000000000000004 < b Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6492.2
Applied rewrites92.2%
if -5.0000000000000004e68 < b < 3.50000000000000024e-222Initial program 97.5%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6466.6
Applied rewrites66.6%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f6482.6
Applied rewrites82.6%
if 3.50000000000000024e-222 < b < 1.80000000000000004Initial program 94.5%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6491.3
Applied rewrites91.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log z) y) b))) y)))
(if (<= b -5e+68)
t_1
(if (<= b 6.8e-156)
(/ (* (pow a (- t 1.0)) x) y)
(if (<= b 4.6e-8) (* (/ (pow z y) a) (/ x y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp(((log(z) * y) - b))) / y;
double tmp;
if (b <= -5e+68) {
tmp = t_1;
} else if (b <= 6.8e-156) {
tmp = (pow(a, (t - 1.0)) * x) / y;
} else if (b <= 4.6e-8) {
tmp = (pow(z, y) / a) * (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 * exp(((log(z) * y) - b))) / y
if (b <= (-5d+68)) then
tmp = t_1
else if (b <= 6.8d-156) then
tmp = ((a ** (t - 1.0d0)) * x) / y
else if (b <= 4.6d-8) then
tmp = ((z ** y) / a) * (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.exp(((Math.log(z) * y) - b))) / y;
double tmp;
if (b <= -5e+68) {
tmp = t_1;
} else if (b <= 6.8e-156) {
tmp = (Math.pow(a, (t - 1.0)) * x) / y;
} else if (b <= 4.6e-8) {
tmp = (Math.pow(z, y) / a) * (x / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp(((math.log(z) * y) - b))) / y tmp = 0 if b <= -5e+68: tmp = t_1 elif b <= 6.8e-156: tmp = (math.pow(a, (t - 1.0)) * x) / y elif b <= 4.6e-8: tmp = (math.pow(z, y) / a) * (x / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(log(z) * y) - b))) / y) tmp = 0.0 if (b <= -5e+68) tmp = t_1; elseif (b <= 6.8e-156) tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / y); elseif (b <= 4.6e-8) tmp = Float64(Float64((z ^ y) / a) * Float64(x / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp(((log(z) * y) - b))) / y; tmp = 0.0; if (b <= -5e+68) tmp = t_1; elseif (b <= 6.8e-156) tmp = ((a ^ (t - 1.0)) * x) / y; elseif (b <= 4.6e-8) tmp = ((z ^ y) / a) * (x / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[b, -5e+68], t$95$1, If[LessEqual[b, 6.8e-156], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[b, 4.6e-8], N[(N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\log z \cdot y - b}}{y}\\
\mathbf{if}\;b \leq -5 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.8 \cdot 10^{-156}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{-8}:\\
\;\;\;\;\frac{{z}^{y}}{a} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -5.0000000000000004e68 or 4.6000000000000002e-8 < b Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6491.5
Applied rewrites91.5%
if -5.0000000000000004e68 < b < 6.79999999999999981e-156Initial program 97.0%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6470.4
Applied rewrites70.4%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f6483.4
Applied rewrites83.4%
if 6.79999999999999981e-156 < b < 4.6000000000000002e-8Initial program 94.5%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6490.1
Applied rewrites90.1%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f6478.1
Applied rewrites78.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9.5e+26) (not (<= b 2.0))) (/ (* x (exp (- (* (log z) y) b))) y) (/ (* (* x (pow z y)) (pow a (- t 1.0))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.5e+26) || !(b <= 2.0)) {
tmp = (x * exp(((log(z) * y) - b))) / y;
} else {
tmp = ((x * pow(z, y)) * 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 <= (-9.5d+26)) .or. (.not. (b <= 2.0d0))) then
tmp = (x * exp(((log(z) * y) - b))) / y
else
tmp = ((x * (z ** y)) * (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 <= -9.5e+26) || !(b <= 2.0)) {
tmp = (x * Math.exp(((Math.log(z) * y) - b))) / y;
} else {
tmp = ((x * Math.pow(z, y)) * Math.pow(a, (t - 1.0))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -9.5e+26) or not (b <= 2.0): tmp = (x * math.exp(((math.log(z) * y) - b))) / y else: tmp = ((x * math.pow(z, y)) * math.pow(a, (t - 1.0))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9.5e+26) || !(b <= 2.0)) tmp = Float64(Float64(x * exp(Float64(Float64(log(z) * y) - b))) / y); else tmp = Float64(Float64(Float64(x * (z ^ y)) * (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 <= -9.5e+26) || ~((b <= 2.0))) tmp = (x * exp(((log(z) * y) - b))) / y; else tmp = ((x * (z ^ y)) * (a ^ (t - 1.0))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9.5e+26], N[Not[LessEqual[b, 2.0]], $MachinePrecision]], N[(N[(x * N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] * N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.5 \cdot 10^{+26} \lor \neg \left(b \leq 2\right):\\
\;\;\;\;\frac{x \cdot e^{\log z \cdot y - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(x \cdot {z}^{y}\right) \cdot {a}^{\left(t - 1\right)}}{y}\\
\end{array}
\end{array}
if b < -9.50000000000000054e26 or 2 < b Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6491.3
Applied rewrites91.3%
if -9.50000000000000054e26 < b < 2Initial program 96.2%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f6484.4
Applied rewrites84.4%
Final simplification87.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<= b -9.8e+179)
t_1
(if (<= b 6.8e-156)
(/ (* (pow a (- t 1.0)) x) y)
(if (<= b 880.0) (* (/ (pow z y) a) (/ x y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (exp(-b) / y) * x;
double tmp;
if (b <= -9.8e+179) {
tmp = t_1;
} else if (b <= 6.8e-156) {
tmp = (pow(a, (t - 1.0)) * x) / y;
} else if (b <= 880.0) {
tmp = (pow(z, y) / a) * (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 = (exp(-b) / y) * x
if (b <= (-9.8d+179)) then
tmp = t_1
else if (b <= 6.8d-156) then
tmp = ((a ** (t - 1.0d0)) * x) / y
else if (b <= 880.0d0) then
tmp = ((z ** y) / a) * (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 = (Math.exp(-b) / y) * x;
double tmp;
if (b <= -9.8e+179) {
tmp = t_1;
} else if (b <= 6.8e-156) {
tmp = (Math.pow(a, (t - 1.0)) * x) / y;
} else if (b <= 880.0) {
tmp = (Math.pow(z, y) / a) * (x / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.exp(-b) / y) * x tmp = 0 if b <= -9.8e+179: tmp = t_1 elif b <= 6.8e-156: tmp = (math.pow(a, (t - 1.0)) * x) / y elif b <= 880.0: tmp = (math.pow(z, y) / a) * (x / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(exp(Float64(-b)) / y) * x) tmp = 0.0 if (b <= -9.8e+179) tmp = t_1; elseif (b <= 6.8e-156) tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / y); elseif (b <= 880.0) tmp = Float64(Float64((z ^ y) / a) * Float64(x / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (exp(-b) / y) * x; tmp = 0.0; if (b <= -9.8e+179) tmp = t_1; elseif (b <= 6.8e-156) tmp = ((a ^ (t - 1.0)) * x) / y; elseif (b <= 880.0) tmp = ((z ^ y) / a) * (x / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -9.8e+179], t$95$1, If[LessEqual[b, 6.8e-156], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[b, 880.0], N[(N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -9.8 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.8 \cdot 10^{-156}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{elif}\;b \leq 880:\\
\;\;\;\;\frac{{z}^{y}}{a} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.7999999999999997e179 or 880 < b Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6491.3
Applied rewrites91.3%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6483.6
Applied rewrites83.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6483.6
Applied rewrites83.6%
if -9.7999999999999997e179 < b < 6.79999999999999981e-156Initial program 97.5%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6471.1
Applied rewrites71.1%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f6481.9
Applied rewrites81.9%
if 6.79999999999999981e-156 < b < 880Initial program 94.8%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f6476.5
Applied rewrites76.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<= b -9.8e+179)
t_1
(if (<= b 7.8e-155)
(/ (* (pow a (- t 1.0)) x) y)
(if (<= b 800.0) (/ (* x (pow z y)) (* a y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (exp(-b) / y) * x;
double tmp;
if (b <= -9.8e+179) {
tmp = t_1;
} else if (b <= 7.8e-155) {
tmp = (pow(a, (t - 1.0)) * x) / y;
} else if (b <= 800.0) {
tmp = (x * pow(z, y)) / (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 = (exp(-b) / y) * x
if (b <= (-9.8d+179)) then
tmp = t_1
else if (b <= 7.8d-155) then
tmp = ((a ** (t - 1.0d0)) * x) / y
else if (b <= 800.0d0) then
tmp = (x * (z ** y)) / (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 = (Math.exp(-b) / y) * x;
double tmp;
if (b <= -9.8e+179) {
tmp = t_1;
} else if (b <= 7.8e-155) {
tmp = (Math.pow(a, (t - 1.0)) * x) / y;
} else if (b <= 800.0) {
tmp = (x * Math.pow(z, y)) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.exp(-b) / y) * x tmp = 0 if b <= -9.8e+179: tmp = t_1 elif b <= 7.8e-155: tmp = (math.pow(a, (t - 1.0)) * x) / y elif b <= 800.0: tmp = (x * math.pow(z, y)) / (a * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(exp(Float64(-b)) / y) * x) tmp = 0.0 if (b <= -9.8e+179) tmp = t_1; elseif (b <= 7.8e-155) tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / y); elseif (b <= 800.0) tmp = Float64(Float64(x * (z ^ y)) / Float64(a * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (exp(-b) / y) * x; tmp = 0.0; if (b <= -9.8e+179) tmp = t_1; elseif (b <= 7.8e-155) tmp = ((a ^ (t - 1.0)) * x) / y; elseif (b <= 800.0) tmp = (x * (z ^ y)) / (a * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -9.8e+179], t$95$1, If[LessEqual[b, 7.8e-155], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[b, 800.0], N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -9.8 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 7.8 \cdot 10^{-155}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{elif}\;b \leq 800:\\
\;\;\;\;\frac{x \cdot {z}^{y}}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.7999999999999997e179 or 800 < b Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6491.3
Applied rewrites91.3%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6483.6
Applied rewrites83.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6483.6
Applied rewrites83.6%
if -9.7999999999999997e179 < b < 7.8000000000000006e-155Initial program 97.5%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6471.1
Applied rewrites71.1%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f6481.9
Applied rewrites81.9%
if 7.8000000000000006e-155 < b < 800Initial program 94.8%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
Taylor expanded in t around 0
*-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6473.8
Applied rewrites73.8%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6474.6
Applied rewrites74.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<= b -9.8e+179)
t_1
(if (<= b 9.5e-155)
(/ (* (pow a (- t 1.0)) x) y)
(if (<= b 800.0) (* (pow z y) (/ x (* a y))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (exp(-b) / y) * x;
double tmp;
if (b <= -9.8e+179) {
tmp = t_1;
} else if (b <= 9.5e-155) {
tmp = (pow(a, (t - 1.0)) * x) / y;
} else if (b <= 800.0) {
tmp = pow(z, y) * (x / (a * y));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (exp(-b) / y) * x
if (b <= (-9.8d+179)) then
tmp = t_1
else if (b <= 9.5d-155) then
tmp = ((a ** (t - 1.0d0)) * x) / y
else if (b <= 800.0d0) then
tmp = (z ** y) * (x / (a * y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.exp(-b) / y) * x;
double tmp;
if (b <= -9.8e+179) {
tmp = t_1;
} else if (b <= 9.5e-155) {
tmp = (Math.pow(a, (t - 1.0)) * x) / y;
} else if (b <= 800.0) {
tmp = Math.pow(z, y) * (x / (a * y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.exp(-b) / y) * x tmp = 0 if b <= -9.8e+179: tmp = t_1 elif b <= 9.5e-155: tmp = (math.pow(a, (t - 1.0)) * x) / y elif b <= 800.0: tmp = math.pow(z, y) * (x / (a * y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(exp(Float64(-b)) / y) * x) tmp = 0.0 if (b <= -9.8e+179) tmp = t_1; elseif (b <= 9.5e-155) tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / y); elseif (b <= 800.0) tmp = Float64((z ^ y) * Float64(x / Float64(a * y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (exp(-b) / y) * x; tmp = 0.0; if (b <= -9.8e+179) tmp = t_1; elseif (b <= 9.5e-155) tmp = ((a ^ (t - 1.0)) * x) / y; elseif (b <= 800.0) tmp = (z ^ y) * (x / (a * y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -9.8e+179], t$95$1, If[LessEqual[b, 9.5e-155], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[b, 800.0], N[(N[Power[z, y], $MachinePrecision] * N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -9.8 \cdot 10^{+179}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 9.5 \cdot 10^{-155}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{elif}\;b \leq 800:\\
\;\;\;\;{z}^{y} \cdot \frac{x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.7999999999999997e179 or 800 < b Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6491.3
Applied rewrites91.3%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6483.6
Applied rewrites83.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6483.6
Applied rewrites83.6%
if -9.7999999999999997e179 < b < 9.50000000000000024e-155Initial program 97.5%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6471.1
Applied rewrites71.1%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f6481.9
Applied rewrites81.9%
if 9.50000000000000024e-155 < b < 800Initial program 94.8%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6487.7
Applied rewrites87.7%
Taylor expanded in t around 0
*-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6473.8
Applied rewrites73.8%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6471.6
Applied rewrites71.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9.8e+179) (not (<= b 2.0))) (* (/ (exp (- b)) y) x) (/ (* (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 <= -9.8e+179) || !(b <= 2.0)) {
tmp = (exp(-b) / y) * x;
} 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 <= (-9.8d+179)) .or. (.not. (b <= 2.0d0))) then
tmp = (exp(-b) / y) * x
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 <= -9.8e+179) || !(b <= 2.0)) {
tmp = (Math.exp(-b) / y) * x;
} else {
tmp = (Math.pow(a, (t - 1.0)) * x) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -9.8e+179) or not (b <= 2.0): tmp = (math.exp(-b) / y) * x 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 <= -9.8e+179) || !(b <= 2.0)) tmp = Float64(Float64(exp(Float64(-b)) / y) * x); 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 <= -9.8e+179) || ~((b <= 2.0))) tmp = (exp(-b) / y) * x; else tmp = ((a ^ (t - 1.0)) * x) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9.8e+179], N[Not[LessEqual[b, 2.0]], $MachinePrecision]], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $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 -9.8 \cdot 10^{+179} \lor \neg \left(b \leq 2\right):\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\end{array}
\end{array}
if b < -9.7999999999999997e179 or 2 < b Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6490.3
Applied rewrites90.3%
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
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.7
Applied rewrites82.7%
if -9.7999999999999997e179 < b < 2Initial program 97.0%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6474.8
Applied rewrites74.8%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f6477.7
Applied rewrites77.7%
Final simplification79.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -7e+26) (not (<= b 8.5e-8))) (* (/ (exp (- b)) y) x) (* (/ 1.0 a) (/ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -7e+26) || !(b <= 8.5e-8)) {
tmp = (exp(-b) / y) * x;
} else {
tmp = (1.0 / a) * (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 <= (-7d+26)) .or. (.not. (b <= 8.5d-8))) then
tmp = (exp(-b) / y) * x
else
tmp = (1.0d0 / a) * (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 <= -7e+26) || !(b <= 8.5e-8)) {
tmp = (Math.exp(-b) / y) * x;
} else {
tmp = (1.0 / a) * (x / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -7e+26) or not (b <= 8.5e-8): tmp = (math.exp(-b) / y) * x else: tmp = (1.0 / a) * (x / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -7e+26) || !(b <= 8.5e-8)) tmp = Float64(Float64(exp(Float64(-b)) / y) * x); else tmp = Float64(Float64(1.0 / a) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -7e+26) || ~((b <= 8.5e-8))) tmp = (exp(-b) / y) * x; else tmp = (1.0 / a) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -7e+26], N[Not[LessEqual[b, 8.5e-8]], $MachinePrecision]], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], N[(N[(1.0 / a), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{+26} \lor \neg \left(b \leq 8.5 \cdot 10^{-8}\right):\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{a} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if b < -6.9999999999999998e26 or 8.49999999999999935e-8 < b Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6488.3
Applied rewrites88.3%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6479.7
Applied rewrites79.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.7
Applied rewrites79.7%
if -6.9999999999999998e26 < b < 8.49999999999999935e-8Initial program 96.2%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6474.9
Applied rewrites74.9%
Taylor expanded in y around 0
exp-to-powN/A
lower-pow.f64N/A
lower--.f6468.3
Applied rewrites68.3%
Taylor expanded in t around 0
rem-exp-logN/A
rec-expN/A
mul-1-negN/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f6434.5
Applied rewrites34.5%
Taylor expanded in t around 0
lower-/.f6434.5
Applied rewrites34.5%
Final simplification56.8%
(FPCore (x y z t a b) :precision binary64 (/ (* (pow a -1.0) x) y))
double code(double x, double y, double z, double t, double a, double b) {
return (pow(a, -1.0) * x) / 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 = ((a ** (-1.0d0)) * x) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (Math.pow(a, -1.0) * x) / y;
}
def code(x, y, z, t, a, b): return (math.pow(a, -1.0) * x) / y
function code(x, y, z, t, a, b) return Float64(Float64((a ^ -1.0) * x) / y) end
function tmp = code(x, y, z, t, a, b) tmp = ((a ^ -1.0) * x) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[Power[a, -1.0], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{{a}^{-1} \cdot x}{y}
\end{array}
Initial program 98.0%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6462.2
Applied rewrites62.2%
Taylor expanded in y around 0
exp-to-powN/A
lower-pow.f64N/A
lower--.f6458.3
Applied rewrites58.3%
Taylor expanded in t around 0
rem-exp-logN/A
rec-expN/A
mul-1-negN/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f6429.5
Applied rewrites29.5%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6429.9
Applied rewrites29.9%
(FPCore (x y z t a b) :precision binary64 (/ (/ x a) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x / a) / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x / a) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x / a) / y;
}
def code(x, y, z, t, a, b): return (x / a) / y
function code(x, y, z, t, a, b) return Float64(Float64(x / a) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x / a) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{a}}{y}
\end{array}
Initial program 98.0%
Taylor expanded in b around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f6462.2
Applied rewrites62.2%
Taylor expanded in t around 0
*-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-pow.f64N/A
lower-/.f6453.3
Applied rewrites53.3%
Taylor expanded in y around 0
associate-/r*N/A
lower-/.f64N/A
lower-/.f6429.9
Applied rewrites29.9%
(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 2025026
(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))