
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 1/2) (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 - 1/2), $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 - \frac{1}{2}\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 1/2) (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 - 1/2), $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 - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (* x (log y)))
(t_3 (fmax (fmin z t) a))
(t_4 (fmax (fmax z t) t_3)))
(if (<=
t_4
879999999999999958507063942391341293078620439980425991327011484655074736196101580184131712581632)
(+
(+ (fmin (fmax z t) t_3) (+ t_1 (+ t_2 (* (log c) (- b 1/2)))))
(* y i))
(+ (+ (+ t_4 (+ t_1 t_2)) (* -1/2 (log c))) (* 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 = x * log(y);
double t_3 = fmax(fmin(z, t), a);
double t_4 = fmax(fmax(z, t), t_3);
double tmp;
if (t_4 <= 8.8e+95) {
tmp = (fmin(fmax(z, t), t_3) + (t_1 + (t_2 + (log(c) * (b - 0.5))))) + (y * i);
} else {
tmp = ((t_4 + (t_1 + t_2)) + (-0.5 * log(c))) + (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) :: t_3
real(8) :: t_4
real(8) :: tmp
t_1 = fmin(fmin(z, t), a)
t_2 = x * log(y)
t_3 = fmax(fmin(z, t), a)
t_4 = fmax(fmax(z, t), t_3)
if (t_4 <= 8.8d+95) then
tmp = (fmin(fmax(z, t), t_3) + (t_1 + (t_2 + (log(c) * (b - 0.5d0))))) + (y * i)
else
tmp = ((t_4 + (t_1 + t_2)) + ((-0.5d0) * log(c))) + (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 = fmin(fmin(z, t), a);
double t_2 = x * Math.log(y);
double t_3 = fmax(fmin(z, t), a);
double t_4 = fmax(fmax(z, t), t_3);
double tmp;
if (t_4 <= 8.8e+95) {
tmp = (fmin(fmax(z, t), t_3) + (t_1 + (t_2 + (Math.log(c) * (b - 0.5))))) + (y * i);
} else {
tmp = ((t_4 + (t_1 + t_2)) + (-0.5 * Math.log(c))) + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmin(fmin(z, t), a) t_2 = x * math.log(y) t_3 = fmax(fmin(z, t), a) t_4 = fmax(fmax(z, t), t_3) tmp = 0 if t_4 <= 8.8e+95: tmp = (fmin(fmax(z, t), t_3) + (t_1 + (t_2 + (math.log(c) * (b - 0.5))))) + (y * i) else: tmp = ((t_4 + (t_1 + t_2)) + (-0.5 * math.log(c))) + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmin(fmin(z, t), a) t_2 = Float64(x * log(y)) t_3 = fmax(fmin(z, t), a) t_4 = fmax(fmax(z, t), t_3) tmp = 0.0 if (t_4 <= 8.8e+95) tmp = Float64(Float64(fmin(fmax(z, t), t_3) + Float64(t_1 + Float64(t_2 + Float64(log(c) * Float64(b - 0.5))))) + Float64(y * i)); else tmp = Float64(Float64(Float64(t_4 + Float64(t_1 + t_2)) + Float64(-0.5 * log(c))) + 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 = x * log(y); t_3 = max(min(z, t), a); t_4 = max(max(z, t), t_3); tmp = 0.0; if (t_4 <= 8.8e+95) tmp = (min(max(z, t), t_3) + (t_1 + (t_2 + (log(c) * (b - 0.5))))) + (y * i); else tmp = ((t_4 + (t_1 + t_2)) + (-0.5 * log(c))) + (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[(x * N[Log[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]}, If[LessEqual[t$95$4, 879999999999999958507063942391341293078620439980425991327011484655074736196101580184131712581632], N[(N[(N[Min[N[Max[z, t], $MachinePrecision], t$95$3], $MachinePrecision] + N[(t$95$1 + N[(t$95$2 + N[(N[Log[c], $MachinePrecision] * N[(b - 1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$4 + N[(t$95$1 + t$95$2), $MachinePrecision]), $MachinePrecision] + N[(-1/2 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_2 := x \cdot \log y\\
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)\\
\mathbf{if}\;t\_4 \leq 879999999999999958507063942391341293078620439980425991327011484655074736196101580184131712581632:\\
\;\;\;\;\left(\mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_3\right) + \left(t\_1 + \left(t\_2 + \log c \cdot \left(b - \frac{1}{2}\right)\right)\right)\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_4 + \left(t\_1 + t\_2\right)\right) + \frac{-1}{2} \cdot \log c\right) + y \cdot i\\
\end{array}
if a < 8.7999999999999996e95Initial program 99.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6483.8%
Applied rewrites83.8%
if 8.7999999999999996e95 < a Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in b around 0
Applied rewrites69.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6469.0%
Applied rewrites69.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmax (fmin z t) a))
(t_2 (fmin (fmin z t) a))
(t_3 (fmax (fmax z t) t_1))
(t_4
(+
(+ (+ t_3 (+ t_2 (* x (log y)))) (* -1/2 (log c)))
(* y i))))
(if (<=
x
-3550000000000000150029738640376626954316728168075833588523823906463939223777785428892323454743652302061568)
t_4
(if (<=
x
1049999999999999974685639735482438568778688196460848270285520923497646456255682135894950006688309094612255899648)
(+
(+ (+ (+ t_2 (fmin (fmax z t) t_1)) t_3) (* (- b 1/2) (log c)))
(* y i))
t_4))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmax(fmin(z, t), a);
double t_2 = fmin(fmin(z, t), a);
double t_3 = fmax(fmax(z, t), t_1);
double t_4 = ((t_3 + (t_2 + (x * log(y)))) + (-0.5 * log(c))) + (y * i);
double tmp;
if (x <= -3.55e+105) {
tmp = t_4;
} else if (x <= 1.05e+111) {
tmp = (((t_2 + fmin(fmax(z, t), t_1)) + t_3) + ((b - 0.5) * log(c))) + (y * i);
} else {
tmp = t_4;
}
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) :: tmp
t_1 = fmax(fmin(z, t), a)
t_2 = fmin(fmin(z, t), a)
t_3 = fmax(fmax(z, t), t_1)
t_4 = ((t_3 + (t_2 + (x * log(y)))) + ((-0.5d0) * log(c))) + (y * i)
if (x <= (-3.55d+105)) then
tmp = t_4
else if (x <= 1.05d+111) then
tmp = (((t_2 + fmin(fmax(z, t), t_1)) + t_3) + ((b - 0.5d0) * log(c))) + (y * i)
else
tmp = t_4
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(fmin(z, t), a);
double t_2 = fmin(fmin(z, t), a);
double t_3 = fmax(fmax(z, t), t_1);
double t_4 = ((t_3 + (t_2 + (x * Math.log(y)))) + (-0.5 * Math.log(c))) + (y * i);
double tmp;
if (x <= -3.55e+105) {
tmp = t_4;
} else if (x <= 1.05e+111) {
tmp = (((t_2 + fmin(fmax(z, t), t_1)) + t_3) + ((b - 0.5) * Math.log(c))) + (y * i);
} else {
tmp = t_4;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmax(fmin(z, t), a) t_2 = fmin(fmin(z, t), a) t_3 = fmax(fmax(z, t), t_1) t_4 = ((t_3 + (t_2 + (x * math.log(y)))) + (-0.5 * math.log(c))) + (y * i) tmp = 0 if x <= -3.55e+105: tmp = t_4 elif x <= 1.05e+111: tmp = (((t_2 + fmin(fmax(z, t), t_1)) + t_3) + ((b - 0.5) * math.log(c))) + (y * i) else: tmp = t_4 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmax(fmin(z, t), a) t_2 = fmin(fmin(z, t), a) t_3 = fmax(fmax(z, t), t_1) t_4 = Float64(Float64(Float64(t_3 + Float64(t_2 + Float64(x * log(y)))) + Float64(-0.5 * log(c))) + Float64(y * i)) tmp = 0.0 if (x <= -3.55e+105) tmp = t_4; elseif (x <= 1.05e+111) tmp = Float64(Float64(Float64(Float64(t_2 + fmin(fmax(z, t), t_1)) + t_3) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)); else tmp = t_4; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = max(min(z, t), a); t_2 = min(min(z, t), a); t_3 = max(max(z, t), t_1); t_4 = ((t_3 + (t_2 + (x * log(y)))) + (-0.5 * log(c))) + (y * i); tmp = 0.0; if (x <= -3.55e+105) tmp = t_4; elseif (x <= 1.05e+111) tmp = (((t_2 + min(max(z, t), t_1)) + t_3) + ((b - 0.5) * log(c))) + (y * i); else tmp = t_4; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[z, t], $MachinePrecision], t$95$1], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(t$95$3 + N[(t$95$2 + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1/2 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3550000000000000150029738640376626954316728168075833588523823906463939223777785428892323454743652302061568], t$95$4, If[LessEqual[x, 1049999999999999974685639735482438568778688196460848270285520923497646456255682135894950006688309094612255899648], N[(N[(N[(N[(t$95$2 + N[Min[N[Max[z, t], $MachinePrecision], t$95$1], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(b - 1/2), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_2 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_3 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_1\right)\\
t_4 := \left(\left(t\_3 + \left(t\_2 + x \cdot \log y\right)\right) + \frac{-1}{2} \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;x \leq -3550000000000000150029738640376626954316728168075833588523823906463939223777785428892323454743652302061568:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;x \leq 1049999999999999974685639735482438568778688196460848270285520923497646456255682135894950006688309094612255899648:\\
\;\;\;\;\left(\left(\left(t\_2 + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_1\right)\right) + t\_3\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
if x < -3.5500000000000002e105 or 1.05e111 < x Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in b around 0
Applied rewrites69.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6469.0%
Applied rewrites69.0%
if -3.5500000000000002e105 < x < 1.05e111Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin t (fmax z a)))
(t_2 (* x (log y)))
(t_3 (fmax t (fmax z a))))
(if (<=
x
-3599999999999999879581681787739427058599582932568556174433318048436749902375581436811618887180905028255744)
(+ (+ t_1 (+ (fmin z a) (+ t_2 (* (log c) -1/2)))) (* y i))
(if (<=
x
1049999999999999974685639735482438568778688196460848270285520923497646456255682135894950006688309094612255899648)
(+ (+ (+ (+ (fmin z a) t_1) t_3) (* (- b 1/2) (log c))) (* y i))
(+ (+ (+ t_3 t_2) (* -1/2 (log c))) (* y i))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(t, fmax(z, a));
double t_2 = x * log(y);
double t_3 = fmax(t, fmax(z, a));
double tmp;
if (x <= -3.6e+105) {
tmp = (t_1 + (fmin(z, a) + (t_2 + (log(c) * -0.5)))) + (y * i);
} else if (x <= 1.05e+111) {
tmp = (((fmin(z, a) + t_1) + t_3) + ((b - 0.5) * log(c))) + (y * i);
} else {
tmp = ((t_3 + t_2) + (-0.5 * log(c))) + (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) :: t_3
real(8) :: tmp
t_1 = fmin(t, fmax(z, a))
t_2 = x * log(y)
t_3 = fmax(t, fmax(z, a))
if (x <= (-3.6d+105)) then
tmp = (t_1 + (fmin(z, a) + (t_2 + (log(c) * (-0.5d0))))) + (y * i)
else if (x <= 1.05d+111) then
tmp = (((fmin(z, a) + t_1) + t_3) + ((b - 0.5d0) * log(c))) + (y * i)
else
tmp = ((t_3 + t_2) + ((-0.5d0) * log(c))) + (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 = fmin(t, fmax(z, a));
double t_2 = x * Math.log(y);
double t_3 = fmax(t, fmax(z, a));
double tmp;
if (x <= -3.6e+105) {
tmp = (t_1 + (fmin(z, a) + (t_2 + (Math.log(c) * -0.5)))) + (y * i);
} else if (x <= 1.05e+111) {
tmp = (((fmin(z, a) + t_1) + t_3) + ((b - 0.5) * Math.log(c))) + (y * i);
} else {
tmp = ((t_3 + t_2) + (-0.5 * Math.log(c))) + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmin(t, fmax(z, a)) t_2 = x * math.log(y) t_3 = fmax(t, fmax(z, a)) tmp = 0 if x <= -3.6e+105: tmp = (t_1 + (fmin(z, a) + (t_2 + (math.log(c) * -0.5)))) + (y * i) elif x <= 1.05e+111: tmp = (((fmin(z, a) + t_1) + t_3) + ((b - 0.5) * math.log(c))) + (y * i) else: tmp = ((t_3 + t_2) + (-0.5 * math.log(c))) + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmin(t, fmax(z, a)) t_2 = Float64(x * log(y)) t_3 = fmax(t, fmax(z, a)) tmp = 0.0 if (x <= -3.6e+105) tmp = Float64(Float64(t_1 + Float64(fmin(z, a) + Float64(t_2 + Float64(log(c) * -0.5)))) + Float64(y * i)); elseif (x <= 1.05e+111) tmp = Float64(Float64(Float64(Float64(fmin(z, a) + t_1) + t_3) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)); else tmp = Float64(Float64(Float64(t_3 + t_2) + Float64(-0.5 * log(c))) + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = min(t, max(z, a)); t_2 = x * log(y); t_3 = max(t, max(z, a)); tmp = 0.0; if (x <= -3.6e+105) tmp = (t_1 + (min(z, a) + (t_2 + (log(c) * -0.5)))) + (y * i); elseif (x <= 1.05e+111) tmp = (((min(z, a) + t_1) + t_3) + ((b - 0.5) * log(c))) + (y * i); else tmp = ((t_3 + t_2) + (-0.5 * log(c))) + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Max[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -3599999999999999879581681787739427058599582932568556174433318048436749902375581436811618887180905028255744], N[(N[(t$95$1 + N[(N[Min[z, a], $MachinePrecision] + N[(t$95$2 + N[(N[Log[c], $MachinePrecision] * -1/2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1049999999999999974685639735482438568778688196460848270285520923497646456255682135894950006688309094612255899648], N[(N[(N[(N[(N[Min[z, a], $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(b - 1/2), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$3 + t$95$2), $MachinePrecision] + N[(-1/2 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(t, \mathsf{max}\left(z, a\right)\right)\\
t_2 := x \cdot \log y\\
t_3 := \mathsf{max}\left(t, \mathsf{max}\left(z, a\right)\right)\\
\mathbf{if}\;x \leq -3599999999999999879581681787739427058599582932568556174433318048436749902375581436811618887180905028255744:\\
\;\;\;\;\left(t\_1 + \left(\mathsf{min}\left(z, a\right) + \left(t\_2 + \log c \cdot \frac{-1}{2}\right)\right)\right) + y \cdot i\\
\mathbf{elif}\;x \leq 1049999999999999974685639735482438568778688196460848270285520923497646456255682135894950006688309094612255899648:\\
\;\;\;\;\left(\left(\left(\mathsf{min}\left(z, a\right) + t\_1\right) + t\_3\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_3 + t\_2\right) + \frac{-1}{2} \cdot \log c\right) + y \cdot i\\
\end{array}
if x < -3.5999999999999999e105Initial program 99.8%
Taylor expanded in a around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6483.8%
Applied rewrites83.8%
Taylor expanded in b around 0
Applied rewrites69.2%
if -3.5999999999999999e105 < x < 1.05e111Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
if 1.05e111 < x Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in b around 0
Applied rewrites69.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6469.0%
Applied rewrites69.0%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6454.7%
Applied rewrites54.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin t (fmax z a))) (t_2 (fmax t (fmax z a))))
(if (<=
x
-3599999999999999879581681787739427058599582932568556174433318048436749902375581436811618887180905028255744)
(134-z0z1z2z3z4
(- i)
(- (* -1 t_1) (+ (* (log y) x) (fmin z a)))
(/ 1 i)
1
y)
(if (<=
x
1049999999999999974685639735482438568778688196460848270285520923497646456255682135894950006688309094612255899648)
(+ (+ (+ (+ (fmin z a) t_1) t_2) (* (- b 1/2) (log c))) (* y i))
(+ (+ (+ t_2 (* x (log y))) (* -1/2 (log c))) (* y i))))))\begin{array}{l}
t_1 := \mathsf{min}\left(t, \mathsf{max}\left(z, a\right)\right)\\
t_2 := \mathsf{max}\left(t, \mathsf{max}\left(z, a\right)\right)\\
\mathbf{if}\;x \leq -3599999999999999879581681787739427058599582932568556174433318048436749902375581436811618887180905028255744:\\
\;\;\;\;\mathsf{134\_z0z1z2z3z4}\left(\left(-i\right), \left(-1 \cdot t\_1 - \left(\log y \cdot x + \mathsf{min}\left(z, a\right)\right)\right), \left(\frac{1}{i}\right), 1, y\right)\\
\mathbf{elif}\;x \leq 1049999999999999974685639735482438568778688196460848270285520923497646456255682135894950006688309094612255899648:\\
\;\;\;\;\left(\left(\left(\mathsf{min}\left(z, a\right) + t\_1\right) + t\_2\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\left(\left(t\_2 + x \cdot \log y\right) + \frac{-1}{2} \cdot \log c\right) + y \cdot i\\
\end{array}
if x < -3.5999999999999999e105Initial 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 rewrites70.1%
Applied rewrites98.8%
Taylor expanded in t around inf
lower-*.f6467.1%
Applied rewrites67.1%
if -3.5999999999999999e105 < x < 1.05e111Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
if 1.05e111 < x Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in b around 0
Applied rewrites69.8%
Taylor expanded in t around 0
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6469.0%
Applied rewrites69.0%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6454.7%
Applied rewrites54.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
x
-3599999999999999879581681787739427058599582932568556174433318048436749902375581436811618887180905028255744)
(134-z0z1z2z3z4
(- i)
(- (* -1 (fmin t a)) (+ (* (log y) x) z))
(/ 1 i)
1
y)
(if (<=
x
4999999999999999681793534688837958868212853663785036782419720361679078139026353774446693497293473788990517591304702846227575332082657167871886131204710002780090859851360619284064431218701999138176915986960331575388717979146899858120583984847024514138112)
(+
(+ (+ (+ z (fmin t a)) (fmax t a)) (* (- b 1/2) (log c)))
(* y i))
(134-z0z1z2z3z4 (- i) (* (- (log y)) x) (/ 1 i) 1 y))))\begin{array}{l}
\mathbf{if}\;x \leq -3599999999999999879581681787739427058599582932568556174433318048436749902375581436811618887180905028255744:\\
\;\;\;\;\mathsf{134\_z0z1z2z3z4}\left(\left(-i\right), \left(-1 \cdot \mathsf{min}\left(t, a\right) - \left(\log y \cdot x + z\right)\right), \left(\frac{1}{i}\right), 1, y\right)\\
\mathbf{elif}\;x \leq 4999999999999999681793534688837958868212853663785036782419720361679078139026353774446693497293473788990517591304702846227575332082657167871886131204710002780090859851360619284064431218701999138176915986960331575388717979146899858120583984847024514138112:\\
\;\;\;\;\left(\left(\left(z + \mathsf{min}\left(t, a\right)\right) + \mathsf{max}\left(t, a\right)\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\mathsf{134\_z0z1z2z3z4}\left(\left(-i\right), \left(\left(-\log y\right) \cdot x\right), \left(\frac{1}{i}\right), 1, y\right)\\
\end{array}
if x < -3.5999999999999999e105Initial 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 rewrites70.1%
Applied rewrites98.8%
Taylor expanded in t around inf
lower-*.f6467.1%
Applied rewrites67.1%
if -3.5999999999999999e105 < x < 4.9999999999999997e252Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
if 4.9999999999999997e252 < 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 rewrites70.1%
Applied rewrites98.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6437.9%
Applied rewrites37.9%
lift-*.f64N/A
mul-1-negN/A
lift-log.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-log.f6437.9%
Applied rewrites37.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (134-z0z1z2z3z4 (- i) (* (- (log y)) x) (/ 1 i) 1 y)))
(if (<=
x
-3599999999999999879581681787739427058599582932568556174433318048436749902375581436811618887180905028255744)
t_1
(if (<=
x
4999999999999999681793534688837958868212853663785036782419720361679078139026353774446693497293473788990517591304702846227575332082657167871886131204710002780090859851360619284064431218701999138176915986960331575388717979146899858120583984847024514138112)
(+ (+ (+ (+ z t) a) (* (- b 1/2) (log c))) (* y i))
t_1))))\begin{array}{l}
t_1 := \mathsf{134\_z0z1z2z3z4}\left(\left(-i\right), \left(\left(-\log y\right) \cdot x\right), \left(\frac{1}{i}\right), 1, y\right)\\
\mathbf{if}\;x \leq -3599999999999999879581681787739427058599582932568556174433318048436749902375581436811618887180905028255744:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4999999999999999681793534688837958868212853663785036782419720361679078139026353774446693497293473788990517591304702846227575332082657167871886131204710002780090859851360619284064431218701999138176915986960331575388717979146899858120583984847024514138112:\\
\;\;\;\;\left(\left(\left(z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -3.5999999999999999e105 or 4.9999999999999997e252 < 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 rewrites70.1%
Applied rewrites98.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6437.9%
Applied rewrites37.9%
lift-*.f64N/A
mul-1-negN/A
lift-log.f64N/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
lower-neg.f64N/A
lift-log.f6437.9%
Applied rewrites37.9%
if -3.5999999999999999e105 < x < 4.9999999999999997e252Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
x
-2900000000000000069204150533318179972423531164014983082171454639135575083669141427456118715053209327656255939076123855554686929346306229350604672279211178777041260228043399439241445376)
(* i (- y (/ (* (- x) (log y)) i)))
(+ (+ (+ (+ z t) a) (* (- b 1/2) (log c))) (* y i))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.9e+183) {
tmp = i * (y - ((-x * log(y)) / i));
} else {
tmp = (((z + t) + a) + ((b - 0.5) * log(c))) + (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) :: tmp
if (x <= (-2.9d+183)) then
tmp = i * (y - ((-x * log(y)) / i))
else
tmp = (((z + t) + a) + ((b - 0.5d0) * log(c))) + (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 tmp;
if (x <= -2.9e+183) {
tmp = i * (y - ((-x * Math.log(y)) / i));
} else {
tmp = (((z + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -2.9e+183: tmp = i * (y - ((-x * math.log(y)) / i)) else: tmp = (((z + t) + a) + ((b - 0.5) * math.log(c))) + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.9e+183) tmp = Float64(i * Float64(y - Float64(Float64(Float64(-x) * log(y)) / i))); else tmp = Float64(Float64(Float64(Float64(z + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= -2.9e+183) tmp = i * (y - ((-x * log(y)) / i)); else tmp = (((z + t) + a) + ((b - 0.5) * log(c))) + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2900000000000000069204150533318179972423531164014983082171454639135575083669141427456118715053209327656255939076123855554686929346306229350604672279211178777041260228043399439241445376], N[(i * N[(y - N[(N[((-x) * N[Log[y], $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 1/2), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq -2900000000000000069204150533318179972423531164014983082171454639135575083669141427456118715053209327656255939076123855554686929346306229350604672279211178777041260228043399439241445376:\\
\;\;\;\;i \cdot \left(y - \frac{\left(-x\right) \cdot \log y}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i\\
\end{array}
if x < -2.9000000000000001e183Initial 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 rewrites70.1%
Applied rewrites98.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6437.9%
Applied rewrites37.9%
lift-134-z0z1z2z3z4N/A
lift-neg.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
sub-negate-revN/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites32.9%
if -2.9000000000000001e183 < x Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ z t) a) (* (- b 1/2) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((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 = (((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 (((z + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((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(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 = (((z + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 1/2), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(z + t\right) + a\right) + \left(b - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i
Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ 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 (((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 = (((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 (((z + t) + a) + (b * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((z + t) + a) + (b * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(z + t) + a) + Float64(b * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((z + t) + a) + (b * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(z + t), $MachinePrecision] + a), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\left(\left(\left(z + t\right) + a\right) + b \cdot \log c\right) + y \cdot i
Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6482.9%
Applied rewrites82.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (log c))))
(if (<=
b
-220000000000000007326340945888506653530663275816339520787551061483281194676992796675380578830910283831394710160078130540983823370103972914382310371986209239684302748330385406265864769173821619794310214916639484596526893062295164526571011132358656)
t_1
(if (<=
b
159999999999999989944552393973900225604372920958349972403300010855230793642961654112601228541105453547752781156718400530593792829447325901273825939842848991414158271414760636416)
(+ (* 1 (+ a (+ t z))) (* 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 = b * log(c);
double tmp;
if (b <= -2.2e+245) {
tmp = t_1;
} else if (b <= 1.6e+176) {
tmp = (1.0 * (a + (t + z))) + (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 = b * log(c)
if (b <= (-2.2d+245)) then
tmp = t_1
else if (b <= 1.6d+176) then
tmp = (1.0d0 * (a + (t + z))) + (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 = b * Math.log(c);
double tmp;
if (b <= -2.2e+245) {
tmp = t_1;
} else if (b <= 1.6e+176) {
tmp = (1.0 * (a + (t + z))) + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = b * math.log(c) tmp = 0 if b <= -2.2e+245: tmp = t_1 elif b <= 1.6e+176: tmp = (1.0 * (a + (t + z))) + (y * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(b * log(c)) tmp = 0.0 if (b <= -2.2e+245) tmp = t_1; elseif (b <= 1.6e+176) tmp = Float64(Float64(1.0 * Float64(a + Float64(t + z))) + 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 = b * log(c); tmp = 0.0; if (b <= -2.2e+245) tmp = t_1; elseif (b <= 1.6e+176) tmp = (1.0 * (a + (t + z))) + (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[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -220000000000000007326340945888506653530663275816339520787551061483281194676992796675380578830910283831394710160078130540983823370103972914382310371986209239684302748330385406265864769173821619794310214916639484596526893062295164526571011132358656], t$95$1, If[LessEqual[b, 159999999999999989944552393973900225604372920958349972403300010855230793642961654112601228541105453547752781156718400530593792829447325901273825939842848991414158271414760636416], N[(N[(1 * N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;b \leq -220000000000000007326340945888506653530663275816339520787551061483281194676992796675380578830910283831394710160078130540983823370103972914382310371986209239684302748330385406265864769173821619794310214916639484596526893062295164526571011132358656:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 159999999999999989944552393973900225604372920958349972403300010855230793642961654112601228541105453547752781156718400530593792829447325901273825939842848991414158271414760636416:\\
\;\;\;\;1 \cdot \left(a + \left(t + z\right)\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -2.2000000000000001e245 or 1.5999999999999999e176 < 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 rewrites70.1%
Applied rewrites98.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6416.1%
Applied rewrites16.1%
if -2.2000000000000001e245 < b < 1.5999999999999999e176Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites83.3%
Taylor expanded in x around inf
Applied rewrites68.1%
(FPCore (x y z t a b c i) :precision binary64 (+ (* 1 (+ a (+ t z))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (1.0 * (a + (t + z))) + (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 = (1.0d0 * (a + (t + z))) + (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 (1.0 * (a + (t + z))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (1.0 * (a + (t + z))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(1.0 * Float64(a + Float64(t + z))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (1.0 * (a + (t + z))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(1 * N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
1 \cdot \left(a + \left(t + z\right)\right) + y \cdot i
Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift-*.f64N/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites83.3%
Taylor expanded in x around inf
Applied rewrites68.1%
(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 1/2) (log c)))
(* y i))
-2000000000)
(+ (* y i) (* (- t_1) -1))
(+ (* -1 (* -1 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 tmp;
if (((((((x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i)) <= -2000000000.0) {
tmp = (y * i) + (-t_1 * -1.0);
} else {
tmp = (-1.0 * (-1.0 * t_3)) + (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) :: 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)) <= (-2000000000.0d0)) then
tmp = (y * i) + (-t_1 * (-1.0d0))
else
tmp = ((-1.0d0) * ((-1.0d0) * t_3)) + (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 = 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)) <= -2000000000.0) {
tmp = (y * i) + (-t_1 * -1.0);
} else {
tmp = (-1.0 * (-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) 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)) <= -2000000000.0: tmp = (y * i) + (-t_1 * -1.0) else: tmp = (-1.0 * (-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) 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)) <= -2000000000.0) tmp = Float64(Float64(y * i) + Float64(Float64(-t_1) * -1.0)); else tmp = Float64(Float64(-1.0 * 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); tmp = 0.0; if (((((((x * log(y)) + t_1) + min(max(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i)) <= -2000000000.0) tmp = (y * i) + (-t_1 * -1.0); else tmp = (-1.0 * (-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]}, 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 - 1/2), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -2000000000], N[(N[(y * i), $MachinePrecision] + N[((-t$95$1) * -1), $MachinePrecision]), $MachinePrecision], N[(N[(-1 * N[(-1 * t$95$3), $MachinePrecision]), $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)\\
\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 - \frac{1}{2}\right) \cdot \log c\right) + y \cdot i \leq -2000000000:\\
\;\;\;\;y \cdot i + \left(-t\_1\right) \cdot -1\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(-1 \cdot t\_3\right) + 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)) < -2e9Initial program 99.8%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites72.9%
Taylor expanded in z around inf
Applied rewrites37.9%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6437.9%
lift-*.f64N/A
mul-1-negN/A
Applied rewrites37.9%
if -2e9 < (+.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 z around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites72.9%
Taylor expanded in z around inf
Applied rewrites37.9%
Taylor expanded in a around inf
lower-*.f6438.7%
Applied rewrites38.7%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (* (- (fmin (fmin z t) a)) -1)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (-fmin(fmin(z, t), a) * -1.0);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 = (y * i) + (-fmin(fmin(z, t), a) * (-1.0d0))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (-fmin(fmin(z, t), a) * -1.0);
}
def code(x, y, z, t, a, b, c, i): return (y * i) + (-fmin(fmin(z, t), a) * -1.0)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(-fmin(fmin(z, t), a)) * -1.0)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + (-min(min(z, t), a) * -1.0); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[((-N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]) * -1), $MachinePrecision]), $MachinePrecision]
y \cdot i + \left(-\mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\right) \cdot -1
Initial program 99.8%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites72.9%
Taylor expanded in z around inf
Applied rewrites37.9%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6437.9%
lift-*.f64N/A
mul-1-negN/A
Applied rewrites37.9%
(FPCore (x y z t a b c i) :precision binary64 (* 1 (* i y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 1.0 * (i * 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, 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 = 1.0d0 * (i * y)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 1.0 * (i * y);
}
def code(x, y, z, t, a, b, c, i): return 1.0 * (i * y)
function code(x, y, z, t, a, b, c, i) return Float64(1.0 * Float64(i * y)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 1.0 * (i * y); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(1 * N[(i * y), $MachinePrecision]), $MachinePrecision]
1 \cdot \left(i \cdot y\right)
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
add-flipN/A
sub-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites66.0%
Taylor expanded in y around inf
Applied rewrites24.0%
herbie shell --seed 2025271 -o generate:evaluate
(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 1/2) (log c))) (* y i)))