
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* b (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + (b * log(c))) + (y * i);
}
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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + (b * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + (b * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + (b * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(b * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + (b * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + b \cdot \log c\right) + y \cdot i
Initial program 99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6497.8%
Applied rewrites97.8%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (fmax (fmax z t) (fmax (fmin z t) a)) (+ (fmin (fmin z t) a) (* x (log y)))) (* b (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((fmax(fmax(z, t), fmax(fmin(z, t), a)) + (fmin(fmin(z, t), a) + (x * log(y)))) + (b * log(c))) + (y * i);
}
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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = ((fmax(fmax(z, t), fmax(fmin(z, t), a)) + (fmin(fmin(z, t), a) + (x * log(y)))) + (b * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((fmax(fmax(z, t), fmax(fmin(z, t), a)) + (fmin(fmin(z, t), a) + (x * Math.log(y)))) + (b * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return ((fmax(fmax(z, t), fmax(fmin(z, t), a)) + (fmin(fmin(z, t), a) + (x * math.log(y)))) + (b * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(fmax(fmax(z, t), fmax(fmin(z, t), a)) + Float64(fmin(fmin(z, t), a) + Float64(x * log(y)))) + Float64(b * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((max(max(z, t), max(min(z, t), a)) + (min(min(z, t), a) + (x * log(y)))) + (b * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[Max[N[Max[z, t], $MachinePrecision], N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]], $MachinePrecision] + N[(N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\left(\left(\mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right) + \left(\mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right) + x \cdot \log y\right)\right) + b \cdot \log c\right) + y \cdot i
Initial program 99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6497.8%
Applied rewrites97.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6482.6%
Applied rewrites82.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmax t (fmax z a)))
(t_2 (+ (+ (+ t_1 (* x (log y))) (* b (log c))) (* y i))))
(if (<= x -2.25e+138)
t_2
(if (<= x 1.05e+216)
(+
(+
(+ (+ (fmin z a) (fmin t (fmax z a))) t_1)
(* (- b 0.5) (log c)))
(* y i))
t_2))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmax(t, fmax(z, a));
double t_2 = ((t_1 + (x * log(y))) + (b * log(c))) + (y * i);
double tmp;
if (x <= -2.25e+138) {
tmp = t_2;
} else if (x <= 1.05e+216) {
tmp = (((fmin(z, a) + fmin(t, fmax(z, a))) + t_1) + ((b - 0.5) * log(c))) + (y * i);
} 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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = fmax(t, fmax(z, a))
t_2 = ((t_1 + (x * log(y))) + (b * log(c))) + (y * i)
if (x <= (-2.25d+138)) then
tmp = t_2
else if (x <= 1.05d+216) then
tmp = (((fmin(z, a) + fmin(t, fmax(z, a))) + t_1) + ((b - 0.5d0) * log(c))) + (y * i)
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 c, double i) {
double t_1 = fmax(t, fmax(z, a));
double t_2 = ((t_1 + (x * Math.log(y))) + (b * Math.log(c))) + (y * i);
double tmp;
if (x <= -2.25e+138) {
tmp = t_2;
} else if (x <= 1.05e+216) {
tmp = (((fmin(z, a) + fmin(t, fmax(z, a))) + t_1) + ((b - 0.5) * Math.log(c))) + (y * i);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmax(t, fmax(z, a)) t_2 = ((t_1 + (x * math.log(y))) + (b * math.log(c))) + (y * i) tmp = 0 if x <= -2.25e+138: tmp = t_2 elif x <= 1.05e+216: tmp = (((fmin(z, a) + fmin(t, fmax(z, a))) + t_1) + ((b - 0.5) * math.log(c))) + (y * i) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmax(t, fmax(z, a)) t_2 = Float64(Float64(Float64(t_1 + Float64(x * log(y))) + Float64(b * log(c))) + Float64(y * i)) tmp = 0.0 if (x <= -2.25e+138) tmp = t_2; elseif (x <= 1.05e+216) tmp = Float64(Float64(Float64(Float64(fmin(z, a) + fmin(t, fmax(z, a))) + t_1) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = max(t, max(z, a)); t_2 = ((t_1 + (x * log(y))) + (b * log(c))) + (y * i); tmp = 0.0; if (x <= -2.25e+138) tmp = t_2; elseif (x <= 1.05e+216) tmp = (((min(z, a) + min(t, max(z, a))) + t_1) + ((b - 0.5) * log(c))) + (y * i); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Max[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(t$95$1 + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.25e+138], t$95$2, If[LessEqual[x, 1.05e+216], N[(N[(N[(N[(N[Min[z, a], $MachinePrecision] + N[Min[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(t, \mathsf{max}\left(z, a\right)\right)\\
t_2 := \left(\left(t\_1 + x \cdot \log y\right) + b \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;x \leq -2.25 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+216}:\\
\;\;\;\;\left(\left(\left(\mathsf{min}\left(z, a\right) + \mathsf{min}\left(t, \mathsf{max}\left(z, a\right)\right)\right) + t\_1\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if x < -2.2499999999999999e138 or 1.05e216 < x Initial program 99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6497.8%
Applied rewrites97.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6482.6%
Applied rewrites82.6%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6468.1%
Applied rewrites68.1%
if -2.2499999999999999e138 < x < 1.05e216Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (* -1.0 (* x (log y))))))
(if (<= x -6e+253)
t_1
(if (<= x 1.05e+216)
(+ (+ (+ (+ z t) a) (* (- b 0.5) (log c))) (* y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -(-1.0 * (x * log(y)));
double tmp;
if (x <= -6e+253) {
tmp = t_1;
} else if (x <= 1.05e+216) {
tmp = (((z + t) + a) + ((b - 0.5) * log(c))) + (y * i);
} 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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = -((-1.0d0) * (x * log(y)))
if (x <= (-6d+253)) then
tmp = t_1
else if (x <= 1.05d+216) then
tmp = (((z + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
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 c, double i) {
double t_1 = -(-1.0 * (x * Math.log(y)));
double tmp;
if (x <= -6e+253) {
tmp = t_1;
} else if (x <= 1.05e+216) {
tmp = (((z + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -(-1.0 * (x * math.log(y))) tmp = 0 if x <= -6e+253: tmp = t_1 elif x <= 1.05e+216: tmp = (((z + t) + a) + ((b - 0.5) * math.log(c))) + (y * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-Float64(-1.0 * Float64(x * log(y)))) tmp = 0.0 if (x <= -6e+253) tmp = t_1; elseif (x <= 1.05e+216) tmp = Float64(Float64(Float64(Float64(z + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -(-1.0 * (x * log(y))); tmp = 0.0; if (x <= -6e+253) tmp = t_1; elseif (x <= 1.05e+216) tmp = (((z + t) + a) + ((b - 0.5) * log(c))) + (y * i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = (-N[(-1.0 * N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -6e+253], t$95$1, If[LessEqual[x, 1.05e+216], N[(N[(N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := --1 \cdot \left(x \cdot \log y\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+216}:\\
\;\;\;\;\left(\left(\left(z + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -5.9999999999999996e253 or 1.05e216 < x Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6416.2%
Applied rewrites16.2%
if -5.9999999999999996e253 < x < 1.05e216Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (* -1.0 (* x (log y))))))
(if (<= x -6e+253)
t_1
(if (<= x 1.05e+216)
(+ (+ (+ (+ t z) a) (* b (log c))) (* y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -(-1.0 * (x * log(y)));
double tmp;
if (x <= -6e+253) {
tmp = t_1;
} else if (x <= 1.05e+216) {
tmp = (((t + z) + a) + (b * log(c))) + (y * i);
} 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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = -((-1.0d0) * (x * log(y)))
if (x <= (-6d+253)) then
tmp = t_1
else if (x <= 1.05d+216) then
tmp = (((t + z) + a) + (b * log(c))) + (y * i)
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 c, double i) {
double t_1 = -(-1.0 * (x * Math.log(y)));
double tmp;
if (x <= -6e+253) {
tmp = t_1;
} else if (x <= 1.05e+216) {
tmp = (((t + z) + a) + (b * Math.log(c))) + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -(-1.0 * (x * math.log(y))) tmp = 0 if x <= -6e+253: tmp = t_1 elif x <= 1.05e+216: tmp = (((t + z) + a) + (b * math.log(c))) + (y * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-Float64(-1.0 * Float64(x * log(y)))) tmp = 0.0 if (x <= -6e+253) tmp = t_1; elseif (x <= 1.05e+216) tmp = Float64(Float64(Float64(Float64(t + z) + a) + Float64(b * log(c))) + Float64(y * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -(-1.0 * (x * log(y))); tmp = 0.0; if (x <= -6e+253) tmp = t_1; elseif (x <= 1.05e+216) tmp = (((t + z) + a) + (b * log(c))) + (y * i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = (-N[(-1.0 * N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -6e+253], t$95$1, If[LessEqual[x, 1.05e+216], N[(N[(N[(N[(t + z), $MachinePrecision] + a), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := --1 \cdot \left(x \cdot \log y\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+216}:\\
\;\;\;\;\left(\left(\left(t + z\right) + a\right) + b \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -5.9999999999999996e253 or 1.05e216 < x Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6416.2%
Applied rewrites16.2%
if -5.9999999999999996e253 < x < 1.05e216Initial program 99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6497.8%
Applied rewrites97.8%
Taylor expanded in x around 0
lower-+.f6483.0%
Applied rewrites83.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (* -1.0 (* x (log y))))))
(if (<= x -6e+253)
t_1
(if (<= x 1.05e+216)
(+
(+
(+ (fmax (fmax z t) (fmax (fmin z t) a)) (fmin (fmin z t) a))
(* b (log c)))
(* y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -(-1.0 * (x * log(y)));
double tmp;
if (x <= -6e+253) {
tmp = t_1;
} else if (x <= 1.05e+216) {
tmp = ((fmax(fmax(z, t), fmax(fmin(z, t), a)) + fmin(fmin(z, t), a)) + (b * log(c))) + (y * i);
} 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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = -((-1.0d0) * (x * log(y)))
if (x <= (-6d+253)) then
tmp = t_1
else if (x <= 1.05d+216) then
tmp = ((fmax(fmax(z, t), fmax(fmin(z, t), a)) + fmin(fmin(z, t), a)) + (b * log(c))) + (y * i)
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 c, double i) {
double t_1 = -(-1.0 * (x * Math.log(y)));
double tmp;
if (x <= -6e+253) {
tmp = t_1;
} else if (x <= 1.05e+216) {
tmp = ((fmax(fmax(z, t), fmax(fmin(z, t), a)) + fmin(fmin(z, t), a)) + (b * Math.log(c))) + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -(-1.0 * (x * math.log(y))) tmp = 0 if x <= -6e+253: tmp = t_1 elif x <= 1.05e+216: tmp = ((fmax(fmax(z, t), fmax(fmin(z, t), a)) + fmin(fmin(z, t), a)) + (b * math.log(c))) + (y * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-Float64(-1.0 * Float64(x * log(y)))) tmp = 0.0 if (x <= -6e+253) tmp = t_1; elseif (x <= 1.05e+216) tmp = Float64(Float64(Float64(fmax(fmax(z, t), fmax(fmin(z, t), a)) + fmin(fmin(z, t), a)) + Float64(b * log(c))) + Float64(y * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -(-1.0 * (x * log(y))); tmp = 0.0; if (x <= -6e+253) tmp = t_1; elseif (x <= 1.05e+216) tmp = ((max(max(z, t), max(min(z, t), a)) + min(min(z, t), a)) + (b * log(c))) + (y * i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = (-N[(-1.0 * N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, If[LessEqual[x, -6e+253], t$95$1, If[LessEqual[x, 1.05e+216], N[(N[(N[(N[Max[N[Max[z, t], $MachinePrecision], N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]], $MachinePrecision] + N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := --1 \cdot \left(x \cdot \log y\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.05 \cdot 10^{+216}:\\
\;\;\;\;\left(\left(\mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right) + \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\right) + b \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -5.9999999999999996e253 or 1.05e216 < x Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6416.2%
Applied rewrites16.2%
if -5.9999999999999996e253 < x < 1.05e216Initial program 99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6497.8%
Applied rewrites97.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6482.6%
Applied rewrites82.6%
Taylor expanded in x around 0
Applied rewrites68.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (* -1.0 (* x (log y)))))
(t_2 (fmax (fmax z t) (fmax (fmin z t) a))))
(if (<= x -6e+253)
t_1
(if (<= x 5.6e+210)
(+ (* (+ 1.0 (/ (fmin (fmin z t) a) t_2)) t_2) (* y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -(-1.0 * (x * log(y)));
double t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a));
double tmp;
if (x <= -6e+253) {
tmp = t_1;
} else if (x <= 5.6e+210) {
tmp = ((1.0 + (fmin(fmin(z, t), a) / t_2)) * t_2) + (y * i);
} 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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -((-1.0d0) * (x * log(y)))
t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a))
if (x <= (-6d+253)) then
tmp = t_1
else if (x <= 5.6d+210) then
tmp = ((1.0d0 + (fmin(fmin(z, t), a) / t_2)) * t_2) + (y * i)
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 c, double i) {
double t_1 = -(-1.0 * (x * Math.log(y)));
double t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a));
double tmp;
if (x <= -6e+253) {
tmp = t_1;
} else if (x <= 5.6e+210) {
tmp = ((1.0 + (fmin(fmin(z, t), a) / t_2)) * t_2) + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -(-1.0 * (x * math.log(y))) t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a)) tmp = 0 if x <= -6e+253: tmp = t_1 elif x <= 5.6e+210: tmp = ((1.0 + (fmin(fmin(z, t), a) / t_2)) * t_2) + (y * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-Float64(-1.0 * Float64(x * log(y)))) t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a)) tmp = 0.0 if (x <= -6e+253) tmp = t_1; elseif (x <= 5.6e+210) tmp = Float64(Float64(Float64(1.0 + Float64(fmin(fmin(z, t), a) / t_2)) * t_2) + Float64(y * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -(-1.0 * (x * log(y))); t_2 = max(max(z, t), max(min(z, t), a)); tmp = 0.0; if (x <= -6e+253) tmp = t_1; elseif (x <= 5.6e+210) tmp = ((1.0 + (min(min(z, t), a) / t_2)) * t_2) + (y * i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = (-N[(-1.0 * N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$2 = N[Max[N[Max[z, t], $MachinePrecision], N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -6e+253], t$95$1, If[LessEqual[x, 5.6e+210], N[(N[(N[(1.0 + N[(N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := --1 \cdot \left(x \cdot \log y\right)\\
t_2 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.6 \cdot 10^{+210}:\\
\;\;\;\;\left(1 + \frac{\mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)}{t\_2}\right) \cdot t\_2 + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -5.9999999999999996e253 or 5.6000000000000004e210 < x Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6416.2%
Applied rewrites16.2%
if -5.9999999999999996e253 < x < 5.6000000000000004e210Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6446.5%
Applied rewrites46.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6446.5%
Applied rewrites46.5%
Taylor expanded in z around inf
lower-/.f6446.7%
Applied rewrites46.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (* -1.0 (* b (log c)))))
(t_2 (fmax (fmax z t) (fmax (fmin z t) a))))
(if (<= b -7.2e+172)
t_1
(if (<= b 6.2e+246)
(+ (* (+ 1.0 (/ (fmin (fmin z t) a) t_2)) t_2) (* y i))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -(-1.0 * (b * log(c)));
double t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a));
double tmp;
if (b <= -7.2e+172) {
tmp = t_1;
} else if (b <= 6.2e+246) {
tmp = ((1.0 + (fmin(fmin(z, t), a) / t_2)) * t_2) + (y * i);
} 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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = -((-1.0d0) * (b * log(c)))
t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a))
if (b <= (-7.2d+172)) then
tmp = t_1
else if (b <= 6.2d+246) then
tmp = ((1.0d0 + (fmin(fmin(z, t), a) / t_2)) * t_2) + (y * i)
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 c, double i) {
double t_1 = -(-1.0 * (b * Math.log(c)));
double t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a));
double tmp;
if (b <= -7.2e+172) {
tmp = t_1;
} else if (b <= 6.2e+246) {
tmp = ((1.0 + (fmin(fmin(z, t), a) / t_2)) * t_2) + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = -(-1.0 * (b * math.log(c))) t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a)) tmp = 0 if b <= -7.2e+172: tmp = t_1 elif b <= 6.2e+246: tmp = ((1.0 + (fmin(fmin(z, t), a) / t_2)) * t_2) + (y * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-Float64(-1.0 * Float64(b * log(c)))) t_2 = fmax(fmax(z, t), fmax(fmin(z, t), a)) tmp = 0.0 if (b <= -7.2e+172) tmp = t_1; elseif (b <= 6.2e+246) tmp = Float64(Float64(Float64(1.0 + Float64(fmin(fmin(z, t), a) / t_2)) * t_2) + Float64(y * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = -(-1.0 * (b * log(c))); t_2 = max(max(z, t), max(min(z, t), a)); tmp = 0.0; if (b <= -7.2e+172) tmp = t_1; elseif (b <= 6.2e+246) tmp = ((1.0 + (min(min(z, t), a) / t_2)) * t_2) + (y * i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = (-N[(-1.0 * N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$2 = N[Max[N[Max[z, t], $MachinePrecision], N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[b, -7.2e+172], t$95$1, If[LessEqual[b, 6.2e+246], N[(N[(N[(1.0 + N[(N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision] / t$95$2), $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := --1 \cdot \left(b \cdot \log c\right)\\
t_2 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right)\\
\mathbf{if}\;b \leq -7.2 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 6.2 \cdot 10^{+246}:\\
\;\;\;\;\left(1 + \frac{\mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)}{t\_2}\right) \cdot t\_2 + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -7.1999999999999995e172 or 6.1999999999999998e246 < b Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6416.4%
Applied rewrites16.4%
if -7.1999999999999995e172 < b < 6.1999999999999998e246Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6446.5%
Applied rewrites46.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6446.5%
Applied rewrites46.5%
Taylor expanded in z around inf
lower-/.f6446.7%
Applied rewrites46.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmax (fmax z t) (fmax (fmin z t) a)))
(t_2 (fmin (fmin z t) a)))
(if (<= t_2 -1.75e+280)
(- (* -1.0 t_2))
(+ (* (+ 1.0 (/ t_2 t_1)) t_1) (* y i)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmax(fmax(z, t), fmax(fmin(z, t), a));
double t_2 = fmin(fmin(z, t), a);
double tmp;
if (t_2 <= -1.75e+280) {
tmp = -(-1.0 * t_2);
} else {
tmp = ((1.0 + (t_2 / t_1)) * t_1) + (y * i);
}
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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = fmax(fmax(z, t), fmax(fmin(z, t), a))
t_2 = fmin(fmin(z, t), a)
if (t_2 <= (-1.75d+280)) then
tmp = -((-1.0d0) * t_2)
else
tmp = ((1.0d0 + (t_2 / t_1)) * t_1) + (y * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmax(fmax(z, t), fmax(fmin(z, t), a));
double t_2 = fmin(fmin(z, t), a);
double tmp;
if (t_2 <= -1.75e+280) {
tmp = -(-1.0 * t_2);
} else {
tmp = ((1.0 + (t_2 / t_1)) * t_1) + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmax(fmax(z, t), fmax(fmin(z, t), a)) t_2 = fmin(fmin(z, t), a) tmp = 0 if t_2 <= -1.75e+280: tmp = -(-1.0 * t_2) else: tmp = ((1.0 + (t_2 / t_1)) * t_1) + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmax(fmax(z, t), fmax(fmin(z, t), a)) t_2 = fmin(fmin(z, t), a) tmp = 0.0 if (t_2 <= -1.75e+280) tmp = Float64(-Float64(-1.0 * t_2)); else tmp = Float64(Float64(Float64(1.0 + Float64(t_2 / t_1)) * t_1) + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = max(max(z, t), max(min(z, t), a)); t_2 = min(min(z, t), a); tmp = 0.0; if (t_2 <= -1.75e+280) tmp = -(-1.0 * t_2); else tmp = ((1.0 + (t_2 / t_1)) * t_1) + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Max[N[Max[z, t], $MachinePrecision], N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, If[LessEqual[t$95$2, -1.75e+280], (-N[(-1.0 * t$95$2), $MachinePrecision]), N[(N[(N[(1.0 + N[(t$95$2 / t$95$1), $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right)\\
t_2 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
\mathbf{if}\;t\_2 \leq -1.75 \cdot 10^{+280}:\\
\;\;\;\;--1 \cdot t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(1 + \frac{t\_2}{t\_1}\right) \cdot t\_1 + y \cdot i\\
\end{array}
if z < -1.7500000000000001e280Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
if -1.7500000000000001e280 < z Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6446.5%
Applied rewrites46.5%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6446.5%
Applied rewrites46.5%
Taylor expanded in z around inf
lower-/.f6446.7%
Applied rewrites46.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (fmax (fmin z t) a))
(t_3 (fmin (fmax z t) t_2))
(t_4 (fmax (fmax z t) t_2))
(t_5 (+ (* (+ 1.0 (/ t_3 t_4)) t_4) (* y i)))
(t_6
(+
(+
(+ (+ (+ (* x (log y)) t_1) t_3) t_4)
(* (- b 0.5) (log c)))
(* y i))))
(if (<= t_6 -4e+306) t_5 (if (<= t_6 -2e+33) (- (* -1.0 t_1)) t_5))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmin(fmax(z, t), t_2);
double t_4 = fmax(fmax(z, t), t_2);
double t_5 = ((1.0 + (t_3 / t_4)) * t_4) + (y * i);
double t_6 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_6 <= -4e+306) {
tmp = t_5;
} else if (t_6 <= -2e+33) {
tmp = -(-1.0 * t_1);
} else {
tmp = t_5;
}
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, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = fmin(fmin(z, t), a)
t_2 = fmax(fmin(z, t), a)
t_3 = fmin(fmax(z, t), t_2)
t_4 = fmax(fmax(z, t), t_2)
t_5 = ((1.0d0 + (t_3 / t_4)) * t_4) + (y * i)
t_6 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5d0) * log(c))) + (y * i)
if (t_6 <= (-4d+306)) then
tmp = t_5
else if (t_6 <= (-2d+33)) then
tmp = -((-1.0d0) * t_1)
else
tmp = t_5
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmin(fmax(z, t), t_2);
double t_4 = fmax(fmax(z, t), t_2);
double t_5 = ((1.0 + (t_3 / t_4)) * t_4) + (y * i);
double t_6 = (((((x * Math.log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_6 <= -4e+306) {
tmp = t_5;
} else if (t_6 <= -2e+33) {
tmp = -(-1.0 * t_1);
} else {
tmp = t_5;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmin(fmin(z, t), a) t_2 = fmax(fmin(z, t), a) t_3 = fmin(fmax(z, t), t_2) t_4 = fmax(fmax(z, t), t_2) t_5 = ((1.0 + (t_3 / t_4)) * t_4) + (y * i) t_6 = (((((x * math.log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_6 <= -4e+306: tmp = t_5 elif t_6 <= -2e+33: tmp = -(-1.0 * t_1) else: tmp = t_5 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmin(fmin(z, t), a) t_2 = fmax(fmin(z, t), a) t_3 = fmin(fmax(z, t), t_2) t_4 = fmax(fmax(z, t), t_2) t_5 = Float64(Float64(Float64(1.0 + Float64(t_3 / t_4)) * t_4) + Float64(y * i)) t_6 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + t_3) + t_4) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_6 <= -4e+306) tmp = t_5; elseif (t_6 <= -2e+33) tmp = Float64(-Float64(-1.0 * t_1)); else tmp = t_5; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = min(min(z, t), a); t_2 = max(min(z, t), a); t_3 = min(max(z, t), t_2); t_4 = max(max(z, t), t_2); t_5 = ((1.0 + (t_3 / t_4)) * t_4) + (y * i); t_6 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_6 <= -4e+306) tmp = t_5; elseif (t_6 <= -2e+33) tmp = -(-1.0 * t_1); else tmp = t_5; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(1.0 + N[(t$95$3 / t$95$4), $MachinePrecision]), $MachinePrecision] * t$95$4), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$6 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -4e+306], t$95$5, If[LessEqual[t$95$6, -2e+33], (-N[(-1.0 * t$95$1), $MachinePrecision]), t$95$5]]]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
t_4 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
t_5 := \left(1 + \frac{t\_3}{t\_4}\right) \cdot t\_4 + y \cdot i\\
t_6 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + t\_3\right) + t\_4\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_6 \leq -4 \cdot 10^{+306}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_6 \leq -2 \cdot 10^{+33}:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_5\\
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -4.0000000000000001e306 or -1.9999999999999999e33 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.7%
Taylor expanded in t around inf
lower-/.f6446.8%
Applied rewrites46.8%
if -4.0000000000000001e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.9999999999999999e33Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (fmax (fmin z t) a))
(t_3 (fmax (fmax z t) t_2))
(t_4
(+
(+
(+ (+ (+ (* x (log y)) t_1) (fmin (fmax z t) t_2)) t_3)
(* (- b 0.5) (log c)))
(* y i))))
(if (<= t_4 (- INFINITY))
(- (* -1.0 (* i y)))
(if (<= t_4 -2e+33) (- (* -1.0 t_1)) (+ (* 1.0 t_3) (* y i))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmax(fmax(z, t), t_2);
double t_4 = (((((x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_4 <= -((double) INFINITY)) {
tmp = -(-1.0 * (i * y));
} else if (t_4 <= -2e+33) {
tmp = -(-1.0 * t_1);
} else {
tmp = (1.0 * t_3) + (y * i);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmax(fmax(z, t), t_2);
double t_4 = (((((x * Math.log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_4 <= -Double.POSITIVE_INFINITY) {
tmp = -(-1.0 * (i * y));
} else if (t_4 <= -2e+33) {
tmp = -(-1.0 * t_1);
} else {
tmp = (1.0 * t_3) + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmin(fmin(z, t), a) t_2 = fmax(fmin(z, t), a) t_3 = fmax(fmax(z, t), t_2) t_4 = (((((x * math.log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_4 <= -math.inf: tmp = -(-1.0 * (i * y)) elif t_4 <= -2e+33: tmp = -(-1.0 * t_1) else: tmp = (1.0 * t_3) + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmin(fmin(z, t), a) t_2 = fmax(fmin(z, t), a) t_3 = fmax(fmax(z, t), t_2) t_4 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_4 <= Float64(-Inf)) tmp = Float64(-Float64(-1.0 * Float64(i * y))); elseif (t_4 <= -2e+33) tmp = Float64(-Float64(-1.0 * t_1)); else tmp = Float64(Float64(1.0 * t_3) + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = min(min(z, t), a); t_2 = max(min(z, t), a); t_3 = max(max(z, t), t_2); t_4 = (((((x * log(y)) + t_1) + min(max(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_4 <= -Inf) tmp = -(-1.0 * (i * y)); elseif (t_4 <= -2e+33) tmp = -(-1.0 * t_1); else tmp = (1.0 * t_3) + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, (-Infinity)], (-N[(-1.0 * N[(i * y), $MachinePrecision]), $MachinePrecision]), If[LessEqual[t$95$4, -2e+33], (-N[(-1.0 * t$95$1), $MachinePrecision]), N[(N[(1.0 * t$95$3), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_3 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
t_4 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\right) + t\_3\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_4 \leq -\infty:\\
\;\;\;\;--1 \cdot \left(i \cdot y\right)\\
\mathbf{elif}\;t\_4 \leq -2 \cdot 10^{+33}:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;1 \cdot t\_3 + y \cdot i\\
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6424.8%
Applied rewrites24.8%
if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.9999999999999999e33Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
if -1.9999999999999999e33 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.7%
Taylor expanded in x around inf
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6446.5%
Applied rewrites46.5%
Taylor expanded in a around inf
Applied rewrites39.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (- (* -1.0 (* i y))))
(t_3 (fmax (fmin z t) a))
(t_4 (fmax (fmax z t) t_3))
(t_5
(+
(+
(+ (+ (+ (* x (log y)) t_1) (fmin (fmax z t) t_3)) t_4)
(* (- b 0.5) (log c)))
(* y i))))
(if (<= t_5 (- INFINITY))
t_2
(if (<= t_5 -50.0)
(- (* -1.0 t_1))
(if (<= t_5 1e+308) (- (- t_4)) t_2)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = -(-1.0 * (i * y));
double t_3 = fmax(fmin(z, t), a);
double t_4 = fmax(fmax(z, t), t_3);
double t_5 = (((((x * log(y)) + t_1) + fmin(fmax(z, t), t_3)) + t_4) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = t_2;
} else if (t_5 <= -50.0) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 1e+308) {
tmp = -(-t_4);
} else {
tmp = t_2;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = -(-1.0 * (i * y));
double t_3 = fmax(fmin(z, t), a);
double t_4 = fmax(fmax(z, t), t_3);
double t_5 = (((((x * Math.log(y)) + t_1) + fmin(fmax(z, t), t_3)) + t_4) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_5 <= -Double.POSITIVE_INFINITY) {
tmp = t_2;
} else if (t_5 <= -50.0) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 1e+308) {
tmp = -(-t_4);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmin(fmin(z, t), a) t_2 = -(-1.0 * (i * y)) t_3 = fmax(fmin(z, t), a) t_4 = fmax(fmax(z, t), t_3) t_5 = (((((x * math.log(y)) + t_1) + fmin(fmax(z, t), t_3)) + t_4) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_5 <= -math.inf: tmp = t_2 elif t_5 <= -50.0: tmp = -(-1.0 * t_1) elif t_5 <= 1e+308: tmp = -(-t_4) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmin(fmin(z, t), a) t_2 = Float64(-Float64(-1.0 * Float64(i * y))) t_3 = fmax(fmin(z, t), a) t_4 = fmax(fmax(z, t), t_3) t_5 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + fmin(fmax(z, t), t_3)) + t_4) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_5 <= Float64(-Inf)) tmp = t_2; elseif (t_5 <= -50.0) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_5 <= 1e+308) tmp = Float64(-Float64(-t_4)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = min(min(z, t), a); t_2 = -(-1.0 * (i * y)); t_3 = max(min(z, t), a); t_4 = max(max(z, t), t_3); t_5 = (((((x * log(y)) + t_1) + min(max(z, t), t_3)) + t_4) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_5 <= -Inf) tmp = t_2; elseif (t_5 <= -50.0) tmp = -(-1.0 * t_1); elseif (t_5 <= 1e+308) tmp = -(-t_4); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = (-N[(-1.0 * N[(i * y), $MachinePrecision]), $MachinePrecision])}, Block[{t$95$3 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[z, t], $MachinePrecision], t$95$3], $MachinePrecision]}, Block[{t$95$5 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[Min[N[Max[z, t], $MachinePrecision], t$95$3], $MachinePrecision]), $MachinePrecision] + t$95$4), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, (-Infinity)], t$95$2, If[LessEqual[t$95$5, -50.0], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$5, 1e+308], (-(-t$95$4)), t$95$2]]]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_2 := --1 \cdot \left(i \cdot y\right)\\
t_3 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_4 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_3\right)\\
t_5 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_3\right)\right) + t\_4\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_5 \leq -\infty:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_5 \leq -50:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_5 \leq 10^{+308}:\\
\;\;\;\;-\left(-t\_4\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0 or 1e308 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6424.8%
Applied rewrites24.8%
if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -50Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
if -50 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1e308Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (fmax (fmin z t) a))
(t_3 (fmax (fmax z t) t_2)))
(if (<=
(+
(+
(+ (+ (+ (* x (log y)) t_1) (fmin (fmax z t) t_2)) t_3)
(* (- b 0.5) (log c)))
(* y i))
-50.0)
(- (* -1.0 t_1))
(- (- t_3)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmax(fmax(z, t), t_2);
double tmp;
if (((((((x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i)) <= -50.0) {
tmp = -(-1.0 * t_1);
} else {
tmp = -(-t_3);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_1 = fmin(fmin(z, t), a)
t_2 = fmax(fmin(z, t), a)
t_3 = fmax(fmax(z, t), t_2)
if (((((((x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5d0) * log(c))) + (y * i)) <= (-50.0d0)) then
tmp = -((-1.0d0) * t_1)
else
tmp = -(-t_3)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmax(fmax(z, t), t_2);
double tmp;
if (((((((x * Math.log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * Math.log(c))) + (y * i)) <= -50.0) {
tmp = -(-1.0 * t_1);
} else {
tmp = -(-t_3);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmin(fmin(z, t), a) t_2 = fmax(fmin(z, t), a) t_3 = fmax(fmax(z, t), t_2) tmp = 0 if ((((((x * math.log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * math.log(c))) + (y * i)) <= -50.0: tmp = -(-1.0 * t_1) else: tmp = -(-t_3) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmin(fmin(z, t), a) t_2 = fmax(fmin(z, t), a) t_3 = fmax(fmax(z, t), t_2) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= -50.0) tmp = Float64(-Float64(-1.0 * t_1)); else tmp = Float64(-Float64(-t_3)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = min(min(z, t), a); t_2 = max(min(z, t), a); t_3 = max(max(z, t), t_2); tmp = 0.0; if (((((((x * log(y)) + t_1) + min(max(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i)) <= -50.0) tmp = -(-1.0 * t_1); else tmp = -(-t_3); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -50.0], (-N[(-1.0 * t$95$1), $MachinePrecision]), (-(-t$95$3))]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_3 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
\mathbf{if}\;\left(\left(\left(\left(x \cdot \log y + t\_1\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\right) + t\_3\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i \leq -50:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{else}:\\
\;\;\;\;-\left(-t\_3\right)\\
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -50Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
if -50 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
(FPCore (x y z t a b c i) :precision binary64 (- (- (fmax t (fmax z a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return -(-fmax(t, fmax(z, a)));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = -(-fmax(t, fmax(z, a)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return -(-fmax(t, fmax(z, a)));
}
def code(x, y, z, t, a, b, c, i): return -(-fmax(t, fmax(z, a)))
function code(x, y, z, t, a, b, c, i) return Float64(-Float64(-fmax(t, fmax(z, a)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = -(-max(t, max(z, a))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := (-(-N[Max[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]))
-\left(-\mathsf{max}\left(t, \mathsf{max}\left(z, a\right)\right)\right)
Initial program 99.8%
Taylor expanded in i around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.9%
Taylor expanded in a around inf
lower-*.f6416.6%
Applied rewrites16.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.6%
Applied rewrites16.6%
herbie shell --seed 2025258
(FPCore (x y z t a b c i)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
:precision binary64
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))