
(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}
Herbie found 24 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 (fma (log a) t (- (- (* (log z) y) (log a)) b)))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp(fma(log(a), t, (((log(z) * y) - log(a)) - b)))) / y;
}
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(fma(log(a), t, Float64(Float64(Float64(log(z) * y) - log(a)) - b)))) / y) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[Log[a], $MachinePrecision] * t + N[(N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\mathsf{fma}\left(\log a, t, \left(\log z \cdot y - \log a\right) - b\right)}}{y}
\end{array}
Initial program 98.3%
Applied rewrites98.3%
(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.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= (- t 1.0) -5e+123)
(/ (* (pow a (- t 1.0)) x) y)
(if (<= (- t 1.0) 10000000000000.0)
(/ (* x (* (exp (- (* (log z) y) b)) (/ 1.0 a))) y)
(/ (* x (exp (- (* (log a) (- t 1.0)) b))) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t - 1.0) <= -5e+123) {
tmp = (pow(a, (t - 1.0)) * x) / y;
} else if ((t - 1.0) <= 10000000000000.0) {
tmp = (x * (exp(((log(z) * y) - b)) * (1.0 / a))) / y;
} else {
tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t - 1.0d0) <= (-5d+123)) then
tmp = ((a ** (t - 1.0d0)) * x) / y
else if ((t - 1.0d0) <= 10000000000000.0d0) then
tmp = (x * (exp(((log(z) * y) - b)) * (1.0d0 / a))) / y
else
tmp = (x * exp(((log(a) * (t - 1.0d0)) - b))) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t - 1.0) <= -5e+123) {
tmp = (Math.pow(a, (t - 1.0)) * x) / y;
} else if ((t - 1.0) <= 10000000000000.0) {
tmp = (x * (Math.exp(((Math.log(z) * y) - b)) * (1.0 / a))) / y;
} else {
tmp = (x * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t - 1.0) <= -5e+123: tmp = (math.pow(a, (t - 1.0)) * x) / y elif (t - 1.0) <= 10000000000000.0: tmp = (x * (math.exp(((math.log(z) * y) - b)) * (1.0 / a))) / y else: tmp = (x * math.exp(((math.log(a) * (t - 1.0)) - b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(t - 1.0) <= -5e+123) tmp = Float64(Float64((a ^ Float64(t - 1.0)) * x) / y); elseif (Float64(t - 1.0) <= 10000000000000.0) tmp = Float64(Float64(x * Float64(exp(Float64(Float64(log(z) * y) - b)) * Float64(1.0 / a))) / y); else tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t - 1.0) <= -5e+123) tmp = ((a ^ (t - 1.0)) * x) / y; elseif ((t - 1.0) <= 10000000000000.0) tmp = (x * (exp(((log(z) * y) - b)) * (1.0 / a))) / y; else tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(t - 1.0), $MachinePrecision], -5e+123], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[N[(t - 1.0), $MachinePrecision], 10000000000000.0], N[(N[(x * N[(N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t - 1 \leq -5 \cdot 10^{+123}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{elif}\;t - 1 \leq 10000000000000:\\
\;\;\;\;\frac{x \cdot \left(e^{\log z \cdot y - b} \cdot \frac{1}{a}\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\end{array}
\end{array}
if (-.f64 t #s(literal 1 binary64)) < -4.99999999999999974e123Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6484.3
Applied rewrites84.3%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lift--.f6487.0
Applied rewrites87.0%
if -4.99999999999999974e123 < (-.f64 t #s(literal 1 binary64)) < 1e13Initial program 97.3%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
exp-sumN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f64N/A
unpow1N/A
metadata-evalN/A
pow-flipN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
unpow-1N/A
inv-powN/A
Applied rewrites94.5%
if 1e13 < (-.f64 t #s(literal 1 binary64)) Initial program 100.0%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6489.9
Applied rewrites89.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= t -5.6e-62)
t_1
(if (<= t 6600000000000.0)
(/ (* (exp (- (* (log z) y) b)) x) (* a y))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp(((log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t <= -5.6e-62) {
tmp = t_1;
} else if (t <= 6600000000000.0) {
tmp = (exp(((log(z) * y) - b)) * x) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * exp(((log(a) * (t - 1.0d0)) - b))) / y
if (t <= (-5.6d-62)) then
tmp = t_1
else if (t <= 6600000000000.0d0) then
tmp = (exp(((log(z) * y) - b)) * x) / (a * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t <= -5.6e-62) {
tmp = t_1;
} else if (t <= 6600000000000.0) {
tmp = (Math.exp(((Math.log(z) * y) - b)) * x) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp(((math.log(a) * (t - 1.0)) - b))) / y tmp = 0 if t <= -5.6e-62: tmp = t_1 elif t <= 6600000000000.0: tmp = (math.exp(((math.log(z) * y) - b)) * x) / (a * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y) tmp = 0.0 if (t <= -5.6e-62) tmp = t_1; elseif (t <= 6600000000000.0) tmp = Float64(Float64(exp(Float64(Float64(log(z) * y) - b)) * x) / Float64(a * y)); 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 - 1.0)) - b))) / y; tmp = 0.0; if (t <= -5.6e-62) tmp = t_1; elseif (t <= 6600000000000.0) tmp = (exp(((log(z) * y) - b)) * x) / (a * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -5.6e-62], t$95$1, If[LessEqual[t, 6600000000000.0], N[(N[(N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{if}\;t \leq -5.6 \cdot 10^{-62}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6600000000000:\\
\;\;\;\;\frac{e^{\log z \cdot y - b} \cdot x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.60000000000000005e-62 or 6.6e12 < t Initial program 99.7%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6488.1
Applied rewrites88.1%
if -5.60000000000000005e-62 < t < 6.6e12Initial program 96.8%
Applied rewrites96.8%
Taylor expanded in t around 0
*-commutativeN/A
associate-/l*N/A
Applied rewrites88.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* (log z) y))) y)))
(if (<= y -2.3e+71)
t_1
(if (<= y 5.5e+46) (/ (* 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((log(z) * y))) / y;
double tmp;
if (y <= -2.3e+71) {
tmp = t_1;
} else if (y <= 5.5e+46) {
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((log(z) * y))) / y
if (y <= (-2.3d+71)) then
tmp = t_1
else if (y <= 5.5d+46) 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((Math.log(z) * y))) / y;
double tmp;
if (y <= -2.3e+71) {
tmp = t_1;
} else if (y <= 5.5e+46) {
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((math.log(z) * y))) / y tmp = 0 if y <= -2.3e+71: tmp = t_1 elif y <= 5.5e+46: 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(log(z) * y))) / y) tmp = 0.0 if (y <= -2.3e+71) tmp = t_1; elseif (y <= 5.5e+46) 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((log(z) * y))) / y; tmp = 0.0; if (y <= -2.3e+71) tmp = t_1; elseif (y <= 5.5e+46) 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[Log[z], $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -2.3e+71], t$95$1, If[LessEqual[y, 5.5e+46], 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}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\log z \cdot y}}{y}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+46}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.3000000000000002e71 or 5.4999999999999998e46 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6482.8
Applied rewrites82.8%
if -2.3000000000000002e71 < y < 5.4999999999999998e46Initial program 97.2%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6493.2
Applied rewrites93.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* (log z) y))) y)))
(if (<= y -9.2e+70)
t_1
(if (<= y 9e+45) (* (exp (- (* (log a) (- t 1.0)) b)) (/ x y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp((log(z) * y))) / y;
double tmp;
if (y <= -9.2e+70) {
tmp = t_1;
} else if (y <= 9e+45) {
tmp = exp(((log(a) * (t - 1.0)) - b)) * (x / y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * exp((log(z) * y))) / y
if (y <= (-9.2d+70)) then
tmp = t_1
else if (y <= 9d+45) then
tmp = exp(((log(a) * (t - 1.0d0)) - b)) * (x / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * Math.exp((Math.log(z) * y))) / y;
double tmp;
if (y <= -9.2e+70) {
tmp = t_1;
} else if (y <= 9e+45) {
tmp = Math.exp(((Math.log(a) * (t - 1.0)) - b)) * (x / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp((math.log(z) * y))) / y tmp = 0 if y <= -9.2e+70: tmp = t_1 elif y <= 9e+45: tmp = math.exp(((math.log(a) * (t - 1.0)) - b)) * (x / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(log(z) * y))) / y) tmp = 0.0 if (y <= -9.2e+70) tmp = t_1; elseif (y <= 9e+45) tmp = Float64(exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b)) * Float64(x / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp((log(z) * y))) / y; tmp = 0.0; if (y <= -9.2e+70) tmp = t_1; elseif (y <= 9e+45) tmp = exp(((log(a) * (t - 1.0)) - b)) * (x / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -9.2e+70], t$95$1, If[LessEqual[y, 9e+45], N[(N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\log z \cdot y}}{y}\\
\mathbf{if}\;y \leq -9.2 \cdot 10^{+70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{+45}:\\
\;\;\;\;e^{\log a \cdot \left(t - 1\right) - b} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.19999999999999975e70 or 8.9999999999999997e45 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6482.7
Applied rewrites82.7%
if -9.19999999999999975e70 < y < 8.9999999999999997e45Initial program 97.2%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6485.5
Applied rewrites85.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* (log z) y))) y)))
(if (<= y -3.8e+46)
t_1
(if (<= y 9.2e-139)
(* x (/ (/ (exp (- b)) y) a))
(if (<= y 410000000.0) (* (pow a (- t 1.0)) (/ x y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp((log(z) * y))) / y;
double tmp;
if (y <= -3.8e+46) {
tmp = t_1;
} else if (y <= 9.2e-139) {
tmp = x * ((exp(-b) / y) / a);
} else if (y <= 410000000.0) {
tmp = pow(a, (t - 1.0)) * (x / y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * exp((log(z) * y))) / y
if (y <= (-3.8d+46)) then
tmp = t_1
else if (y <= 9.2d-139) then
tmp = x * ((exp(-b) / y) / a)
else if (y <= 410000000.0d0) then
tmp = (a ** (t - 1.0d0)) * (x / y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * Math.exp((Math.log(z) * y))) / y;
double tmp;
if (y <= -3.8e+46) {
tmp = t_1;
} else if (y <= 9.2e-139) {
tmp = x * ((Math.exp(-b) / y) / a);
} else if (y <= 410000000.0) {
tmp = Math.pow(a, (t - 1.0)) * (x / y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp((math.log(z) * y))) / y tmp = 0 if y <= -3.8e+46: tmp = t_1 elif y <= 9.2e-139: tmp = x * ((math.exp(-b) / y) / a) elif y <= 410000000.0: tmp = math.pow(a, (t - 1.0)) * (x / y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(log(z) * y))) / y) tmp = 0.0 if (y <= -3.8e+46) tmp = t_1; elseif (y <= 9.2e-139) tmp = Float64(x * Float64(Float64(exp(Float64(-b)) / y) / a)); elseif (y <= 410000000.0) tmp = Float64((a ^ Float64(t - 1.0)) * Float64(x / y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp((log(z) * y))) / y; tmp = 0.0; if (y <= -3.8e+46) tmp = t_1; elseif (y <= 9.2e-139) tmp = x * ((exp(-b) / y) / a); elseif (y <= 410000000.0) tmp = (a ^ (t - 1.0)) * (x / y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -3.8e+46], t$95$1, If[LessEqual[y, 9.2e-139], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 410000000.0], N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\log z \cdot y}}{y}\\
\mathbf{if}\;y \leq -3.8 \cdot 10^{+46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.2 \cdot 10^{-139}:\\
\;\;\;\;x \cdot \frac{\frac{e^{-b}}{y}}{a}\\
\mathbf{elif}\;y \leq 410000000:\\
\;\;\;\;{a}^{\left(t - 1\right)} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.7999999999999999e46 or 4.1e8 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6480.9
Applied rewrites80.9%
if -3.7999999999999999e46 < y < 9.2000000000000005e-139Initial program 96.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6484.9
Applied rewrites84.9%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6471.4
Applied rewrites71.4%
lift-/.f64N/A
lift-/.f64N/A
lift-exp.f64N/A
lift-neg.f64N/A
associate-/l/N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
lift-exp.f6471.4
Applied rewrites71.4%
if 9.2000000000000005e-139 < y < 4.1e8Initial program 97.6%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6491.5
Applied rewrites91.5%
Taylor expanded in b around 0
exp-to-powN/A
lower-pow.f64N/A
lift--.f6468.2
Applied rewrites68.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* (pow a (- t 1.0)) x) y)))
(if (<= t -1.8e+113)
t_1
(if (<= t 1.8) (/ (* x (/ (exp (- b)) a)) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (pow(a, (t - 1.0)) * x) / y;
double tmp;
if (t <= -1.8e+113) {
tmp = t_1;
} else if (t <= 1.8) {
tmp = (x * (exp(-b) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((a ** (t - 1.0d0)) * x) / y
if (t <= (-1.8d+113)) then
tmp = t_1
else if (t <= 1.8d0) then
tmp = (x * (exp(-b) / a)) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.pow(a, (t - 1.0)) * x) / y;
double tmp;
if (t <= -1.8e+113) {
tmp = t_1;
} else if (t <= 1.8) {
tmp = (x * (Math.exp(-b) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.pow(a, (t - 1.0)) * x) / y tmp = 0 if t <= -1.8e+113: tmp = t_1 elif t <= 1.8: tmp = (x * (math.exp(-b) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64((a ^ Float64(t - 1.0)) * x) / y) tmp = 0.0 if (t <= -1.8e+113) tmp = t_1; elseif (t <= 1.8) tmp = Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((a ^ (t - 1.0)) * x) / y; tmp = 0.0; if (t <= -1.8e+113) tmp = t_1; elseif (t <= 1.8) tmp = (x * (exp(-b) / a)) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -1.8e+113], t$95$1, If[LessEqual[t, 1.8], N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{{a}^{\left(t - 1\right)} \cdot x}{y}\\
\mathbf{if}\;t \leq -1.8 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.8:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.79999999999999996e113 or 1.80000000000000004 < t Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6481.6
Applied rewrites81.6%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lift--.f6481.9
Applied rewrites81.9%
if -1.79999999999999996e113 < t < 1.80000000000000004Initial program 97.2%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
exp-sumN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f64N/A
unpow1N/A
metadata-evalN/A
pow-flipN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
unpow-1N/A
inv-powN/A
Applied rewrites95.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6469.4
Applied rewrites69.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (pow a t) (/ x y))))
(if (<= t -2.3e+113)
t_1
(if (<= t 2.0) (/ (* x (/ (exp (- b)) a)) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = pow(a, t) * (x / y);
double tmp;
if (t <= -2.3e+113) {
tmp = t_1;
} else if (t <= 2.0) {
tmp = (x * (exp(-b) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (a ** t) * (x / y)
if (t <= (-2.3d+113)) then
tmp = t_1
else if (t <= 2.0d0) then
tmp = (x * (exp(-b) / a)) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.pow(a, t) * (x / y);
double tmp;
if (t <= -2.3e+113) {
tmp = t_1;
} else if (t <= 2.0) {
tmp = (x * (Math.exp(-b) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.pow(a, t) * (x / y) tmp = 0 if t <= -2.3e+113: tmp = t_1 elif t <= 2.0: tmp = (x * (math.exp(-b) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64((a ^ t) * Float64(x / y)) tmp = 0.0 if (t <= -2.3e+113) tmp = t_1; elseif (t <= 2.0) tmp = Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a ^ t) * (x / y); tmp = 0.0; if (t <= -2.3e+113) tmp = t_1; elseif (t <= 2.0) tmp = (x * (exp(-b) / a)) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Power[a, t], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.3e+113], t$95$1, If[LessEqual[t, 2.0], N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {a}^{t} \cdot \frac{x}{y}\\
\mathbf{if}\;t \leq -2.3 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.29999999999999997e113 or 2 < t Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6481.6
Applied rewrites81.6%
Taylor expanded in b around 0
exp-to-powN/A
lower-pow.f64N/A
lift--.f6473.2
Applied rewrites73.2%
Taylor expanded in t around inf
Applied rewrites73.2%
if -2.29999999999999997e113 < t < 2Initial program 97.2%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
exp-sumN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f64N/A
unpow1N/A
metadata-evalN/A
pow-flipN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
unpow-1N/A
inv-powN/A
Applied rewrites95.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6469.4
Applied rewrites69.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (- b))) (t_2 (* (- t 1.0) (log a))))
(if (<= t_2 321.2)
(* x (/ (/ t_1 a) y))
(if (<= t_2 1e+114)
(* (/ t_1 y) (/ x a))
(/ (* (/ (fma (log a) t 1.0) a) x) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double t_2 = (t - 1.0) * log(a);
double tmp;
if (t_2 <= 321.2) {
tmp = x * ((t_1 / a) / y);
} else if (t_2 <= 1e+114) {
tmp = (t_1 / y) * (x / a);
} else {
tmp = ((fma(log(a), t, 1.0) / a) * x) / y;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) t_2 = Float64(Float64(t - 1.0) * log(a)) tmp = 0.0 if (t_2 <= 321.2) tmp = Float64(x * Float64(Float64(t_1 / a) / y)); elseif (t_2 <= 1e+114) tmp = Float64(Float64(t_1 / y) * Float64(x / a)); else tmp = Float64(Float64(Float64(fma(log(a), t, 1.0) / a) * x) / y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 321.2], N[(x * N[(N[(t$95$1 / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+114], N[(N[(t$95$1 / y), $MachinePrecision] * N[(x / a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Log[a], $MachinePrecision] * t + 1.0), $MachinePrecision] / a), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
t_2 := \left(t - 1\right) \cdot \log a\\
\mathbf{if}\;t\_2 \leq 321.2:\\
\;\;\;\;x \cdot \frac{\frac{t\_1}{a}}{y}\\
\mathbf{elif}\;t\_2 \leq 10^{+114}:\\
\;\;\;\;\frac{t\_1}{y} \cdot \frac{x}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\log a, t, 1\right)}{a} \cdot x}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 321.199999999999989Initial program 97.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6470.3
Applied rewrites70.3%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6461.2
Applied rewrites61.2%
if 321.199999999999989 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 1e114Initial program 99.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6472.1
Applied rewrites72.1%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6463.0
Applied rewrites63.0%
lift-*.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-exp.f64N/A
lift-neg.f64N/A
associate-/l/N/A
associate-/l*N/A
*-commutativeN/A
*-commutativeN/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lift-neg.f64N/A
lift-exp.f64N/A
lower-/.f6461.0
Applied rewrites61.0%
if 1e114 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
Taylor expanded in b around 0
exp-to-powN/A
lower-pow.f64N/A
lift--.f6478.2
Applied rewrites78.2%
Taylor expanded in t around 0
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6447.7
Applied rewrites47.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 1e+114) (/ (* x (/ (exp (- b)) a)) y) (/ (* (/ (fma (log a) t 1.0) a) x) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= 1e+114) {
tmp = (x * (exp(-b) / a)) / y;
} else {
tmp = ((fma(log(a), t, 1.0) / a) * x) / y;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= 1e+114) tmp = Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y); else tmp = Float64(Float64(Float64(fma(log(a), t, 1.0) / a) * x) / y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], 1e+114], N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(N[(N[Log[a], $MachinePrecision] * t + 1.0), $MachinePrecision] / a), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq 10^{+114}:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\log a, t, 1\right)}{a} \cdot x}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 1e114Initial program 98.0%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
exp-sumN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f64N/A
unpow1N/A
metadata-evalN/A
pow-flipN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
unpow-1N/A
inv-powN/A
Applied rewrites85.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6462.1
Applied rewrites62.1%
if 1e114 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
Taylor expanded in b around 0
exp-to-powN/A
lower-pow.f64N/A
lift--.f6478.2
Applied rewrites78.2%
Taylor expanded in t around 0
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6447.7
Applied rewrites47.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -6.5e-51)
t_1
(if (<= b 1200000.0) (/ (* (/ (fma (log a) t 1.0) a) x) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (exp(-b) / y);
double tmp;
if (b <= -6.5e-51) {
tmp = t_1;
} else if (b <= 1200000.0) {
tmp = ((fma(log(a), t, 1.0) / a) * x) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(exp(Float64(-b)) / y)) tmp = 0.0 if (b <= -6.5e-51) tmp = t_1; elseif (b <= 1200000.0) tmp = Float64(Float64(Float64(fma(log(a), t, 1.0) / a) * x) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.5e-51], t$95$1, If[LessEqual[b, 1200000.0], N[(N[(N[(N[(N[Log[a], $MachinePrecision] * t + 1.0), $MachinePrecision] / a), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -6.5 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1200000:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\log a, t, 1\right)}{a} \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.5000000000000003e-51 or 1.2e6 < b Initial program 99.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6474.9
Applied rewrites74.9%
Applied rewrites74.9%
if -6.5000000000000003e-51 < b < 1.2e6Initial program 96.8%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6466.7
Applied rewrites66.7%
Taylor expanded in b around 0
exp-to-powN/A
lower-pow.f64N/A
lift--.f6467.5
Applied rewrites67.5%
Taylor expanded in t around 0
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6442.1
Applied rewrites42.1%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6441.9
Applied rewrites41.9%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 1e+114) (* x (/ (/ (exp (- b)) a) y)) (/ (* (/ (fma (log a) t 1.0) a) x) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= 1e+114) {
tmp = x * ((exp(-b) / a) / y);
} else {
tmp = ((fma(log(a), t, 1.0) / a) * x) / y;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= 1e+114) tmp = Float64(x * Float64(Float64(exp(Float64(-b)) / a) / y)); else tmp = Float64(Float64(Float64(fma(log(a), t, 1.0) / a) * x) / y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], 1e+114], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[Log[a], $MachinePrecision] * t + 1.0), $MachinePrecision] / a), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq 10^{+114}:\\
\;\;\;\;x \cdot \frac{\frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\log a, t, 1\right)}{a} \cdot x}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 1e114Initial program 98.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6470.8
Applied rewrites70.8%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6461.7
Applied rewrites61.7%
if 1e114 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6485.2
Applied rewrites85.2%
Taylor expanded in b around 0
exp-to-powN/A
lower-pow.f64N/A
lift--.f6478.2
Applied rewrites78.2%
Taylor expanded in t around 0
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6447.7
Applied rewrites47.7%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f6451.6
Applied rewrites51.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (/ (exp (- b)) y)))) (if (<= b -6.5e-51) t_1 (if (<= b 1200000.0) (/ (/ x a) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (exp(-b) / y);
double tmp;
if (b <= -6.5e-51) {
tmp = t_1;
} else if (b <= 1200000.0) {
tmp = (x / a) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (exp(-b) / y)
if (b <= (-6.5d-51)) then
tmp = t_1
else if (b <= 1200000.0d0) then
tmp = (x / a) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (Math.exp(-b) / y);
double tmp;
if (b <= -6.5e-51) {
tmp = t_1;
} else if (b <= 1200000.0) {
tmp = (x / a) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (math.exp(-b) / y) tmp = 0 if b <= -6.5e-51: tmp = t_1 elif b <= 1200000.0: tmp = (x / a) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(exp(Float64(-b)) / y)) tmp = 0.0 if (b <= -6.5e-51) tmp = t_1; elseif (b <= 1200000.0) tmp = Float64(Float64(x / a) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (exp(-b) / y); tmp = 0.0; if (b <= -6.5e-51) tmp = t_1; elseif (b <= 1200000.0) tmp = (x / a) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.5e-51], t$95$1, If[LessEqual[b, 1200000.0], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -6.5 \cdot 10^{-51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 1200000:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.5000000000000003e-51 or 1.2e6 < b Initial program 99.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6474.9
Applied rewrites74.9%
Applied rewrites74.9%
if -6.5000000000000003e-51 < b < 1.2e6Initial program 96.8%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6466.7
Applied rewrites66.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6439.6
Applied rewrites39.6%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6439.4
Applied rewrites39.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a))))
(if (<= t_1 310.0)
(* x (/ (- 1.0 b) (* a y)))
(if (<= t_1 20000000000000.0)
(/ (* x (/ 1.0 a)) y)
(/ (fma (- x) b x) (* a y))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * log(a);
double tmp;
if (t_1 <= 310.0) {
tmp = x * ((1.0 - b) / (a * y));
} else if (t_1 <= 20000000000000.0) {
tmp = (x * (1.0 / a)) / y;
} else {
tmp = fma(-x, b, x) / (a * y);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * log(a)) tmp = 0.0 if (t_1 <= 310.0) tmp = Float64(x * Float64(Float64(1.0 - b) / Float64(a * y))); elseif (t_1 <= 20000000000000.0) tmp = Float64(Float64(x * Float64(1.0 / a)) / y); else tmp = Float64(fma(Float64(-x), b, x) / Float64(a * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 310.0], N[(x * N[(N[(1.0 - b), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 20000000000000.0], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[((-x) * b + x), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
\mathbf{if}\;t\_1 \leq 310:\\
\;\;\;\;x \cdot \frac{1 - b}{a \cdot y}\\
\mathbf{elif}\;t\_1 \leq 20000000000000:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(-x, b, x\right)}{a \cdot y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 310Initial program 97.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6470.4
Applied rewrites70.4%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6461.3
Applied rewrites61.3%
Taylor expanded in b around 0
+-commutativeN/A
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
div-add-revN/A
lift-neg.f64N/A
mul-1-negN/A
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-*.f6434.4
Applied rewrites34.4%
if 310 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 2e13Initial program 99.2%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
exp-sumN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f64N/A
unpow1N/A
metadata-evalN/A
pow-flipN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
unpow-1N/A
inv-powN/A
Applied rewrites98.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6472.5
Applied rewrites72.5%
Taylor expanded in b around 0
Applied rewrites42.3%
if 2e13 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6482.5
Applied rewrites82.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6450.8
Applied rewrites50.8%
Taylor expanded in b around 0
associate-*r/N/A
div-add-revN/A
lower-/.f64N/A
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lower-neg.f64N/A
lower-*.f6427.2
Applied rewrites27.2%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 288.0) (* x (/ (- 1.0 b) (* a y))) (/ (* x (/ (- 1.0 b) a)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= 288.0) {
tmp = x * ((1.0 - b) / (a * y));
} else {
tmp = (x * ((1.0 - b) / a)) / y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((t - 1.0d0) * log(a)) <= 288.0d0) then
tmp = x * ((1.0d0 - b) / (a * y))
else
tmp = (x * ((1.0d0 - b) / a)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * Math.log(a)) <= 288.0) {
tmp = x * ((1.0 - b) / (a * y));
} else {
tmp = (x * ((1.0 - b) / a)) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= 288.0: tmp = x * ((1.0 - b) / (a * y)) else: tmp = (x * ((1.0 - b) / a)) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= 288.0) tmp = Float64(x * Float64(Float64(1.0 - b) / Float64(a * y))); else tmp = Float64(Float64(x * Float64(Float64(1.0 - b) / a)) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((t - 1.0) * log(a)) <= 288.0) tmp = x * ((1.0 - b) / (a * y)); else tmp = (x * ((1.0 - b) / a)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], 288.0], N[(x * N[(N[(1.0 - b), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(N[(1.0 - b), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq 288:\\
\;\;\;\;x \cdot \frac{1 - b}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1 - b}{a}}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 288Initial program 97.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6470.6
Applied rewrites70.6%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6461.3
Applied rewrites61.3%
Taylor expanded in b around 0
+-commutativeN/A
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
div-add-revN/A
lift-neg.f64N/A
mul-1-negN/A
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-*.f6434.3
Applied rewrites34.3%
if 288 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 99.6%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
exp-sumN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f64N/A
unpow1N/A
metadata-evalN/A
pow-flipN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
unpow-1N/A
inv-powN/A
Applied rewrites79.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6459.0
Applied rewrites59.0%
Taylor expanded in b around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6435.8
Applied rewrites35.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 285.0) (* x (/ (- 1.0 b) (* a y))) (* (/ (- 1.0 b) a) (/ x y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= 285.0) {
tmp = x * ((1.0 - b) / (a * y));
} else {
tmp = ((1.0 - b) / a) * (x / y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((t - 1.0d0) * log(a)) <= 285.0d0) then
tmp = x * ((1.0d0 - b) / (a * y))
else
tmp = ((1.0d0 - b) / a) * (x / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * Math.log(a)) <= 285.0) {
tmp = x * ((1.0 - b) / (a * y));
} else {
tmp = ((1.0 - b) / a) * (x / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= 285.0: tmp = x * ((1.0 - b) / (a * y)) else: tmp = ((1.0 - b) / a) * (x / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= 285.0) tmp = Float64(x * Float64(Float64(1.0 - b) / Float64(a * y))); else tmp = Float64(Float64(Float64(1.0 - b) / a) * Float64(x / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((t - 1.0) * log(a)) <= 285.0) tmp = x * ((1.0 - b) / (a * y)); else tmp = ((1.0 - b) / a) * (x / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], 285.0], N[(x * N[(N[(1.0 - b), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 - b), $MachinePrecision] / a), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq 285:\\
\;\;\;\;x \cdot \frac{1 - b}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - b}{a} \cdot \frac{x}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 285Initial program 97.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6470.6
Applied rewrites70.6%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6461.3
Applied rewrites61.3%
Taylor expanded in b around 0
+-commutativeN/A
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
div-add-revN/A
lift-neg.f64N/A
mul-1-negN/A
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-*.f6434.3
Applied rewrites34.3%
if 285 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 99.6%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
exp-sumN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f64N/A
unpow1N/A
metadata-evalN/A
pow-flipN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
unpow-1N/A
inv-powN/A
Applied rewrites79.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6458.9
Applied rewrites58.9%
Taylor expanded in b around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6435.8
Applied rewrites35.8%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
Applied rewrites36.4%
(FPCore (x y z t a b) :precision binary64 (if (<= b 8.8e-137) (* x (/ (/ (- 1.0 b) a) y)) (/ (/ x a) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 8.8e-137) {
tmp = x * (((1.0 - b) / a) / y);
} else {
tmp = (x / a) / y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 8.8d-137) then
tmp = x * (((1.0d0 - b) / a) / y)
else
tmp = (x / a) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 8.8e-137) {
tmp = x * (((1.0 - b) / a) / y);
} else {
tmp = (x / a) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 8.8e-137: tmp = x * (((1.0 - b) / a) / y) else: tmp = (x / a) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 8.8e-137) tmp = Float64(x * Float64(Float64(Float64(1.0 - b) / a) / y)); else tmp = Float64(Float64(x / a) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 8.8e-137) tmp = x * (((1.0 - b) / a) / y); else tmp = (x / a) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 8.8e-137], N[(x * N[(N[(N[(1.0 - b), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8.8 \cdot 10^{-137}:\\
\;\;\;\;x \cdot \frac{\frac{1 - b}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\end{array}
\end{array}
if b < 8.8000000000000005e-137Initial program 98.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6472.2
Applied rewrites72.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6455.1
Applied rewrites55.1%
Taylor expanded in b around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6442.2
Applied rewrites42.2%
if 8.8000000000000005e-137 < b Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6474.7
Applied rewrites74.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6467.5
Applied rewrites67.5%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6426.0
Applied rewrites26.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6426.1
Applied rewrites26.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b 8.8e-137) (* x (/ (- 1.0 b) (* a y))) (/ (/ x a) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 8.8e-137) {
tmp = x * ((1.0 - b) / (a * y));
} else {
tmp = (x / a) / y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 8.8d-137) then
tmp = x * ((1.0d0 - b) / (a * y))
else
tmp = (x / a) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 8.8e-137) {
tmp = x * ((1.0 - b) / (a * y));
} else {
tmp = (x / a) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 8.8e-137: tmp = x * ((1.0 - b) / (a * y)) else: tmp = (x / a) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 8.8e-137) tmp = Float64(x * Float64(Float64(1.0 - b) / Float64(a * y))); else tmp = Float64(Float64(x / a) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 8.8e-137) tmp = x * ((1.0 - b) / (a * y)); else tmp = (x / a) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 8.8e-137], N[(x * N[(N[(1.0 - b), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 8.8 \cdot 10^{-137}:\\
\;\;\;\;x \cdot \frac{1 - b}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\end{array}
\end{array}
if b < 8.8000000000000005e-137Initial program 98.0%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6472.2
Applied rewrites72.2%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6455.1
Applied rewrites55.1%
Taylor expanded in b around 0
+-commutativeN/A
associate-*r/N/A
mul-1-negN/A
lift-neg.f64N/A
div-add-revN/A
lift-neg.f64N/A
mul-1-negN/A
lower-/.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-*.f6441.5
Applied rewrites41.5%
if 8.8000000000000005e-137 < b Initial program 98.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6474.7
Applied rewrites74.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6467.5
Applied rewrites67.5%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6426.0
Applied rewrites26.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6426.1
Applied rewrites26.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -6.5e-51) (/ (* x (/ (- b) a)) y) (/ x (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.5e-51) {
tmp = (x * (-b / a)) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-6.5d-51)) then
tmp = (x * (-b / a)) / y
else
tmp = x / (a * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -6.5e-51) {
tmp = (x * (-b / a)) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -6.5e-51: tmp = (x * (-b / a)) / y else: tmp = x / (a * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -6.5e-51) tmp = Float64(Float64(x * Float64(Float64(-b) / a)) / y); else tmp = Float64(x / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -6.5e-51) tmp = (x * (-b / a)) / y; else tmp = x / (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -6.5e-51], N[(N[(x * N[((-b) / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{-51}:\\
\;\;\;\;\frac{x \cdot \frac{-b}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a \cdot y}\\
\end{array}
\end{array}
if b < -6.5000000000000003e-51Initial program 99.4%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
exp-sumN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f64N/A
unpow1N/A
metadata-evalN/A
pow-flipN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
unpow-1N/A
inv-powN/A
Applied rewrites86.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6474.3
Applied rewrites74.3%
Taylor expanded in b around 0
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f6444.2
Applied rewrites44.2%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6442.7
Applied rewrites42.7%
if -6.5000000000000003e-51 < b Initial program 97.9%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6470.7
Applied rewrites70.7%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6453.5
Applied rewrites53.5%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6432.8
Applied rewrites32.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 320.0) (* x (/ 1.0 (* a y))) (/ (* x (/ 1.0 a)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= 320.0) {
tmp = x * (1.0 / (a * y));
} else {
tmp = (x * (1.0 / a)) / y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((t - 1.0d0) * log(a)) <= 320.0d0) then
tmp = x * (1.0d0 / (a * y))
else
tmp = (x * (1.0d0 / a)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * Math.log(a)) <= 320.0) {
tmp = x * (1.0 / (a * y));
} else {
tmp = (x * (1.0 / a)) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= 320.0: tmp = x * (1.0 / (a * y)) else: tmp = (x * (1.0 / a)) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= 320.0) tmp = Float64(x * Float64(1.0 / Float64(a * y))); else tmp = Float64(Float64(x * Float64(1.0 / a)) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((t - 1.0) * log(a)) <= 320.0) tmp = x * (1.0 / (a * y)); else tmp = (x * (1.0 / a)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], 320.0], N[(x * N[(1.0 / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq 320:\\
\;\;\;\;x \cdot \frac{1}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 320Initial program 97.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6470.3
Applied rewrites70.3%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6461.3
Applied rewrites61.3%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if 320 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 99.7%
Taylor expanded in t around 0
associate--l+N/A
+-commutativeN/A
exp-sumN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f64N/A
unpow1N/A
metadata-evalN/A
pow-flipN/A
inv-powN/A
unpow-1N/A
lower-/.f64N/A
unpow-1N/A
inv-powN/A
Applied rewrites78.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6458.7
Applied rewrites58.7%
Taylor expanded in b around 0
Applied rewrites32.5%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 288.0) (* x (/ 1.0 (* a y))) (/ (/ x a) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= 288.0) {
tmp = x * (1.0 / (a * y));
} else {
tmp = (x / a) / y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((t - 1.0d0) * log(a)) <= 288.0d0) then
tmp = x * (1.0d0 / (a * y))
else
tmp = (x / a) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * Math.log(a)) <= 288.0) {
tmp = x * (1.0 / (a * y));
} else {
tmp = (x / a) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= 288.0: tmp = x * (1.0 / (a * y)) else: tmp = (x / a) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= 288.0) tmp = Float64(x * Float64(1.0 / Float64(a * y))); else tmp = Float64(Float64(x / a) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((t - 1.0) * log(a)) <= 288.0) tmp = x * (1.0 / (a * y)); else tmp = (x / a) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], 288.0], N[(x * N[(1.0 / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq 288:\\
\;\;\;\;x \cdot \frac{1}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 288Initial program 97.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6470.6
Applied rewrites70.6%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6461.3
Applied rewrites61.3%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6432.5
Applied rewrites32.5%
if 288 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 99.6%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6476.9
Applied rewrites76.9%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6456.9
Applied rewrites56.9%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6431.0
Applied rewrites31.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6432.7
Applied rewrites32.7%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 320.0) (/ x (* a y)) (/ (/ x a) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= 320.0) {
tmp = x / (a * y);
} else {
tmp = (x / a) / y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((t - 1.0d0) * log(a)) <= 320.0d0) then
tmp = x / (a * y)
else
tmp = (x / a) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * Math.log(a)) <= 320.0) {
tmp = x / (a * y);
} else {
tmp = (x / a) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= 320.0: tmp = x / (a * y) else: tmp = (x / a) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= 320.0) tmp = Float64(x / Float64(a * y)); else tmp = Float64(Float64(x / a) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((t - 1.0) * log(a)) <= 320.0) tmp = x / (a * y); else tmp = (x / a) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], 320.0], N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq 320:\\
\;\;\;\;\frac{x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 320Initial program 97.5%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6470.3
Applied rewrites70.3%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6461.3
Applied rewrites61.3%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6432.5
Applied rewrites32.5%
if 320 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 99.7%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6477.5
Applied rewrites77.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6456.8
Applied rewrites56.8%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6431.0
Applied rewrites31.0%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6432.5
Applied rewrites32.5%
(FPCore (x y z t a b) :precision binary64 (/ x (* a y)))
double code(double x, double y, double z, double t, double a, double b) {
return x / (a * y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x / (a * y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / (a * y);
}
def code(x, y, z, t, a, b): return x / (a * y)
function code(x, y, z, t, a, b) return Float64(x / Float64(a * y)) end
function tmp = code(x, y, z, t, a, b) tmp = x / (a * y); end
code[x_, y_, z_, t_, a_, b_] := N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a \cdot y}
\end{array}
Initial program 98.3%
Taylor expanded in y around 0
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lift--.f64N/A
lower-/.f6473.1
Applied rewrites73.1%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
div-expN/A
*-commutativeN/A
exp-to-powN/A
inv-powN/A
associate-/l/N/A
rem-exp-logN/A
exp-sumN/A
+-commutativeN/A
exp-sumN/A
rem-exp-logN/A
associate-/l/N/A
exp-negN/A
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6459.5
Applied rewrites59.5%
Taylor expanded in b around 0
lower-/.f64N/A
lower-*.f6431.9
Applied rewrites31.9%
herbie shell --seed 2025130
(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))