
(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 13 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 (/ (* 1.0 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 (1.0 * x) / (exp(fma((1.0 - t), log(a), (b - (log(z) * y)))) * y);
}
function code(x, y, z, t, a, b) return Float64(Float64(1.0 * x) / Float64(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[(1.0 * x), $MachinePrecision] / N[(N[Exp[N[(N[(1.0 - t), $MachinePrecision] * N[Log[a], $MachinePrecision] + N[(b - N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1 \cdot x}{e^{\mathsf{fma}\left(1 - t, \log a, b - \log z \cdot y\right)} \cdot y}
\end{array}
Initial program 98.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites98.5%
(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.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= (- t 1.0) -5e+42)
(* (/ x y) (exp (fma (log a) (- t 1.0) (- (* (log z) y) b))))
(if (<= (- t 1.0) 2e+30)
(/ (* x (/ (exp (- (* y (log z)) b)) a)) y)
(/ (* x (exp (- (* (log a) (- t 1.0)) b))) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t - 1.0) <= -5e+42) {
tmp = (x / y) * exp(fma(log(a), (t - 1.0), ((log(z) * y) - b)));
} else if ((t - 1.0) <= 2e+30) {
tmp = (x * (exp(((y * log(z)) - b)) / a)) / y;
} else {
tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(t - 1.0) <= -5e+42) tmp = Float64(Float64(x / y) * exp(fma(log(a), Float64(t - 1.0), Float64(Float64(log(z) * y) - b)))); elseif (Float64(t - 1.0) <= 2e+30) tmp = Float64(Float64(x * Float64(exp(Float64(Float64(y * log(z)) - b)) / a)) / y); else tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(t - 1.0), $MachinePrecision], -5e+42], N[(N[(x / y), $MachinePrecision] * N[Exp[N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision] + N[(N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(t - 1.0), $MachinePrecision], 2e+30], N[(N[(x * N[(N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t - 1 \leq -5 \cdot 10^{+42}:\\
\;\;\;\;\frac{x}{y} \cdot e^{\mathsf{fma}\left(\log a, t - 1, \log z \cdot y - b\right)}\\
\mathbf{elif}\;t - 1 \leq 2 \cdot 10^{+30}:\\
\;\;\;\;\frac{x \cdot \frac{e^{y \cdot \log z - b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\end{array}
\end{array}
if (-.f64 t #s(literal 1 binary64)) < -5.00000000000000007e42Initial program 98.2%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6488.2
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
lift-*.f64N/A
*-commutativeN/A
sub-flip-reverseN/A
Applied rewrites88.2%
if -5.00000000000000007e42 < (-.f64 t #s(literal 1 binary64)) < 2e30Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
if 2e30 < (-.f64 t #s(literal 1 binary64)) Initial program 98.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6480.4
Applied rewrites80.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log a) (- t 1.0)) b))) y)))
(if (<= (- t 1.0) -5e+42)
t_1
(if (<= (- t 1.0) 2e+30)
(/ (* x (/ (exp (- (* y (log z)) b)) a)) y)
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp(((log(a) * (t - 1.0)) - b))) / y;
double tmp;
if ((t - 1.0) <= -5e+42) {
tmp = t_1;
} else if ((t - 1.0) <= 2e+30) {
tmp = (x * (exp(((y * log(z)) - b)) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * exp(((log(a) * (t - 1.0d0)) - b))) / y
if ((t - 1.0d0) <= (-5d+42)) then
tmp = t_1
else if ((t - 1.0d0) <= 2d+30) then
tmp = (x * (exp(((y * log(z)) - b)) / a)) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
double tmp;
if ((t - 1.0) <= -5e+42) {
tmp = t_1;
} else if ((t - 1.0) <= 2e+30) {
tmp = (x * (Math.exp(((y * Math.log(z)) - b)) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp(((math.log(a) * (t - 1.0)) - b))) / y tmp = 0 if (t - 1.0) <= -5e+42: tmp = t_1 elif (t - 1.0) <= 2e+30: tmp = (x * (math.exp(((y * math.log(z)) - b)) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b))) / y) tmp = 0.0 if (Float64(t - 1.0) <= -5e+42) tmp = t_1; elseif (Float64(t - 1.0) <= 2e+30) tmp = Float64(Float64(x * Float64(exp(Float64(Float64(y * log(z)) - b)) / a)) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp(((log(a) * (t - 1.0)) - b))) / y; tmp = 0.0; if ((t - 1.0) <= -5e+42) tmp = t_1; elseif ((t - 1.0) <= 2e+30) tmp = (x * (exp(((y * log(z)) - b)) / a)) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[N[(t - 1.0), $MachinePrecision], -5e+42], t$95$1, If[LessEqual[N[(t - 1.0), $MachinePrecision], 2e+30], N[(N[(x * N[(N[Exp[N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] / a), $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 - 1 \leq -5 \cdot 10^{+42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t - 1 \leq 2 \cdot 10^{+30}:\\
\;\;\;\;\frac{x \cdot \frac{e^{y \cdot \log z - b}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (-.f64 t #s(literal 1 binary64)) < -5.00000000000000007e42 or 2e30 < (-.f64 t #s(literal 1 binary64)) Initial program 98.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6480.4
Applied rewrites80.4%
if -5.00000000000000007e42 < (-.f64 t #s(literal 1 binary64)) < 2e30Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (/ (pow z y) a)) y)))
(if (<= y -750000.0)
t_1
(if (<= y 1.45e+60) (/ x (* y (exp (+ b (* (log a) (- 1.0 t)))))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * (pow(z, y) / a)) / y;
double tmp;
if (y <= -750000.0) {
tmp = t_1;
} else if (y <= 1.45e+60) {
tmp = x / (y * exp((b + (log(a) * (1.0 - t)))));
} 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 * ((z ** y) / a)) / y
if (y <= (-750000.0d0)) then
tmp = t_1
else if (y <= 1.45d+60) then
tmp = x / (y * exp((b + (log(a) * (1.0d0 - t)))))
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.pow(z, y) / a)) / y;
double tmp;
if (y <= -750000.0) {
tmp = t_1;
} else if (y <= 1.45e+60) {
tmp = x / (y * Math.exp((b + (Math.log(a) * (1.0 - t)))));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * (math.pow(z, y) / a)) / y tmp = 0 if y <= -750000.0: tmp = t_1 elif y <= 1.45e+60: tmp = x / (y * math.exp((b + (math.log(a) * (1.0 - t))))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * Float64((z ^ y) / a)) / y) tmp = 0.0 if (y <= -750000.0) tmp = t_1; elseif (y <= 1.45e+60) tmp = Float64(x / Float64(y * exp(Float64(b + Float64(log(a) * Float64(1.0 - t)))))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * ((z ^ y) / a)) / y; tmp = 0.0; if (y <= -750000.0) tmp = t_1; elseif (y <= 1.45e+60) tmp = x / (y * exp((b + (log(a) * (1.0 - t))))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -750000.0], t$95$1, If[LessEqual[y, 1.45e+60], N[(x / N[(y * N[Exp[N[(b + N[(N[Log[a], $MachinePrecision] * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{if}\;y \leq -750000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+60}:\\
\;\;\;\;\frac{x}{y \cdot e^{b + \log a \cdot \left(1 - t\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.5e5 or 1.45e60 < y Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in b around 0
lower-pow.f6457.8
Applied rewrites57.8%
if -7.5e5 < y < 1.45e60Initial program 98.2%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-exp.f64N/A
lift--.f64N/A
sub-negate-revN/A
exp-negN/A
sub-negate-revN/A
lift--.f64N/A
Applied rewrites98.5%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-exp.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6480.7
Applied rewrites80.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (/ (pow z y) a)) y)))
(if (<= y -750000.0)
t_1
(if (<= y 1.45e+60) (/ (* 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 * (pow(z, y) / a)) / y;
double tmp;
if (y <= -750000.0) {
tmp = t_1;
} else if (y <= 1.45e+60) {
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 * ((z ** y) / a)) / y
if (y <= (-750000.0d0)) then
tmp = t_1
else if (y <= 1.45d+60) 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.pow(z, y) / a)) / y;
double tmp;
if (y <= -750000.0) {
tmp = t_1;
} else if (y <= 1.45e+60) {
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.pow(z, y) / a)) / y tmp = 0 if y <= -750000.0: tmp = t_1 elif y <= 1.45e+60: 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 * Float64((z ^ y) / a)) / y) tmp = 0.0 if (y <= -750000.0) tmp = t_1; elseif (y <= 1.45e+60) 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 * ((z ^ y) / a)) / y; tmp = 0.0; if (y <= -750000.0) tmp = t_1; elseif (y <= 1.45e+60) 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[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -750000.0], t$95$1, If[LessEqual[y, 1.45e+60], 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 \frac{{z}^{y}}{a}}{y}\\
\mathbf{if}\;y \leq -750000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.45 \cdot 10^{+60}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.5e5 or 1.45e60 < y Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in b around 0
lower-pow.f6457.8
Applied rewrites57.8%
if -7.5e5 < y < 1.45e60Initial program 98.2%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6480.4
Applied rewrites80.4%
(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 -2e+45)
t_2
(if (<= t_1 -155.0)
(* (/ (/ (exp (- b)) a) y) x)
(if (<= t_1 1000.0) (/ (* 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 <= -2e+45) {
tmp = t_2;
} else if (t_1 <= -155.0) {
tmp = ((exp(-b) / a) / y) * x;
} else if (t_1 <= 1000.0) {
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 <= (-2d+45)) then
tmp = t_2
else if (t_1 <= (-155.0d0)) then
tmp = ((exp(-b) / a) / y) * x
else if (t_1 <= 1000.0d0) 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 <= -2e+45) {
tmp = t_2;
} else if (t_1 <= -155.0) {
tmp = ((Math.exp(-b) / a) / y) * x;
} else if (t_1 <= 1000.0) {
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 <= -2e+45: tmp = t_2 elif t_1 <= -155.0: tmp = ((math.exp(-b) / a) / y) * x elif t_1 <= 1000.0: 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 <= -2e+45) tmp = t_2; elseif (t_1 <= -155.0) tmp = Float64(Float64(Float64(exp(Float64(-b)) / a) / y) * x); elseif (t_1 <= 1000.0) tmp = Float64(Float64(x * Float64((z ^ y) / 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 <= -2e+45) tmp = t_2; elseif (t_1 <= -155.0) tmp = ((exp(-b) / a) / y) * x; elseif (t_1 <= 1000.0) 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, -2e+45], t$95$2, If[LessEqual[t$95$1, -155.0], N[(N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 1000.0], N[(N[(x * N[(N[Power[z, y], $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^{t \cdot \log a}}{y}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+45}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -155:\\
\;\;\;\;\frac{\frac{e^{-b}}{a}}{y} \cdot x\\
\mathbf{elif}\;t\_1 \leq 1000:\\
\;\;\;\;\frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1.9999999999999999e45 or 1e3 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-log.f6448.2
Applied rewrites48.2%
if -1.9999999999999999e45 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -155Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower-neg.f6459.3
Applied rewrites59.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6459.5
Applied rewrites59.5%
if -155 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 1e3Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in b around 0
lower-pow.f6457.8
Applied rewrites57.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (* t (log a)))) y)))
(if (<= t -2.05e+124)
t_1
(if (<= t 1.95e-22) (* (/ (/ (exp (- b)) a) y) x) 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 <= -2.05e+124) {
tmp = t_1;
} else if (t <= 1.95e-22) {
tmp = ((exp(-b) / a) / y) * x;
} 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 <= (-2.05d+124)) then
tmp = t_1
else if (t <= 1.95d-22) then
tmp = ((exp(-b) / a) / y) * x
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 <= -2.05e+124) {
tmp = t_1;
} else if (t <= 1.95e-22) {
tmp = ((Math.exp(-b) / a) / y) * x;
} 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 <= -2.05e+124: tmp = t_1 elif t <= 1.95e-22: tmp = ((math.exp(-b) / a) / y) * x 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 <= -2.05e+124) tmp = t_1; elseif (t <= 1.95e-22) tmp = Float64(Float64(Float64(exp(Float64(-b)) / a) / y) * x); 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 <= -2.05e+124) tmp = t_1; elseif (t <= 1.95e-22) tmp = ((exp(-b) / a) / y) * x; 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, -2.05e+124], t$95$1, If[LessEqual[t, 1.95e-22], N[(N[(N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision] * x), $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 -2.05 \cdot 10^{+124}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.95 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{e^{-b}}{a}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.05000000000000001e124 or 1.94999999999999999e-22 < t Initial program 98.2%
Taylor expanded in t around inf
lower-*.f64N/A
lower-log.f6448.2
Applied rewrites48.2%
if -2.05000000000000001e124 < t < 1.94999999999999999e-22Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower-neg.f6459.3
Applied rewrites59.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6459.5
Applied rewrites59.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (exp (- b)))) (if (<= t 1.95e-22) (* (/ (/ t_1 a) y) x) (* (/ t_1 y) x))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(-b);
double tmp;
if (t <= 1.95e-22) {
tmp = ((t_1 / a) / y) * x;
} else {
tmp = (t_1 / y) * 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(-b)
if (t <= 1.95d-22) then
tmp = ((t_1 / a) / y) * x
else
tmp = (t_1 / y) * 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(-b);
double tmp;
if (t <= 1.95e-22) {
tmp = ((t_1 / a) / y) * x;
} else {
tmp = (t_1 / y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(-b) tmp = 0 if t <= 1.95e-22: tmp = ((t_1 / a) / y) * x else: tmp = (t_1 / y) * x return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(-b)) tmp = 0.0 if (t <= 1.95e-22) tmp = Float64(Float64(Float64(t_1 / a) / y) * x); else tmp = Float64(Float64(t_1 / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(-b); tmp = 0.0; if (t <= 1.95e-22) tmp = ((t_1 / a) / y) * x; else tmp = (t_1 / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[(-b)], $MachinePrecision]}, If[LessEqual[t, 1.95e-22], N[(N[(N[(t$95$1 / a), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], N[(N[(t$95$1 / y), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{-b}\\
\mathbf{if}\;t \leq 1.95 \cdot 10^{-22}:\\
\;\;\;\;\frac{\frac{t\_1}{a}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1}{y} \cdot x\\
\end{array}
\end{array}
if t < 1.94999999999999999e-22Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower-neg.f6459.3
Applied rewrites59.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6459.5
Applied rewrites59.5%
if 1.94999999999999999e-22 < t Initial program 98.2%
Taylor expanded in b around inf
lower-*.f6448.1
Applied rewrites48.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6448.1
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6448.1
Applied rewrites48.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<= b -1.98e-47)
t_1
(if (<= b 5.2e-9) (/ (* x (/ (+ 1.0 (* -1.0 b)) a)) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (exp(-b) / y) * x;
double tmp;
if (b <= -1.98e-47) {
tmp = t_1;
} else if (b <= 5.2e-9) {
tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (exp(-b) / y) * x
if (b <= (-1.98d-47)) then
tmp = t_1
else if (b <= 5.2d-9) then
tmp = (x * ((1.0d0 + ((-1.0d0) * b)) / a)) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.exp(-b) / y) * x;
double tmp;
if (b <= -1.98e-47) {
tmp = t_1;
} else if (b <= 5.2e-9) {
tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.exp(-b) / y) * x tmp = 0 if b <= -1.98e-47: tmp = t_1 elif b <= 5.2e-9: tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(exp(Float64(-b)) / y) * x) tmp = 0.0 if (b <= -1.98e-47) tmp = t_1; elseif (b <= 5.2e-9) tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(-1.0 * b)) / a)) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (exp(-b) / y) * x; tmp = 0.0; if (b <= -1.98e-47) tmp = t_1; elseif (b <= 5.2e-9) tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -1.98e-47], t$95$1, If[LessEqual[b, 5.2e-9], N[(N[(x * N[(N[(1.0 + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -1.98 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{x \cdot \frac{1 + -1 \cdot b}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.98e-47 or 5.2000000000000002e-9 < b Initial program 98.2%
Taylor expanded in b around inf
lower-*.f6448.1
Applied rewrites48.1%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6448.1
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6448.1
Applied rewrites48.1%
if -1.98e-47 < b < 5.2000000000000002e-9Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower-neg.f6459.3
Applied rewrites59.3%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ x y) (exp (- b)))))
(if (<= b -1.98e-47)
t_1
(if (<= b 5.2e-9) (/ (* x (/ (+ 1.0 (* -1.0 b)) a)) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x / y) * exp(-b);
double tmp;
if (b <= -1.98e-47) {
tmp = t_1;
} else if (b <= 5.2e-9) {
tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x / y) * exp(-b)
if (b <= (-1.98d-47)) then
tmp = t_1
else if (b <= 5.2d-9) then
tmp = (x * ((1.0d0 + ((-1.0d0) * b)) / a)) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x / y) * Math.exp(-b);
double tmp;
if (b <= -1.98e-47) {
tmp = t_1;
} else if (b <= 5.2e-9) {
tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x / y) * math.exp(-b) tmp = 0 if b <= -1.98e-47: tmp = t_1 elif b <= 5.2e-9: tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x / y) * exp(Float64(-b))) tmp = 0.0 if (b <= -1.98e-47) tmp = t_1; elseif (b <= 5.2e-9) tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(-1.0 * b)) / a)) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x / y) * exp(-b); tmp = 0.0; if (b <= -1.98e-47) tmp = t_1; elseif (b <= 5.2e-9) tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x / y), $MachinePrecision] * N[Exp[(-b)], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.98e-47], t$95$1, If[LessEqual[b, 5.2e-9], N[(N[(x * N[(N[(1.0 + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y} \cdot e^{-b}\\
\mathbf{if}\;b \leq -1.98 \cdot 10^{-47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{x \cdot \frac{1 + -1 \cdot b}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.98e-47 or 5.2000000000000002e-9 < b Initial program 98.2%
Taylor expanded in b around inf
lower-*.f6448.1
Applied rewrites48.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6443.4
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6443.4
Applied rewrites43.4%
if -1.98e-47 < b < 5.2000000000000002e-9Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower-neg.f6459.3
Applied rewrites59.3%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
(FPCore (x y z t a b) :precision binary64 (if (<= b 0.00016) (/ (* x (/ (+ 1.0 (* -1.0 b)) a)) y) (/ (* x (/ 1.0 a)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 0.00016) {
tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y;
} else {
tmp = (x * (1.0 / a)) / y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= 0.00016d0) then
tmp = (x * ((1.0d0 + ((-1.0d0) * b)) / a)) / y
else
tmp = (x * (1.0d0 / a)) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= 0.00016) {
tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y;
} else {
tmp = (x * (1.0 / a)) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= 0.00016: tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y else: tmp = (x * (1.0 / a)) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= 0.00016) tmp = Float64(Float64(x * Float64(Float64(1.0 + Float64(-1.0 * b)) / a)) / y); else tmp = Float64(Float64(x * Float64(1.0 / a)) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= 0.00016) tmp = (x * ((1.0 + (-1.0 * b)) / a)) / y; else tmp = (x * (1.0 / a)) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, 0.00016], N[(N[(x * N[(N[(1.0 + N[(-1.0 * b), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 0.00016:\\
\;\;\;\;\frac{x \cdot \frac{1 + -1 \cdot b}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{1}{a}}{y}\\
\end{array}
\end{array}
if b < 1.60000000000000013e-4Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in y around 0
lower-exp.f64N/A
lower-neg.f6459.3
Applied rewrites59.3%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f6432.4
Applied rewrites32.4%
if 1.60000000000000013e-4 < b Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in b around 0
lower-pow.f6457.8
Applied rewrites57.8%
Taylor expanded in y around 0
Applied rewrites30.7%
(FPCore (x y z t a b) :precision binary64 (/ (* x (/ 1.0 a)) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * (1.0 / a)) / y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (x * (1.0d0 / a)) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x * (1.0 / a)) / y;
}
def code(x, y, z, t, a, b): return (x * (1.0 / a)) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * Float64(1.0 / a)) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * (1.0 / a)) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[(1.0 / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot \frac{1}{a}}{y}
\end{array}
Initial program 98.2%
lift-exp.f64N/A
lift--.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate--l+N/A
exp-sumN/A
lift-*.f64N/A
*-commutativeN/A
lift-log.f64N/A
exp-to-powN/A
sub-flip-reverseN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
sub-flip-reverseN/A
lower--.f6480.0
Applied rewrites80.0%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.0
Applied rewrites80.0%
Taylor expanded in b around 0
lower-pow.f6457.8
Applied rewrites57.8%
Taylor expanded in y around 0
Applied rewrites30.7%
herbie shell --seed 2025154
(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))