
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
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)) + (a * (log((1.0d0 - z)) - b))))
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)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
Herbie found 11 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
}
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)) + (a * (log((1.0d0 - z)) - b))))
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)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
(FPCore (x y z t a b)
:precision binary64
(if (<=
(* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))
INFINITY)
(* (exp (- (* (- (- z) b) a) (* (- t (log z)) y))) x)
(* x (pow z y))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))))) <= ((double) INFINITY)) {
tmp = exp((((-z - b) * a) - ((t - log(z)) * y))) * x;
} else {
tmp = x * pow(z, y);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))))) <= Double.POSITIVE_INFINITY) {
tmp = Math.exp((((-z - b) * a) - ((t - Math.log(z)) * y))) * x;
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))) <= math.inf: tmp = math.exp((((-z - b) * a) - ((t - math.log(z)) * y))) * x else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) <= Inf) tmp = Float64(exp(Float64(Float64(Float64(Float64(-z) - b) * a) - Float64(Float64(t - log(z)) * y))) * x); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))))) <= Inf) tmp = exp((((-z - b) * a) - ((t - log(z)) * y))) * x; else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], Infinity], N[(N[Exp[N[(N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision] - N[(N[(t - N[Log[z], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)} \leq \infty:\\
\;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a - \left(t - \log z\right) \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
if (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))))) < +inf.0Initial program 96.7%
Taylor expanded in z around 0
lower-*.f6499.1%
Applied rewrites99.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.1%
Applied rewrites99.1%
if +inf.0 < (*.f64 x (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))))) Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
Applied rewrites19.5%
Taylor expanded in t around 0
lower-pow.f6451.5%
Applied rewrites51.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -5.8e+47)
(* x (exp (* y (- (log z) t))))
(if (<= y 2e-10)
(* (exp (- (* (- (- z) b) a) (* t y))) x)
(* x (pow (* z (exp (- t))) y)))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.8e+47) {
tmp = x * exp((y * (log(z) - t)));
} else if (y <= 2e-10) {
tmp = exp((((-z - b) * a) - (t * y))) * x;
} else {
tmp = x * pow((z * exp(-t)), 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 (y <= (-5.8d+47)) then
tmp = x * exp((y * (log(z) - t)))
else if (y <= 2d-10) then
tmp = exp((((-z - b) * a) - (t * y))) * x
else
tmp = x * ((z * exp(-t)) ** 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 (y <= -5.8e+47) {
tmp = x * Math.exp((y * (Math.log(z) - t)));
} else if (y <= 2e-10) {
tmp = Math.exp((((-z - b) * a) - (t * y))) * x;
} else {
tmp = x * Math.pow((z * Math.exp(-t)), y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -5.8e+47: tmp = x * math.exp((y * (math.log(z) - t))) elif y <= 2e-10: tmp = math.exp((((-z - b) * a) - (t * y))) * x else: tmp = x * math.pow((z * math.exp(-t)), y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.8e+47) tmp = Float64(x * exp(Float64(y * Float64(log(z) - t)))); elseif (y <= 2e-10) tmp = Float64(exp(Float64(Float64(Float64(Float64(-z) - b) * a) - Float64(t * y))) * x); else tmp = Float64(x * (Float64(z * exp(Float64(-t))) ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -5.8e+47) tmp = x * exp((y * (log(z) - t))); elseif (y <= 2e-10) tmp = exp((((-z - b) * a) - (t * y))) * x; else tmp = x * ((z * exp(-t)) ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.8e+47], N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2e-10], N[(N[Exp[N[(N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision] - N[(t * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], N[(x * N[Power[N[(z * N[Exp[(-t)], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq -5.8 \cdot 10^{+47}:\\
\;\;\;\;x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-10}:\\
\;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a - t \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot {\left(z \cdot e^{-t}\right)}^{y}\\
\end{array}
if y < -5.7999999999999996e47Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
if -5.7999999999999996e47 < y < 2.0000000000000001e-10Initial program 96.7%
Taylor expanded in z around 0
lower-*.f6499.1%
Applied rewrites99.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.1%
Applied rewrites99.1%
Taylor expanded in t around inf
lower-*.f6487.5%
Applied rewrites87.5%
if 2.0000000000000001e-10 < y Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
lift-exp.f64N/A
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
lift-neg.f64N/A
distribute-rgt-inN/A
lift-*.f64N/A
exp-sumN/A
lower-exp.f64N/A
lower-*.f32N/A
lower-unsound-log.f64N/A
lower-unsound-*.f32N/A
lower-unsound-exp.f64N/A
pow-to-expN/A
lift-*.f64N/A
exp-prodN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-exp.f6469.6%
Applied rewrites69.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (exp (* y (- (log z) t))))))
(if (<= y -5.8e+47)
t_1
(if (<= y 2e-10) (* (exp (- (* (- (- z) b) a) (* t y))) x) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * exp((y * (log(z) - t)));
double tmp;
if (y <= -5.8e+47) {
tmp = t_1;
} else if (y <= 2e-10) {
tmp = exp((((-z - b) * a) - (t * 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((y * (log(z) - t)))
if (y <= (-5.8d+47)) then
tmp = t_1
else if (y <= 2d-10) then
tmp = exp((((-z - b) * a) - (t * 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((y * (Math.log(z) - t)));
double tmp;
if (y <= -5.8e+47) {
tmp = t_1;
} else if (y <= 2e-10) {
tmp = Math.exp((((-z - b) * a) - (t * y))) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * math.exp((y * (math.log(z) - t))) tmp = 0 if y <= -5.8e+47: tmp = t_1 elif y <= 2e-10: tmp = math.exp((((-z - b) * a) - (t * y))) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * exp(Float64(y * Float64(log(z) - t)))) tmp = 0.0 if (y <= -5.8e+47) tmp = t_1; elseif (y <= 2e-10) tmp = Float64(exp(Float64(Float64(Float64(Float64(-z) - b) * a) - Float64(t * y))) * x); 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) - t))); tmp = 0.0; if (y <= -5.8e+47) tmp = t_1; elseif (y <= 2e-10) tmp = exp((((-z - b) * a) - (t * y))) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[Exp[N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.8e+47], t$95$1, If[LessEqual[y, 2e-10], N[(N[Exp[N[(N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision] - N[(t * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x \cdot e^{y \cdot \left(\log z - t\right)}\\
\mathbf{if}\;y \leq -5.8 \cdot 10^{+47}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2 \cdot 10^{-10}:\\
\;\;\;\;e^{\left(\left(-z\right) - b\right) \cdot a - t \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -5.7999999999999996e47 or 2.0000000000000001e-10 < y Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
if -5.7999999999999996e47 < y < 2.0000000000000001e-10Initial program 96.7%
Taylor expanded in z around 0
lower-*.f6499.1%
Applied rewrites99.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.1%
Applied rewrites99.1%
Taylor expanded in t around inf
lower-*.f6487.5%
Applied rewrites87.5%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (exp (- (* (- (- z) b) a) (* t y))) x))) (if (<= t -1.4e-91) t_1 (if (<= t 9.8e-166) (* x (pow z y)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((((-z - b) * a) - (t * y))) * x;
double tmp;
if (t <= -1.4e-91) {
tmp = t_1;
} else if (t <= 9.8e-166) {
tmp = x * pow(z, 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((((-z - b) * a) - (t * y))) * x
if (t <= (-1.4d-91)) then
tmp = t_1
else if (t <= 9.8d-166) then
tmp = x * (z ** 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((((-z - b) * a) - (t * y))) * x;
double tmp;
if (t <= -1.4e-91) {
tmp = t_1;
} else if (t <= 9.8e-166) {
tmp = x * Math.pow(z, y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((((-z - b) * a) - (t * y))) * x tmp = 0 if t <= -1.4e-91: tmp = t_1 elif t <= 9.8e-166: tmp = x * math.pow(z, y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(Float64(Float64(Float64(-z) - b) * a) - Float64(t * y))) * x) tmp = 0.0 if (t <= -1.4e-91) tmp = t_1; elseif (t <= 9.8e-166) tmp = Float64(x * (z ^ y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((((-z - b) * a) - (t * y))) * x; tmp = 0.0; if (t <= -1.4e-91) tmp = t_1; elseif (t <= 9.8e-166) tmp = x * (z ^ y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[(N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision] - N[(t * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -1.4e-91], t$95$1, If[LessEqual[t, 9.8e-166], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := e^{\left(\left(-z\right) - b\right) \cdot a - t \cdot y} \cdot x\\
\mathbf{if}\;t \leq -1.4 \cdot 10^{-91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 9.8 \cdot 10^{-166}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.3999999999999999e-91 or 9.7999999999999998e-166 < t Initial program 96.7%
Taylor expanded in z around 0
lower-*.f6499.1%
Applied rewrites99.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.1%
Applied rewrites99.1%
Taylor expanded in t around inf
lower-*.f6487.5%
Applied rewrites87.5%
if -1.3999999999999999e-91 < t < 9.7999999999999998e-166Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
Applied rewrites19.5%
Taylor expanded in t around 0
lower-pow.f6451.5%
Applied rewrites51.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (exp (* -1.0 (* t y))) x)))
(if (<= t -1000000000.0)
t_1
(if (<= t 1.7e-81) (* x (pow z y)) t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp((-1.0 * (t * y))) * x;
double tmp;
if (t <= -1000000000.0) {
tmp = t_1;
} else if (t <= 1.7e-81) {
tmp = x * pow(z, 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(((-1.0d0) * (t * y))) * x
if (t <= (-1000000000.0d0)) then
tmp = t_1
else if (t <= 1.7d-81) then
tmp = x * (z ** 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((-1.0 * (t * y))) * x;
double tmp;
if (t <= -1000000000.0) {
tmp = t_1;
} else if (t <= 1.7e-81) {
tmp = x * Math.pow(z, y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp((-1.0 * (t * y))) * x tmp = 0 if t <= -1000000000.0: tmp = t_1 elif t <= 1.7e-81: tmp = x * math.pow(z, y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(exp(Float64(-1.0 * Float64(t * y))) * x) tmp = 0.0 if (t <= -1000000000.0) tmp = t_1; elseif (t <= 1.7e-81) tmp = Float64(x * (z ^ y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp((-1.0 * (t * y))) * x; tmp = 0.0; if (t <= -1000000000.0) tmp = t_1; elseif (t <= 1.7e-81) tmp = x * (z ^ y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Exp[N[(-1.0 * N[(t * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -1000000000.0], t$95$1, If[LessEqual[t, 1.7e-81], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := e^{-1 \cdot \left(t \cdot y\right)} \cdot x\\
\mathbf{if}\;t \leq -1000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{-81}:\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1e9 or 1.6999999999999999e-81 < t Initial program 96.7%
Taylor expanded in z around 0
lower-*.f6499.1%
Applied rewrites99.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.1%
Applied rewrites99.1%
Taylor expanded in t around inf
lower-*.f6487.5%
Applied rewrites87.5%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f6456.7%
Applied rewrites56.7%
if -1e9 < t < 1.6999999999999999e-81Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
Applied rewrites19.5%
Taylor expanded in t around 0
lower-pow.f6451.5%
Applied rewrites51.5%
(FPCore (x y z t a b) :precision binary64 (if (<= t -5000.0) (* (- (* (- t) y) -1.0) x) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5000.0) {
tmp = ((-t * y) - -1.0) * x;
} else {
tmp = x * pow(z, y);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-5000.0d0)) then
tmp = ((-t * y) - (-1.0d0)) * x
else
tmp = x * (z ** y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -5000.0) {
tmp = ((-t * y) - -1.0) * x;
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -5000.0: tmp = ((-t * y) - -1.0) * x else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -5000.0) tmp = Float64(Float64(Float64(Float64(-t) * y) - -1.0) * x); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -5000.0) tmp = ((-t * y) - -1.0) * x; else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -5000.0], N[(N[(N[((-t) * y), $MachinePrecision] - -1.0), $MachinePrecision] * x), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;t \leq -5000:\\
\;\;\;\;\left(\left(-t\right) \cdot y - -1\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
if t < -5e3Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6429.7%
Applied rewrites29.7%
Taylor expanded in t around inf
lower-*.f6427.7%
Applied rewrites27.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6427.7%
Applied rewrites27.7%
if -5e3 < t Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
Applied rewrites19.5%
Taylor expanded in t around 0
lower-pow.f6451.5%
Applied rewrites51.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t) y))
(t_2 (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))
(t_3 (* (* (- t) x) y)))
(if (<= t_2 -50000000.0)
(/ (- (* t_3 t_3) (* x x)) (- t_3 x))
(if (<= t_2 1e+275)
(* x (/ (- (* t_1 t_1) (* 1.0 1.0)) (- t_1 1.0)))
(* (- t_1 -1.0) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -t * y;
double t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b));
double t_3 = (-t * x) * y;
double tmp;
if (t_2 <= -50000000.0) {
tmp = ((t_3 * t_3) - (x * x)) / (t_3 - x);
} else if (t_2 <= 1e+275) {
tmp = x * (((t_1 * t_1) - (1.0 * 1.0)) / (t_1 - 1.0));
} else {
tmp = (t_1 - -1.0) * 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = -t * y
t_2 = (y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))
t_3 = (-t * x) * y
if (t_2 <= (-50000000.0d0)) then
tmp = ((t_3 * t_3) - (x * x)) / (t_3 - x)
else if (t_2 <= 1d+275) then
tmp = x * (((t_1 * t_1) - (1.0d0 * 1.0d0)) / (t_1 - 1.0d0))
else
tmp = (t_1 - (-1.0d0)) * 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 = -t * y;
double t_2 = (y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b));
double t_3 = (-t * x) * y;
double tmp;
if (t_2 <= -50000000.0) {
tmp = ((t_3 * t_3) - (x * x)) / (t_3 - x);
} else if (t_2 <= 1e+275) {
tmp = x * (((t_1 * t_1) - (1.0 * 1.0)) / (t_1 - 1.0));
} else {
tmp = (t_1 - -1.0) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -t * y t_2 = (y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)) t_3 = (-t * x) * y tmp = 0 if t_2 <= -50000000.0: tmp = ((t_3 * t_3) - (x * x)) / (t_3 - x) elif t_2 <= 1e+275: tmp = x * (((t_1 * t_1) - (1.0 * 1.0)) / (t_1 - 1.0)) else: tmp = (t_1 - -1.0) * x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-t) * y) t_2 = Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) t_3 = Float64(Float64(Float64(-t) * x) * y) tmp = 0.0 if (t_2 <= -50000000.0) tmp = Float64(Float64(Float64(t_3 * t_3) - Float64(x * x)) / Float64(t_3 - x)); elseif (t_2 <= 1e+275) tmp = Float64(x * Float64(Float64(Float64(t_1 * t_1) - Float64(1.0 * 1.0)) / Float64(t_1 - 1.0))); else tmp = Float64(Float64(t_1 - -1.0) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -t * y; t_2 = (y * (log(z) - t)) + (a * (log((1.0 - z)) - b)); t_3 = (-t * x) * y; tmp = 0.0; if (t_2 <= -50000000.0) tmp = ((t_3 * t_3) - (x * x)) / (t_3 - x); elseif (t_2 <= 1e+275) tmp = x * (((t_1 * t_1) - (1.0 * 1.0)) / (t_1 - 1.0)); else tmp = (t_1 - -1.0) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-t) * y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[((-t) * x), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[t$95$2, -50000000.0], N[(N[(N[(t$95$3 * t$95$3), $MachinePrecision] - N[(x * x), $MachinePrecision]), $MachinePrecision] / N[(t$95$3 - x), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+275], N[(x * N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(1.0 * 1.0), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - -1.0), $MachinePrecision] * x), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \left(-t\right) \cdot y\\
t_2 := y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)\\
t_3 := \left(\left(-t\right) \cdot x\right) \cdot y\\
\mathbf{if}\;t\_2 \leq -50000000:\\
\;\;\;\;\frac{t\_3 \cdot t\_3 - x \cdot x}{t\_3 - x}\\
\mathbf{elif}\;t\_2 \leq 10^{+275}:\\
\;\;\;\;x \cdot \frac{t\_1 \cdot t\_1 - 1 \cdot 1}{t\_1 - 1}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - -1\right) \cdot x\\
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < -5e7Initial program 96.7%
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--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites57.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6429.7%
Applied rewrites29.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6426.8%
Applied rewrites26.8%
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites22.2%
if -5e7 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999996e274Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6429.7%
Applied rewrites29.7%
Taylor expanded in t around inf
lower-*.f6427.7%
Applied rewrites27.7%
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites25.4%
if 9.9999999999999996e274 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6429.7%
Applied rewrites29.7%
Taylor expanded in t around inf
lower-*.f6427.7%
Applied rewrites27.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6427.7%
Applied rewrites27.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t) y)))
(if (<= (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))) 1e+275)
(* x (/ (- (* t_1 t_1) (* 1.0 1.0)) (- t_1 1.0)))
(* (- t_1 -1.0) x))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = -t * y;
double tmp;
if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= 1e+275) {
tmp = x * (((t_1 * t_1) - (1.0 * 1.0)) / (t_1 - 1.0));
} else {
tmp = (t_1 - -1.0) * 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 = -t * y
if (((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))) <= 1d+275) then
tmp = x * (((t_1 * t_1) - (1.0d0 * 1.0d0)) / (t_1 - 1.0d0))
else
tmp = (t_1 - (-1.0d0)) * 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 = -t * y;
double tmp;
if (((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))) <= 1e+275) {
tmp = x * (((t_1 * t_1) - (1.0 * 1.0)) / (t_1 - 1.0));
} else {
tmp = (t_1 - -1.0) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = -t * y tmp = 0 if ((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))) <= 1e+275: tmp = x * (((t_1 * t_1) - (1.0 * 1.0)) / (t_1 - 1.0)) else: tmp = (t_1 - -1.0) * x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(-t) * y) tmp = 0.0 if (Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))) <= 1e+275) tmp = Float64(x * Float64(Float64(Float64(t_1 * t_1) - Float64(1.0 * 1.0)) / Float64(t_1 - 1.0))); else tmp = Float64(Float64(t_1 - -1.0) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = -t * y; tmp = 0.0; if (((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))) <= 1e+275) tmp = x * (((t_1 * t_1) - (1.0 * 1.0)) / (t_1 - 1.0)); else tmp = (t_1 - -1.0) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[((-t) * y), $MachinePrecision]}, If[LessEqual[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1e+275], N[(x * N[(N[(N[(t$95$1 * t$95$1), $MachinePrecision] - N[(1.0 * 1.0), $MachinePrecision]), $MachinePrecision] / N[(t$95$1 - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 - -1.0), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
t_1 := \left(-t\right) \cdot y\\
\mathbf{if}\;y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right) \leq 10^{+275}:\\
\;\;\;\;x \cdot \frac{t\_1 \cdot t\_1 - 1 \cdot 1}{t\_1 - 1}\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - -1\right) \cdot x\\
\end{array}
if (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) < 9.9999999999999996e274Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6429.7%
Applied rewrites29.7%
Taylor expanded in t around inf
lower-*.f6427.7%
Applied rewrites27.7%
lift-+.f64N/A
+-commutativeN/A
flip-+N/A
lower-unsound-/.f64N/A
Applied rewrites25.4%
if 9.9999999999999996e274 < (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b))) Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6429.7%
Applied rewrites29.7%
Taylor expanded in t around inf
lower-*.f6427.7%
Applied rewrites27.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6427.7%
Applied rewrites27.7%
(FPCore (x y z t a b) :precision binary64 (* (- (* (- t) y) -1.0) x))
double code(double x, double y, double z, double t, double a, double b) {
return ((-t * y) - -1.0) * 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 = ((-t * y) - (-1.0d0)) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((-t * y) - -1.0) * x;
}
def code(x, y, z, t, a, b): return ((-t * y) - -1.0) * x
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(-t) * y) - -1.0) * x) end
function tmp = code(x, y, z, t, a, b) tmp = ((-t * y) - -1.0) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[((-t) * y), $MachinePrecision] - -1.0), $MachinePrecision] * x), $MachinePrecision]
\left(\left(-t\right) \cdot y - -1\right) \cdot x
Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6429.7%
Applied rewrites29.7%
Taylor expanded in t around inf
lower-*.f6427.7%
Applied rewrites27.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6427.7%
Applied rewrites27.7%
(FPCore (x y z t a b) :precision binary64 (+ x (* (* x y) (- t))))
double code(double x, double y, double z, double t, double a, double b) {
return x + ((x * y) * -t);
}
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 + ((x * y) * -t)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + ((x * y) * -t);
}
def code(x, y, z, t, a, b): return x + ((x * y) * -t)
function code(x, y, z, t, a, b) return Float64(x + Float64(Float64(x * y) * Float64(-t))) end
function tmp = code(x, y, z, t, a, b) tmp = x + ((x * y) * -t); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(N[(x * y), $MachinePrecision] * (-t)), $MachinePrecision]), $MachinePrecision]
x + \left(x \cdot y\right) \cdot \left(-t\right)
Initial program 96.7%
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--.f64N/A
lower-*.f64N/A
lower-*.f64N/A
Applied rewrites57.0%
Taylor expanded in a around 0
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6429.7%
Applied rewrites29.7%
Taylor expanded in t around inf
lower-*.f64N/A
lower-*.f64N/A
lower-*.f6426.8%
Applied rewrites26.8%
lift-*.f64N/A
lift-*.f64N/A
associate-*r*N/A
lift-*.f64N/A
*-commutativeN/A
lower-*.f6426.8%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6426.8%
Applied rewrites26.8%
(FPCore (x y z t a b) :precision binary64 (* x 1.0))
double code(double x, double y, double z, double t, double a, double b) {
return x * 1.0;
}
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
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 1.0;
}
def code(x, y, z, t, a, b): return x * 1.0
function code(x, y, z, t, a, b) return Float64(x * 1.0) end
function tmp = code(x, y, z, t, a, b) tmp = x * 1.0; end
code[x_, y_, z_, t_, a_, b_] := N[(x * 1.0), $MachinePrecision]
x \cdot 1
Initial program 96.7%
Taylor expanded in a around 0
lower-exp.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-log.f6471.6%
Applied rewrites71.6%
Taylor expanded in y around 0
Applied rewrites19.5%
herbie shell --seed 2025258
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
:precision binary64
(* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))