
(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 18 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.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= t -5e+113)
t_1
(if (<= t 1.75e+127)
(/ (* 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 <= -5e+113) {
tmp = t_1;
} else if (t <= 1.75e+127) {
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 <= (-5d+113)) then
tmp = t_1
else if (t <= 1.75d+127) 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 <= -5e+113) {
tmp = t_1;
} else if (t <= 1.75e+127) {
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 <= -5e+113: tmp = t_1 elif t <= 1.75e+127: 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 <= -5e+113) tmp = t_1; elseif (t <= 1.75e+127) 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 <= -5e+113) tmp = t_1; elseif (t <= 1.75e+127) 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, -5e+113], t$95$1, If[LessEqual[t, 1.75e+127], 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 -5 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.75 \cdot 10^{+127}:\\
\;\;\;\;\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 < -5e113 or 1.74999999999999989e127 < t Initial program 98.5%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6480.5
Applied rewrites80.5%
if -5e113 < t < 1.74999999999999989e127Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= t -5e+113)
t_1
(if (<= t 2e+126)
(* 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 <= -5e+113) {
tmp = t_1;
} else if (t <= 2e+126) {
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 <= (-5d+113)) then
tmp = t_1
else if (t <= 2d+126) 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 <= -5e+113) {
tmp = t_1;
} else if (t <= 2e+126) {
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 <= -5e+113: tmp = t_1 elif t <= 2e+126: 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 <= -5e+113) tmp = t_1; elseif (t <= 2e+126) tmp = Float64(x * Float64(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 <= -5e+113) tmp = t_1; elseif (t <= 2e+126) 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, -5e+113], t$95$1, If[LessEqual[t, 2e+126], N[(x * N[(N[(N[(1.0 / a), $MachinePrecision] * N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{if}\;t \leq -5 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2 \cdot 10^{+126}:\\
\;\;\;\;x \cdot \frac{\frac{1}{a} \cdot e^{\log z \cdot y - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5e113 or 1.99999999999999985e126 < t Initial program 98.5%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6480.5
Applied rewrites80.5%
if -5e113 < t < 1.99999999999999985e126Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* (log z) y))) y)))
(if (<= y -4e+112)
t_1
(if (<= y 2.04e+28) (/ (* 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 <= -4e+112) {
tmp = t_1;
} else if (y <= 2.04e+28) {
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 <= (-4d+112)) then
tmp = t_1
else if (y <= 2.04d+28) 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 <= -4e+112) {
tmp = t_1;
} else if (y <= 2.04e+28) {
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 <= -4e+112: tmp = t_1 elif y <= 2.04e+28: 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 <= -4e+112) tmp = t_1; elseif (y <= 2.04e+28) 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 <= -4e+112) tmp = t_1; elseif (y <= 2.04e+28) 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, -4e+112], t$95$1, If[LessEqual[y, 2.04e+28], 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 -4 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.04 \cdot 10^{+28}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.9999999999999997e112 or 2.04e28 < y Initial program 98.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6448.3
Applied rewrites48.3%
if -3.9999999999999997e112 < y < 2.04e28Initial program 98.5%
Taylor expanded in y around 0
lower-*.f64N/A
lift-log.f64N/A
lift--.f6480.5
Applied rewrites80.5%
(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 -4e+41)
t_2
(if (<= t_1 -200.0)
(/ (* x (/ (pow z y) a)) y)
(if (<= t_1 2e+22) (/ (* 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 <= -4e+41) {
tmp = t_2;
} else if (t_1 <= -200.0) {
tmp = (x * (pow(z, y) / a)) / y;
} else if (t_1 <= 2e+22) {
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 <= (-4d+41)) then
tmp = t_2
else if (t_1 <= (-200.0d0)) then
tmp = (x * ((z ** y) / a)) / y
else if (t_1 <= 2d+22) 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 <= -4e+41) {
tmp = t_2;
} else if (t_1 <= -200.0) {
tmp = (x * (Math.pow(z, y) / a)) / y;
} else if (t_1 <= 2e+22) {
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 <= -4e+41: tmp = t_2 elif t_1 <= -200.0: tmp = (x * (math.pow(z, y) / a)) / y elif t_1 <= 2e+22: 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 <= -4e+41) tmp = t_2; elseif (t_1 <= -200.0) tmp = Float64(Float64(x * Float64((z ^ y) / a)) / y); elseif (t_1 <= 2e+22) 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 <= -4e+41) tmp = t_2; elseif (t_1 <= -200.0) tmp = (x * ((z ^ y) / a)) / y; elseif (t_1 <= 2e+22) 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, -4e+41], t$95$2, If[LessEqual[t$95$1, -200.0], N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$1, 2e+22], 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 -4 \cdot 10^{+41}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -200:\\
\;\;\;\;\frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+22}:\\
\;\;\;\;\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)) < -4.00000000000000002e41 or 2e22 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6447.7
Applied rewrites47.7%
if -4.00000000000000002e41 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -200Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6459.7
Applied rewrites59.7%
if -200 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 2e22Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a)))
(t_2 (/ (exp (- b)) a))
(t_3 (/ (* x (exp (* (log a) t))) y)))
(if (<= t_1 -4e+41)
t_3
(if (<= t_1 -325.0)
(* (/ t_2 y) x)
(if (<= t_1 -200.0)
(/ (* x (exp (* (log z) y))) y)
(if (<= t_1 2e+22) (/ (* x t_2) y) t_3))))))
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 = exp(-b) / a;
double t_3 = (x * exp((log(a) * t))) / y;
double tmp;
if (t_1 <= -4e+41) {
tmp = t_3;
} else if (t_1 <= -325.0) {
tmp = (t_2 / y) * x;
} else if (t_1 <= -200.0) {
tmp = (x * exp((log(z) * y))) / y;
} else if (t_1 <= 2e+22) {
tmp = (x * t_2) / y;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = (t - 1.0d0) * log(a)
t_2 = exp(-b) / a
t_3 = (x * exp((log(a) * t))) / y
if (t_1 <= (-4d+41)) then
tmp = t_3
else if (t_1 <= (-325.0d0)) then
tmp = (t_2 / y) * x
else if (t_1 <= (-200.0d0)) then
tmp = (x * exp((log(z) * y))) / y
else if (t_1 <= 2d+22) then
tmp = (x * t_2) / y
else
tmp = t_3
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * Math.log(a);
double t_2 = Math.exp(-b) / a;
double t_3 = (x * Math.exp((Math.log(a) * t))) / y;
double tmp;
if (t_1 <= -4e+41) {
tmp = t_3;
} else if (t_1 <= -325.0) {
tmp = (t_2 / y) * x;
} else if (t_1 <= -200.0) {
tmp = (x * Math.exp((Math.log(z) * y))) / y;
} else if (t_1 <= 2e+22) {
tmp = (x * t_2) / y;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 1.0) * math.log(a) t_2 = math.exp(-b) / a t_3 = (x * math.exp((math.log(a) * t))) / y tmp = 0 if t_1 <= -4e+41: tmp = t_3 elif t_1 <= -325.0: tmp = (t_2 / y) * x elif t_1 <= -200.0: tmp = (x * math.exp((math.log(z) * y))) / y elif t_1 <= 2e+22: tmp = (x * t_2) / y else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * log(a)) t_2 = Float64(exp(Float64(-b)) / a) t_3 = Float64(Float64(x * exp(Float64(log(a) * t))) / y) tmp = 0.0 if (t_1 <= -4e+41) tmp = t_3; elseif (t_1 <= -325.0) tmp = Float64(Float64(t_2 / y) * x); elseif (t_1 <= -200.0) tmp = Float64(Float64(x * exp(Float64(log(z) * y))) / y); elseif (t_1 <= 2e+22) tmp = Float64(Float64(x * t_2) / y); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (t - 1.0) * log(a); t_2 = exp(-b) / a; t_3 = (x * exp((log(a) * t))) / y; tmp = 0.0; if (t_1 <= -4e+41) tmp = t_3; elseif (t_1 <= -325.0) tmp = (t_2 / y) * x; elseif (t_1 <= -200.0) tmp = (x * exp((log(z) * y))) / y; elseif (t_1 <= 2e+22) tmp = (x * t_2) / y; else tmp = t_3; 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[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * N[Exp[N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+41], t$95$3, If[LessEqual[t$95$1, -325.0], N[(N[(t$95$2 / y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, -200.0], N[(N[(x * N[Exp[N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$1, 2e+22], N[(N[(x * t$95$2), $MachinePrecision] / y), $MachinePrecision], t$95$3]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := \frac{e^{-b}}{a}\\
t_3 := \frac{x \cdot e^{\log a \cdot t}}{y}\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+41}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_1 \leq -325:\\
\;\;\;\;\frac{t\_2}{y} \cdot x\\
\mathbf{elif}\;t\_1 \leq -200:\\
\;\;\;\;\frac{x \cdot e^{\log z \cdot y}}{y}\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+22}:\\
\;\;\;\;\frac{x \cdot t\_2}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -4.00000000000000002e41 or 2e22 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6447.7
Applied rewrites47.7%
if -4.00000000000000002e41 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -325Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.7
Applied rewrites59.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.7
Applied rewrites59.7%
if -325 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -200Initial program 98.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6448.3
Applied rewrites48.3%
if -200 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 2e22Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* (log a) t))) y))
(t_2 (* (- t 1.0) (log a)))
(t_3 (* (/ (/ (exp (- b)) a) y) x)))
(if (<= t_2 -4e+41)
t_1
(if (<= t_2 380.0)
t_3
(if (<= t_2 550.0)
(/ (* (pow z y) x) (* a y))
(if (<= t_2 2e+19) t_3 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 t_2 = (t - 1.0) * log(a);
double t_3 = ((exp(-b) / a) / y) * x;
double tmp;
if (t_2 <= -4e+41) {
tmp = t_1;
} else if (t_2 <= 380.0) {
tmp = t_3;
} else if (t_2 <= 550.0) {
tmp = (pow(z, y) * x) / (a * y);
} else if (t_2 <= 2e+19) {
tmp = t_3;
} 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = (x * exp((log(a) * t))) / y
t_2 = (t - 1.0d0) * log(a)
t_3 = ((exp(-b) / a) / y) * x
if (t_2 <= (-4d+41)) then
tmp = t_1
else if (t_2 <= 380.0d0) then
tmp = t_3
else if (t_2 <= 550.0d0) then
tmp = ((z ** y) * x) / (a * y)
else if (t_2 <= 2d+19) then
tmp = t_3
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 t_2 = (t - 1.0) * Math.log(a);
double t_3 = ((Math.exp(-b) / a) / y) * x;
double tmp;
if (t_2 <= -4e+41) {
tmp = t_1;
} else if (t_2 <= 380.0) {
tmp = t_3;
} else if (t_2 <= 550.0) {
tmp = (Math.pow(z, y) * x) / (a * y);
} else if (t_2 <= 2e+19) {
tmp = t_3;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp((math.log(a) * t))) / y t_2 = (t - 1.0) * math.log(a) t_3 = ((math.exp(-b) / a) / y) * x tmp = 0 if t_2 <= -4e+41: tmp = t_1 elif t_2 <= 380.0: tmp = t_3 elif t_2 <= 550.0: tmp = (math.pow(z, y) * x) / (a * y) elif t_2 <= 2e+19: tmp = t_3 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) t_2 = Float64(Float64(t - 1.0) * log(a)) t_3 = Float64(Float64(Float64(exp(Float64(-b)) / a) / y) * x) tmp = 0.0 if (t_2 <= -4e+41) tmp = t_1; elseif (t_2 <= 380.0) tmp = t_3; elseif (t_2 <= 550.0) tmp = Float64(Float64((z ^ y) * x) / Float64(a * y)); elseif (t_2 <= 2e+19) tmp = t_3; 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; t_2 = (t - 1.0) * log(a); t_3 = ((exp(-b) / a) / y) * x; tmp = 0.0; if (t_2 <= -4e+41) tmp = t_1; elseif (t_2 <= 380.0) tmp = t_3; elseif (t_2 <= 550.0) tmp = ((z ^ y) * x) / (a * y); elseif (t_2 <= 2e+19) tmp = t_3; 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]}, Block[{t$95$2 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+41], t$95$1, If[LessEqual[t$95$2, 380.0], t$95$3, If[LessEqual[t$95$2, 550.0], N[(N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+19], t$95$3, t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\log a \cdot t}}{y}\\
t_2 := \left(t - 1\right) \cdot \log a\\
t_3 := \frac{\frac{e^{-b}}{a}}{y} \cdot x\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 380:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 550:\\
\;\;\;\;\frac{{z}^{y} \cdot x}{a \cdot y}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+19}:\\
\;\;\;\;t\_3\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -4.00000000000000002e41 or 2e19 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.5%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
lift-log.f6447.7
Applied rewrites47.7%
if -4.00000000000000002e41 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 380 or 550 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 2e19Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.7
Applied rewrites59.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.7
Applied rewrites59.7%
if 380 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 550Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -7000000.0)
t_1
(if (<= b 900.0) (/ (* (pow z y) x) (* a y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (exp(-b) / y);
double tmp;
if (b <= -7000000.0) {
tmp = t_1;
} else if (b <= 900.0) {
tmp = (pow(z, y) * x) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x * (exp(-b) / y)
if (b <= (-7000000.0d0)) then
tmp = t_1
else if (b <= 900.0d0) then
tmp = ((z ** y) * x) / (a * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (Math.exp(-b) / y);
double tmp;
if (b <= -7000000.0) {
tmp = t_1;
} else if (b <= 900.0) {
tmp = (Math.pow(z, y) * x) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (math.exp(-b) / y) tmp = 0 if b <= -7000000.0: tmp = t_1 elif b <= 900.0: tmp = (math.pow(z, y) * x) / (a * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(exp(Float64(-b)) / y)) tmp = 0.0 if (b <= -7000000.0) tmp = t_1; elseif (b <= 900.0) tmp = Float64(Float64((z ^ y) * x) / Float64(a * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * (exp(-b) / y); tmp = 0.0; if (b <= -7000000.0) tmp = t_1; elseif (b <= 900.0) tmp = ((z ^ y) * x) / (a * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -7000000.0], t$95$1, If[LessEqual[b, 900.0], N[(N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -7000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 900:\\
\;\;\;\;\frac{{z}^{y} \cdot x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -7e6 or 900 < b Initial program 98.5%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.7
Applied rewrites48.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.7
Applied rewrites48.7%
if -7e6 < b < 900Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (- b))))
(if (<= b -2.8e-11)
(* (/ (/ t_1 a) y) x)
(if (<= b 3.45e+41)
(/ (/ (fma (* (log z) y) x x) 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 (b <= -2.8e-11) {
tmp = ((t_1 / a) / y) * x;
} else if (b <= 3.45e+41) {
tmp = (fma((log(z) * y), x, x) / 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 (b <= -2.8e-11) tmp = Float64(Float64(Float64(t_1 / a) / y) * x); elseif (b <= 3.45e+41) tmp = Float64(Float64(fma(Float64(log(z) * y), x, x) / a) / y); else tmp = Float64(x * Float64(t_1 / y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, If[LessEqual[b, -2.8e-11], N[(N[(N[(t$95$1 / a), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[b, 3.45e+41], N[(N[(N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] * x + x), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision], N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
\mathbf{if}\;b \leq -2.8 \cdot 10^{-11}:\\
\;\;\;\;\frac{\frac{t\_1}{a}}{y} \cdot x\\
\mathbf{elif}\;b \leq 3.45 \cdot 10^{+41}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\log z \cdot y, x, x\right)}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{t\_1}{y}\\
\end{array}
\end{array}
if b < -2.8e-11Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.7
Applied rewrites59.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6459.7
Applied rewrites59.7%
if -2.8e-11 < b < 3.4500000000000001e41Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
lower-/.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f6431.4
Applied rewrites31.4%
if 3.4500000000000001e41 < b Initial program 98.5%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.7
Applied rewrites48.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.7
Applied rewrites48.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -2.1)
t_1
(if (<= b 3.45e+41) (/ (/ (fma (* (log z) y) x x) a) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (exp(-b) / y);
double tmp;
if (b <= -2.1) {
tmp = t_1;
} else if (b <= 3.45e+41) {
tmp = (fma((log(z) * y), x, x) / a) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(exp(Float64(-b)) / y)) tmp = 0.0 if (b <= -2.1) tmp = t_1; elseif (b <= 3.45e+41) tmp = Float64(Float64(fma(Float64(log(z) * y), x, x) / a) / y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.1], t$95$1, If[LessEqual[b, 3.45e+41], N[(N[(N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] * x + x), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -2.1:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.45 \cdot 10^{+41}:\\
\;\;\;\;\frac{\frac{\mathsf{fma}\left(\log z \cdot y, x, x\right)}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.10000000000000009 or 3.4500000000000001e41 < b Initial program 98.5%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.7
Applied rewrites48.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.7
Applied rewrites48.7%
if -2.10000000000000009 < b < 3.4500000000000001e41Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
lower-/.f64N/A
div-add-revN/A
lower-/.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f6431.4
Applied rewrites31.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (exp (- b)) y))))
(if (<= b -1.85)
t_1
(if (<= b 350.0) (/ (* (fma (log z) y 1.0) x) (* a y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (exp(-b) / y);
double tmp;
if (b <= -1.85) {
tmp = t_1;
} else if (b <= 350.0) {
tmp = (fma(log(z), y, 1.0) * x) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64(exp(Float64(-b)) / y)) tmp = 0.0 if (b <= -1.85) tmp = t_1; elseif (b <= 350.0) tmp = Float64(Float64(fma(log(z), y, 1.0) * x) / Float64(a * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.85], t$95$1, If[LessEqual[b, 350.0], N[(N[(N[(N[Log[z], $MachinePrecision] * y + 1.0), $MachinePrecision] * x), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{e^{-b}}{y}\\
\mathbf{if}\;b \leq -1.85:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 350:\\
\;\;\;\;\frac{\mathsf{fma}\left(\log z, y, 1\right) \cdot x}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.8500000000000001 or 350 < b Initial program 98.5%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.7
Applied rewrites48.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.7
Applied rewrites48.7%
if -1.8500000000000001 < b < 350Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6429.7
Applied rewrites29.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* x (/ (exp (- b)) y)))) (if (<= b -1.85) t_1 (if (<= b 4.7e-14) (/ (* 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 <= -1.85) {
tmp = t_1;
} else if (b <= 4.7e-14) {
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 <= (-1.85d0)) then
tmp = t_1
else if (b <= 4.7d-14) 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 <= -1.85) {
tmp = t_1;
} else if (b <= 4.7e-14) {
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 <= -1.85: tmp = t_1 elif b <= 4.7e-14: 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 <= -1.85) tmp = t_1; elseif (b <= 4.7e-14) 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 <= -1.85) tmp = t_1; elseif (b <= 4.7e-14) 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, -1.85], t$95$1, If[LessEqual[b, 4.7e-14], 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 -1.85:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.7 \cdot 10^{-14}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.8500000000000001 or 4.7000000000000002e-14 < b Initial program 98.5%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6448.7
Applied rewrites48.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6448.7
Applied rewrites48.7%
if -1.8500000000000001 < b < 4.7000000000000002e-14Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
Taylor expanded in b around 0
Applied rewrites31.1%
(FPCore (x y z t a b) :precision binary64 (/ (* x (/ (exp (- b)) a)) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * (exp(-b) / 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 * (exp(-b) / a)) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * (Math.exp(-b) / a)) / y;
}
def code(x, y, z, t, a, b): return (x * (math.exp(-b) / a)) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * (exp(-b) / a)) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \frac{e^{-b}}{a}}{y}
\end{array}
Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -8.5e-285) (/ (* x (/ (* (* b b) 0.5) a)) y) (/ x (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.5e-285) {
tmp = (x * (((b * b) * 0.5) / a)) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-8.5d-285)) then
tmp = (x * (((b * b) * 0.5d0) / a)) / y
else
tmp = x / (a * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.5e-285) {
tmp = (x * (((b * b) * 0.5) / a)) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -8.5e-285: tmp = (x * (((b * b) * 0.5) / a)) / y else: tmp = x / (a * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.5e-285) tmp = Float64(Float64(x * Float64(Float64(Float64(b * b) * 0.5) / a)) / y); else tmp = Float64(x / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -8.5e-285) tmp = (x * (((b * b) * 0.5) / a)) / y; else tmp = x / (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.5e-285], N[(N[(x * N[(N[(N[(b * b), $MachinePrecision] * 0.5), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.5 \cdot 10^{-285}:\\
\;\;\;\;\frac{x \cdot \frac{\left(b \cdot b\right) \cdot 0.5}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a \cdot y}\\
\end{array}
\end{array}
if b < -8.49999999999999979e-285Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
Taylor expanded in b around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-*.f6439.4
Applied rewrites39.4%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
unpow2N/A
lower-*.f6436.7
Applied rewrites36.7%
if -8.49999999999999979e-285 < b Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
Applied rewrites30.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -3.8e-105) (/ (* x (/ (+ (- b) 1.0) a)) y) (/ x (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.8e-105) {
tmp = (x * ((-b + 1.0) / a)) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-3.8d-105)) then
tmp = (x * ((-b + 1.0d0) / a)) / y
else
tmp = x / (a * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.8e-105) {
tmp = (x * ((-b + 1.0) / a)) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.8e-105: tmp = (x * ((-b + 1.0) / a)) / y else: tmp = x / (a * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.8e-105) tmp = Float64(Float64(x * Float64(Float64(Float64(-b) + 1.0) / a)) / y); else tmp = Float64(x / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -3.8e-105) tmp = (x * ((-b + 1.0) / a)) / y; else tmp = x / (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.8e-105], N[(N[(x * N[(N[((-b) + 1.0), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.8 \cdot 10^{-105}:\\
\;\;\;\;\frac{x \cdot \frac{\left(-b\right) + 1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a \cdot y}\\
\end{array}
\end{array}
if b < -3.7999999999999998e-105Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
Taylor expanded in b around 0
mul-1-negN/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f6432.4
Applied rewrites32.4%
if -3.7999999999999998e-105 < b Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
Applied rewrites30.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.15e+18) (* x (/ (/ (+ (- b) 1.0) a) y)) (/ x (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.15e+18) {
tmp = x * (((-b + 1.0) / a) / y);
} else {
tmp = x / (a * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-2.15d+18)) then
tmp = x * (((-b + 1.0d0) / a) / y)
else
tmp = x / (a * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.15e+18) {
tmp = x * (((-b + 1.0) / a) / y);
} else {
tmp = x / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.15e+18: tmp = x * (((-b + 1.0) / a) / y) else: tmp = x / (a * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.15e+18) tmp = Float64(x * Float64(Float64(Float64(Float64(-b) + 1.0) / a) / y)); else tmp = Float64(x / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -2.15e+18) tmp = x * (((-b + 1.0) / a) / y); else tmp = x / (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.15e+18], N[(x * N[(N[(N[((-b) + 1.0), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.15 \cdot 10^{+18}:\\
\;\;\;\;x \cdot \frac{\frac{\left(-b\right) + 1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a \cdot y}\\
\end{array}
\end{array}
if b < -2.15e18Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6459.7
Applied rewrites59.7%
Taylor expanded in b around 0
mul-1-negN/A
lift-neg.f64N/A
+-commutativeN/A
lower-+.f6432.2
Applied rewrites32.2%
if -2.15e18 < b Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
Applied rewrites30.9%
(FPCore (x y z t a b) :precision binary64 (if (<= (* (- t 1.0) (log a)) -5e+90) (/ (* x (/ 1.0 a)) y) (/ x (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= -5e+90) {
tmp = (x * (1.0 / a)) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((t - 1.0d0) * log(a)) <= (-5d+90)) then
tmp = (x * (1.0d0 / a)) / y
else
tmp = x / (a * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * Math.log(a)) <= -5e+90) {
tmp = (x * (1.0 / a)) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((t - 1.0) * math.log(a)) <= -5e+90: tmp = (x * (1.0 / a)) / y else: tmp = x / (a * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(t - 1.0) * log(a)) <= -5e+90) tmp = Float64(Float64(x * Float64(1.0 / a)) / y); else tmp = Float64(x / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((t - 1.0) * log(a)) <= -5e+90) tmp = (x * (1.0 / a)) / y; else tmp = x / (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision], -5e+90], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(t - 1\right) \cdot \log a \leq -5 \cdot 10^{+90}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a \cdot y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -5.0000000000000004e90Initial program 98.5%
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.f6481.5
Applied rewrites81.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lift-neg.f6460.1
Applied rewrites60.1%
Taylor expanded in b around 0
Applied rewrites31.1%
if -5.0000000000000004e90 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
Applied rewrites30.9%
(FPCore (x y z t a b) :precision binary64 (/ x (* a y)))
double code(double x, double y, double z, double t, double a, double b) {
return x / (a * y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x / (a * y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / (a * y);
}
def code(x, y, z, t, a, b): return x / (a * y)
function code(x, y, z, t, a, b) return Float64(x / Float64(a * y)) end
function tmp = code(x, y, z, t, a, b) tmp = x / (a * y); end
code[x_, y_, z_, t_, a_, b_] := N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a \cdot y}
\end{array}
Initial program 98.5%
Taylor expanded in t around 0
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites81.4%
Taylor expanded in b around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f6454.1
Applied rewrites54.1%
Taylor expanded in y around 0
Applied rewrites30.9%
herbie shell --seed 2025123
(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))