
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (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), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (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), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
(FPCore (x y z t a b)
:precision binary64
(if (<=
t
-390000000000000018709163058384596334462097100072711165034982446989312)
(/ (* x (exp (- (* t (log a)) b))) y)
(if (<= t 760000000000)
(/ (* x (/ (exp (- (* y (log z)) b)) a)) y)
(/ (* x (exp (- (* (log a) (- t 1)) b))) y))))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.9e+68) {
tmp = (x * exp(((t * log(a)) - b))) / y;
} else if (t <= 760000000000.0) {
tmp = (x * (exp(((y * log(z)) - b)) / a)) / y;
} else {
tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / 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 <= (-3.9d+68)) then
tmp = (x * exp(((t * log(a)) - b))) / y
else if (t <= 760000000000.0d0) then
tmp = (x * (exp(((y * log(z)) - b)) / a)) / y
else
tmp = (x * exp(((log(a) * (t - 1.0d0)) - b))) / 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 <= -3.9e+68) {
tmp = (x * Math.exp(((t * Math.log(a)) - b))) / y;
} else if (t <= 760000000000.0) {
tmp = (x * (Math.exp(((y * Math.log(z)) - b)) / a)) / y;
} else {
tmp = (x * Math.exp(((Math.log(a) * (t - 1.0)) - b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -3.9e+68: tmp = (x * math.exp(((t * math.log(a)) - b))) / y elif t <= 760000000000.0: tmp = (x * (math.exp(((y * math.log(z)) - b)) / a)) / y else: tmp = (x * math.exp(((math.log(a) * (t - 1.0)) - b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.9e+68) tmp = Float64(Float64(x * exp(Float64(Float64(t * log(a)) - b))) / y); elseif (t <= 760000000000.0) 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
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -3.9e+68) tmp = (x * exp(((t * log(a)) - b))) / y; elseif (t <= 760000000000.0) tmp = (x * (exp(((y * log(z)) - b)) / a)) / y; else tmp = (x * exp(((log(a) * (t - 1.0)) - b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -390000000000000018709163058384596334462097100072711165034982446989312], N[(N[(x * N[Exp[N[(N[(t * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 760000000000], 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), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;t \leq -390000000000000018709163058384596334462097100072711165034982446989312:\\
\;\;\;\;\frac{x \cdot e^{t \cdot \log a - b}}{y}\\
\mathbf{elif}\;t \leq 760000000000:\\
\;\;\;\;\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}
if t < -3.9000000000000002e68Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.9%
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-log.f6471.0%
Applied rewrites71.0%
if -3.9000000000000002e68 < t < 7.6e11Initial program 98.4%
Taylor expanded in t around 0
Applied rewrites79.8%
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
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower--.f6480.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.3%
Applied rewrites80.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.3%
Applied rewrites80.3%
if 7.6e11 < t Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.9%
Applied rewrites79.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (/ (pow z y) a)) y)))
(if (<=
y
-195000000000000005530134988394275899665636953307969977661704486743354790468717363233529085825986647041662798352389781960632721784479407422471678600413184)
t_1
(if (<=
y
4500000000000000019078304432264122303733756101574914456232085946498844990803826090203216760651656203340873920963136832239329362009709596647375489368570061360048046430374894696986141290046399168833761837056)
(/ (* x (exp (- (* (log a) (- t 1)) 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 <= -1.95e+152) {
tmp = t_1;
} else if (y <= 4.5e+204) {
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 <= (-1.95d+152)) then
tmp = t_1
else if (y <= 4.5d+204) 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 <= -1.95e+152) {
tmp = t_1;
} else if (y <= 4.5e+204) {
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 <= -1.95e+152: tmp = t_1 elif y <= 4.5e+204: 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 <= -1.95e+152) tmp = t_1; elseif (y <= 4.5e+204) 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 <= -1.95e+152) tmp = t_1; elseif (y <= 4.5e+204) 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, -195000000000000005530134988394275899665636953307969977661704486743354790468717363233529085825986647041662798352389781960632721784479407422471678600413184], t$95$1, If[LessEqual[y, 4500000000000000019078304432264122303733756101574914456232085946498844990803826090203216760651656203340873920963136832239329362009709596647375489368570061360048046430374894696986141290046399168833761837056], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{if}\;y \leq -195000000000000005530134988394275899665636953307969977661704486743354790468717363233529085825986647041662798352389781960632721784479407422471678600413184:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4500000000000000019078304432264122303733756101574914456232085946498844990803826090203216760651656203340873920963136832239329362009709596647375489368570061360048046430374894696986141290046399168833761837056:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t - 1\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -1.9500000000000001e152 or 4.5e204 < y Initial program 98.4%
Taylor expanded in t around 0
Applied rewrites79.8%
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
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower--.f6480.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.3%
Applied rewrites80.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.3%
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6459.3%
Applied rewrites59.3%
if -1.9500000000000001e152 < y < 4.5e204Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.9%
Applied rewrites79.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* t (log a)) b))) y)))
(if (<= t -1250000000000000017421514619926762391339008)
t_1
(if (<= t 760000000000)
(/ (* x (pow z y)) (* a (* y (exp b))))
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp(((t * log(a)) - b))) / y;
double tmp;
if (t <= -1.25e+42) {
tmp = t_1;
} else if (t <= 760000000000.0) {
tmp = (x * pow(z, y)) / (a * (y * exp(b)));
} 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)) - b))) / y
if (t <= (-1.25d+42)) then
tmp = t_1
else if (t <= 760000000000.0d0) then
tmp = (x * (z ** y)) / (a * (y * exp(b)))
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)) - b))) / y;
double tmp;
if (t <= -1.25e+42) {
tmp = t_1;
} else if (t <= 760000000000.0) {
tmp = (x * Math.pow(z, y)) / (a * (y * Math.exp(b)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp(((t * math.log(a)) - b))) / y tmp = 0 if t <= -1.25e+42: tmp = t_1 elif t <= 760000000000.0: tmp = (x * math.pow(z, y)) / (a * (y * math.exp(b))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(t * log(a)) - b))) / y) tmp = 0.0 if (t <= -1.25e+42) tmp = t_1; elseif (t <= 760000000000.0) tmp = Float64(Float64(x * (z ^ y)) / Float64(a * Float64(y * exp(b)))); 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)) - b))) / y; tmp = 0.0; if (t <= -1.25e+42) tmp = t_1; elseif (t <= 760000000000.0) tmp = (x * (z ^ y)) / (a * (y * exp(b))); 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[(t * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -1250000000000000017421514619926762391339008], t$95$1, If[LessEqual[t, 760000000000], N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(a * N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x \cdot e^{t \cdot \log a - b}}{y}\\
\mathbf{if}\;t \leq -1250000000000000017421514619926762391339008:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 760000000000:\\
\;\;\;\;\frac{x \cdot {z}^{y}}{a \cdot \left(y \cdot e^{b}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.25e42 or 7.6e11 < t Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.9%
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-log.f6471.0%
Applied rewrites71.0%
if -1.25e42 < t < 7.6e11Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-*.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.4%
Applied rewrites66.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* t (log a)) b))) y)))
(if (<= t -12000000000000)
t_1
(if (<=
t
4807053516048627/25300281663413827294061918339864663381194581220517764794612669753428792445999418361495047962679640561898384733039601488923726092173224184608376674992592313740189678034570795170558363467761652042654970959809093133570250935428086587327262919456144944542601257064044846194041676826903812816523290938580750782913463467636686848)
(* (/ 1 (* a (* y (exp b)))) x)
(if (<= t 720000000000) (/ (* x (/ (pow z y) a)) y) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp(((t * log(a)) - b))) / y;
double tmp;
if (t <= -12000000000000.0) {
tmp = t_1;
} else if (t <= 1.9e-307) {
tmp = (1.0 / (a * (y * exp(b)))) * x;
} else if (t <= 720000000000.0) {
tmp = (x * (pow(z, y) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (x * exp(((t * log(a)) - b))) / y
if (t <= (-12000000000000.0d0)) then
tmp = t_1
else if (t <= 1.9d-307) then
tmp = (1.0d0 / (a * (y * exp(b)))) * x
else if (t <= 720000000000.0d0) then
tmp = (x * ((z ** y) / a)) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * Math.exp(((t * Math.log(a)) - b))) / y;
double tmp;
if (t <= -12000000000000.0) {
tmp = t_1;
} else if (t <= 1.9e-307) {
tmp = (1.0 / (a * (y * Math.exp(b)))) * x;
} else if (t <= 720000000000.0) {
tmp = (x * (Math.pow(z, y) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp(((t * math.log(a)) - b))) / y tmp = 0 if t <= -12000000000000.0: tmp = t_1 elif t <= 1.9e-307: tmp = (1.0 / (a * (y * math.exp(b)))) * x elif t <= 720000000000.0: tmp = (x * (math.pow(z, y) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(t * log(a)) - b))) / y) tmp = 0.0 if (t <= -12000000000000.0) tmp = t_1; elseif (t <= 1.9e-307) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * exp(b)))) * x); elseif (t <= 720000000000.0) tmp = Float64(Float64(x * Float64((z ^ y) / a)) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp(((t * log(a)) - b))) / y; tmp = 0.0; if (t <= -12000000000000.0) tmp = t_1; elseif (t <= 1.9e-307) tmp = (1.0 / (a * (y * exp(b)))) * x; elseif (t <= 720000000000.0) tmp = (x * ((z ^ y) / a)) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(t * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -12000000000000], t$95$1, If[LessEqual[t, 4807053516048627/25300281663413827294061918339864663381194581220517764794612669753428792445999418361495047962679640561898384733039601488923726092173224184608376674992592313740189678034570795170558363467761652042654970959809093133570250935428086587327262919456144944542601257064044846194041676826903812816523290938580750782913463467636686848], N[(N[(1 / N[(a * N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 720000000000], N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{x \cdot e^{t \cdot \log a - b}}{y}\\
\mathbf{if}\;t \leq -12000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq \frac{4807053516048627}{25300281663413827294061918339864663381194581220517764794612669753428792445999418361495047962679640561898384733039601488923726092173224184608376674992592313740189678034570795170558363467761652042654970959809093133570250935428086587327262919456144944542601257064044846194041676826903812816523290938580750782913463467636686848}:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot e^{b}\right)} \cdot x\\
\mathbf{elif}\;t \leq 720000000000:\\
\;\;\;\;\frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -1.2e13 or 7.2e11 < t Initial program 98.4%
Taylor expanded in y around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6479.9%
Applied rewrites79.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower-log.f6471.0%
Applied rewrites71.0%
if -1.2e13 < t < 1.8999999999999999e-307Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
if 1.8999999999999999e-307 < t < 7.2e11Initial program 98.4%
Taylor expanded in t around 0
Applied rewrites79.8%
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
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower--.f6480.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.3%
Applied rewrites80.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.3%
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6459.3%
Applied rewrites59.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (* t (log a))) y) x)))
(if (<= t -320000000000000009721152909664117340504064)
t_1
(if (<=
t
4807053516048627/25300281663413827294061918339864663381194581220517764794612669753428792445999418361495047962679640561898384733039601488923726092173224184608376674992592313740189678034570795170558363467761652042654970959809093133570250935428086587327262919456144944542601257064044846194041676826903812816523290938580750782913463467636686848)
(* (/ 1 (* a (* y (exp b)))) x)
(if (<= t 820000000000) (/ (* x (/ (pow z y) a)) y) t_1)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (exp((t * log(a))) / y) * x;
double tmp;
if (t <= -3.2e+41) {
tmp = t_1;
} else if (t <= 1.9e-307) {
tmp = (1.0 / (a * (y * exp(b)))) * x;
} else if (t <= 820000000000.0) {
tmp = (x * (pow(z, y) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (exp((t * log(a))) / y) * x
if (t <= (-3.2d+41)) then
tmp = t_1
else if (t <= 1.9d-307) then
tmp = (1.0d0 / (a * (y * exp(b)))) * x
else if (t <= 820000000000.0d0) then
tmp = (x * ((z ** y) / a)) / y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.exp((t * Math.log(a))) / y) * x;
double tmp;
if (t <= -3.2e+41) {
tmp = t_1;
} else if (t <= 1.9e-307) {
tmp = (1.0 / (a * (y * Math.exp(b)))) * x;
} else if (t <= 820000000000.0) {
tmp = (x * (Math.pow(z, y) / a)) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.exp((t * math.log(a))) / y) * x tmp = 0 if t <= -3.2e+41: tmp = t_1 elif t <= 1.9e-307: tmp = (1.0 / (a * (y * math.exp(b)))) * x elif t <= 820000000000.0: tmp = (x * (math.pow(z, y) / a)) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(exp(Float64(t * log(a))) / y) * x) tmp = 0.0 if (t <= -3.2e+41) tmp = t_1; elseif (t <= 1.9e-307) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * exp(b)))) * x); elseif (t <= 820000000000.0) tmp = Float64(Float64(x * Float64((z ^ y) / a)) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (exp((t * log(a))) / y) * x; tmp = 0.0; if (t <= -3.2e+41) tmp = t_1; elseif (t <= 1.9e-307) tmp = (1.0 / (a * (y * exp(b)))) * x; elseif (t <= 820000000000.0) tmp = (x * ((z ^ y) / a)) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Exp[N[(t * N[Log[a], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -320000000000000009721152909664117340504064], t$95$1, If[LessEqual[t, 4807053516048627/25300281663413827294061918339864663381194581220517764794612669753428792445999418361495047962679640561898384733039601488923726092173224184608376674992592313740189678034570795170558363467761652042654970959809093133570250935428086587327262919456144944542601257064044846194041676826903812816523290938580750782913463467636686848], N[(N[(1 / N[(a * N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 820000000000], N[(N[(x * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \frac{e^{t \cdot \log a}}{y} \cdot x\\
\mathbf{if}\;t \leq -320000000000000009721152909664117340504064:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq \frac{4807053516048627}{25300281663413827294061918339864663381194581220517764794612669753428792445999418361495047962679640561898384733039601488923726092173224184608376674992592313740189678034570795170558363467761652042654970959809093133570250935428086587327262919456144944542601257064044846194041676826903812816523290938580750782913463467636686848}:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot e^{b}\right)} \cdot x\\
\mathbf{elif}\;t \leq 820000000000:\\
\;\;\;\;\frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if t < -3.2000000000000001e41 or 8.2e11 < t Initial program 98.4%
Taylor expanded in b around inf
lower-*.f6447.3%
Applied rewrites47.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.3%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6447.3%
Applied rewrites47.3%
Taylor expanded in t around inf
lower-*.f64N/A
lower-log.f6448.3%
Applied rewrites48.3%
if -3.2000000000000001e41 < t < 1.8999999999999999e-307Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
if 1.8999999999999999e-307 < t < 8.2e11Initial program 98.4%
Taylor expanded in t around 0
Applied rewrites79.8%
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
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower--.f6480.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.3%
Applied rewrites80.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.3%
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6459.3%
Applied rewrites59.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1) (log a)))
(t_2 (/ (* (* x (pow a (- t 1))) 1) (* (+ 1 b) y))))
(if (<= t_1 -100000000000)
t_2
(if (<= t_1 90)
(* (/ 1 (* a (* y (exp b)))) x)
(if (<=
t_1
1999999999999999918833448912700725462983992179296902879339478019613407845901908851032064)
(* (/ (pow z y) (* a y)) x)
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 * pow(a, (t - 1.0))) * 1.0) / ((1.0 + b) * y);
double tmp;
if (t_1 <= -100000000000.0) {
tmp = t_2;
} else if (t_1 <= 90.0) {
tmp = (1.0 / (a * (y * exp(b)))) * x;
} else if (t_1 <= 2e+87) {
tmp = (pow(z, y) / (a * y)) * x;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - 1.0d0) * log(a)
t_2 = ((x * (a ** (t - 1.0d0))) * 1.0d0) / ((1.0d0 + b) * y)
if (t_1 <= (-100000000000.0d0)) then
tmp = t_2
else if (t_1 <= 90.0d0) then
tmp = (1.0d0 / (a * (y * exp(b)))) * x
else if (t_1 <= 2d+87) then
tmp = ((z ** y) / (a * y)) * x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * Math.log(a);
double t_2 = ((x * Math.pow(a, (t - 1.0))) * 1.0) / ((1.0 + b) * y);
double tmp;
if (t_1 <= -100000000000.0) {
tmp = t_2;
} else if (t_1 <= 90.0) {
tmp = (1.0 / (a * (y * Math.exp(b)))) * x;
} else if (t_1 <= 2e+87) {
tmp = (Math.pow(z, y) / (a * y)) * x;
} 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.pow(a, (t - 1.0))) * 1.0) / ((1.0 + b) * y) tmp = 0 if t_1 <= -100000000000.0: tmp = t_2 elif t_1 <= 90.0: tmp = (1.0 / (a * (y * math.exp(b)))) * x elif t_1 <= 2e+87: tmp = (math.pow(z, y) / (a * y)) * x 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(Float64(x * (a ^ Float64(t - 1.0))) * 1.0) / Float64(Float64(1.0 + b) * y)) tmp = 0.0 if (t_1 <= -100000000000.0) tmp = t_2; elseif (t_1 <= 90.0) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * exp(b)))) * x); elseif (t_1 <= 2e+87) tmp = Float64(Float64((z ^ y) / Float64(a * y)) * x); 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 * (a ^ (t - 1.0))) * 1.0) / ((1.0 + b) * y); tmp = 0.0; if (t_1 <= -100000000000.0) tmp = t_2; elseif (t_1 <= 90.0) tmp = (1.0 / (a * (y * exp(b)))) * x; elseif (t_1 <= 2e+87) tmp = ((z ^ y) / (a * y)) * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[Power[a, N[(t - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * 1), $MachinePrecision] / N[(N[(1 + b), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -100000000000], t$95$2, If[LessEqual[t$95$1, 90], N[(N[(1 / N[(a * N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 1999999999999999918833448912700725462983992179296902879339478019613407845901908851032064], N[(N[(N[Power[z, y], $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := \frac{\left(x \cdot {a}^{\left(t - 1\right)}\right) \cdot 1}{\left(1 + b\right) \cdot y}\\
\mathbf{if}\;t\_1 \leq -100000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 90:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot e^{b}\right)} \cdot x\\
\mathbf{elif}\;t\_1 \leq 1999999999999999918833448912700725462983992179296902879339478019613407845901908851032064:\\
\;\;\;\;\frac{{z}^{y}}{a \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e11 or 1.9999999999999999e87 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites66.6%
Taylor expanded in y around 0
Applied rewrites66.5%
Taylor expanded in b around 0
lower-+.f6452.8%
Applied rewrites52.8%
if -1e11 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 90Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
if 90 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 1.9999999999999999e87Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in b around 0
lower-*.f6454.4%
Applied rewrites54.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1) (log a)))
(t_2 (* (pow a (- t 1)) (* x (/ 1 (* (- b -1) y))))))
(if (<= t_1 -100000000000)
t_2
(if (<= t_1 90)
(* (/ 1 (* a (* y (exp b)))) x)
(if (<=
t_1
1999999999999999918833448912700725462983992179296902879339478019613407845901908851032064)
(* (/ (pow z y) (* a y)) x)
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 = pow(a, (t - 1.0)) * (x * (1.0 / ((b - -1.0) * y)));
double tmp;
if (t_1 <= -100000000000.0) {
tmp = t_2;
} else if (t_1 <= 90.0) {
tmp = (1.0 / (a * (y * exp(b)))) * x;
} else if (t_1 <= 2e+87) {
tmp = (pow(z, y) / (a * y)) * x;
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (t - 1.0d0) * log(a)
t_2 = (a ** (t - 1.0d0)) * (x * (1.0d0 / ((b - (-1.0d0)) * y)))
if (t_1 <= (-100000000000.0d0)) then
tmp = t_2
else if (t_1 <= 90.0d0) then
tmp = (1.0d0 / (a * (y * exp(b)))) * x
else if (t_1 <= 2d+87) then
tmp = ((z ** y) / (a * y)) * x
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * Math.log(a);
double t_2 = Math.pow(a, (t - 1.0)) * (x * (1.0 / ((b - -1.0) * y)));
double tmp;
if (t_1 <= -100000000000.0) {
tmp = t_2;
} else if (t_1 <= 90.0) {
tmp = (1.0 / (a * (y * Math.exp(b)))) * x;
} else if (t_1 <= 2e+87) {
tmp = (Math.pow(z, y) / (a * y)) * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (t - 1.0) * math.log(a) t_2 = math.pow(a, (t - 1.0)) * (x * (1.0 / ((b - -1.0) * y))) tmp = 0 if t_1 <= -100000000000.0: tmp = t_2 elif t_1 <= 90.0: tmp = (1.0 / (a * (y * math.exp(b)))) * x elif t_1 <= 2e+87: tmp = (math.pow(z, y) / (a * y)) * x 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((a ^ Float64(t - 1.0)) * Float64(x * Float64(1.0 / Float64(Float64(b - -1.0) * y)))) tmp = 0.0 if (t_1 <= -100000000000.0) tmp = t_2; elseif (t_1 <= 90.0) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * exp(b)))) * x); elseif (t_1 <= 2e+87) tmp = Float64(Float64((z ^ y) / Float64(a * y)) * x); 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 = (a ^ (t - 1.0)) * (x * (1.0 / ((b - -1.0) * y))); tmp = 0.0; if (t_1 <= -100000000000.0) tmp = t_2; elseif (t_1 <= 90.0) tmp = (1.0 / (a * (y * exp(b)))) * x; elseif (t_1 <= 2e+87) tmp = ((z ^ y) / (a * y)) * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Power[a, N[(t - 1), $MachinePrecision]], $MachinePrecision] * N[(x * N[(1 / N[(N[(b - -1), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -100000000000], t$95$2, If[LessEqual[t$95$1, 90], N[(N[(1 / N[(a * N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$1, 1999999999999999918833448912700725462983992179296902879339478019613407845901908851032064], N[(N[(N[Power[z, y], $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
t_2 := {a}^{\left(t - 1\right)} \cdot \left(x \cdot \frac{1}{\left(b - -1\right) \cdot y}\right)\\
\mathbf{if}\;t\_1 \leq -100000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 90:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot e^{b}\right)} \cdot x\\
\mathbf{elif}\;t\_1 \leq 1999999999999999918833448912700725462983992179296902879339478019613407845901908851032064:\\
\;\;\;\;\frac{{z}^{y}}{a \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e11 or 1.9999999999999999e87 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 98.4%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lift-exp.f64N/A
lift--.f64N/A
exp-diffN/A
frac-timesN/A
lower-/.f64N/A
Applied rewrites66.6%
Taylor expanded in y around 0
Applied rewrites66.5%
Taylor expanded in b around 0
lower-+.f6452.8%
Applied rewrites52.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lift-*.f64N/A
lift--.f64N/A
lift-pow.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
lift-pow.f64N/A
lift--.f64N/A
lower-*.f64N/A
lower-/.f6450.4%
Applied rewrites50.4%
if -1e11 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 90Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
if 90 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 1.9999999999999999e87Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in b around 0
lower-*.f6454.4%
Applied rewrites54.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (/ (pow z y) a)) y)))
(if (<= y -4410161389954167/154742504910672534362390528)
t_1
(if (<=
y
5746858278247083/47890485652059026823698344598447161988085597568237568)
(* (/ 1 (* a (* y (exp b)))) x)
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 <= -2.85e-11) {
tmp = t_1;
} else if (y <= 1.2e-37) {
tmp = (1.0 / (a * (y * exp(b)))) * 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 * ((z ** y) / a)) / y
if (y <= (-2.85d-11)) then
tmp = t_1
else if (y <= 1.2d-37) then
tmp = (1.0d0 / (a * (y * exp(b)))) * 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.pow(z, y) / a)) / y;
double tmp;
if (y <= -2.85e-11) {
tmp = t_1;
} else if (y <= 1.2e-37) {
tmp = (1.0 / (a * (y * Math.exp(b)))) * x;
} 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 <= -2.85e-11: tmp = t_1 elif y <= 1.2e-37: tmp = (1.0 / (a * (y * math.exp(b)))) * x 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 <= -2.85e-11) tmp = t_1; elseif (y <= 1.2e-37) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * exp(b)))) * x); 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 <= -2.85e-11) tmp = t_1; elseif (y <= 1.2e-37) tmp = (1.0 / (a * (y * exp(b)))) * 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[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -4410161389954167/154742504910672534362390528], t$95$1, If[LessEqual[y, 5746858278247083/47890485652059026823698344598447161988085597568237568], N[(N[(1 / N[(a * N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{x \cdot \frac{{z}^{y}}{a}}{y}\\
\mathbf{if}\;y \leq \frac{-4410161389954167}{154742504910672534362390528}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq \frac{5746858278247083}{47890485652059026823698344598447161988085597568237568}:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot e^{b}\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.8499999999999999e-11 or 1.2e-37 < y Initial program 98.4%
Taylor expanded in t around 0
Applied rewrites79.8%
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
lower-*.f64N/A
lower-pow.f64N/A
lower-exp.f64N/A
lower--.f6480.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.3%
Applied rewrites80.3%
Taylor expanded in t around 0
lower-/.f64N/A
lower-exp.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-log.f6480.3%
Applied rewrites80.3%
Taylor expanded in b around 0
lower-/.f64N/A
lower-pow.f6459.3%
Applied rewrites59.3%
if -2.8499999999999999e-11 < y < 1.2e-37Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (pow z y) (* a y)) x)))
(if (<= y -4410161389954167/154742504910672534362390528)
t_1
(if (<=
y
5746858278247083/47890485652059026823698344598447161988085597568237568)
(* (/ 1 (* a (* y (exp b)))) x)
t_1))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (pow(z, y) / (a * y)) * x;
double tmp;
if (y <= -2.85e-11) {
tmp = t_1;
} else if (y <= 1.2e-37) {
tmp = (1.0 / (a * (y * exp(b)))) * 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 = ((z ** y) / (a * y)) * x
if (y <= (-2.85d-11)) then
tmp = t_1
else if (y <= 1.2d-37) then
tmp = (1.0d0 / (a * (y * exp(b)))) * 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 = (Math.pow(z, y) / (a * y)) * x;
double tmp;
if (y <= -2.85e-11) {
tmp = t_1;
} else if (y <= 1.2e-37) {
tmp = (1.0 / (a * (y * Math.exp(b)))) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.pow(z, y) / (a * y)) * x tmp = 0 if y <= -2.85e-11: tmp = t_1 elif y <= 1.2e-37: tmp = (1.0 / (a * (y * math.exp(b)))) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64((z ^ y) / Float64(a * y)) * x) tmp = 0.0 if (y <= -2.85e-11) tmp = t_1; elseif (y <= 1.2e-37) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * exp(b)))) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((z ^ y) / (a * y)) * x; tmp = 0.0; if (y <= -2.85e-11) tmp = t_1; elseif (y <= 1.2e-37) tmp = (1.0 / (a * (y * exp(b)))) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Power[z, y], $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[y, -4410161389954167/154742504910672534362390528], t$95$1, If[LessEqual[y, 5746858278247083/47890485652059026823698344598447161988085597568237568], N[(N[(1 / N[(a * N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{{z}^{y}}{a \cdot y} \cdot x\\
\mathbf{if}\;y \leq \frac{-4410161389954167}{154742504910672534362390528}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq \frac{5746858278247083}{47890485652059026823698344598447161988085597568237568}:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot e^{b}\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.8499999999999999e-11 or 1.2e-37 < y Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in b around 0
lower-*.f6454.4%
Applied rewrites54.4%
if -2.8499999999999999e-11 < y < 1.2e-37Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<=
b
-65999999999999999094766531639258277720490223831174184121362368939827725166012816820909123351066837024896848192060796525872824256518352701099084430357506546122883072)
t_1
(if (<= b 199999999999999998644189734872325595292341688388812800)
(* (/ (pow z y) (* a y)) x)
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 <= -6.6e+163) {
tmp = t_1;
} else if (b <= 2e+53) {
tmp = (pow(z, y) / (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 = (exp(-b) / y) * x
if (b <= (-6.6d+163)) then
tmp = t_1
else if (b <= 2d+53) then
tmp = ((z ** y) / (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 = (Math.exp(-b) / y) * x;
double tmp;
if (b <= -6.6e+163) {
tmp = t_1;
} else if (b <= 2e+53) {
tmp = (Math.pow(z, y) / (a * y)) * x;
} 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 <= -6.6e+163: tmp = t_1 elif b <= 2e+53: tmp = (math.pow(z, y) / (a * y)) * x 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 <= -6.6e+163) tmp = t_1; elseif (b <= 2e+53) tmp = Float64(Float64((z ^ y) / Float64(a * y)) * x); 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 <= -6.6e+163) tmp = t_1; elseif (b <= 2e+53) tmp = ((z ^ y) / (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[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -65999999999999999094766531639258277720490223831174184121362368939827725166012816820909123351066837024896848192060796525872824256518352701099084430357506546122883072], t$95$1, If[LessEqual[b, 199999999999999998644189734872325595292341688388812800], N[(N[(N[Power[z, y], $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -65999999999999999094766531639258277720490223831174184121362368939827725166012816820909123351066837024896848192060796525872824256518352701099084430357506546122883072:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 199999999999999998644189734872325595292341688388812800:\\
\;\;\;\;\frac{{z}^{y}}{a \cdot y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -6.5999999999999999e163 or 2e53 < b Initial program 98.4%
Taylor expanded in b around inf
lower-*.f6447.3%
Applied rewrites47.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.3%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6447.3%
Applied rewrites47.3%
if -6.5999999999999999e163 < b < 2e53Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in b around 0
lower-*.f6454.4%
Applied rewrites54.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ 1 (* a y)))
(t_2
(/
(* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b)))
y)))
(if (<= t_2 (- INFINITY))
(* (+ (* b (- (* 1/2 (/ b (* a y))) t_1)) t_1) x)
(if (<=
t_2
2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128)
(*
(/ 1 (* a (* y (+ 1 (* b (+ 1 (* b (+ 1/2 (* 1/6 b)))))))))
x)
(* (/ (exp (- b)) y) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 / (a * y);
double t_2 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = ((b * ((0.5 * (b / (a * y))) - t_1)) + t_1) * x;
} else if (t_2 <= 2e+216) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x;
} else {
tmp = (exp(-b) / y) * x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 / (a * y);
double t_2 = (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = ((b * ((0.5 * (b / (a * y))) - t_1)) + t_1) * x;
} else if (t_2 <= 2e+216) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x;
} else {
tmp = (Math.exp(-b) / y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 / (a * y) t_2 = (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y tmp = 0 if t_2 <= -math.inf: tmp = ((b * ((0.5 * (b / (a * y))) - t_1)) + t_1) * x elif t_2 <= 2e+216: tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x else: tmp = (math.exp(-b) / y) * x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 / Float64(a * y)) t_2 = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = Float64(Float64(Float64(b * Float64(Float64(0.5 * Float64(b / Float64(a * y))) - t_1)) + t_1) * x); elseif (t_2 <= 2e+216) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * Float64(1.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(0.16666666666666666 * b))))))))) * x); else tmp = Float64(Float64(exp(Float64(-b)) / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 / (a * y); t_2 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; tmp = 0.0; if (t_2 <= -Inf) tmp = ((b * ((0.5 * (b / (a * y))) - t_1)) + t_1) * x; elseif (t_2 <= 2e+216) tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x; else tmp = (exp(-b) / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1 / N[(a * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[(b * N[(N[(1/2 * N[(b / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128], N[(N[(1 / N[(a * N[(y * N[(1 + N[(b * N[(1 + N[(b * N[(1/2 + N[(1/6 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{1}{a \cdot y}\\
t_2 := \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;\left(b \cdot \left(\frac{1}{2} \cdot \frac{b}{a \cdot y} - t\_1\right) + t\_1\right) \cdot x\\
\mathbf{elif}\;t\_2 \leq 2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot \left(1 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\end{array}
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < -inf.0Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if -inf.0 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 2e216Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6440.6%
Applied rewrites40.6%
if 2e216 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) Initial program 98.4%
Taylor expanded in b around inf
lower-*.f6447.3%
Applied rewrites47.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6447.3%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6447.3%
Applied rewrites47.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ b (* a y)))
(t_2 (/ 1 (* a y)))
(t_3
(/
(* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b)))
y)))
(if (<= t_3 (- INFINITY))
(* (+ (* b (- (* 1/2 t_1) t_2)) t_2) x)
(if (<=
t_3
200000000000000004713873502834051166649906559011376372625982507853656333693232346519661872318489902052462821376)
(*
(/ 1 (* a (* y (+ 1 (* b (+ 1 (* b (+ 1/2 (* 1/6 b)))))))))
x)
(*
(+ (* b (- (* b (+ (* -1/6 t_1) (* 1/2 t_2))) t_2)) t_2)
x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b / (a * y);
double t_2 = 1.0 / (a * y);
double t_3 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double tmp;
if (t_3 <= -((double) INFINITY)) {
tmp = ((b * ((0.5 * t_1) - t_2)) + t_2) * x;
} else if (t_3 <= 2e+110) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x;
} else {
tmp = ((b * ((b * ((-0.16666666666666666 * t_1) + (0.5 * t_2))) - t_2)) + t_2) * x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b / (a * y);
double t_2 = 1.0 / (a * y);
double t_3 = (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
double tmp;
if (t_3 <= -Double.POSITIVE_INFINITY) {
tmp = ((b * ((0.5 * t_1) - t_2)) + t_2) * x;
} else if (t_3 <= 2e+110) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x;
} else {
tmp = ((b * ((b * ((-0.16666666666666666 * t_1) + (0.5 * t_2))) - t_2)) + t_2) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b / (a * y) t_2 = 1.0 / (a * y) t_3 = (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y tmp = 0 if t_3 <= -math.inf: tmp = ((b * ((0.5 * t_1) - t_2)) + t_2) * x elif t_3 <= 2e+110: tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x else: tmp = ((b * ((b * ((-0.16666666666666666 * t_1) + (0.5 * t_2))) - t_2)) + t_2) * x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b / Float64(a * y)) t_2 = Float64(1.0 / Float64(a * y)) t_3 = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) tmp = 0.0 if (t_3 <= Float64(-Inf)) tmp = Float64(Float64(Float64(b * Float64(Float64(0.5 * t_1) - t_2)) + t_2) * x); elseif (t_3 <= 2e+110) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * Float64(1.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(0.16666666666666666 * b))))))))) * x); else tmp = Float64(Float64(Float64(b * Float64(Float64(b * Float64(Float64(-0.16666666666666666 * t_1) + Float64(0.5 * t_2))) - t_2)) + t_2) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b / (a * y); t_2 = 1.0 / (a * y); t_3 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; tmp = 0.0; if (t_3 <= -Inf) tmp = ((b * ((0.5 * t_1) - t_2)) + t_2) * x; elseif (t_3 <= 2e+110) tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x; else tmp = ((b * ((b * ((-0.16666666666666666 * t_1) + (0.5 * t_2))) - t_2)) + t_2) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b / N[(a * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(1 / N[(a * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t$95$3, (-Infinity)], N[(N[(N[(b * N[(N[(1/2 * t$95$1), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$3, 200000000000000004713873502834051166649906559011376372625982507853656333693232346519661872318489902052462821376], N[(N[(1 / N[(a * N[(y * N[(1 + N[(b * N[(1 + N[(b * N[(1/2 + N[(1/6 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(b * N[(N[(b * N[(N[(-1/6 * t$95$1), $MachinePrecision] + N[(1/2 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] * x), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \frac{b}{a \cdot y}\\
t_2 := \frac{1}{a \cdot y}\\
t_3 := \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
\mathbf{if}\;t\_3 \leq -\infty:\\
\;\;\;\;\left(b \cdot \left(\frac{1}{2} \cdot t\_1 - t\_2\right) + t\_2\right) \cdot x\\
\mathbf{elif}\;t\_3 \leq 200000000000000004713873502834051166649906559011376372625982507853656333693232346519661872318489902052462821376:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot \left(1 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(b \cdot \left(b \cdot \left(\frac{-1}{6} \cdot t\_1 + \frac{1}{2} \cdot t\_2\right) - t\_2\right) + t\_2\right) \cdot x\\
\end{array}
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < -inf.0Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if -inf.0 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 2e110Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6440.6%
Applied rewrites40.6%
if 2e110 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
Applied rewrites35.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ 1 (* a y)))
(t_2
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))
(t_3 (* (+ (* b (- (* 1/2 (/ b (* a y))) t_1)) t_1) x)))
(if (<= t_2 (- INFINITY))
t_3
(if (<=
t_2
200000000000000004713873502834051166649906559011376372625982507853656333693232346519661872318489902052462821376)
(*
(/ 1 (* a (* y (+ 1 (* b (+ 1 (* b (+ 1/2 (* 1/6 b)))))))))
x)
t_3))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 / (a * y);
double t_2 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double t_3 = ((b * ((0.5 * (b / (a * y))) - t_1)) + t_1) * x;
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_3;
} else if (t_2 <= 2e+110) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x;
} else {
tmp = t_3;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 / (a * y);
double t_2 = (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
double t_3 = ((b * ((0.5 * (b / (a * y))) - t_1)) + t_1) * x;
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_3;
} else if (t_2 <= 2e+110) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 / (a * y) t_2 = (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y t_3 = ((b * ((0.5 * (b / (a * y))) - t_1)) + t_1) * x tmp = 0 if t_2 <= -math.inf: tmp = t_3 elif t_2 <= 2e+110: tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 / Float64(a * y)) t_2 = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) t_3 = Float64(Float64(Float64(b * Float64(Float64(0.5 * Float64(b / Float64(a * y))) - t_1)) + t_1) * x) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_3; elseif (t_2 <= 2e+110) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * Float64(1.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(0.16666666666666666 * b))))))))) * x); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 / (a * y); t_2 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; t_3 = ((b * ((0.5 * (b / (a * y))) - t_1)) + t_1) * x; tmp = 0.0; if (t_2 <= -Inf) tmp = t_3; elseif (t_2 <= 2e+110) tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x; else tmp = t_3; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1 / N[(a * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(b * N[(N[(1/2 * N[(b / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$3, If[LessEqual[t$95$2, 200000000000000004713873502834051166649906559011376372625982507853656333693232346519661872318489902052462821376], N[(N[(1 / N[(a * N[(y * N[(1 + N[(b * N[(1 + N[(b * N[(1/2 + N[(1/6 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_1 := \frac{1}{a \cdot y}\\
t_2 := \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
t_3 := \left(b \cdot \left(\frac{1}{2} \cdot \frac{b}{a \cdot y} - t\_1\right) + t\_1\right) \cdot x\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq 200000000000000004713873502834051166649906559011376372625982507853656333693232346519661872318489902052462821376:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot \left(1 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < -inf.0 or 2e110 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.4%
Applied rewrites35.4%
if -inf.0 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 2e110Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6440.6%
Applied rewrites40.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))
(t_2 (/ 1 (* a y))))
(if (<= t_1 (- INFINITY))
(* t_2 x)
(if (<=
t_1
200000000000000004713873502834051166649906559011376372625982507853656333693232346519661872318489902052462821376)
(*
(/ 1 (* a (* y (+ 1 (* b (+ 1 (* b (+ 1/2 (* 1/6 b)))))))))
x)
(* (+ (* -1 (/ b (* a y))) t_2) x)))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double t_2 = 1.0 / (a * y);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2 * x;
} else if (t_1 <= 2e+110) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x;
} else {
tmp = ((-1.0 * (b / (a * y))) + t_2) * x;
}
return tmp;
}
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 - 1.0) * Math.log(a))) - b))) / y;
double t_2 = 1.0 / (a * y);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2 * x;
} else if (t_1 <= 2e+110) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x;
} else {
tmp = ((-1.0 * (b / (a * y))) + t_2) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y t_2 = 1.0 / (a * y) tmp = 0 if t_1 <= -math.inf: tmp = t_2 * x elif t_1 <= 2e+110: tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x else: tmp = ((-1.0 * (b / (a * y))) + t_2) * x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) t_2 = Float64(1.0 / Float64(a * y)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(t_2 * x); elseif (t_1 <= 2e+110) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * Float64(1.0 + Float64(b * Float64(1.0 + Float64(b * Float64(0.5 + Float64(0.16666666666666666 * b))))))))) * x); else tmp = Float64(Float64(Float64(-1.0 * Float64(b / Float64(a * y))) + t_2) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; t_2 = 1.0 / (a * y); tmp = 0.0; if (t_1 <= -Inf) tmp = t_2 * x; elseif (t_1 <= 2e+110) tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (b * (0.5 + (0.16666666666666666 * b))))))))) * x; else tmp = ((-1.0 * (b / (a * y))) + t_2) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(1 / N[(a * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(t$95$2 * x), $MachinePrecision], If[LessEqual[t$95$1, 200000000000000004713873502834051166649906559011376372625982507853656333693232346519661872318489902052462821376], N[(N[(1 / N[(a * N[(y * N[(1 + N[(b * N[(1 + N[(b * N[(1/2 + N[(1/6 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(-1 * N[(b / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$2), $MachinePrecision] * x), $MachinePrecision]]]]]
\begin{array}{l}
t_1 := \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
t_2 := \frac{1}{a \cdot y}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2 \cdot x\\
\mathbf{elif}\;t\_1 \leq 200000000000000004713873502834051166649906559011376372625982507853656333693232346519661872318489902052462821376:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot \left(1 + b \cdot \left(1 + b \cdot \left(\frac{1}{2} + \frac{1}{6} \cdot b\right)\right)\right)\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(-1 \cdot \frac{b}{a \cdot y} + t\_2\right) \cdot x\\
\end{array}
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < -inf.0Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-*.f6430.8%
Applied rewrites30.8%
if -inf.0 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 2e110Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6440.6%
Applied rewrites40.6%
if 2e110 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6430.5%
Applied rewrites30.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))
(t_2 (* (/ 1 (* a y)) x)))
(if (<= t_1 (- INFINITY))
t_2
(if (<=
t_1
2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128)
(* (/ 1 (* a (* y (+ 1 (* b (+ 1 (* 1/2 b))))))) x)
t_2))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double t_2 = (1.0 / (a * y)) * x;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 2e+216) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (0.5 * b))))))) * x;
} else {
tmp = t_2;
}
return tmp;
}
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 - 1.0) * Math.log(a))) - b))) / y;
double t_2 = (1.0 / (a * y)) * x;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 2e+216) {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (0.5 * b))))))) * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y t_2 = (1.0 / (a * y)) * x tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 2e+216: tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (0.5 * b))))))) * x else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) t_2 = Float64(Float64(1.0 / Float64(a * y)) * x) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 2e+216) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * Float64(1.0 + Float64(b * Float64(1.0 + Float64(0.5 * b))))))) * x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; t_2 = (1.0 / (a * y)) * x; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 2e+216) tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (0.5 * b))))))) * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1 / N[(a * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128], N[(N[(1 / N[(a * N[(y * N[(1 + N[(b * N[(1 + N[(1/2 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
t_2 := \frac{1}{a \cdot y} \cdot x\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot \left(1 + b \cdot \left(1 + \frac{1}{2} \cdot b\right)\right)\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < -inf.0 or 2e216 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-*.f6430.8%
Applied rewrites30.8%
if -inf.0 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 2e216Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
(FPCore (x y z t a b)
:precision binary64
(if (<=
b
-319999999999999980930328336171282656767465475227369543374392612606025672213179642821747208129662418219985516560482187448740079701940785539748470911095844711728460857344)
(* (+ (* -1 (/ b (* a y))) (/ 1 (* a y))) x)
(* (/ 1 (* a (* y (+ 1 (* b (+ 1 (* 1/2 b))))))) x)))double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.2e+167) {
tmp = ((-1.0 * (b / (a * y))) + (1.0 / (a * y))) * x;
} else {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (0.5 * b))))))) * 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) :: tmp
if (b <= (-3.2d+167)) then
tmp = (((-1.0d0) * (b / (a * y))) + (1.0d0 / (a * y))) * x
else
tmp = (1.0d0 / (a * (y * (1.0d0 + (b * (1.0d0 + (0.5d0 * b))))))) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.2e+167) {
tmp = ((-1.0 * (b / (a * y))) + (1.0 / (a * y))) * x;
} else {
tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (0.5 * b))))))) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.2e+167: tmp = ((-1.0 * (b / (a * y))) + (1.0 / (a * y))) * x else: tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (0.5 * b))))))) * x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.2e+167) tmp = Float64(Float64(Float64(-1.0 * Float64(b / Float64(a * y))) + Float64(1.0 / Float64(a * y))) * x); else tmp = Float64(Float64(1.0 / Float64(a * Float64(y * Float64(1.0 + Float64(b * Float64(1.0 + Float64(0.5 * b))))))) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -3.2e+167) tmp = ((-1.0 * (b / (a * y))) + (1.0 / (a * y))) * x; else tmp = (1.0 / (a * (y * (1.0 + (b * (1.0 + (0.5 * b))))))) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -319999999999999980930328336171282656767465475227369543374392612606025672213179642821747208129662418219985516560482187448740079701940785539748470911095844711728460857344], N[(N[(N[(-1 * N[(b / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(1 / N[(a * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(1 / N[(a * N[(y * N[(1 + N[(b * N[(1 + N[(1/2 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;b \leq -319999999999999980930328336171282656767465475227369543374392612606025672213179642821747208129662418219985516560482187448740079701940785539748470911095844711728460857344:\\
\;\;\;\;\left(-1 \cdot \frac{b}{a \cdot y} + \frac{1}{a \cdot y}\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot \left(1 + b \cdot \left(1 + \frac{1}{2} \cdot b\right)\right)\right)} \cdot x\\
\end{array}
if b < -3.1999999999999998e167Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6430.5%
Applied rewrites30.5%
if -3.1999999999999998e167 < b Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6439.5%
Applied rewrites39.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))
(t_2 (* (/ 1 (* a y)) x)))
(if (<= t_1 (- INFINITY))
t_2
(if (<=
t_1
2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128)
(* (/ 1 (* a (+ y (* b (+ y (* 1/2 (* b y))))))) x)
t_2))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double t_2 = (1.0 / (a * y)) * x;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 2e+216) {
tmp = (1.0 / (a * (y + (b * (y + (0.5 * (b * y))))))) * x;
} else {
tmp = t_2;
}
return tmp;
}
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 - 1.0) * Math.log(a))) - b))) / y;
double t_2 = (1.0 / (a * y)) * x;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 2e+216) {
tmp = (1.0 / (a * (y + (b * (y + (0.5 * (b * y))))))) * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y t_2 = (1.0 / (a * y)) * x tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 2e+216: tmp = (1.0 / (a * (y + (b * (y + (0.5 * (b * y))))))) * x else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) t_2 = Float64(Float64(1.0 / Float64(a * y)) * x) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 2e+216) tmp = Float64(Float64(1.0 / Float64(a * Float64(y + Float64(b * Float64(y + Float64(0.5 * Float64(b * y))))))) * x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; t_2 = (1.0 / (a * y)) * x; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 2e+216) tmp = (1.0 / (a * (y + (b * (y + (0.5 * (b * y))))))) * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1 / N[(a * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128], N[(N[(1 / N[(a * N[(y + N[(b * N[(y + N[(1/2 * N[(b * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
t_2 := \frac{1}{a \cdot y} \cdot x\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128:\\
\;\;\;\;\frac{1}{a \cdot \left(y + b \cdot \left(y + \frac{1}{2} \cdot \left(b \cdot y\right)\right)\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < -inf.0 or 2e216 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-*.f6430.8%
Applied rewrites30.8%
if -inf.0 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 2e216Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6438.1%
Applied rewrites38.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1) (log a))) b))) y))
(t_2 (* (/ 1 (* a y)) x)))
(if (<= t_1 (- INFINITY))
t_2
(if (<=
t_1
2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128)
(* (/ 1 (* a (* y (+ 1 b)))) x)
t_2))))double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
double t_2 = (1.0 / (a * y)) * x;
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_1 <= 2e+216) {
tmp = (1.0 / (a * (y * (1.0 + b)))) * x;
} else {
tmp = t_2;
}
return tmp;
}
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 - 1.0) * Math.log(a))) - b))) / y;
double t_2 = (1.0 / (a * y)) * x;
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_1 <= 2e+216) {
tmp = (1.0 / (a * (y * (1.0 + b)))) * x;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y t_2 = (1.0 / (a * y)) * x tmp = 0 if t_1 <= -math.inf: tmp = t_2 elif t_1 <= 2e+216: tmp = (1.0 / (a * (y * (1.0 + b)))) * x else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) t_2 = Float64(Float64(1.0 / Float64(a * y)) * x) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = t_2; elseif (t_1 <= 2e+216) tmp = Float64(Float64(1.0 / Float64(a * Float64(y * Float64(1.0 + b)))) * x); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; t_2 = (1.0 / (a * y)) * x; tmp = 0.0; if (t_1 <= -Inf) tmp = t_2; elseif (t_1 <= 2e+216) tmp = (1.0 / (a * (y * (1.0 + b)))) * x; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, Block[{t$95$2 = N[(N[(1 / N[(a * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], t$95$2, If[LessEqual[t$95$1, 2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128], N[(N[(1 / N[(a * N[(y * N[(1 + b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}\\
t_2 := \frac{1}{a \cdot y} \cdot x\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2000000000000000042843093916083914884986269493489898588353418190684583481166660738809762058694254899725914558636661864181657900957739886843189208296670960146935684485884880403647747761611295732625305407912459924144128:\\
\;\;\;\;\frac{1}{a \cdot \left(y \cdot \left(1 + b\right)\right)} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < -inf.0 or 2e216 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-*.f6430.8%
Applied rewrites30.8%
if -inf.0 < (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a))) b))) y) < 2e216Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-+.f6432.1%
Applied rewrites32.1%
(FPCore (x y z t a b) :precision binary64 (* (/ 1 (* a y)) x))
double code(double x, double y, double z, double t, double a, double b) {
return (1.0 / (a * y)) * x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = (1.0d0 / (a * y)) * x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (1.0 / (a * y)) * x;
}
def code(x, y, z, t, a, b): return (1.0 / (a * y)) * x
function code(x, y, z, t, a, b) return Float64(Float64(1.0 / Float64(a * y)) * x) end
function tmp = code(x, y, z, t, a, b) tmp = (1.0 / (a * y)) * x; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(1 / N[(a * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]
\frac{1}{a \cdot y} \cdot x
Initial program 98.4%
Applied rewrites70.6%
Taylor expanded in t around 0
lower-/.f64N/A
lower-pow.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6466.3%
Applied rewrites66.3%
Taylor expanded in y around 0
lower-/.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-exp.f6458.8%
Applied rewrites58.8%
Taylor expanded in b around 0
lower-*.f6430.8%
Applied rewrites30.8%
herbie shell --seed 2025271 -o generate:evaluate
(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) (log a))) b))) y))