
(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]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
Herbie found 14 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]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a)))
(t_2 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= t_1 -2e+30)
t_2
(if (<= t_1 5e+174)
(/ (* x (exp (- (+ (* y (log z)) (* -1.0 (log a))) b))) y)
t_2))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * log(a);
double t_2 = (x * exp(((log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t_1 <= -2e+30) {
tmp = t_2;
} else if (t_1 <= 5e+174) {
tmp = (x * exp((((y * log(z)) + (-1.0 * log(a))) - b))) / y;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - 1.0d0) * log(a)
t_2 = (x * exp(((log(a) * (t - 1.0d0)) - b))) / y
if (t_1 <= (-2d+30)) then
tmp = t_2
else if (t_1 <= 5d+174) then
tmp = (x * exp((((y * log(z)) + ((-1.0d0) * log(a))) - b))) / y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * Math.log(a);
double t_2 = (x * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t_1 <= -2e+30) {
tmp = t_2;
} else if (t_1 <= 5e+174) {
tmp = (x * Math.exp((((y * Math.log(z)) + (-1.0 * Math.log(a))) - b))) / y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 1.0) * math.log(a) t_2 = (x * math.exp(((math.log(a) * (t - 1.0)) - b))) / y tmp = 0 if t_1 <= -2e+30: tmp = t_2 elif t_1 <= 5e+174: tmp = (x * math.exp((((y * math.log(z)) + (-1.0 * math.log(a))) - b))) / y else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * log(a)) t_2 = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y) tmp = 0.0 if (t_1 <= -2e+30) tmp = t_2; elseif (t_1 <= 5e+174) tmp = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(-1.0 * log(a))) - b))) / y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - 1.0) * log(a); t_2 = (x * exp(((log(a) * (t - 1.0)) - b))) / y; tmp = 0.0; if (t_1 <= -2e+30) tmp = t_2; elseif (t_1 <= 5e+174) tmp = (x * exp((((y * log(z)) + (-1.0 * log(a))) - b))) / y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+30], t$95$2, If[LessEqual[t$95$1, 5e+174], N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := \frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+30}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+174}:\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z + -1 \cdot \log a\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -2e30 or 4.9999999999999997e174 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.4%
Applied rewrites79.4%
if -2e30 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 4.9999999999999997e174Initial program 98.4%
Taylor expanded in t around 0
Applied rewrites80.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* y (log z)) b))) y)))
(if (<= y -3.6e+33)
t_1
(if (<= y 10.5)
(/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp(((y * log(z)) - b))) / y;
double tmp;
if (y <= -3.6e+33) {
tmp = t_1;
} else if (y <= 10.5) {
tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * exp(((y * log(z)) - b))) / y
if (y <= (-3.6d+33)) then
tmp = t_1
else if (y <= 10.5d0) then
tmp = (x * exp(((log(a) * (t - 1.0d0)) - b))) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * Math.exp(((y * Math.log(z)) - b))) / y;
double tmp;
if (y <= -3.6e+33) {
tmp = t_1;
} else if (y <= 10.5) {
tmp = (x * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp(((y * math.log(z)) - b))) / y tmp = 0 if y <= -3.6e+33: tmp = t_1 elif y <= 10.5: tmp = (x * math.exp(((math.log(a) * (t - 1.0)) - b))) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(y * log(z)) - b))) / y) tmp = 0.0 if (y <= -3.6e+33) tmp = t_1; elseif (y <= 10.5) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp(((y * log(z)) - b))) / y; tmp = 0.0; if (y <= -3.6e+33) tmp = t_1; elseif (y <= 10.5) tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -3.6e+33], t$95$1, If[LessEqual[y, 10.5], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x \cdot e^{y \cdot \log z - b}}{y}\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 10.5:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -3.6000000000000003e33 or 10.5 < y Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.4%
Applied rewrites79.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower-log.f6471.3%
Applied rewrites71.3%
if -3.6000000000000003e33 < y < 10.5Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.4%
Applied rewrites79.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow a (- t 1.0)))
(t_2 (/ (* x (exp (- (* y (log z)) b))) y)))
(if (<= b -460.0)
t_2
(if (<= b 6e-108)
(* t_1 (/ (* x (pow z y)) y))
(if (<= b 6e+54) (* (/ (* t_1 1.0) (+ y (* b y))) x) 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(((y * log(z)) - b))) / y;
double tmp;
if (b <= -460.0) {
tmp = t_2;
} else if (b <= 6e-108) {
tmp = t_1 * ((x * pow(z, y)) / y);
} else if (b <= 6e+54) {
tmp = ((t_1 * 1.0) / (y + (b * y))) * x;
} 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(((y * log(z)) - b))) / y
if (b <= (-460.0d0)) then
tmp = t_2
else if (b <= 6d-108) then
tmp = t_1 * ((x * (z ** y)) / y)
else if (b <= 6d+54) then
tmp = ((t_1 * 1.0d0) / (y + (b * y))) * x
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(((y * Math.log(z)) - b))) / y;
double tmp;
if (b <= -460.0) {
tmp = t_2;
} else if (b <= 6e-108) {
tmp = t_1 * ((x * Math.pow(z, y)) / y);
} else if (b <= 6e+54) {
tmp = ((t_1 * 1.0) / (y + (b * y))) * x;
} 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(((y * math.log(z)) - b))) / y tmp = 0 if b <= -460.0: tmp = t_2 elif b <= 6e-108: tmp = t_1 * ((x * math.pow(z, y)) / y) elif b <= 6e+54: tmp = ((t_1 * 1.0) / (y + (b * y))) * x 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(y * log(z)) - b))) / y) tmp = 0.0 if (b <= -460.0) tmp = t_2; elseif (b <= 6e-108) tmp = Float64(t_1 * Float64(Float64(x * (z ^ y)) / y)); elseif (b <= 6e+54) tmp = Float64(Float64(Float64(t_1 * 1.0) / Float64(y + Float64(b * y))) * x); 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(((y * log(z)) - b))) / y; tmp = 0.0; if (b <= -460.0) tmp = t_2; elseif (b <= 6e-108) tmp = t_1 * ((x * (z ^ y)) / y); elseif (b <= 6e+54) tmp = ((t_1 * 1.0) / (y + (b * y))) * x; 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[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[b, -460.0], t$95$2, If[LessEqual[b, 6e-108], N[(t$95$1 * N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 6e+54], N[(N[(N[(t$95$1 * 1.0), $MachinePrecision] / N[(y + N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := {a}^{\left(t - 1\right)}\\
t_2 := \frac{x \cdot e^{y \cdot \log z - b}}{y}\\
\mathbf{if}\;b \leq -460:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 6 \cdot 10^{-108}:\\
\;\;\;\;t\_1 \cdot \frac{x \cdot {z}^{y}}{y}\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+54}:\\
\;\;\;\;\frac{t\_1 \cdot 1}{y + b \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if b < -460 or 5.9999999999999998e54 < b Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.4%
Applied rewrites79.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower-log.f6471.3%
Applied rewrites71.3%
if -460 < b < 5.9999999999999999e-108Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
associate-*l/N/A
lower-/.f64N/A
lower-*.f6466.2%
Applied rewrites66.2%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f6466.9%
Applied rewrites66.9%
if 5.9999999999999999e-108 < b < 5.9999999999999998e54Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* y (log z)) b))) y)))
(if (<= b -1.0)
t_1
(if (<= b 5e-245)
(* (/ (* (/ 1.0 a) (pow z y)) (* (+ 1.0 b) y)) x)
(if (<= b 6e+54)
(* (/ (* (pow a (- t 1.0)) 1.0) (+ y (* b y))) x)
t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp(((y * log(z)) - b))) / y;
double tmp;
if (b <= -1.0) {
tmp = t_1;
} else if (b <= 5e-245) {
tmp = (((1.0 / a) * pow(z, y)) / ((1.0 + b) * y)) * x;
} else if (b <= 6e+54) {
tmp = ((pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x;
} 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(((y * log(z)) - b))) / y
if (b <= (-1.0d0)) then
tmp = t_1
else if (b <= 5d-245) then
tmp = (((1.0d0 / a) * (z ** y)) / ((1.0d0 + b) * y)) * x
else if (b <= 6d+54) then
tmp = (((a ** (t - 1.0d0)) * 1.0d0) / (y + (b * y))) * x
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(((y * Math.log(z)) - b))) / y;
double tmp;
if (b <= -1.0) {
tmp = t_1;
} else if (b <= 5e-245) {
tmp = (((1.0 / a) * Math.pow(z, y)) / ((1.0 + b) * y)) * x;
} else if (b <= 6e+54) {
tmp = ((Math.pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp(((y * math.log(z)) - b))) / y tmp = 0 if b <= -1.0: tmp = t_1 elif b <= 5e-245: tmp = (((1.0 / a) * math.pow(z, y)) / ((1.0 + b) * y)) * x elif b <= 6e+54: tmp = ((math.pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(y * log(z)) - b))) / y) tmp = 0.0 if (b <= -1.0) tmp = t_1; elseif (b <= 5e-245) tmp = Float64(Float64(Float64(Float64(1.0 / a) * (z ^ y)) / Float64(Float64(1.0 + b) * y)) * x); elseif (b <= 6e+54) tmp = Float64(Float64(Float64((a ^ Float64(t - 1.0)) * 1.0) / Float64(y + Float64(b * y))) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp(((y * log(z)) - b))) / y; tmp = 0.0; if (b <= -1.0) tmp = t_1; elseif (b <= 5e-245) tmp = (((1.0 / a) * (z ^ y)) / ((1.0 + b) * y)) * x; elseif (b <= 6e+54) tmp = (((a ^ (t - 1.0)) * 1.0) / (y + (b * y))) * x; 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[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[b, -1.0], t$95$1, If[LessEqual[b, 5e-245], N[(N[(N[(N[(1.0 / a), $MachinePrecision] * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[b, 6e+54], N[(N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{x \cdot e^{y \cdot \log z - b}}{y}\\
\mathbf{if}\;b \leq -1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-245}:\\
\;\;\;\;\frac{\frac{1}{a} \cdot {z}^{y}}{\left(1 + b\right) \cdot y} \cdot x\\
\mathbf{elif}\;b \leq 6 \cdot 10^{+54}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot 1}{y + b \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1 or 5.9999999999999998e54 < b Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.4%
Applied rewrites79.4%
Taylor expanded in y around inf
lower-*.f64N/A
lower-log.f6471.3%
Applied rewrites71.3%
if -1 < b < 4.9999999999999997e-245Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in b around 0
lower-+.f6458.3%
Applied rewrites58.3%
Taylor expanded in t around 0
lower-/.f6449.5%
Applied rewrites49.5%
if 4.9999999999999997e-245 < b < 5.9999999999999998e54Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<= b -1.25e+47)
t_1
(if (<= b 5e-245)
(* (/ (* (/ 1.0 a) (pow z y)) (* (+ 1.0 b) y)) x)
(if (<= b 2.95e+72)
(* (/ (* (pow a (- t 1.0)) 1.0) (+ y (* b y))) x)
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 <= -1.25e+47) {
tmp = t_1;
} else if (b <= 5e-245) {
tmp = (((1.0 / a) * pow(z, y)) / ((1.0 + b) * y)) * x;
} else if (b <= 2.95e+72) {
tmp = ((pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x;
} 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 <= (-1.25d+47)) then
tmp = t_1
else if (b <= 5d-245) then
tmp = (((1.0d0 / a) * (z ** y)) / ((1.0d0 + b) * y)) * x
else if (b <= 2.95d+72) then
tmp = (((a ** (t - 1.0d0)) * 1.0d0) / (y + (b * y))) * x
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 <= -1.25e+47) {
tmp = t_1;
} else if (b <= 5e-245) {
tmp = (((1.0 / a) * Math.pow(z, y)) / ((1.0 + b) * y)) * x;
} else if (b <= 2.95e+72) {
tmp = ((Math.pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x;
} 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 <= -1.25e+47: tmp = t_1 elif b <= 5e-245: tmp = (((1.0 / a) * math.pow(z, y)) / ((1.0 + b) * y)) * x elif b <= 2.95e+72: tmp = ((math.pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x 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 <= -1.25e+47) tmp = t_1; elseif (b <= 5e-245) tmp = Float64(Float64(Float64(Float64(1.0 / a) * (z ^ y)) / Float64(Float64(1.0 + b) * y)) * x); elseif (b <= 2.95e+72) tmp = Float64(Float64(Float64((a ^ Float64(t - 1.0)) * 1.0) / Float64(y + Float64(b * y))) * x); 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 <= -1.25e+47) tmp = t_1; elseif (b <= 5e-245) tmp = (((1.0 / a) * (z ^ y)) / ((1.0 + b) * y)) * x; elseif (b <= 2.95e+72) tmp = (((a ^ (t - 1.0)) * 1.0) / (y + (b * y))) * x; 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, -1.25e+47], t$95$1, If[LessEqual[b, 5e-245], N[(N[(N[(N[(1.0 / a), $MachinePrecision] * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(N[(1.0 + b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[b, 2.95e+72], N[(N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -1.25 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5 \cdot 10^{-245}:\\
\;\;\;\;\frac{\frac{1}{a} \cdot {z}^{y}}{\left(1 + b\right) \cdot y} \cdot x\\
\mathbf{elif}\;b \leq 2.95 \cdot 10^{+72}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot 1}{y + b \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1.2500000000000001e47 or 2.9500000000000001e72 < b Initial program 98.4%
Taylor expanded in b around inf
lower-*.f6447.4%
Applied rewrites47.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lift-neg.f64N/A
Applied rewrites43.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-/r/N/A
div-flip-revN/A
associate-/r/N/A
lower-*.f64N/A
div-flip-revN/A
lower-/.f6447.4%
Applied rewrites47.4%
if -1.2500000000000001e47 < b < 4.9999999999999997e-245Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in b around 0
lower-+.f6458.3%
Applied rewrites58.3%
Taylor expanded in t around 0
lower-/.f6449.5%
Applied rewrites49.5%
if 4.9999999999999997e-245 < b < 2.9500000000000001e72Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -8.6e-25)
(* (/ 1.0 a) (* (/ 1.0 (* (exp b) y)) x))
(if (<= b 2.95e+72)
(* (/ (* (pow a (- t 1.0)) 1.0) (+ y (* b y))) x)
(* (/ (exp (- b)) y) x))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.6e-25) {
tmp = (1.0 / a) * ((1.0 / (exp(b) * y)) * x);
} else if (b <= 2.95e+72) {
tmp = ((pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x;
} else {
tmp = (exp(-b) / y) * 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) :: tmp
if (b <= (-8.6d-25)) then
tmp = (1.0d0 / a) * ((1.0d0 / (exp(b) * y)) * x)
else if (b <= 2.95d+72) then
tmp = (((a ** (t - 1.0d0)) * 1.0d0) / (y + (b * y))) * x
else
tmp = (exp(-b) / y) * x
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 <= -8.6e-25) {
tmp = (1.0 / a) * ((1.0 / (Math.exp(b) * y)) * x);
} else if (b <= 2.95e+72) {
tmp = ((Math.pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x;
} else {
tmp = (Math.exp(-b) / y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -8.6e-25: tmp = (1.0 / a) * ((1.0 / (math.exp(b) * y)) * x) elif b <= 2.95e+72: tmp = ((math.pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x else: tmp = (math.exp(-b) / y) * x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.6e-25) tmp = Float64(Float64(1.0 / a) * Float64(Float64(1.0 / Float64(exp(b) * y)) * x)); elseif (b <= 2.95e+72) tmp = Float64(Float64(Float64((a ^ Float64(t - 1.0)) * 1.0) / Float64(y + Float64(b * y))) * x); else tmp = Float64(Float64(exp(Float64(-b)) / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -8.6e-25) tmp = (1.0 / a) * ((1.0 / (exp(b) * y)) * x); elseif (b <= 2.95e+72) tmp = (((a ^ (t - 1.0)) * 1.0) / (y + (b * y))) * x; else tmp = (exp(-b) / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.6e-25], N[(N[(1.0 / a), $MachinePrecision] * N[(N[(1.0 / N[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.95e+72], N[(N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -8.6 \cdot 10^{-25}:\\
\;\;\;\;\frac{1}{a} \cdot \left(\frac{1}{e^{b} \cdot y} \cdot x\right)\\
\mathbf{elif}\;b \leq 2.95 \cdot 10^{+72}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot 1}{y + b \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\end{array}
if b < -8.5999999999999995e-25Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in t around 0
lower-/.f6458.3%
Applied rewrites58.3%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
associate-*l*N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f6458.8%
Applied rewrites58.8%
if -8.5999999999999995e-25 < b < 2.9500000000000001e72Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
if 2.9500000000000001e72 < b Initial program 98.4%
Taylor expanded in b around inf
lower-*.f6447.4%
Applied rewrites47.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lift-neg.f64N/A
Applied rewrites43.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-/r/N/A
div-flip-revN/A
associate-/r/N/A
lower-*.f64N/A
div-flip-revN/A
lower-/.f6447.4%
Applied rewrites47.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<= b -1.45e+15)
t_1
(if (<= b 2.95e+72)
(* (/ (* (pow a (- t 1.0)) 1.0) (+ y (* b y))) x)
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 <= -1.45e+15) {
tmp = t_1;
} else if (b <= 2.95e+72) {
tmp = ((pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x;
} 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 <= (-1.45d+15)) then
tmp = t_1
else if (b <= 2.95d+72) then
tmp = (((a ** (t - 1.0d0)) * 1.0d0) / (y + (b * y))) * x
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 <= -1.45e+15) {
tmp = t_1;
} else if (b <= 2.95e+72) {
tmp = ((Math.pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x;
} 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 <= -1.45e+15: tmp = t_1 elif b <= 2.95e+72: tmp = ((math.pow(a, (t - 1.0)) * 1.0) / (y + (b * y))) * x 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 <= -1.45e+15) tmp = t_1; elseif (b <= 2.95e+72) tmp = Float64(Float64(Float64((a ^ Float64(t - 1.0)) * 1.0) / Float64(y + Float64(b * y))) * x); 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 <= -1.45e+15) tmp = t_1; elseif (b <= 2.95e+72) tmp = (((a ^ (t - 1.0)) * 1.0) / (y + (b * y))) * x; 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, -1.45e+15], t$95$1, If[LessEqual[b, 2.95e+72], N[(N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -1.45 \cdot 10^{+15}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.95 \cdot 10^{+72}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot 1}{y + b \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1.45e15 or 2.9500000000000001e72 < b Initial program 98.4%
Taylor expanded in b around inf
lower-*.f6447.4%
Applied rewrites47.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lift-neg.f64N/A
Applied rewrites43.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-/r/N/A
div-flip-revN/A
associate-/r/N/A
lower-*.f64N/A
div-flip-revN/A
lower-/.f6447.4%
Applied rewrites47.4%
if -1.45e15 < b < 2.9500000000000001e72Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6452.1%
Applied rewrites52.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(/
(*
(fabs x)
(exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b)))
y))
(t_2 (* (/ (exp (- b)) y) (fabs x))))
(*
(copysign 1.0 x)
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 5e+150)
(*
(/
(* (/ 1.0 a) 1.0)
(*
(+
1.0
(* b (+ 1.0 (* b (+ 0.5 (* 0.16666666666666666 b))))))
y))
(fabs x))
t_2)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (fabs(x) * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double t_2 = (exp(-b) / y) * fabs(x);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 5e+150) {
tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * fabs(x);
} else {
tmp = t_2;
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.abs(x) * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
double t_2 = (Math.exp(-b) / y) * Math.abs(x);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 5e+150) {
tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * Math.abs(x);
} else {
tmp = t_2;
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.fabs(x) * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y t_2 = (math.exp(-b) / y) * math.fabs(x) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 5e+150: tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * math.fabs(x) else: tmp = t_2 return math.copysign(1.0, x) * tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(abs(x) * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) t_2 = Float64(Float64(exp(Float64(-b)) / y) * abs(x)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 5e+150) tmp = Float64(Float64(Float64(Float64(1.0 / a) * 1.0) / Float64(Float64(1.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(0.16666666666666666 * b)))))) * y)) * abs(x)); else tmp = t_2; end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (abs(x) * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; t_2 = (exp(-b) / y) * abs(x); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 5e+150) tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * abs(x); else tmp = t_2; end tmp_2 = (sign(x) * abs(1.0)) * tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Abs[x], $MachinePrecision] * 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]}, Block[{t$95$2 = N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 5e+150], N[(N[(N[(N[(1.0 / a), $MachinePrecision] * 1.0), $MachinePrecision] / N[(N[(1.0 + N[(b * N[(1.0 + N[(b * N[(0.5 + N[(0.16666666666666666 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision], t$95$2]]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{\left|x\right| \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
t_2 := \frac{e^{-b}}{y} \cdot \left|x\right|\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+150}:\\
\;\;\;\;\frac{\frac{1}{a} \cdot 1}{\left(1 + b \cdot \left(1 + b \cdot \left(0.5 + 0.16666666666666666 \cdot b\right)\right)\right) \cdot y} \cdot \left|x\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < -inf.0 or 5.0000000000000001e150 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) Initial program 98.4%
Taylor expanded in b around inf
lower-*.f6447.4%
Applied rewrites47.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lift-neg.f64N/A
Applied rewrites43.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
associate-/r/N/A
div-flip-revN/A
associate-/r/N/A
lower-*.f64N/A
div-flip-revN/A
lower-/.f6447.4%
Applied rewrites47.4%
if -inf.0 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 5.0000000000000001e150Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in t around 0
lower-/.f6458.3%
Applied rewrites58.3%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6439.6%
Applied rewrites39.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(/
(*
(fabs x)
(exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b)))
y))
(t_2 (* (exp (- b)) (/ (fabs x) y))))
(*
(copysign 1.0 x)
(if (<= t_1 (- INFINITY))
t_2
(if (<= t_1 5e+150)
(*
(/
(* (/ 1.0 a) 1.0)
(*
(+
1.0
(* b (+ 1.0 (* b (+ 0.5 (* 0.16666666666666666 b))))))
y))
(fabs x))
t_2)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (fabs(x) * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double t_2 = exp(-b) * (fabs(x) / y);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 5e+150) {
tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * fabs(x);
} else {
tmp = t_2;
}
return copysign(1.0, x) * tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.abs(x) * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
double t_2 = Math.exp(-b) * (Math.abs(x) / y);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 5e+150) {
tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * Math.abs(x);
} else {
tmp = t_2;
}
return Math.copySign(1.0, x) * tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.fabs(x) * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y t_2 = math.exp(-b) * (math.fabs(x) / y) tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 5e+150: tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * math.fabs(x) else: tmp = t_2 return math.copysign(1.0, x) * tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(abs(x) * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) t_2 = Float64(exp(Float64(-b)) * Float64(abs(x) / y)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 5e+150) tmp = Float64(Float64(Float64(Float64(1.0 / a) * 1.0) / Float64(Float64(1.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(0.16666666666666666 * b)))))) * y)) * abs(x)); else tmp = t_2; end return Float64(copysign(1.0, x) * tmp) end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (abs(x) * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; t_2 = exp(-b) * (abs(x) / y); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 5e+150) tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * abs(x); else tmp = t_2; end tmp_2 = (sign(x) * abs(1.0)) * tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Abs[x], $MachinePrecision] * 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]}, Block[{t$95$2 = N[(N[Exp[(-b)], $MachinePrecision] * N[(N[Abs[x], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 5e+150], N[(N[(N[(N[(1.0 / a), $MachinePrecision] * 1.0), $MachinePrecision] / N[(N[(1.0 + N[(b * N[(1.0 + N[(b * N[(0.5 + N[(0.16666666666666666 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision], t$95$2]]), $MachinePrecision]]]
\begin{array}{l}
t_1 := \frac{\left|x\right| \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
t_2 := e^{-b} \cdot \frac{\left|x\right|}{y}\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+150}:\\
\;\;\;\;\frac{\frac{1}{a} \cdot 1}{\left(1 + b \cdot \left(1 + b \cdot \left(0.5 + 0.16666666666666666 \cdot b\right)\right)\right) \cdot y} \cdot \left|x\right|\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < -inf.0 or 5.0000000000000001e150 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) Initial program 98.4%
Taylor expanded in b around inf
lower-*.f6447.4%
Applied rewrites47.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
lift-neg.f64N/A
lift-neg.f64N/A
Applied rewrites43.1%
if -inf.0 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 5.0000000000000001e150Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in t around 0
lower-/.f6458.3%
Applied rewrites58.3%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6439.6%
Applied rewrites39.6%
(FPCore (x y z t a b) :precision binary64 (* (/ (* (/ 1.0 a) 1.0) (* (+ 1.0 (* b (+ 1.0 (* b (+ 0.5 (* 0.16666666666666666 b)))))) y)) x))
double code(double x, double y, double z, double t, double a, double b) {
return (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * x;
}
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 = (((1.0d0 / a) * 1.0d0) / ((1.0d0 + (b * (1.0d0 + (b * (0.5d0 + (0.16666666666666666d0 * b)))))) * y)) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * x;
}
def code(x, y, z, t, a, b): return (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * x
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(1.0 / a) * 1.0) / Float64(Float64(1.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(0.16666666666666666 * b)))))) * y)) * x) end
function tmp = code(x, y, z, t, a, b) tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b)))))) * y)) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(1.0 / a), $MachinePrecision] * 1.0), $MachinePrecision] / N[(N[(1.0 + N[(b * N[(1.0 + N[(b * N[(0.5 + N[(0.16666666666666666 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{\frac{1}{a} \cdot 1}{\left(1 + b \cdot \left(1 + b \cdot \left(0.5 + 0.16666666666666666 \cdot b\right)\right)\right) \cdot y} \cdot x
Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in t around 0
lower-/.f6458.3%
Applied rewrites58.3%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6439.6%
Applied rewrites39.6%
(FPCore (x y z t a b) :precision binary64 (* (/ (* (/ 1.0 a) 1.0) (* (+ 1.0 (* b (+ 1.0 (* 0.5 b)))) y)) x))
double code(double x, double y, double z, double t, double a, double b) {
return (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (0.5 * b)))) * y)) * x;
}
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 = (((1.0d0 / a) * 1.0d0) / ((1.0d0 + (b * (1.0d0 + (0.5d0 * b)))) * y)) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (0.5 * b)))) * y)) * x;
}
def code(x, y, z, t, a, b): return (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (0.5 * b)))) * y)) * x
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(1.0 / a) * 1.0) / Float64(Float64(1.0 + Float64(b * Float64(1.0 + Float64(0.5 * b)))) * y)) * x) end
function tmp = code(x, y, z, t, a, b) tmp = (((1.0 / a) * 1.0) / ((1.0 + (b * (1.0 + (0.5 * b)))) * y)) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(1.0 / a), $MachinePrecision] * 1.0), $MachinePrecision] / N[(N[(1.0 + N[(b * N[(1.0 + N[(0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{\frac{1}{a} \cdot 1}{\left(1 + b \cdot \left(1 + 0.5 \cdot b\right)\right) \cdot y} \cdot x
Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in t around 0
lower-/.f6458.3%
Applied rewrites58.3%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6438.3%
Applied rewrites38.3%
(FPCore (x y z t a b) :precision binary64 (* (/ (* (/ 1.0 a) 1.0) (+ y (* b (+ y (* 0.5 (* b y)))))) x))
double code(double x, double y, double z, double t, double a, double b) {
return (((1.0 / a) * 1.0) / (y + (b * (y + (0.5 * (b * y)))))) * x;
}
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 = (((1.0d0 / a) * 1.0d0) / (y + (b * (y + (0.5d0 * (b * y)))))) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((1.0 / a) * 1.0) / (y + (b * (y + (0.5 * (b * y)))))) * x;
}
def code(x, y, z, t, a, b): return (((1.0 / a) * 1.0) / (y + (b * (y + (0.5 * (b * y)))))) * x
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(1.0 / a) * 1.0) / Float64(y + Float64(b * Float64(y + Float64(0.5 * Float64(b * y)))))) * x) end
function tmp = code(x, y, z, t, a, b) tmp = (((1.0 / a) * 1.0) / (y + (b * (y + (0.5 * (b * y)))))) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(1.0 / a), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + N[(b * N[(y + N[(0.5 * N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{\frac{1}{a} \cdot 1}{y + b \cdot \left(y + 0.5 \cdot \left(b \cdot y\right)\right)} \cdot x
Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in t around 0
lower-/.f6458.3%
Applied rewrites58.3%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6437.1%
Applied rewrites37.1%
(FPCore (x y z t a b) :precision binary64 (* (/ (* (/ 1.0 a) 1.0) (+ y (* b y))) x))
double code(double x, double y, double z, double t, double a, double b) {
return (((1.0 / a) * 1.0) / (y + (b * y))) * x;
}
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 = (((1.0d0 / a) * 1.0d0) / (y + (b * y))) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((1.0 / a) * 1.0) / (y + (b * y))) * x;
}
def code(x, y, z, t, a, b): return (((1.0 / a) * 1.0) / (y + (b * y))) * x
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(1.0 / a) * 1.0) / Float64(y + Float64(b * y))) * x) end
function tmp = code(x, y, z, t, a, b) tmp = (((1.0 / a) * 1.0) / (y + (b * y))) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(1.0 / a), $MachinePrecision] * 1.0), $MachinePrecision] / N[(y + N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{\frac{1}{a} \cdot 1}{y + b \cdot y} \cdot x
Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites69.8%
Taylor expanded in y around 0
Applied rewrites68.0%
Taylor expanded in t around 0
lower-/.f6458.3%
Applied rewrites58.3%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6431.3%
Applied rewrites31.3%
herbie shell --seed 2025258
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
:precision binary64
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))