
(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 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (/ (* x (* (exp (fma (log a) t (- (* y (log z)) b))) (/ 1.0 a))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * (exp(fma(log(a), t, ((y * log(z)) - b))) * (1.0 / a))) / y;
}
function code(x, y, z, t, a, b) return Float64(Float64(x * Float64(exp(fma(log(a), t, Float64(Float64(y * log(z)) - b))) * Float64(1.0 / a))) / y) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[(N[Exp[N[(N[Log[a], $MachinePrecision] * t + N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \left(e^{\mathsf{fma}\left(\log a, t, y \cdot \log z - b\right)} \cdot \frac{1}{a}\right)}{y}
\end{array}
Initial program 98.3%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
metadata-evalN/A
mul-1-negN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites98.3%
lift-exp.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
mul-1-negN/A
+-commutativeN/A
associate-+r+N/A
exp-sumN/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
Applied rewrites98.9%
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
Initial program 98.3%
(FPCore (x y z t a b) :precision binary64 (/ (/ x (exp (fma (- 1.0 t) (log a) (- b (* (log z) y))))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x / exp(fma((1.0 - t), log(a), (b - (log(z) * y))))) / y;
}
function code(x, y, z, t, a, b) return Float64(Float64(x / exp(fma(Float64(1.0 - t), log(a), Float64(b - Float64(log(z) * y))))) / y) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x / N[Exp[N[(N[(1.0 - t), $MachinePrecision] * N[Log[a], $MachinePrecision] + N[(b - N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{e^{\mathsf{fma}\left(1 - t, \log a, b - \log z \cdot y\right)}}}{y}
\end{array}
Initial program 98.3%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
Applied rewrites98.3%
(FPCore (x y z t a b) :precision binary64 (* (/ (exp (fma (log a) (- t 1.0) (- (* (log z) y) b))) y) x))
double code(double x, double y, double z, double t, double a, double b) {
return (exp(fma(log(a), (t - 1.0), ((log(z) * y) - b))) / y) * x;
}
function code(x, y, z, t, a, b) return Float64(Float64(exp(fma(log(a), Float64(t - 1.0), Float64(Float64(log(z) * y) - b))) / y) * x) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[Exp[N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{\mathsf{fma}\left(\log a, t - 1, \log z \cdot y - b\right)}}{y} \cdot x
\end{array}
Initial program 98.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- (- (* y (log z)) (log a)) b)) y) x)))
(if (<= y -6.2e+97)
t_1
(if (<= y 29.5) (/ (* x (/ (exp (- (* t (log a)) b)) a)) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (exp((((y * log(z)) - log(a)) - b)) / y) * x;
double tmp;
if (y <= -6.2e+97) {
tmp = t_1;
} else if (y <= 29.5) {
tmp = (x * (exp(((t * log(a)) - 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 = (exp((((y * log(z)) - log(a)) - b)) / y) * x
if (y <= (-6.2d+97)) then
tmp = t_1
else if (y <= 29.5d0) then
tmp = (x * (exp(((t * log(a)) - b)) / a)) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.exp((((y * Math.log(z)) - Math.log(a)) - b)) / y) * x;
double tmp;
if (y <= -6.2e+97) {
tmp = t_1;
} else if (y <= 29.5) {
tmp = (x * (Math.exp(((t * Math.log(a)) - b)) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.exp((((y * math.log(z)) - math.log(a)) - b)) / y) * x tmp = 0 if y <= -6.2e+97: tmp = t_1 elif y <= 29.5: tmp = (x * (math.exp(((t * math.log(a)) - b)) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(exp(Float64(Float64(Float64(y * log(z)) - log(a)) - b)) / y) * x) tmp = 0.0 if (y <= -6.2e+97) tmp = t_1; elseif (y <= 29.5) tmp = Float64(Float64(x * Float64(exp(Float64(Float64(t * log(a)) - b)) / a)) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (exp((((y * log(z)) - log(a)) - b)) / y) * x; tmp = 0.0; if (y <= -6.2e+97) tmp = t_1; elseif (y <= 29.5) tmp = (x * (exp(((t * log(a)) - b)) / a)) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -6.2e+97], t$95$1, If[LessEqual[y, 29.5], N[(N[(x * N[(N[Exp[N[(N[(t * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{e^{\left(y \cdot \log z - \log a\right) - b}}{y} \cdot x\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+97}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 29.5:\\
\;\;\;\;\frac{x \cdot \frac{e^{t \cdot \log a - b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -6.19999999999999962e97 or 29.5 < y Initial program 98.3%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f6480.3
Applied rewrites80.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.2%
if -6.19999999999999962e97 < y < 29.5Initial program 98.3%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
metadata-evalN/A
mul-1-negN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites98.3%
lift-exp.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
mul-1-negN/A
+-commutativeN/A
associate-+r+N/A
exp-sumN/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
Applied rewrites98.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.4
Applied rewrites80.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (exp (- (- (* y (log z)) (log a)) b))))
(if (<= y -6.2e+97)
(* (/ t_1 y) x)
(if (<= y 29.5)
(/ (* x (/ (exp (- (* t (log a)) b)) a)) y)
(* (* (/ 1.0 y) t_1) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((((y * log(z)) - log(a)) - b));
double tmp;
if (y <= -6.2e+97) {
tmp = (t_1 / y) * x;
} else if (y <= 29.5) {
tmp = (x * (exp(((t * log(a)) - b)) / a)) / y;
} else {
tmp = ((1.0 / y) * t_1) * x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = exp((((y * log(z)) - log(a)) - b))
if (y <= (-6.2d+97)) then
tmp = (t_1 / y) * x
else if (y <= 29.5d0) then
tmp = (x * (exp(((t * log(a)) - b)) / a)) / y
else
tmp = ((1.0d0 / y) * t_1) * x
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((((y * Math.log(z)) - Math.log(a)) - b));
double tmp;
if (y <= -6.2e+97) {
tmp = (t_1 / y) * x;
} else if (y <= 29.5) {
tmp = (x * (Math.exp(((t * Math.log(a)) - b)) / a)) / y;
} else {
tmp = ((1.0 / y) * t_1) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((((y * math.log(z)) - math.log(a)) - b)) tmp = 0 if y <= -6.2e+97: tmp = (t_1 / y) * x elif y <= 29.5: tmp = (x * (math.exp(((t * math.log(a)) - b)) / a)) / y else: tmp = ((1.0 / y) * t_1) * x return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(Float64(Float64(y * log(z)) - log(a)) - b)) tmp = 0.0 if (y <= -6.2e+97) tmp = Float64(Float64(t_1 / y) * x); elseif (y <= 29.5) tmp = Float64(Float64(x * Float64(exp(Float64(Float64(t * log(a)) - b)) / a)) / y); else tmp = Float64(Float64(Float64(1.0 / y) * t_1) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((((y * log(z)) - log(a)) - b)); tmp = 0.0; if (y <= -6.2e+97) tmp = (t_1 / y) * x; elseif (y <= 29.5) tmp = (x * (exp(((t * log(a)) - b)) / a)) / y; else tmp = ((1.0 / y) * t_1) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -6.2e+97], N[(N[(t$95$1 / y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[y, 29.5], N[(N[(x * N[(N[Exp[N[(N[(t * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(1.0 / y), $MachinePrecision] * t$95$1), $MachinePrecision] * x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{\left(y \cdot \log z - \log a\right) - b}\\
\mathbf{if}\;y \leq -6.2 \cdot 10^{+97}:\\
\;\;\;\;\frac{t\_1}{y} \cdot x\\
\mathbf{elif}\;y \leq 29.5:\\
\;\;\;\;\frac{x \cdot \frac{e^{t \cdot \log a - b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(\frac{1}{y} \cdot t\_1\right) \cdot x\\
\end{array}
\end{array}
if y < -6.19999999999999962e97Initial program 98.3%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f6480.3
Applied rewrites80.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites80.2%
if -6.19999999999999962e97 < y < 29.5Initial program 98.3%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
metadata-evalN/A
mul-1-negN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites98.3%
lift-exp.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
mul-1-negN/A
+-commutativeN/A
associate-+r+N/A
exp-sumN/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
Applied rewrites98.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.4
Applied rewrites80.4%
if 29.5 < y Initial program 98.3%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f6480.3
Applied rewrites80.3%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
Applied rewrites80.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (* (exp (* (- y) (log z))) y))))
(if (<= y -7.8e+99)
t_1
(if (<= y 15500000.0) (/ (* x (/ (exp (- (* t (log a)) b)) a)) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (exp((-y * log(z))) * y);
double tmp;
if (y <= -7.8e+99) {
tmp = t_1;
} else if (y <= 15500000.0) {
tmp = (x * (exp(((t * log(a)) - 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((-y * log(z))) * y)
if (y <= (-7.8d+99)) then
tmp = t_1
else if (y <= 15500000.0d0) then
tmp = (x * (exp(((t * log(a)) - 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((-y * Math.log(z))) * y);
double tmp;
if (y <= -7.8e+99) {
tmp = t_1;
} else if (y <= 15500000.0) {
tmp = (x * (Math.exp(((t * Math.log(a)) - b)) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (math.exp((-y * math.log(z))) * y) tmp = 0 if y <= -7.8e+99: tmp = t_1 elif y <= 15500000.0: tmp = (x * (math.exp(((t * math.log(a)) - b)) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(exp(Float64(Float64(-y) * log(z))) * y)) tmp = 0.0 if (y <= -7.8e+99) tmp = t_1; elseif (y <= 15500000.0) tmp = Float64(Float64(x * Float64(exp(Float64(Float64(t * log(a)) - 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((-y * log(z))) * y); tmp = 0.0; if (y <= -7.8e+99) tmp = t_1; elseif (y <= 15500000.0) tmp = (x * (exp(((t * log(a)) - b)) / 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[N[((-y) * N[Log[z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.8e+99], t$95$1, If[LessEqual[y, 15500000.0], N[(N[(x * N[(N[Exp[N[(N[(t * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{e^{\left(-y\right) \cdot \log z} \cdot y}\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 15500000:\\
\;\;\;\;\frac{x \cdot \frac{e^{t \cdot \log a - b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.79999999999999989e99 or 1.55e7 < y Initial program 98.3%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
Applied rewrites98.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6448.5
Applied rewrites48.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6448.5
Applied rewrites48.5%
if -7.79999999999999989e99 < y < 1.55e7Initial program 98.3%
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
sub-flip-reverseN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-flipN/A
distribute-lft-inN/A
associate-+l+N/A
*-commutativeN/A
metadata-evalN/A
mul-1-negN/A
lower-fma.f64N/A
lower-+.f64N/A
Applied rewrites98.3%
lift-exp.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
lift-neg.f64N/A
mul-1-negN/A
+-commutativeN/A
associate-+r+N/A
exp-sumN/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
inv-powN/A
lower-*.f64N/A
Applied rewrites98.9%
Taylor expanded in y around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.4
Applied rewrites80.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (* (exp (* (- y) (log z))) y))))
(if (<= y -7.8e+99)
t_1
(if (<= y 15500000.0)
(/ (* 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((-y * log(z))) * y);
double tmp;
if (y <= -7.8e+99) {
tmp = t_1;
} else if (y <= 15500000.0) {
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((-y * log(z))) * y)
if (y <= (-7.8d+99)) then
tmp = t_1
else if (y <= 15500000.0d0) 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((-y * Math.log(z))) * y);
double tmp;
if (y <= -7.8e+99) {
tmp = t_1;
} else if (y <= 15500000.0) {
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((-y * math.log(z))) * y) tmp = 0 if y <= -7.8e+99: tmp = t_1 elif y <= 15500000.0: 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(x / Float64(exp(Float64(Float64(-y) * log(z))) * y)) tmp = 0.0 if (y <= -7.8e+99) tmp = t_1; elseif (y <= 15500000.0) 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((-y * log(z))) * y); tmp = 0.0; if (y <= -7.8e+99) tmp = t_1; elseif (y <= 15500000.0) 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[(x / N[(N[Exp[N[((-y) * N[Log[z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.8e+99], t$95$1, If[LessEqual[y, 15500000.0], 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}{e^{\left(-y\right) \cdot \log z} \cdot y}\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 15500000:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.79999999999999989e99 or 1.55e7 < y Initial program 98.3%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
Applied rewrites98.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6448.5
Applied rewrites48.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6448.5
Applied rewrites48.5%
if -7.79999999999999989e99 < y < 1.55e7Initial program 98.3%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.8
Applied rewrites79.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (* (exp (* (- y) (log z))) y))))
(if (<= y -7.8e+99)
t_1
(if (<= y 15500000.0) (/ (/ x (exp (fma (- 1.0 t) (log a) b))) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (exp((-y * log(z))) * y);
double tmp;
if (y <= -7.8e+99) {
tmp = t_1;
} else if (y <= 15500000.0) {
tmp = (x / exp(fma((1.0 - t), log(a), b))) / y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(exp(Float64(Float64(-y) * log(z))) * y)) tmp = 0.0 if (y <= -7.8e+99) tmp = t_1; elseif (y <= 15500000.0) tmp = Float64(Float64(x / exp(fma(Float64(1.0 - t), log(a), b))) / 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[N[((-y) * N[Log[z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.8e+99], t$95$1, If[LessEqual[y, 15500000.0], N[(N[(x / N[Exp[N[(N[(1.0 - t), $MachinePrecision] * N[Log[a], $MachinePrecision] + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{e^{\left(-y\right) \cdot \log z} \cdot y}\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 15500000:\\
\;\;\;\;\frac{\frac{x}{e^{\mathsf{fma}\left(1 - t, \log a, b\right)}}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.79999999999999989e99 or 1.55e7 < y Initial program 98.3%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
Applied rewrites98.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6448.5
Applied rewrites48.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6448.5
Applied rewrites48.5%
if -7.79999999999999989e99 < y < 1.55e7Initial program 98.3%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
Applied rewrites98.3%
Taylor expanded in y around 0
Applied rewrites79.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ x (* (exp (* (- y) (log z))) y))))
(if (<= y -7.8e+99)
t_1
(if (<= y 15500000.0) (/ x (* (exp (fma (- 1.0 t) (log a) b)) y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (exp((-y * log(z))) * y);
double tmp;
if (y <= -7.8e+99) {
tmp = t_1;
} else if (y <= 15500000.0) {
tmp = x / (exp(fma((1.0 - t), log(a), b)) * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(exp(Float64(Float64(-y) * log(z))) * y)) tmp = 0.0 if (y <= -7.8e+99) tmp = t_1; elseif (y <= 15500000.0) tmp = Float64(x / Float64(exp(fma(Float64(1.0 - t), log(a), b)) * 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[N[((-y) * N[Log[z], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.8e+99], t$95$1, If[LessEqual[y, 15500000.0], N[(x / N[(N[Exp[N[(N[(1.0 - t), $MachinePrecision] * N[Log[a], $MachinePrecision] + b), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{e^{\left(-y\right) \cdot \log z} \cdot y}\\
\mathbf{if}\;y \leq -7.8 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 15500000:\\
\;\;\;\;\frac{x}{e^{\mathsf{fma}\left(1 - t, \log a, b\right)} \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.79999999999999989e99 or 1.55e7 < y Initial program 98.3%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
Applied rewrites98.3%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6448.5
Applied rewrites48.5%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6448.5
Applied rewrites48.5%
if -7.79999999999999989e99 < y < 1.55e7Initial program 98.3%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
Applied rewrites98.3%
Taylor expanded in y around 0
Applied rewrites79.8%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
lower-/.f64N/A
lower-*.f6480.1
Applied rewrites80.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* t (log a)))) y)))
(if (<= t -1.15e+136)
t_1
(if (<= t 1.02e-231)
(/ (* x (exp (- (* -1.0 (log a)) b))) y)
(if (<= t 3600000000000.0) (/ (* x (pow z y)) (* a y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp((t * log(a)))) / y;
double tmp;
if (t <= -1.15e+136) {
tmp = t_1;
} else if (t <= 1.02e-231) {
tmp = (x * exp(((-1.0 * log(a)) - b))) / y;
} else if (t <= 3600000000000.0) {
tmp = (x * pow(z, y)) / (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((t * log(a)))) / y
if (t <= (-1.15d+136)) then
tmp = t_1
else if (t <= 1.02d-231) then
tmp = (x * exp((((-1.0d0) * log(a)) - b))) / y
else if (t <= 3600000000000.0d0) then
tmp = (x * (z ** y)) / (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((t * Math.log(a)))) / y;
double tmp;
if (t <= -1.15e+136) {
tmp = t_1;
} else if (t <= 1.02e-231) {
tmp = (x * Math.exp(((-1.0 * Math.log(a)) - b))) / y;
} else if (t <= 3600000000000.0) {
tmp = (x * Math.pow(z, y)) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp((t * math.log(a)))) / y tmp = 0 if t <= -1.15e+136: tmp = t_1 elif t <= 1.02e-231: tmp = (x * math.exp(((-1.0 * math.log(a)) - b))) / y elif t <= 3600000000000.0: tmp = (x * math.pow(z, y)) / (a * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(t * log(a)))) / y) tmp = 0.0 if (t <= -1.15e+136) tmp = t_1; elseif (t <= 1.02e-231) tmp = Float64(Float64(x * exp(Float64(Float64(-1.0 * log(a)) - b))) / y); elseif (t <= 3600000000000.0) tmp = Float64(Float64(x * (z ^ y)) / 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((t * log(a)))) / y; tmp = 0.0; if (t <= -1.15e+136) tmp = t_1; elseif (t <= 1.02e-231) tmp = (x * exp(((-1.0 * log(a)) - b))) / y; elseif (t <= 3600000000000.0) tmp = (x * (z ^ y)) / (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[(t * N[Log[a], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -1.15e+136], t$95$1, If[LessEqual[t, 1.02e-231], N[(N[(x * N[Exp[N[(N[(-1.0 * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 3600000000000.0], N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{t \cdot \log a}}{y}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-231}:\\
\;\;\;\;\frac{x \cdot e^{-1 \cdot \log a - b}}{y}\\
\mathbf{elif}\;t \leq 3600000000000:\\
\;\;\;\;\frac{x \cdot {z}^{y}}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.15e136 or 3.6e12 < t Initial program 98.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower-log.f6448.3
Applied rewrites48.3%
if -1.15e136 < t < 1.02000000000000006e-231Initial program 98.3%
Taylor expanded in t around 0
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f6480.3
Applied rewrites80.3%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f6458.3
Applied rewrites58.3%
if 1.02000000000000006e-231 < t < 3.6e12Initial program 98.3%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
div-expN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-/.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-negate-revN/A
sub-flipN/A
distribute-neg-inN/A
Applied rewrites79.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6466.1
Applied rewrites66.1%
Taylor expanded in b around 0
lower-*.f6454.6
Applied rewrites54.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* t (log a)))) y)))
(if (<= t -1.15e+136)
t_1
(if (<= t 1.02e-231)
(/ (/ x (exp (fma 1.0 (log a) b))) y)
(if (<= t 3600000000000.0) (/ (* x (pow z y)) (* a y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp((t * log(a)))) / y;
double tmp;
if (t <= -1.15e+136) {
tmp = t_1;
} else if (t <= 1.02e-231) {
tmp = (x / exp(fma(1.0, log(a), b))) / y;
} else if (t <= 3600000000000.0) {
tmp = (x * pow(z, y)) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(t * log(a)))) / y) tmp = 0.0 if (t <= -1.15e+136) tmp = t_1; elseif (t <= 1.02e-231) tmp = Float64(Float64(x / exp(fma(1.0, log(a), b))) / y); elseif (t <= 3600000000000.0) tmp = Float64(Float64(x * (z ^ y)) / Float64(a * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(t * N[Log[a], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -1.15e+136], t$95$1, If[LessEqual[t, 1.02e-231], N[(N[(x / N[Exp[N[(1.0 * N[Log[a], $MachinePrecision] + b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 3600000000000.0], N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{t \cdot \log a}}{y}\\
\mathbf{if}\;t \leq -1.15 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.02 \cdot 10^{-231}:\\
\;\;\;\;\frac{\frac{x}{e^{\mathsf{fma}\left(1, \log a, b\right)}}}{y}\\
\mathbf{elif}\;t \leq 3600000000000:\\
\;\;\;\;\frac{x \cdot {z}^{y}}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -1.15e136 or 3.6e12 < t Initial program 98.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower-log.f6448.3
Applied rewrites48.3%
if -1.15e136 < t < 1.02000000000000006e-231Initial program 98.3%
lift-*.f64N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
mult-flip-revN/A
lower-/.f64N/A
lift--.f64N/A
Applied rewrites98.3%
Taylor expanded in y around 0
Applied rewrites79.8%
Taylor expanded in t around 0
Applied rewrites58.3%
if 1.02000000000000006e-231 < t < 3.6e12Initial program 98.3%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
div-expN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-/.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-negate-revN/A
sub-flipN/A
distribute-neg-inN/A
Applied rewrites79.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6466.1
Applied rewrites66.1%
Taylor expanded in b around 0
lower-*.f6454.6
Applied rewrites54.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a))) (t_2 (/ (* x (exp (* t (log a)))) y)))
(if (<= t_1 -1.2e+99)
t_2
(if (<= t_1 -180.0)
(/ x (* y (exp (+ b (log a)))))
(if (<= t_1 1e+80) (/ (* x (pow z y)) (* 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((t * log(a)))) / y;
double tmp;
if (t_1 <= -1.2e+99) {
tmp = t_2;
} else if (t_1 <= -180.0) {
tmp = x / (y * exp((b + log(a))));
} else if (t_1 <= 1e+80) {
tmp = (x * pow(z, y)) / (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((t * log(a)))) / y
if (t_1 <= (-1.2d+99)) then
tmp = t_2
else if (t_1 <= (-180.0d0)) then
tmp = x / (y * exp((b + log(a))))
else if (t_1 <= 1d+80) then
tmp = (x * (z ** y)) / (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((t * Math.log(a)))) / y;
double tmp;
if (t_1 <= -1.2e+99) {
tmp = t_2;
} else if (t_1 <= -180.0) {
tmp = x / (y * Math.exp((b + Math.log(a))));
} else if (t_1 <= 1e+80) {
tmp = (x * Math.pow(z, y)) / (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((t * math.log(a)))) / y tmp = 0 if t_1 <= -1.2e+99: tmp = t_2 elif t_1 <= -180.0: tmp = x / (y * math.exp((b + math.log(a)))) elif t_1 <= 1e+80: tmp = (x * math.pow(z, y)) / (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(t * log(a)))) / y) tmp = 0.0 if (t_1 <= -1.2e+99) tmp = t_2; elseif (t_1 <= -180.0) tmp = Float64(x / Float64(y * exp(Float64(b + log(a))))); elseif (t_1 <= 1e+80) tmp = Float64(Float64(x * (z ^ y)) / Float64(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((t * log(a)))) / y; tmp = 0.0; if (t_1 <= -1.2e+99) tmp = t_2; elseif (t_1 <= -180.0) tmp = x / (y * exp((b + log(a)))); elseif (t_1 <= 1e+80) tmp = (x * (z ^ y)) / (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[(t * N[Log[a], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$1, -1.2e+99], t$95$2, If[LessEqual[t$95$1, -180.0], N[(x / N[(y * N[Exp[N[(b + N[Log[a], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+80], N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(a * y), $MachinePrecision]), $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^{t \cdot \log a}}{y}\\
\mathbf{if}\;t\_1 \leq -1.2 \cdot 10^{+99}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -180:\\
\;\;\;\;\frac{x}{y \cdot e^{b + \log a}}\\
\mathbf{elif}\;t\_1 \leq 10^{+80}:\\
\;\;\;\;\frac{x \cdot {z}^{y}}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1.2000000000000001e99 or 1e80 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower-log.f6448.3
Applied rewrites48.3%
if -1.2000000000000001e99 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -180Initial program 98.3%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
div-expN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-/.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-negate-revN/A
sub-flipN/A
distribute-neg-inN/A
Applied rewrites79.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6466.1
Applied rewrites66.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6458.3
Applied rewrites58.3%
if -180 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 1e80Initial program 98.3%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
div-expN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-/.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-negate-revN/A
sub-flipN/A
distribute-neg-inN/A
Applied rewrites79.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6466.1
Applied rewrites66.1%
Taylor expanded in b around 0
lower-*.f6454.6
Applied rewrites54.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<= b -1100000000000.0)
t_1
(if (<= b 0.0022) (/ (* x (pow z y)) (* a y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (exp(-b) / y) * x;
double tmp;
if (b <= -1100000000000.0) {
tmp = t_1;
} else if (b <= 0.0022) {
tmp = (x * pow(z, y)) / (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 = (exp(-b) / y) * x
if (b <= (-1100000000000.0d0)) then
tmp = t_1
else if (b <= 0.0022d0) then
tmp = (x * (z ** y)) / (a * y)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.exp(-b) / y) * x;
double tmp;
if (b <= -1100000000000.0) {
tmp = t_1;
} else if (b <= 0.0022) {
tmp = (x * Math.pow(z, y)) / (a * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.exp(-b) / y) * x tmp = 0 if b <= -1100000000000.0: tmp = t_1 elif b <= 0.0022: tmp = (x * math.pow(z, y)) / (a * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(exp(Float64(-b)) / y) * x) tmp = 0.0 if (b <= -1100000000000.0) tmp = t_1; elseif (b <= 0.0022) tmp = Float64(Float64(x * (z ^ y)) / Float64(a * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (exp(-b) / y) * x; tmp = 0.0; if (b <= -1100000000000.0) tmp = t_1; elseif (b <= 0.0022) tmp = (x * (z ^ y)) / (a * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -1100000000000.0], t$95$1, If[LessEqual[b, 0.0022], N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -1100000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 0.0022:\\
\;\;\;\;\frac{x \cdot {z}^{y}}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.1e12 or 0.00220000000000000013 < b Initial program 98.3%
Taylor expanded in b around inf
lower-*.f6447.2
Applied rewrites47.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.2
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6447.2
Applied rewrites47.2%
if -1.1e12 < b < 0.00220000000000000013Initial program 98.3%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
div-expN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-/.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-negate-revN/A
sub-flipN/A
distribute-neg-inN/A
Applied rewrites79.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6466.1
Applied rewrites66.1%
Taylor expanded in b around 0
lower-*.f6454.6
Applied rewrites54.6%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (exp (- b))) (t_2 (* (/ t_1 y) x))) (if (<= b -1e+48) t_2 (if (<= b 8e-18) (/ (* x t_1) (* a y)) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double t_2 = (t_1 / y) * x;
double tmp;
if (b <= -1e+48) {
tmp = t_2;
} else if (b <= 8e-18) {
tmp = (x * t_1) / (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 = exp(-b)
t_2 = (t_1 / y) * x
if (b <= (-1d+48)) then
tmp = t_2
else if (b <= 8d-18) then
tmp = (x * t_1) / (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 = Math.exp(-b);
double t_2 = (t_1 / y) * x;
double tmp;
if (b <= -1e+48) {
tmp = t_2;
} else if (b <= 8e-18) {
tmp = (x * t_1) / (a * y);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(-b) t_2 = (t_1 / y) * x tmp = 0 if b <= -1e+48: tmp = t_2 elif b <= 8e-18: tmp = (x * t_1) / (a * y) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) t_2 = Float64(Float64(t_1 / y) * x) tmp = 0.0 if (b <= -1e+48) tmp = t_2; elseif (b <= 8e-18) tmp = Float64(Float64(x * t_1) / Float64(a * y)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(-b); t_2 = (t_1 / y) * x; tmp = 0.0; if (b <= -1e+48) tmp = t_2; elseif (b <= 8e-18) tmp = (x * t_1) / (a * y); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -1e+48], t$95$2, If[LessEqual[b, 8e-18], N[(N[(x * t$95$1), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
t_2 := \frac{t\_1}{y} \cdot x\\
\mathbf{if}\;b \leq -1 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 8 \cdot 10^{-18}:\\
\;\;\;\;\frac{x \cdot t\_1}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.00000000000000004e48 or 8.0000000000000006e-18 < b Initial program 98.3%
Taylor expanded in b around inf
lower-*.f6447.2
Applied rewrites47.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.2
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6447.2
Applied rewrites47.2%
if -1.00000000000000004e48 < b < 8.0000000000000006e-18Initial program 98.3%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
div-expN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-/.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-negate-revN/A
sub-flipN/A
distribute-neg-inN/A
Applied rewrites79.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6466.1
Applied rewrites66.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-neg.f64N/A
lower-*.f6454.5
Applied rewrites54.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (exp (- b))) (t_2 (* (/ t_1 y) x))) (if (<= b -1e+48) t_2 (if (<= b 8e-18) (* (/ t_1 (* a y)) x) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double t_2 = (t_1 / y) * x;
double tmp;
if (b <= -1e+48) {
tmp = t_2;
} else if (b <= 8e-18) {
tmp = (t_1 / (a * y)) * x;
} 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 = exp(-b)
t_2 = (t_1 / y) * x
if (b <= (-1d+48)) then
tmp = t_2
else if (b <= 8d-18) then
tmp = (t_1 / (a * y)) * x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.exp(-b);
double t_2 = (t_1 / y) * x;
double tmp;
if (b <= -1e+48) {
tmp = t_2;
} else if (b <= 8e-18) {
tmp = (t_1 / (a * y)) * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(-b) t_2 = (t_1 / y) * x tmp = 0 if b <= -1e+48: tmp = t_2 elif b <= 8e-18: tmp = (t_1 / (a * y)) * x else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) t_2 = Float64(Float64(t_1 / y) * x) tmp = 0.0 if (b <= -1e+48) tmp = t_2; elseif (b <= 8e-18) tmp = Float64(Float64(t_1 / Float64(a * y)) * x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(-b); t_2 = (t_1 / y) * x; tmp = 0.0; if (b <= -1e+48) tmp = t_2; elseif (b <= 8e-18) tmp = (t_1 / (a * y)) * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, Block[{t$95$2 = N[(N[(t$95$1 / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -1e+48], t$95$2, If[LessEqual[b, 8e-18], N[(N[(t$95$1 / N[(a * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
t_2 := \frac{t\_1}{y} \cdot x\\
\mathbf{if}\;b \leq -1 \cdot 10^{+48}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;b \leq 8 \cdot 10^{-18}:\\
\;\;\;\;\frac{t\_1}{a \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if b < -1.00000000000000004e48 or 8.0000000000000006e-18 < b Initial program 98.3%
Taylor expanded in b around inf
lower-*.f6447.2
Applied rewrites47.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.2
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6447.2
Applied rewrites47.2%
if -1.00000000000000004e48 < b < 8.0000000000000006e-18Initial program 98.3%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
div-expN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-/.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-negate-revN/A
sub-flipN/A
distribute-neg-inN/A
Applied rewrites79.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6466.1
Applied rewrites66.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.7%
Taylor expanded in y around 0
lower-exp.f64N/A
lower-neg.f6454.4
Applied rewrites54.4%
(FPCore (x y z t a b) :precision binary64 (/ x (* y (exp (+ b (log a))))))
double code(double x, double y, double z, double t, double a, double b) {
return x / (y * exp((b + log(a))));
}
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 / (y * exp((b + log(a))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / (y * Math.exp((b + Math.log(a))));
}
def code(x, y, z, t, a, b): return x / (y * math.exp((b + math.log(a))))
function code(x, y, z, t, a, b) return Float64(x / Float64(y * exp(Float64(b + log(a))))) end
function tmp = code(x, y, z, t, a, b) tmp = x / (y * exp((b + log(a)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x / N[(y * N[Exp[N[(b + N[Log[a], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot e^{b + \log a}}
\end{array}
Initial program 98.3%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
associate--l+N/A
add-flipN/A
sub-negate-revN/A
div-expN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
lower-/.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-negate-revN/A
sub-flipN/A
distribute-neg-inN/A
Applied rewrites79.5%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6466.1
Applied rewrites66.1%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-log.f6458.3
Applied rewrites58.3%
(FPCore (x y z t a b) :precision binary64 (* (/ (exp (- b)) y) x))
double code(double x, double y, double z, double t, double a, double b) {
return (exp(-b) / y) * x;
}
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 = (exp(-b) / y) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (Math.exp(-b) / y) * x;
}
def code(x, y, z, t, a, b): return (math.exp(-b) / y) * x
function code(x, y, z, t, a, b) return Float64(Float64(exp(Float64(-b)) / y) * x) end
function tmp = code(x, y, z, t, a, b) tmp = (exp(-b) / y) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{-b}}{y} \cdot x
\end{array}
Initial program 98.3%
Taylor expanded in b around inf
lower-*.f6447.2
Applied rewrites47.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.2
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6447.2
Applied rewrites47.2%
(FPCore (x y z t a b) :precision binary64 (* (exp (- b)) (/ x y)))
double code(double x, double y, double z, double t, double a, double b) {
return exp(-b) * (x / y);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = exp(-b) * (x / y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return Math.exp(-b) * (x / y);
}
def code(x, y, z, t, a, b): return math.exp(-b) * (x / y)
function code(x, y, z, t, a, b) return Float64(exp(Float64(-b)) * Float64(x / y)) end
function tmp = code(x, y, z, t, a, b) tmp = exp(-b) * (x / y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[Exp[(-b)], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{-b} \cdot \frac{x}{y}
\end{array}
Initial program 98.3%
Taylor expanded in b around inf
lower-*.f6447.2
Applied rewrites47.2%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-neg.f64N/A
lower-neg.f64N/A
Applied rewrites42.9%
herbie shell --seed 2025143
(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))