
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
Initial program 98.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= t -1.5e+77)
t_1
(if (<= t 4.4e-7)
(/ (* x (* (/ 1.0 a) (exp (- (* (log z) y) b)))) 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 <= -1.5e+77) {
tmp = t_1;
} else if (t <= 4.4e-7) {
tmp = (x * ((1.0 / a) * exp(((log(z) * y) - 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(a) * (t - 1.0d0)) - b))) / y
if (t <= (-1.5d+77)) then
tmp = t_1
else if (t <= 4.4d-7) then
tmp = (x * ((1.0d0 / a) * exp(((log(z) * y) - 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(a) * (t - 1.0)) - b))) / y;
double tmp;
if (t <= -1.5e+77) {
tmp = t_1;
} else if (t <= 4.4e-7) {
tmp = (x * ((1.0 / a) * Math.exp(((Math.log(z) * y) - b)))) / 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 <= -1.5e+77: tmp = t_1 elif t <= 4.4e-7: tmp = (x * ((1.0 / a) * math.exp(((math.log(z) * y) - b)))) / 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 <= -1.5e+77) tmp = t_1; elseif (t <= 4.4e-7) tmp = Float64(Float64(x * Float64(Float64(1.0 / a) * exp(Float64(Float64(log(z) * y) - 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(a) * (t - 1.0)) - b))) / y; tmp = 0.0; if (t <= -1.5e+77) tmp = t_1; elseif (t <= 4.4e-7) tmp = (x * ((1.0 / a) * exp(((log(z) * y) - 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[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -1.5e+77], t$95$1, If[LessEqual[t, 4.4e-7], N[(N[(x * N[(N[(1.0 / a), $MachinePrecision] * N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $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 -1.5 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-7}:\\
\;\;\;\;\frac{x \cdot \left(\frac{1}{a} \cdot e^{\log z \cdot y - b}\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.4999999999999999e77 or 4.4000000000000002e-7 < t Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6490.3
Applied rewrites90.3%
if -1.4999999999999999e77 < t < 4.4000000000000002e-7Initial program 96.9%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6495.5
Applied rewrites95.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= t -1.5e+77)
t_1
(if (<= t 4.4e-7) (/ (/ (* x (exp (- (* y (log z)) b))) y) a) 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 <= -1.5e+77) {
tmp = t_1;
} else if (t <= 4.4e-7) {
tmp = ((x * exp(((y * log(z)) - b))) / y) / a;
} 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 <= (-1.5d+77)) then
tmp = t_1
else if (t <= 4.4d-7) then
tmp = ((x * exp(((y * log(z)) - b))) / y) / a
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 <= -1.5e+77) {
tmp = t_1;
} else if (t <= 4.4e-7) {
tmp = ((x * Math.exp(((y * Math.log(z)) - b))) / y) / a;
} 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 <= -1.5e+77: tmp = t_1 elif t <= 4.4e-7: tmp = ((x * math.exp(((y * math.log(z)) - b))) / y) / a 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 <= -1.5e+77) tmp = t_1; elseif (t <= 4.4e-7) tmp = Float64(Float64(Float64(x * exp(Float64(Float64(y * log(z)) - b))) / y) / a); 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 <= -1.5e+77) tmp = t_1; elseif (t <= 4.4e-7) tmp = ((x * exp(((y * log(z)) - b))) / y) / a; 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, -1.5e+77], t$95$1, If[LessEqual[t, 4.4e-7], N[(N[(N[(x * N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision] / a), $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 -1.5 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 4.4 \cdot 10^{-7}:\\
\;\;\;\;\frac{\frac{x \cdot e^{y \cdot \log z - b}}{y}}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.4999999999999999e77 or 4.4000000000000002e-7 < t Initial program 99.9%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6490.3
Applied rewrites90.3%
if -1.4999999999999999e77 < t < 4.4000000000000002e-7Initial program 96.9%
Taylor expanded in t around 0
Applied rewrites37.2%
Taylor expanded in a around 0
Applied rewrites30.3%
Taylor expanded in t around 0
lift-log.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-exp.f64N/A
lift-*.f64N/A
lift-/.f6495.7
Applied rewrites95.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* (log z) y))) y)))
(if (<= y -6.2e+60)
t_1
(if (<= y 3.1e+129) (/ (* 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 <= -6.2e+60) {
tmp = t_1;
} else if (y <= 3.1e+129) {
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 <= (-6.2d+60)) then
tmp = t_1
else if (y <= 3.1d+129) 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 <= -6.2e+60) {
tmp = t_1;
} else if (y <= 3.1e+129) {
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 <= -6.2e+60: tmp = t_1 elif y <= 3.1e+129: 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 <= -6.2e+60) tmp = t_1; elseif (y <= 3.1e+129) 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 <= -6.2e+60) tmp = t_1; elseif (y <= 3.1e+129) 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, -6.2e+60], t$95$1, If[LessEqual[y, 3.1e+129], 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 -6.2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.1 \cdot 10^{+129}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.2000000000000001e60 or 3.1e129 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6484.2
Applied rewrites84.2%
if -6.2000000000000001e60 < y < 3.1e129Initial program 97.3%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6490.9
Applied rewrites90.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a))) (t_2 (/ (* x (exp (* (log a) t))) y)))
(if (<= t_1 -1e+51)
t_2
(if (<= t_1 2e+94) (/ (* x (/ (exp (- b)) a)) y) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * log(a);
double t_2 = (x * exp((log(a) * t))) / y;
double tmp;
if (t_1 <= -1e+51) {
tmp = t_2;
} else if (t_1 <= 2e+94) {
tmp = (x * (exp(-b) / a)) / y;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - 1.0d0) * log(a)
t_2 = (x * exp((log(a) * t))) / y
if (t_1 <= (-1d+51)) then
tmp = t_2
else if (t_1 <= 2d+94) then
tmp = (x * (exp(-b) / a)) / y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * Math.log(a);
double t_2 = (x * Math.exp((Math.log(a) * t))) / y;
double tmp;
if (t_1 <= -1e+51) {
tmp = t_2;
} else if (t_1 <= 2e+94) {
tmp = (x * (Math.exp(-b) / a)) / y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 1.0) * math.log(a) t_2 = (x * math.exp((math.log(a) * t))) / y tmp = 0 if t_1 <= -1e+51: tmp = t_2 elif t_1 <= 2e+94: tmp = (x * (math.exp(-b) / a)) / y else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * log(a)) t_2 = Float64(Float64(x * exp(Float64(log(a) * t))) / y) tmp = 0.0 if (t_1 <= -1e+51) tmp = t_2; elseif (t_1 <= 2e+94) tmp = Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - 1.0) * log(a); t_2 = (x * exp((log(a) * t))) / y; tmp = 0.0; if (t_1 <= -1e+51) tmp = t_2; elseif (t_1 <= 2e+94) tmp = (x * (exp(-b) / a)) / y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Exp[N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+51], t$95$2, If[LessEqual[t$95$1, 2e+94], N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := \frac{x \cdot e^{\log a \cdot t}}{y}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+51}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+94}:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e51 or 2e94 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6483.3
Applied rewrites83.3%
if -1e51 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 2e94Initial program 97.1%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6493.0
Applied rewrites93.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6467.3
Applied rewrites67.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (- b))))
(if (<= b -8.5e+48)
(/ (* x t_1) y)
(if (<= b 3.1e-11) (/ (* x (pow z y)) (* a y)) (/ (* x (/ t_1 a)) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double tmp;
if (b <= -8.5e+48) {
tmp = (x * t_1) / y;
} else if (b <= 3.1e-11) {
tmp = (x * pow(z, y)) / (a * y);
} else {
tmp = (x * (t_1 / 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) :: t_1
real(8) :: tmp
t_1 = exp(-b)
if (b <= (-8.5d+48)) then
tmp = (x * t_1) / y
else if (b <= 3.1d-11) then
tmp = (x * (z ** y)) / (a * y)
else
tmp = (x * (t_1 / 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 t_1 = Math.exp(-b);
double tmp;
if (b <= -8.5e+48) {
tmp = (x * t_1) / y;
} else if (b <= 3.1e-11) {
tmp = (x * Math.pow(z, y)) / (a * y);
} else {
tmp = (x * (t_1 / a)) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(-b) tmp = 0 if b <= -8.5e+48: tmp = (x * t_1) / y elif b <= 3.1e-11: tmp = (x * math.pow(z, y)) / (a * y) else: tmp = (x * (t_1 / a)) / y return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) tmp = 0.0 if (b <= -8.5e+48) tmp = Float64(Float64(x * t_1) / y); elseif (b <= 3.1e-11) tmp = Float64(Float64(x * (z ^ y)) / Float64(a * y)); else tmp = Float64(Float64(x * Float64(t_1 / a)) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(-b); tmp = 0.0; if (b <= -8.5e+48) tmp = (x * t_1) / y; elseif (b <= 3.1e-11) tmp = (x * (z ^ y)) / (a * y); else tmp = (x * (t_1 / a)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, If[LessEqual[b, -8.5e+48], N[(N[(x * t$95$1), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[b, 3.1e-11], N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
\mathbf{if}\;b \leq -8.5 \cdot 10^{+48}:\\
\;\;\;\;\frac{x \cdot t\_1}{y}\\
\mathbf{elif}\;b \leq 3.1 \cdot 10^{-11}:\\
\;\;\;\;\frac{x \cdot {z}^{y}}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{t\_1}{a}}{y}\\
\end{array}
\end{array}
if b < -8.5000000000000001e48Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6480.9
Applied rewrites80.9%
if -8.5000000000000001e48 < b < 3.10000000000000028e-11Initial program 96.8%
Taylor expanded in t around 0
Applied rewrites33.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lower-*.f6467.2
Applied rewrites67.2%
Taylor expanded in b around 0
lower-pow.f6465.3
Applied rewrites65.3%
if 3.10000000000000028e-11 < b Initial program 99.9%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6488.1
Applied rewrites88.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6477.3
Applied rewrites77.3%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 2e+234) (/ (* x (/ (exp (- b)) a)) y) (/ (* x (/ (+ 1.0 (* b (- (* 0.5 b) 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)) <= 2e+234) {
tmp = (x * (exp(-b) / a)) / y;
} else {
tmp = (x * ((1.0 + (b * ((0.5 * b) - 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)) <= 2d+234) then
tmp = (x * (exp(-b) / a)) / y
else
tmp = (x * ((1.0d0 + (b * ((0.5d0 * b) - 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)) <= 2e+234) {
tmp = (x * (Math.exp(-b) / a)) / y;
} else {
tmp = (x * ((1.0 + (b * ((0.5 * b) - 1.0))) / a)) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= 2e+234: tmp = (x * (math.exp(-b) / a)) / y else: tmp = (x * ((1.0 + (b * ((0.5 * b) - 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)) <= 2e+234) tmp = Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y); else tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(b * Float64(Float64(0.5 * b) - 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)) <= 2e+234) tmp = (x * (exp(-b) / a)) / y; else tmp = (x * ((1.0 + (b * ((0.5 * b) - 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], 2e+234], N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[(N[(1.0 + N[(b * N[(N[(0.5 * b), $MachinePrecision] - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq 2 \cdot 10^{+234}:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1 + b \cdot \left(0.5 \cdot b - 1\right)}{a}}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 2.00000000000000004e234Initial program 98.1%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6482.2
Applied rewrites82.2%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6459.8
Applied rewrites59.8%
if 2.00000000000000004e234 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6450.7
Applied rewrites50.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6438.2
Applied rewrites38.2%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6447.2
Applied rewrites47.2%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 2e+236) (/ (* x (/ (exp (- b)) a)) y) (/ (* x (+ 1.0 (* y (log z)))) (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= 2e+236) {
tmp = (x * (exp(-b) / a)) / y;
} else {
tmp = (x * (1.0 + (y * log(z)))) / (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)) <= 2d+236) then
tmp = (x * (exp(-b) / a)) / y
else
tmp = (x * (1.0d0 + (y * log(z)))) / (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)) <= 2e+236) {
tmp = (x * (Math.exp(-b) / a)) / y;
} else {
tmp = (x * (1.0 + (y * Math.log(z)))) / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= 2e+236: tmp = (x * (math.exp(-b) / a)) / y else: tmp = (x * (1.0 + (y * math.log(z)))) / (a * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= 2e+236) tmp = Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y); else tmp = Float64(Float64(x * Float64(1.0 + Float64(y * log(z)))) / Float64(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)) <= 2e+236) tmp = (x * (exp(-b) / a)) / y; else tmp = (x * (1.0 + (y * log(z)))) / (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], 2e+236], N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[(1.0 + N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq 2 \cdot 10^{+236}:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \left(1 + y \cdot \log z\right)}{a \cdot y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 2.00000000000000011e236Initial program 98.1%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6482.2
Applied rewrites82.2%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6459.8
Applied rewrites59.8%
if 2.00000000000000011e236 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in t around 0
Applied rewrites33.8%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lower-*.f6445.6
Applied rewrites45.6%
Taylor expanded in b around 0
lower-pow.f6440.5
Applied rewrites40.5%
Taylor expanded in y around 0
lower-+.f64N/A
lift-log.f64N/A
lift-*.f6424.7
Applied rewrites24.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (exp (- b))))) (if (<= x 5e+32) (/ (/ t_1 y) a) (/ t_1 (* a y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp(-b);
double tmp;
if (x <= 5e+32) {
tmp = (t_1 / y) / a;
} else {
tmp = t_1 / (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) :: t_1
real(8) :: tmp
t_1 = x * exp(-b)
if (x <= 5d+32) then
tmp = (t_1 / y) / a
else
tmp = t_1 / (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 t_1 = x * Math.exp(-b);
double tmp;
if (x <= 5e+32) {
tmp = (t_1 / y) / a;
} else {
tmp = t_1 / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp(-b) tmp = 0 if x <= 5e+32: tmp = (t_1 / y) / a else: tmp = t_1 / (a * y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(-b))) tmp = 0.0 if (x <= 5e+32) tmp = Float64(Float64(t_1 / y) / a); else tmp = Float64(t_1 / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * exp(-b); tmp = 0.0; if (x <= 5e+32) tmp = (t_1 / y) / a; else tmp = t_1 / (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[(-b)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, 5e+32], N[(N[(t$95$1 / y), $MachinePrecision] / a), $MachinePrecision], N[(t$95$1 / N[(a * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot e^{-b}\\
\mathbf{if}\;x \leq 5 \cdot 10^{+32}:\\
\;\;\;\;\frac{\frac{t\_1}{y}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{a \cdot y}\\
\end{array}
\end{array}
if x < 4.9999999999999997e32Initial program 97.9%
Taylor expanded in t around 0
Applied rewrites34.4%
Taylor expanded in a around 0
Applied rewrites26.1%
Taylor expanded in t around 0
lift-log.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift-exp.f64N/A
lift-*.f64N/A
lift-/.f6480.6
Applied rewrites80.6%
Taylor expanded in y around 0
lower-*.f64N/A
lift-neg.f64N/A
lift-exp.f6459.6
Applied rewrites59.6%
if 4.9999999999999997e32 < x Initial program 99.4%
Taylor expanded in t around 0
Applied rewrites32.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lower-*.f6472.1
Applied rewrites72.1%
Taylor expanded in y around 0
lift-neg.f64N/A
lift-exp.f6453.6
Applied rewrites53.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- b))) y)))
(if (<= b -1.4e+33)
t_1
(if (<= b 3.0) (/ (* x (fma -1.0 (/ b a) (/ 1.0 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 <= -1.4e+33) {
tmp = t_1;
} else if (b <= 3.0) {
tmp = (x * fma(-1.0, (b / a), (1.0 / a))) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(-b))) / y) tmp = 0.0 if (b <= -1.4e+33) tmp = t_1; elseif (b <= 3.0) tmp = Float64(Float64(x * fma(-1.0, Float64(b / a), Float64(1.0 / a))) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[(-b)], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[b, -1.4e+33], t$95$1, If[LessEqual[b, 3.0], N[(N[(x * N[(-1.0 * N[(b / a), $MachinePrecision] + N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{-b}}{y}\\
\mathbf{if}\;b \leq -1.4 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3:\\
\;\;\;\;\frac{x \cdot \mathsf{fma}\left(-1, \frac{b}{a}, \frac{1}{a}\right)}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.4e33 or 3 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6479.0
Applied rewrites79.0%
if -1.4e33 < b < 3Initial program 96.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6472.5
Applied rewrites72.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6440.6
Applied rewrites40.6%
Taylor expanded in b around 0
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6438.7
Applied rewrites38.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- b))) y)))
(if (<= b -1.4e+33)
t_1
(if (<= b 3.0) (/ (* x (/ (+ 1.0 (* -1.0 b)) 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 <= -1.4e+33) {
tmp = t_1;
} else if (b <= 3.0) {
tmp = (x * ((1.0 + (-1.0 * 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 = (x * exp(-b)) / y
if (b <= (-1.4d+33)) then
tmp = t_1
else if (b <= 3.0d0) then
tmp = (x * ((1.0d0 + ((-1.0d0) * 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 = (x * Math.exp(-b)) / y;
double tmp;
if (b <= -1.4e+33) {
tmp = t_1;
} else if (b <= 3.0) {
tmp = (x * ((1.0 + (-1.0 * b)) / 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 <= -1.4e+33: tmp = t_1 elif b <= 3.0: tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(-b))) / y) tmp = 0.0 if (b <= -1.4e+33) tmp = t_1; elseif (b <= 3.0) tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(-1.0 * b)) / 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 <= -1.4e+33) tmp = t_1; elseif (b <= 3.0) tmp = (x * ((1.0 + (-1.0 * 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[(x * N[Exp[(-b)], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[b, -1.4e+33], t$95$1, If[LessEqual[b, 3.0], N[(N[(x * N[(N[(1.0 + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{-b}}{y}\\
\mathbf{if}\;b \leq -1.4 \cdot 10^{+33}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3:\\
\;\;\;\;\frac{x \cdot \frac{1 + -1 \cdot b}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.4e33 or 3 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6479.0
Applied rewrites79.0%
if -1.4e33 < b < 3Initial program 96.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6472.5
Applied rewrites72.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6440.6
Applied rewrites40.6%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6438.7
Applied rewrites38.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b 5.4e-39) (/ (* x (/ (+ 1.0 (* -1.0 b)) a)) y) (/ (* x 1.0) (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 5.4e-39) {
tmp = (x * ((1.0 + (-1.0 * b)) / 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 (b <= 5.4d-39) then
tmp = (x * ((1.0d0 + ((-1.0d0) * b)) / 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 (b <= 5.4e-39) {
tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y;
} else {
tmp = (x * 1.0) / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 5.4e-39: tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y else: tmp = (x * 1.0) / (a * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 5.4e-39) tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(-1.0 * b)) / a)) / y); else tmp = Float64(Float64(x * 1.0) / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 5.4e-39) tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y; else tmp = (x * 1.0) / (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 5.4e-39], N[(N[(x * N[(N[(1.0 + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * 1.0), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 5.4 \cdot 10^{-39}:\\
\;\;\;\;\frac{x \cdot \frac{1 + -1 \cdot b}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 1}{a \cdot y}\\
\end{array}
\end{array}
if b < 5.4000000000000001e-39Initial program 97.7%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6477.8
Applied rewrites77.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6452.7
Applied rewrites52.7%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6440.8
Applied rewrites40.8%
if 5.4000000000000001e-39 < b Initial program 99.6%
Taylor expanded in t around 0
Applied rewrites41.2%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lower-*.f6473.8
Applied rewrites73.8%
Taylor expanded in b around 0
lower-pow.f6440.1
Applied rewrites40.1%
Taylor expanded in y around 0
Applied rewrites21.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x 1.05e-95) (/ (* 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 (x <= 1.05e-95) {
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 (x <= 1.05d-95) 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 (x <= 1.05e-95) {
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 x <= 1.05e-95: 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 (x <= 1.05e-95) tmp = Float64(Float64(x * Float64(1.0 / a)) / y); else tmp = Float64(Float64(x * 1.0) / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 1.05e-95) 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[x, 1.05e-95], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * 1.0), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.05 \cdot 10^{-95}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot 1}{a \cdot y}\\
\end{array}
\end{array}
if x < 1.05e-95Initial program 97.9%
Taylor expanded in t around 0
associate--l+N/A
exp-sumN/A
*-commutativeN/A
pow-to-expN/A
inv-powN/A
lower-*.f64N/A
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-log.f6480.5
Applied rewrites80.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6459.1
Applied rewrites59.1%
Taylor expanded in b around 0
Applied rewrites31.7%
if 1.05e-95 < x Initial program 99.0%
Taylor expanded in t around 0
Applied rewrites33.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lower-*.f6471.4
Applied rewrites71.4%
Taylor expanded in b around 0
lower-pow.f6454.8
Applied rewrites54.8%
Taylor expanded in y around 0
Applied rewrites30.9%
(FPCore (x y z t a b) :precision binary64 (/ (* x 1.0) (* a y)))
double code(double x, double y, double z, double t, double a, double b) {
return (x * 1.0) / (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 * 1.0d0) / (a * y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * 1.0) / (a * y);
}
def code(x, y, z, t, a, b): return (x * 1.0) / (a * y)
function code(x, y, z, t, a, b) return Float64(Float64(x * 1.0) / Float64(a * y)) end
function tmp = code(x, y, z, t, a, b) tmp = (x * 1.0) / (a * y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * 1.0), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot 1}{a \cdot y}
\end{array}
Initial program 98.2%
Taylor expanded in t around 0
Applied rewrites34.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lift-log.f64N/A
lower-*.f6472.3
Applied rewrites72.3%
Taylor expanded in b around 0
lower-pow.f6454.0
Applied rewrites54.0%
Taylor expanded in y around 0
Applied rewrites31.2%
herbie shell --seed 2025114
(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))