
(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 12 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.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log z) y) b))) y)))
(if (<= y -1.22e+48)
t_1
(if (<= y 1.42e+166)
(/ (* x (exp (- (* (log a) (/ (- (* t t) 1.0) (+ 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) - b))) / y;
double tmp;
if (y <= -1.22e+48) {
tmp = t_1;
} else if (y <= 1.42e+166) {
tmp = (x * exp(((log(a) * (((t * t) - 1.0) / (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) - b))) / y
if (y <= (-1.22d+48)) then
tmp = t_1
else if (y <= 1.42d+166) then
tmp = (x * exp(((log(a) * (((t * t) - 1.0d0) / (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) - b))) / y;
double tmp;
if (y <= -1.22e+48) {
tmp = t_1;
} else if (y <= 1.42e+166) {
tmp = (x * Math.exp(((Math.log(a) * (((t * t) - 1.0) / (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) - b))) / y tmp = 0 if y <= -1.22e+48: tmp = t_1 elif y <= 1.42e+166: tmp = (x * math.exp(((math.log(a) * (((t * t) - 1.0) / (t + 1.0))) - b))) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(log(z) * y) - b))) / y) tmp = 0.0 if (y <= -1.22e+48) tmp = t_1; elseif (y <= 1.42e+166) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(Float64(Float64(t * t) - 1.0) / 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) - b))) / y; tmp = 0.0; if (y <= -1.22e+48) tmp = t_1; elseif (y <= 1.42e+166) tmp = (x * exp(((log(a) * (((t * t) - 1.0) / (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[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -1.22e+48], t$95$1, If[LessEqual[y, 1.42e+166], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(N[(N[(t * t), $MachinePrecision] - 1.0), $MachinePrecision] / N[(t + 1.0), $MachinePrecision]), $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 - b}}{y}\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{+166}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \frac{t \cdot t - 1}{t + 1} - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.22000000000000004e48 or 1.41999999999999995e166 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6492.1
Applied rewrites92.1%
if -1.22000000000000004e48 < y < 1.41999999999999995e166Initial program 97.7%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6490.1
Applied rewrites90.1%
lift--.f64N/A
flip--N/A
lower-/.f64N/A
metadata-evalN/A
lower--.f64N/A
lower-*.f64N/A
lower-+.f6488.8
Applied rewrites88.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log z) y) b))) y)))
(if (<= y -1.22e+48)
t_1
(if (<= y 1.42e+166) (/ (* 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) - b))) / y;
double tmp;
if (y <= -1.22e+48) {
tmp = t_1;
} else if (y <= 1.42e+166) {
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) - b))) / y
if (y <= (-1.22d+48)) then
tmp = t_1
else if (y <= 1.42d+166) 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) - b))) / y;
double tmp;
if (y <= -1.22e+48) {
tmp = t_1;
} else if (y <= 1.42e+166) {
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) - b))) / y tmp = 0 if y <= -1.22e+48: tmp = t_1 elif y <= 1.42e+166: tmp = (x * math.exp(((math.log(a) * (t - 1.0)) - b))) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(log(z) * y) - b))) / y) tmp = 0.0 if (y <= -1.22e+48) tmp = t_1; elseif (y <= 1.42e+166) 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) - b))) / y; tmp = 0.0; if (y <= -1.22e+48) tmp = t_1; elseif (y <= 1.42e+166) 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[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -1.22e+48], t$95$1, If[LessEqual[y, 1.42e+166], 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 - b}}{y}\\
\mathbf{if}\;y \leq -1.22 \cdot 10^{+48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.42 \cdot 10^{+166}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.22000000000000004e48 or 1.41999999999999995e166 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6492.1
Applied rewrites92.1%
if -1.22000000000000004e48 < y < 1.41999999999999995e166Initial program 97.7%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6490.1
Applied rewrites90.1%
(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+18)
t_2
(if (<= t_1 -160.0)
(* x (/ (/ (exp (- b)) a) y))
(if (<= t_1 705.0) (/ (* x (exp (- (* (log z) y) b))) y) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * log(a);
double t_2 = (x * exp((log(a) * t))) / y;
double tmp;
if (t_1 <= -1e+18) {
tmp = t_2;
} else if (t_1 <= -160.0) {
tmp = x * ((exp(-b) / a) / y);
} else if (t_1 <= 705.0) {
tmp = (x * exp(((log(z) * y) - b))) / y;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - 1.0d0) * log(a)
t_2 = (x * exp((log(a) * t))) / y
if (t_1 <= (-1d+18)) then
tmp = t_2
else if (t_1 <= (-160.0d0)) then
tmp = x * ((exp(-b) / a) / y)
else if (t_1 <= 705.0d0) then
tmp = (x * exp(((log(z) * y) - b))) / y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * Math.log(a);
double t_2 = (x * Math.exp((Math.log(a) * t))) / y;
double tmp;
if (t_1 <= -1e+18) {
tmp = t_2;
} else if (t_1 <= -160.0) {
tmp = x * ((Math.exp(-b) / a) / y);
} else if (t_1 <= 705.0) {
tmp = (x * Math.exp(((Math.log(z) * y) - b))) / y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 1.0) * math.log(a) t_2 = (x * math.exp((math.log(a) * t))) / y tmp = 0 if t_1 <= -1e+18: tmp = t_2 elif t_1 <= -160.0: tmp = x * ((math.exp(-b) / a) / y) elif t_1 <= 705.0: tmp = (x * math.exp(((math.log(z) * y) - b))) / y else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * log(a)) t_2 = Float64(Float64(x * exp(Float64(log(a) * t))) / y) tmp = 0.0 if (t_1 <= -1e+18) tmp = t_2; elseif (t_1 <= -160.0) tmp = Float64(x * Float64(Float64(exp(Float64(-b)) / a) / y)); elseif (t_1 <= 705.0) tmp = Float64(Float64(x * exp(Float64(Float64(log(z) * y) - b))) / y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - 1.0) * log(a); t_2 = (x * exp((log(a) * t))) / y; tmp = 0.0; if (t_1 <= -1e+18) tmp = t_2; elseif (t_1 <= -160.0) tmp = x * ((exp(-b) / a) / y); elseif (t_1 <= 705.0) tmp = (x * exp(((log(z) * y) - b))) / y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Exp[N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+18], t$95$2, If[LessEqual[t$95$1, -160.0], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 705.0], N[(N[(x * N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $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^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -160:\\
\;\;\;\;x \cdot \frac{\frac{e^{-b}}{a}}{y}\\
\mathbf{elif}\;t\_1 \leq 705:\\
\;\;\;\;\frac{x \cdot e^{\log z \cdot y - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e18 or 705 < (*.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.f6480.3
Applied rewrites80.3%
if -1e18 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -160Initial program 94.4%
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.f6494.3
Applied rewrites94.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6498.0
Applied rewrites98.0%
Taylor expanded in y around 0
lift-neg.f64N/A
lift-exp.f6473.8
Applied rewrites73.8%
if -160 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 705Initial program 98.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6482.0
Applied rewrites82.0%
(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+18)
t_2
(if (<= t_1 360.0)
(* x (/ (/ (exp (- b)) a) y))
(if (<= t_1 705.0) (/ (* x (exp (* (log z) y))) y) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * log(a);
double t_2 = (x * exp((log(a) * t))) / y;
double tmp;
if (t_1 <= -1e+18) {
tmp = t_2;
} else if (t_1 <= 360.0) {
tmp = x * ((exp(-b) / a) / y);
} else if (t_1 <= 705.0) {
tmp = (x * exp((log(z) * y))) / y;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - 1.0d0) * log(a)
t_2 = (x * exp((log(a) * t))) / y
if (t_1 <= (-1d+18)) then
tmp = t_2
else if (t_1 <= 360.0d0) then
tmp = x * ((exp(-b) / a) / y)
else if (t_1 <= 705.0d0) then
tmp = (x * exp((log(z) * y))) / y
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * Math.log(a);
double t_2 = (x * Math.exp((Math.log(a) * t))) / y;
double tmp;
if (t_1 <= -1e+18) {
tmp = t_2;
} else if (t_1 <= 360.0) {
tmp = x * ((Math.exp(-b) / a) / y);
} else if (t_1 <= 705.0) {
tmp = (x * Math.exp((Math.log(z) * y))) / y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 1.0) * math.log(a) t_2 = (x * math.exp((math.log(a) * t))) / y tmp = 0 if t_1 <= -1e+18: tmp = t_2 elif t_1 <= 360.0: tmp = x * ((math.exp(-b) / a) / y) elif t_1 <= 705.0: tmp = (x * math.exp((math.log(z) * y))) / y else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * log(a)) t_2 = Float64(Float64(x * exp(Float64(log(a) * t))) / y) tmp = 0.0 if (t_1 <= -1e+18) tmp = t_2; elseif (t_1 <= 360.0) tmp = Float64(x * Float64(Float64(exp(Float64(-b)) / a) / y)); elseif (t_1 <= 705.0) tmp = Float64(Float64(x * exp(Float64(log(z) * y))) / y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - 1.0) * log(a); t_2 = (x * exp((log(a) * t))) / y; tmp = 0.0; if (t_1 <= -1e+18) tmp = t_2; elseif (t_1 <= 360.0) tmp = x * ((exp(-b) / a) / y); elseif (t_1 <= 705.0) tmp = (x * exp((log(z) * y))) / y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Exp[N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+18], t$95$2, If[LessEqual[t$95$1, 360.0], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 705.0], N[(N[(x * N[Exp[N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]], $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^{+18}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 360:\\
\;\;\;\;x \cdot \frac{\frac{e^{-b}}{a}}{y}\\
\mathbf{elif}\;t\_1 \leq 705:\\
\;\;\;\;\frac{x \cdot e^{\log z \cdot y}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e18 or 705 < (*.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.f6480.3
Applied rewrites80.3%
if -1e18 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 360Initial program 96.4%
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.f6496.7
Applied rewrites96.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6498.2
Applied rewrites98.2%
Taylor expanded in y around 0
lift-neg.f64N/A
lift-exp.f6472.0
Applied rewrites72.0%
if 360 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 705Initial program 98.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6454.1
Applied rewrites54.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* (log a) t))) y)))
(if (<= t -12500000000000.0)
t_1
(if (<= t 10.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 = (x * exp((log(a) * t))) / y;
double tmp;
if (t <= -12500000000000.0) {
tmp = t_1;
} else if (t <= 10.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 = (x * exp((log(a) * t))) / y
if (t <= (-12500000000000.0d0)) then
tmp = t_1
else if (t <= 10.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 = (x * Math.exp((Math.log(a) * t))) / y;
double tmp;
if (t <= -12500000000000.0) {
tmp = t_1;
} else if (t <= 10.0) {
tmp = (x * (Math.exp(-b) / 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))) / y tmp = 0 if t <= -12500000000000.0: tmp = t_1 elif t <= 10.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(Float64(x * exp(Float64(log(a) * t))) / y) tmp = 0.0 if (t <= -12500000000000.0) tmp = t_1; elseif (t <= 10.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 = (x * exp((log(a) * t))) / y; tmp = 0.0; if (t <= -12500000000000.0) tmp = t_1; elseif (t <= 10.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[(x * N[Exp[N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -12500000000000.0], t$95$1, If[LessEqual[t, 10.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 := \frac{x \cdot e^{\log a \cdot t}}{y}\\
\mathbf{if}\;t \leq -12500000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 10:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.25e13 or 10 < t Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6480.6
Applied rewrites80.6%
if -1.25e13 < t < 10Initial 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.f6497.6
Applied rewrites97.6%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6470.6
Applied rewrites70.6%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) 5e+192) (* 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)) <= 5e+192) {
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)) <= 5d+192) 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)) <= 5e+192) {
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)) <= 5e+192: 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)) <= 5e+192) tmp = Float64(x * Float64(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)) <= 5e+192) 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], 5e+192], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $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 5 \cdot 10^{+192}:\\
\;\;\;\;x \cdot \frac{\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)) < 5.00000000000000033e192Initial program 98.3%
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.f6483.1
Applied rewrites83.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6482.6
Applied rewrites82.6%
Taylor expanded in y around 0
lift-neg.f64N/A
lift-exp.f6459.6
Applied rewrites59.6%
if 5.00000000000000033e192 < (*.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.f6452.8
Applied rewrites52.8%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6440.4
Applied rewrites40.4%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f6442.2
Applied rewrites42.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (exp (- b)))) (if (<= t 9e-6) (/ (* x (/ t_1 a)) y) (* x (/ t_1 y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double tmp;
if (t <= 9e-6) {
tmp = (x * (t_1 / a)) / y;
} else {
tmp = x * (t_1 / 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 (t <= 9d-6) then
tmp = (x * (t_1 / a)) / y
else
tmp = x * (t_1 / 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 (t <= 9e-6) {
tmp = (x * (t_1 / a)) / y;
} else {
tmp = x * (t_1 / y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(-b) tmp = 0 if t <= 9e-6: tmp = (x * (t_1 / a)) / y else: tmp = x * (t_1 / y) return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) tmp = 0.0 if (t <= 9e-6) tmp = Float64(Float64(x * Float64(t_1 / a)) / y); else tmp = Float64(x * Float64(t_1 / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(-b); tmp = 0.0; if (t <= 9e-6) tmp = (x * (t_1 / a)) / y; else tmp = x * (t_1 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, If[LessEqual[t, 9e-6], N[(N[(x * N[(t$95$1 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
\mathbf{if}\;t \leq 9 \cdot 10^{-6}:\\
\;\;\;\;\frac{x \cdot \frac{t\_1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t\_1}{y}\\
\end{array}
\end{array}
if t < 9.00000000000000023e-6Initial 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.f6487.3
Applied rewrites87.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6464.0
Applied rewrites64.0%
if 9.00000000000000023e-6 < t Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6443.2
Applied rewrites43.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6443.2
Applied rewrites43.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (exp (- b)))) (if (<= (- t 1.0) -0.00375) (* x (/ (/ t_1 a) y)) (* x (/ t_1 y)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double tmp;
if ((t - 1.0) <= -0.00375) {
tmp = x * ((t_1 / a) / y);
} else {
tmp = x * (t_1 / 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 ((t - 1.0d0) <= (-0.00375d0)) then
tmp = x * ((t_1 / a) / y)
else
tmp = x * (t_1 / 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 ((t - 1.0) <= -0.00375) {
tmp = x * ((t_1 / a) / y);
} else {
tmp = x * (t_1 / y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(-b) tmp = 0 if (t - 1.0) <= -0.00375: tmp = x * ((t_1 / a) / y) else: tmp = x * (t_1 / y) return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) tmp = 0.0 if (Float64(t - 1.0) <= -0.00375) tmp = Float64(x * Float64(Float64(t_1 / a) / y)); else tmp = Float64(x * Float64(t_1 / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(-b); tmp = 0.0; if ((t - 1.0) <= -0.00375) tmp = x * ((t_1 / a) / y); else tmp = x * (t_1 / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, If[LessEqual[N[(t - 1.0), $MachinePrecision], -0.00375], N[(x * N[(N[(t$95$1 / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
\mathbf{if}\;t - 1 \leq -0.00375:\\
\;\;\;\;x \cdot \frac{\frac{t\_1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t\_1}{y}\\
\end{array}
\end{array}
if (-.f64 t #s(literal 1 binary64)) < -0.0037499999999999999Initial 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.f6487.3
Applied rewrites87.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6487.1
Applied rewrites87.1%
Taylor expanded in y around 0
lift-neg.f64N/A
lift-exp.f6463.9
Applied rewrites63.9%
if -0.0037499999999999999 < (-.f64 t #s(literal 1 binary64)) Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6442.9
Applied rewrites42.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6442.9
Applied rewrites42.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (/ (exp (- b)) y)))) (if (<= b -4.2e-24) t_1 (if (<= b 2.3e-10) (/ (* x (/ 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 <= -4.2e-24) {
tmp = t_1;
} else if (b <= 2.3e-10) {
tmp = (x * (1.0 / 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 <= (-4.2d-24)) then
tmp = t_1
else if (b <= 2.3d-10) then
tmp = (x * (1.0d0 / 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 <= -4.2e-24) {
tmp = t_1;
} else if (b <= 2.3e-10) {
tmp = (x * (1.0 / 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 <= -4.2e-24: tmp = t_1 elif b <= 2.3e-10: tmp = (x * (1.0 / 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 <= -4.2e-24) tmp = t_1; elseif (b <= 2.3e-10) tmp = Float64(Float64(x * Float64(1.0 / 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 <= -4.2e-24) tmp = t_1; elseif (b <= 2.3e-10) tmp = (x * (1.0 / 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, -4.2e-24], t$95$1, If[LessEqual[b, 2.3e-10], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -4.2 \cdot 10^{-24}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.3 \cdot 10^{-10}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -4.1999999999999999e-24 or 2.30000000000000007e-10 < b Initial program 99.9%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6474.8
Applied rewrites74.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6474.8
Applied rewrites74.8%
if -4.1999999999999999e-24 < b < 2.30000000000000007e-10Initial 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.f6471.7
Applied rewrites71.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6438.7
Applied rewrites38.7%
Taylor expanded in b around 0
Applied rewrites38.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.8e+28) (/ (* 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 <= -2.8e+28) {
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 <= (-2.8d+28)) 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 <= -2.8e+28) {
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 <= -2.8e+28: 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 <= -2.8e+28) tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(-1.0 * b)) / 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 (b <= -2.8e+28) 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, -2.8e+28], N[(N[(x * N[(N[(1.0 + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.8 \cdot 10^{+28}:\\
\;\;\;\;\frac{x \cdot \frac{1 + -1 \cdot b}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\end{array}
\end{array}
if b < -2.8000000000000001e28Initial 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.f6488.7
Applied rewrites88.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6480.4
Applied rewrites80.4%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6446.1
Applied rewrites46.1%
if -2.8000000000000001e28 < b Initial program 98.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.f6477.4
Applied rewrites77.4%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6451.3
Applied rewrites51.3%
Taylor expanded in b around 0
Applied rewrites32.1%
(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 * Float64(1.0 / 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 * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \frac{1}{a}}{y}
\end{array}
Initial program 98.4%
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.0
Applied rewrites80.0%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6458.0
Applied rewrites58.0%
Taylor expanded in b around 0
Applied rewrites30.6%
herbie shell --seed 2025115
(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))