
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 16 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
Initial program 98.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y)))
(if (or (<= t_1 -1e-84) (not (<= t_1 5e-127)))
(/ (* x (fma (- (* (/ 0.5 a) b) (pow a -1.0)) b (pow a -1.0))) y)
(* (pow a -1.0) (/ x y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double tmp;
if ((t_1 <= -1e-84) || !(t_1 <= 5e-127)) {
tmp = (x * fma((((0.5 / a) * b) - pow(a, -1.0)), b, pow(a, -1.0))) / y;
} else {
tmp = pow(a, -1.0) * (x / y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) tmp = 0.0 if ((t_1 <= -1e-84) || !(t_1 <= 5e-127)) tmp = Float64(Float64(x * fma(Float64(Float64(Float64(0.5 / a) * b) - (a ^ -1.0)), b, (a ^ -1.0))) / y); else tmp = Float64((a ^ -1.0) * Float64(x / y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = 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]}, If[Or[LessEqual[t$95$1, -1e-84], N[Not[LessEqual[t$95$1, 5e-127]], $MachinePrecision]], N[(N[(x * N[(N[(N[(N[(0.5 / a), $MachinePrecision] * b), $MachinePrecision] - N[Power[a, -1.0], $MachinePrecision]), $MachinePrecision] * b + N[Power[a, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[Power[a, -1.0], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-84} \lor \neg \left(t\_1 \leq 5 \cdot 10^{-127}\right):\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(\frac{0.5}{a} \cdot b - {a}^{-1}, b, {a}^{-1}\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;{a}^{-1} \cdot \frac{x}{y}\\
\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) < -1e-84 or 4.9999999999999997e-127 < (/.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 99.2%
Taylor expanded in t around 0
exp-diffN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
remove-double-negN/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-exp.f6476.1
Applied rewrites76.1%
Taylor expanded in y around 0
Applied rewrites58.3%
Taylor expanded in b around 0
Applied rewrites56.5%
if -1e-84 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 4.9999999999999997e-127Initial program 98.1%
Taylor expanded in b around 0
+-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.f6473.8
Applied rewrites73.8%
Taylor expanded in t around 0
Applied rewrites57.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6457.3
Applied rewrites57.3%
Taylor expanded in y around 0
Applied rewrites26.7%
Final simplification43.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a))) (t_2 (* (/ (pow a (- t 1.0)) y) x)))
(if (<= t_1 -660.0)
t_2
(if (<= t_1 -600.0)
(* (exp (- b)) (/ x y))
(if (<= t_1 690.0) (* (/ x a) (/ (pow z y) 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 = (pow(a, (t - 1.0)) / y) * x;
double tmp;
if (t_1 <= -660.0) {
tmp = t_2;
} else if (t_1 <= -600.0) {
tmp = exp(-b) * (x / y);
} else if (t_1 <= 690.0) {
tmp = (x / a) * (pow(z, y) / 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 = ((a ** (t - 1.0d0)) / y) * x
if (t_1 <= (-660.0d0)) then
tmp = t_2
else if (t_1 <= (-600.0d0)) then
tmp = exp(-b) * (x / y)
else if (t_1 <= 690.0d0) then
tmp = (x / a) * ((z ** y) / 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 = (Math.pow(a, (t - 1.0)) / y) * x;
double tmp;
if (t_1 <= -660.0) {
tmp = t_2;
} else if (t_1 <= -600.0) {
tmp = Math.exp(-b) * (x / y);
} else if (t_1 <= 690.0) {
tmp = (x / a) * (Math.pow(z, y) / 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 = (math.pow(a, (t - 1.0)) / y) * x tmp = 0 if t_1 <= -660.0: tmp = t_2 elif t_1 <= -600.0: tmp = math.exp(-b) * (x / y) elif t_1 <= 690.0: tmp = (x / a) * (math.pow(z, y) / 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((a ^ Float64(t - 1.0)) / y) * x) tmp = 0.0 if (t_1 <= -660.0) tmp = t_2; elseif (t_1 <= -600.0) tmp = Float64(exp(Float64(-b)) * Float64(x / y)); elseif (t_1 <= 690.0) tmp = Float64(Float64(x / a) * Float64((z ^ y) / 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 = ((a ^ (t - 1.0)) / y) * x; tmp = 0.0; if (t_1 <= -660.0) tmp = t_2; elseif (t_1 <= -600.0) tmp = exp(-b) * (x / y); elseif (t_1 <= 690.0) tmp = (x / a) * ((z ^ y) / 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[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, -660.0], t$95$2, If[LessEqual[t$95$1, -600.0], N[(N[Exp[(-b)], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 690.0], N[(N[(x / a), $MachinePrecision] * N[(N[Power[z, y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := \frac{{a}^{\left(t - 1\right)}}{y} \cdot x\\
\mathbf{if}\;t\_1 \leq -660:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -600:\\
\;\;\;\;e^{-b} \cdot \frac{x}{y}\\
\mathbf{elif}\;t\_1 \leq 690:\\
\;\;\;\;\frac{x}{a} \cdot \frac{{z}^{y}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -660 or 690 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 99.3%
Taylor expanded in b around 0
+-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.f6474.8
Applied rewrites74.8%
Taylor expanded in y around 0
Applied rewrites81.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.1
Applied rewrites82.1%
if -660 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -600Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-out--N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-rgt-outN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
remove-double-negN/A
distribute-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f64N/A
lower-log.f64100.0
Applied rewrites100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f64100.0
Applied rewrites100.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64100.0
Applied rewrites100.0%
if -600 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 690Initial program 97.9%
Taylor expanded in y around 0
distribute-rgt-out--N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-rgt-outN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
remove-double-negN/A
distribute-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f64N/A
lower-log.f6473.6
Applied rewrites73.6%
Taylor expanded in b around 0
Applied rewrites79.6%
Taylor expanded in t around 0
Applied rewrites79.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -31000.0) (not (<= y 1.18e+64))) (/ (* x (exp (- (fma (log z) y (- (log a))) b))) y) (/ (* x (exp (- (* (+ -1.0 t) (log a)) b))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -31000.0) || !(y <= 1.18e+64)) {
tmp = (x * exp((fma(log(z), y, -log(a)) - b))) / y;
} else {
tmp = (x * exp((((-1.0 + t) * log(a)) - b))) / y;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -31000.0) || !(y <= 1.18e+64)) tmp = Float64(Float64(x * exp(Float64(fma(log(z), y, Float64(-log(a))) - b))) / y); else tmp = Float64(Float64(x * exp(Float64(Float64(Float64(-1.0 + t) * log(a)) - b))) / y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -31000.0], N[Not[LessEqual[y, 1.18e+64]], $MachinePrecision]], N[(N[(x * N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y + (-N[Log[a], $MachinePrecision])), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(N[(-1.0 + t), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -31000 \lor \neg \left(y \leq 1.18 \cdot 10^{+64}\right):\\
\;\;\;\;\frac{x \cdot e^{\mathsf{fma}\left(\log z, y, -\log a\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\left(-1 + t\right) \cdot \log a - b}}{y}\\
\end{array}
\end{array}
if y < -31000 or 1.18000000000000006e64 < y Initial program 100.0%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
fp-cancel-sub-sign-invN/A
*-commutativeN/A
mul-1-negN/A
*-rgt-identityN/A
lower-fma.f64N/A
lower-log.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-log.f6494.3
Applied rewrites94.3%
if -31000 < y < 1.18000000000000006e64Initial program 97.6%
Taylor expanded in y around 0
distribute-rgt-out--N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-rgt-outN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
remove-double-negN/A
distribute-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f64N/A
lower-log.f6497.6
Applied rewrites97.6%
Final simplification96.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.4e+32) (not (<= b 1.1e+60))) (* (exp (- b)) (/ x y)) (/ (* x (fma (- (* (/ 0.5 a) b) (pow a -1.0)) b (pow a -1.0))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.4e+32) || !(b <= 1.1e+60)) {
tmp = exp(-b) * (x / y);
} else {
tmp = (x * fma((((0.5 / a) * b) - pow(a, -1.0)), b, pow(a, -1.0))) / y;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.4e+32) || !(b <= 1.1e+60)) tmp = Float64(exp(Float64(-b)) * Float64(x / y)); else tmp = Float64(Float64(x * fma(Float64(Float64(Float64(0.5 / a) * b) - (a ^ -1.0)), b, (a ^ -1.0))) / y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -6.4e+32], N[Not[LessEqual[b, 1.1e+60]], $MachinePrecision]], N[(N[Exp[(-b)], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(N[(N[(0.5 / a), $MachinePrecision] * b), $MachinePrecision] - N[Power[a, -1.0], $MachinePrecision]), $MachinePrecision] * b + N[Power[a, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.4 \cdot 10^{+32} \lor \neg \left(b \leq 1.1 \cdot 10^{+60}\right):\\
\;\;\;\;e^{-b} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(\frac{0.5}{a} \cdot b - {a}^{-1}, b, {a}^{-1}\right)}{y}\\
\end{array}
\end{array}
if b < -6.3999999999999998e32 or 1.09999999999999998e60 < b Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-out--N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-rgt-outN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
remove-double-negN/A
distribute-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f64N/A
lower-log.f6493.7
Applied rewrites93.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6481.0
Applied rewrites81.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6472.7
Applied rewrites72.7%
if -6.3999999999999998e32 < b < 1.09999999999999998e60Initial program 97.8%
Taylor expanded in t around 0
exp-diffN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
remove-double-negN/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-exp.f6473.5
Applied rewrites73.5%
Taylor expanded in y around 0
Applied rewrites42.1%
Taylor expanded in b around 0
Applied rewrites40.8%
Final simplification54.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= b 3e-232)
(/
(*
x
(fma
(- (* (/ (fma -0.16666666666666666 b 0.5) a) b) (pow a -1.0))
b
(pow a -1.0)))
y)
(* (pow a -1.0) (/ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 3e-232) {
tmp = (x * fma((((fma(-0.16666666666666666, b, 0.5) / a) * b) - pow(a, -1.0)), b, pow(a, -1.0))) / y;
} else {
tmp = pow(a, -1.0) * (x / y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 3e-232) tmp = Float64(Float64(x * fma(Float64(Float64(Float64(fma(-0.16666666666666666, b, 0.5) / a) * b) - (a ^ -1.0)), b, (a ^ -1.0))) / y); else tmp = Float64((a ^ -1.0) * Float64(x / y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 3e-232], N[(N[(x * N[(N[(N[(N[(N[(-0.16666666666666666 * b + 0.5), $MachinePrecision] / a), $MachinePrecision] * b), $MachinePrecision] - N[Power[a, -1.0], $MachinePrecision]), $MachinePrecision] * b + N[Power[a, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[Power[a, -1.0], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 3 \cdot 10^{-232}:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(-0.16666666666666666, b, 0.5\right)}{a} \cdot b - {a}^{-1}, b, {a}^{-1}\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;{a}^{-1} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if b < 2.9999999999999999e-232Initial program 98.8%
Taylor expanded in t around 0
exp-diffN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
remove-double-negN/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-exp.f6477.5
Applied rewrites77.5%
Taylor expanded in y around 0
Applied rewrites58.2%
Taylor expanded in b around 0
Applied rewrites53.2%
if 2.9999999999999999e-232 < b Initial program 98.7%
Taylor expanded in b around 0
+-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.f6474.8
Applied rewrites74.8%
Taylor expanded in t around 0
Applied rewrites62.3%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6458.0
Applied rewrites58.0%
Taylor expanded in y around 0
Applied rewrites31.3%
Final simplification42.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (/ (pow z y) a)) y)))
(if (<= y -3.25e-8)
t_1
(if (<= y -2.5e-236)
(* (/ (pow a (- t 1.0)) (* (exp b) y)) x)
(if (<= y 9.5e+70) (/ (* x (exp (- (* (log a) t) b))) y) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * (pow(z, y) / a)) / y;
double tmp;
if (y <= -3.25e-8) {
tmp = t_1;
} else if (y <= -2.5e-236) {
tmp = (pow(a, (t - 1.0)) / (exp(b) * y)) * x;
} else if (y <= 9.5e+70) {
tmp = (x * exp(((log(a) * t) - b))) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * ((z ** y) / a)) / y
if (y <= (-3.25d-8)) then
tmp = t_1
else if (y <= (-2.5d-236)) then
tmp = ((a ** (t - 1.0d0)) / (exp(b) * y)) * x
else if (y <= 9.5d+70) then
tmp = (x * exp(((log(a) * t) - b))) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * (Math.pow(z, y) / a)) / y;
double tmp;
if (y <= -3.25e-8) {
tmp = t_1;
} else if (y <= -2.5e-236) {
tmp = (Math.pow(a, (t - 1.0)) / (Math.exp(b) * y)) * x;
} else if (y <= 9.5e+70) {
tmp = (x * Math.exp(((Math.log(a) * t) - b))) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * (math.pow(z, y) / a)) / y tmp = 0 if y <= -3.25e-8: tmp = t_1 elif y <= -2.5e-236: tmp = (math.pow(a, (t - 1.0)) / (math.exp(b) * y)) * x elif y <= 9.5e+70: tmp = (x * math.exp(((math.log(a) * t) - b))) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * Float64((z ^ y) / a)) / y) tmp = 0.0 if (y <= -3.25e-8) tmp = t_1; elseif (y <= -2.5e-236) tmp = Float64(Float64((a ^ Float64(t - 1.0)) / Float64(exp(b) * y)) * x); elseif (y <= 9.5e+70) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * t) - b))) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * ((z ^ y) / a)) / y; tmp = 0.0; if (y <= -3.25e-8) tmp = t_1; elseif (y <= -2.5e-236) tmp = ((a ^ (t - 1.0)) / (exp(b) * y)) * x; elseif (y <= 9.5e+70) tmp = (x * exp(((log(a) * t) - b))) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -3.25e-8], t$95$1, If[LessEqual[y, -2.5e-236], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / N[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 9.5e+70], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{if}\;y \leq -3.25 \cdot 10^{-8}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.5 \cdot 10^{-236}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)}}{e^{b} \cdot y} \cdot x\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+70}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot t - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.24999999999999999e-8 or 9.5000000000000002e70 < y Initial program 100.0%
Taylor expanded in b around 0
+-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.f6480.4
Applied rewrites80.4%
Taylor expanded in t around 0
Applied rewrites91.1%
if -3.24999999999999999e-8 < y < -2.4999999999999999e-236Initial program 96.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.5%
Taylor expanded in y around 0
exp-to-powN/A
lower-pow.f64N/A
lower--.f6491.5
Applied rewrites91.5%
if -2.4999999999999999e-236 < y < 9.5000000000000002e70Initial program 98.4%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6484.3
Applied rewrites84.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log a) t) b))) y)))
(if (<= b -900.0)
t_1
(if (<= b 3e-214)
(/ (* x (/ (pow z y) a)) y)
(if (<= b 1500000.0) (* (/ (pow a (- t 1.0)) y) x) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp(((log(a) * t) - b))) / y;
double tmp;
if (b <= -900.0) {
tmp = t_1;
} else if (b <= 3e-214) {
tmp = (x * (pow(z, y) / a)) / y;
} else if (b <= 1500000.0) {
tmp = (pow(a, (t - 1.0)) / 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(((log(a) * t) - b))) / y
if (b <= (-900.0d0)) then
tmp = t_1
else if (b <= 3d-214) then
tmp = (x * ((z ** y) / a)) / y
else if (b <= 1500000.0d0) then
tmp = ((a ** (t - 1.0d0)) / 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(((Math.log(a) * t) - b))) / y;
double tmp;
if (b <= -900.0) {
tmp = t_1;
} else if (b <= 3e-214) {
tmp = (x * (Math.pow(z, y) / a)) / y;
} else if (b <= 1500000.0) {
tmp = (Math.pow(a, (t - 1.0)) / y) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp(((math.log(a) * t) - b))) / y tmp = 0 if b <= -900.0: tmp = t_1 elif b <= 3e-214: tmp = (x * (math.pow(z, y) / a)) / y elif b <= 1500000.0: tmp = (math.pow(a, (t - 1.0)) / y) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(log(a) * t) - b))) / y) tmp = 0.0 if (b <= -900.0) tmp = t_1; elseif (b <= 3e-214) tmp = Float64(Float64(x * Float64((z ^ y) / a)) / y); elseif (b <= 1500000.0) tmp = Float64(Float64((a ^ Float64(t - 1.0)) / y) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp(((log(a) * t) - b))) / y; tmp = 0.0; if (b <= -900.0) tmp = t_1; elseif (b <= 3e-214) tmp = (x * ((z ^ y) / a)) / y; elseif (b <= 1500000.0) tmp = ((a ^ (t - 1.0)) / 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[(N[Log[a], $MachinePrecision] * t), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[b, -900.0], t$95$1, If[LessEqual[b, 3e-214], N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[b, 1500000.0], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\log a \cdot t - b}}{y}\\
\mathbf{if}\;b \leq -900:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3 \cdot 10^{-214}:\\
\;\;\;\;\frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{elif}\;b \leq 1500000:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -900 or 1.5e6 < b Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6493.8
Applied rewrites93.8%
if -900 < b < 2.99999999999999994e-214Initial program 97.9%
Taylor expanded in b around 0
+-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.f6490.8
Applied rewrites90.8%
Taylor expanded in t around 0
Applied rewrites81.5%
if 2.99999999999999994e-214 < b < 1.5e6Initial program 96.8%
Taylor expanded in b around 0
+-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.f6488.3
Applied rewrites88.3%
Taylor expanded in y around 0
Applied rewrites79.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6482.9
Applied rewrites82.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -58000.0) (not (<= y 9.5e+70))) (/ (* x (/ (pow z y) a)) y) (/ (* x (exp (- (* (+ -1.0 t) (log a)) b))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -58000.0) || !(y <= 9.5e+70)) {
tmp = (x * (pow(z, y) / a)) / y;
} else {
tmp = (x * exp((((-1.0 + t) * log(a)) - b))) / y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-58000.0d0)) .or. (.not. (y <= 9.5d+70))) then
tmp = (x * ((z ** y) / a)) / y
else
tmp = (x * exp(((((-1.0d0) + t) * log(a)) - b))) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -58000.0) || !(y <= 9.5e+70)) {
tmp = (x * (Math.pow(z, y) / a)) / y;
} else {
tmp = (x * Math.exp((((-1.0 + t) * Math.log(a)) - b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -58000.0) or not (y <= 9.5e+70): tmp = (x * (math.pow(z, y) / a)) / y else: tmp = (x * math.exp((((-1.0 + t) * math.log(a)) - b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -58000.0) || !(y <= 9.5e+70)) tmp = Float64(Float64(x * Float64((z ^ y) / a)) / y); else tmp = Float64(Float64(x * exp(Float64(Float64(Float64(-1.0 + t) * log(a)) - b))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -58000.0) || ~((y <= 9.5e+70))) tmp = (x * ((z ^ y) / a)) / y; else tmp = (x * exp((((-1.0 + t) * log(a)) - b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -58000.0], N[Not[LessEqual[y, 9.5e+70]], $MachinePrecision]], N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(N[(-1.0 + t), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -58000 \lor \neg \left(y \leq 9.5 \cdot 10^{+70}\right):\\
\;\;\;\;\frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\left(-1 + t\right) \cdot \log a - b}}{y}\\
\end{array}
\end{array}
if y < -58000 or 9.5000000000000002e70 < y Initial program 100.0%
Taylor expanded in b around 0
+-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.f6479.9
Applied rewrites79.9%
Taylor expanded in t around 0
Applied rewrites91.7%
if -58000 < y < 9.5000000000000002e70Initial program 97.6%
Taylor expanded in y around 0
distribute-rgt-out--N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-rgt-outN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
remove-double-negN/A
distribute-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f64N/A
lower-log.f6497.6
Applied rewrites97.6%
Final simplification94.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -940.0) (not (<= b 5800000.0))) (/ (* x (exp (- (* (log a) t) b))) y) (/ (* x (* (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 <= -940.0) || !(b <= 5800000.0)) {
tmp = (x * exp(((log(a) * t) - b))) / y;
} else {
tmp = (x * (pow(a, (t - 1.0)) * pow(z, y))) / 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 <= (-940.0d0)) .or. (.not. (b <= 5800000.0d0))) then
tmp = (x * exp(((log(a) * t) - b))) / y
else
tmp = (x * ((a ** (t - 1.0d0)) * (z ** y))) / 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 <= -940.0) || !(b <= 5800000.0)) {
tmp = (x * Math.exp(((Math.log(a) * t) - b))) / y;
} else {
tmp = (x * (Math.pow(a, (t - 1.0)) * Math.pow(z, y))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -940.0) or not (b <= 5800000.0): tmp = (x * math.exp(((math.log(a) * t) - b))) / y else: tmp = (x * (math.pow(a, (t - 1.0)) * math.pow(z, y))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -940.0) || !(b <= 5800000.0)) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * t) - b))) / y); else tmp = Float64(Float64(x * Float64((a ^ Float64(t - 1.0)) * (z ^ y))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -940.0) || ~((b <= 5800000.0))) tmp = (x * exp(((log(a) * t) - b))) / y; else tmp = (x * ((a ^ (t - 1.0)) * (z ^ y))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -940.0], N[Not[LessEqual[b, 5800000.0]], $MachinePrecision]], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * N[Power[z, y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -940 \lor \neg \left(b \leq 5800000\right):\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot t - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left({a}^{\left(t - 1\right)} \cdot {z}^{y}\right)}{y}\\
\end{array}
\end{array}
if b < -940 or 5.8e6 < b Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6493.8
Applied rewrites93.8%
if -940 < b < 5.8e6Initial program 97.5%
Taylor expanded in b around 0
+-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.f6489.8
Applied rewrites89.8%
Final simplification91.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -900.0) (not (<= b 4000000.0))) (/ (* x (exp (- (* (log a) t) b))) y) (* (* (pow a (- t 1.0)) x) (/ (pow z y) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -900.0) || !(b <= 4000000.0)) {
tmp = (x * exp(((log(a) * t) - b))) / y;
} else {
tmp = (pow(a, (t - 1.0)) * x) * (pow(z, y) / 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 <= (-900.0d0)) .or. (.not. (b <= 4000000.0d0))) then
tmp = (x * exp(((log(a) * t) - b))) / y
else
tmp = ((a ** (t - 1.0d0)) * x) * ((z ** y) / 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 <= -900.0) || !(b <= 4000000.0)) {
tmp = (x * Math.exp(((Math.log(a) * t) - b))) / y;
} else {
tmp = (Math.pow(a, (t - 1.0)) * x) * (Math.pow(z, y) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -900.0) or not (b <= 4000000.0): tmp = (x * math.exp(((math.log(a) * t) - b))) / y else: tmp = (math.pow(a, (t - 1.0)) * x) * (math.pow(z, y) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -900.0) || !(b <= 4000000.0)) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * t) - b))) / y); else tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) * Float64((z ^ y) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -900.0) || ~((b <= 4000000.0))) tmp = (x * exp(((log(a) * t) - b))) / y; else tmp = ((a ^ (t - 1.0)) * x) * ((z ^ y) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -900.0], N[Not[LessEqual[b, 4000000.0]], $MachinePrecision]], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] * N[(N[Power[z, y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -900 \lor \neg \left(b \leq 4000000\right):\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot t - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\left({a}^{\left(t - 1\right)} \cdot x\right) \cdot \frac{{z}^{y}}{y}\\
\end{array}
\end{array}
if b < -900 or 4e6 < b Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6493.8
Applied rewrites93.8%
if -900 < b < 4e6Initial program 97.5%
Taylor expanded in y around 0
distribute-rgt-out--N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-rgt-outN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
remove-double-negN/A
distribute-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f64N/A
lower-log.f6472.2
Applied rewrites72.2%
Taylor expanded in b around 0
Applied rewrites89.0%
Final simplification91.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -40000.0) (not (<= y 1.18e+64))) (/ (* x (/ (pow z y) a)) y) (* (/ (pow a (- t 1.0)) y) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -40000.0) || !(y <= 1.18e+64)) {
tmp = (x * (pow(z, y) / a)) / y;
} else {
tmp = (pow(a, (t - 1.0)) / 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 ((y <= (-40000.0d0)) .or. (.not. (y <= 1.18d+64))) then
tmp = (x * ((z ** y) / a)) / y
else
tmp = ((a ** (t - 1.0d0)) / 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 ((y <= -40000.0) || !(y <= 1.18e+64)) {
tmp = (x * (Math.pow(z, y) / a)) / y;
} else {
tmp = (Math.pow(a, (t - 1.0)) / y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -40000.0) or not (y <= 1.18e+64): tmp = (x * (math.pow(z, y) / a)) / y else: tmp = (math.pow(a, (t - 1.0)) / y) * x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -40000.0) || !(y <= 1.18e+64)) tmp = Float64(Float64(x * Float64((z ^ y) / a)) / y); else tmp = Float64(Float64((a ^ Float64(t - 1.0)) / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -40000.0) || ~((y <= 1.18e+64))) tmp = (x * ((z ^ y) / a)) / y; else tmp = ((a ^ (t - 1.0)) / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -40000.0], N[Not[LessEqual[y, 1.18e+64]], $MachinePrecision]], N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -40000 \lor \neg \left(y \leq 1.18 \cdot 10^{+64}\right):\\
\;\;\;\;\frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)}}{y} \cdot x\\
\end{array}
\end{array}
if y < -4e4 or 1.18000000000000006e64 < y Initial program 100.0%
Taylor expanded in b around 0
+-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.f6479.2
Applied rewrites79.2%
Taylor expanded in t around 0
Applied rewrites91.0%
if -4e4 < y < 1.18000000000000006e64Initial program 97.6%
Taylor expanded in b around 0
+-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.f6472.5
Applied rewrites72.5%
Taylor expanded in y around 0
Applied rewrites76.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6477.2
Applied rewrites77.2%
Final simplification83.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.4e+83) (not (<= b 1.1e+60))) (* (/ (exp (- b)) y) x) (* (/ (pow a (- t 1.0)) y) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.4e+83) || !(b <= 1.1e+60)) {
tmp = (exp(-b) / y) * x;
} else {
tmp = (pow(a, (t - 1.0)) / 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 <= (-3.4d+83)) .or. (.not. (b <= 1.1d+60))) then
tmp = (exp(-b) / y) * x
else
tmp = ((a ** (t - 1.0d0)) / 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 <= -3.4e+83) || !(b <= 1.1e+60)) {
tmp = (Math.exp(-b) / y) * x;
} else {
tmp = (Math.pow(a, (t - 1.0)) / y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.4e+83) or not (b <= 1.1e+60): tmp = (math.exp(-b) / y) * x else: tmp = (math.pow(a, (t - 1.0)) / y) * x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.4e+83) || !(b <= 1.1e+60)) tmp = Float64(Float64(exp(Float64(-b)) / y) * x); else tmp = Float64(Float64((a ^ Float64(t - 1.0)) / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -3.4e+83) || ~((b <= 1.1e+60))) tmp = (exp(-b) / y) * x; else tmp = ((a ^ (t - 1.0)) / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.4e+83], N[Not[LessEqual[b, 1.1e+60]], $MachinePrecision]], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.4 \cdot 10^{+83} \lor \neg \left(b \leq 1.1 \cdot 10^{+60}\right):\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)}}{y} \cdot x\\
\end{array}
\end{array}
if b < -3.3999999999999998e83 or 1.09999999999999998e60 < b Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-out--N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-rgt-outN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
remove-double-negN/A
distribute-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f64N/A
lower-log.f6493.0
Applied rewrites93.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6484.1
Applied rewrites84.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6484.1
Applied rewrites84.1%
if -3.3999999999999998e83 < b < 1.09999999999999998e60Initial program 97.9%
Taylor expanded in b around 0
+-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.f6487.8
Applied rewrites87.8%
Taylor expanded in y around 0
Applied rewrites74.5%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6474.8
Applied rewrites74.8%
Final simplification78.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.4e+32) (not (<= b 22500000.0))) (* (/ (exp (- b)) y) x) (* (pow a -1.0) (/ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.4e+32) || !(b <= 22500000.0)) {
tmp = (exp(-b) / y) * x;
} else {
tmp = pow(a, -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 <= (-6.4d+32)) .or. (.not. (b <= 22500000.0d0))) then
tmp = (exp(-b) / y) * x
else
tmp = (a ** (-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 <= -6.4e+32) || !(b <= 22500000.0)) {
tmp = (Math.exp(-b) / y) * x;
} else {
tmp = Math.pow(a, -1.0) * (x / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.4e+32) or not (b <= 22500000.0): tmp = (math.exp(-b) / y) * x else: tmp = math.pow(a, -1.0) * (x / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.4e+32) || !(b <= 22500000.0)) tmp = Float64(Float64(exp(Float64(-b)) / y) * x); else tmp = Float64((a ^ -1.0) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -6.4e+32) || ~((b <= 22500000.0))) tmp = (exp(-b) / y) * x; else tmp = (a ^ -1.0) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -6.4e+32], N[Not[LessEqual[b, 22500000.0]], $MachinePrecision]], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], N[(N[Power[a, -1.0], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.4 \cdot 10^{+32} \lor \neg \left(b \leq 22500000\right):\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;{a}^{-1} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if b < -6.3999999999999998e32 or 2.25e7 < b Initial program 100.0%
Taylor expanded in y around 0
distribute-rgt-out--N/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
distribute-rgt-outN/A
+-commutativeN/A
*-commutativeN/A
metadata-evalN/A
remove-double-negN/A
distribute-neg-inN/A
mul-1-negN/A
lower-*.f64N/A
mul-1-negN/A
distribute-neg-inN/A
metadata-evalN/A
remove-double-negN/A
lower-+.f64N/A
lower-log.f6493.5
Applied rewrites93.5%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6478.8
Applied rewrites78.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6478.8
Applied rewrites78.8%
if -6.3999999999999998e32 < b < 2.25e7Initial program 97.6%
Taylor expanded in b around 0
+-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.f6489.4
Applied rewrites89.4%
Taylor expanded in t around 0
Applied rewrites77.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6471.9
Applied rewrites71.9%
Taylor expanded in y around 0
Applied rewrites40.7%
Final simplification58.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b 5.5e-236) (/ (* x (/ (fma -1.0 b 1.0) a)) y) (* (pow a -1.0) (/ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 5.5e-236) {
tmp = (x * (fma(-1.0, b, 1.0) / a)) / y;
} else {
tmp = pow(a, -1.0) * (x / y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 5.5e-236) tmp = Float64(Float64(x * Float64(fma(-1.0, b, 1.0) / a)) / y); else tmp = Float64((a ^ -1.0) * Float64(x / y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 5.5e-236], N[(N[(x * N[(N[(-1.0 * b + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[Power[a, -1.0], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.5 \cdot 10^{-236}:\\
\;\;\;\;\frac{x \cdot \frac{\mathsf{fma}\left(-1, b, 1\right)}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;{a}^{-1} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if b < 5.49999999999999959e-236Initial program 98.8%
Taylor expanded in t around 0
exp-diffN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
*-commutativeN/A
mul-1-negN/A
remove-double-negN/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-exp.f6477.8
Applied rewrites77.8%
Taylor expanded in y around 0
Applied rewrites58.3%
Taylor expanded in b around 0
Applied rewrites38.1%
if 5.49999999999999959e-236 < b Initial program 98.6%
Taylor expanded in b around 0
+-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.f6475.0
Applied rewrites75.0%
Taylor expanded in t around 0
Applied rewrites62.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6457.9
Applied rewrites57.9%
Taylor expanded in y around 0
Applied rewrites31.4%
Final simplification34.9%
(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((a ^ -1.0) * Float64(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[Power[a, -1.0], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{a}^{-1} \cdot \frac{x}{y}
\end{array}
Initial program 98.7%
Taylor expanded in b around 0
+-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.f6475.6
Applied rewrites75.6%
Taylor expanded in t around 0
Applied rewrites65.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6461.2
Applied rewrites61.2%
Taylor expanded in y around 0
Applied rewrites31.6%
Final simplification31.6%
(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 2024352
(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))