
(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 18 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 (fma y i (+ (+ (fma (log c) (- b 0.5) (fma (log y) x z)) a) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, ((fma(log(c), (b - 0.5), fma(log(y), x, z)) + a) + t));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), fma(log(y), x, z)) + a) + t)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + t\right)
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5)))
(t_2 (fmax t (fmax z a)))
(t_3 (+ t_2 (fma i y (fma x (log y) t_1)))))
(if (<= x -4.4e+197)
t_3
(if (<= x 5.4e+110)
(+ t_2 (+ (fmin t (fmax z a)) (+ (fmin z a) (fma i y 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 = log(c) * (b - 0.5);
double t_2 = fmax(t, fmax(z, a));
double t_3 = t_2 + fma(i, y, fma(x, log(y), t_1));
double tmp;
if (x <= -4.4e+197) {
tmp = t_3;
} else if (x <= 5.4e+110) {
tmp = t_2 + (fmin(t, fmax(z, a)) + (fmin(z, a) + fma(i, y, t_1)));
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(c) * Float64(b - 0.5)) t_2 = fmax(t, fmax(z, a)) t_3 = Float64(t_2 + fma(i, y, fma(x, log(y), t_1))) tmp = 0.0 if (x <= -4.4e+197) tmp = t_3; elseif (x <= 5.4e+110) tmp = Float64(t_2 + Float64(fmin(t, fmax(z, a)) + Float64(fmin(z, a) + fma(i, y, t_1)))); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Max[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.4e+197], t$95$3, If[LessEqual[x, 5.4e+110], N[(t$95$2 + N[(N[Min[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision] + N[(N[Min[z, a], $MachinePrecision] + N[(i * y + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := \mathsf{max}\left(t, \mathsf{max}\left(z, a\right)\right)\\
t_3 := t\_2 + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, t\_1\right)\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+197}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+110}:\\
\;\;\;\;t\_2 + \left(\mathsf{min}\left(t, \mathsf{max}\left(z, a\right)\right) + \left(\mathsf{min}\left(z, a\right) + \mathsf{fma}\left(i, y, t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
if x < -4.39999999999999979e197 or 5.40000000000000019e110 < x Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in t around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.2%
Applied rewrites69.2%
if -4.39999999999999979e197 < x < 5.40000000000000019e110Initial program 99.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.5%
Applied rewrites84.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5)))
(t_2 (fmax t (fmax z a)))
(t_3 (fma i y (fma x (log y) t_1)))
(t_4 (fmin t (fmax z a))))
(if (<= x -4.4e+197)
(+ t_2 t_3)
(if (<= x 5.4e+110)
(+ t_2 (+ t_4 (+ (fmin z a) (fma i y t_1))))
(+ t_2 (+ t_4 t_3))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(c) * (b - 0.5);
double t_2 = fmax(t, fmax(z, a));
double t_3 = fma(i, y, fma(x, log(y), t_1));
double t_4 = fmin(t, fmax(z, a));
double tmp;
if (x <= -4.4e+197) {
tmp = t_2 + t_3;
} else if (x <= 5.4e+110) {
tmp = t_2 + (t_4 + (fmin(z, a) + fma(i, y, t_1)));
} else {
tmp = t_2 + (t_4 + t_3);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(c) * Float64(b - 0.5)) t_2 = fmax(t, fmax(z, a)) t_3 = fma(i, y, fma(x, log(y), t_1)) t_4 = fmin(t, fmax(z, a)) tmp = 0.0 if (x <= -4.4e+197) tmp = Float64(t_2 + t_3); elseif (x <= 5.4e+110) tmp = Float64(t_2 + Float64(t_4 + Float64(fmin(z, a) + fma(i, y, t_1)))); else tmp = Float64(t_2 + Float64(t_4 + t_3)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Max[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(i * y + N[(x * N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Min[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -4.4e+197], N[(t$95$2 + t$95$3), $MachinePrecision], If[LessEqual[x, 5.4e+110], N[(t$95$2 + N[(t$95$4 + N[(N[Min[z, a], $MachinePrecision] + N[(i * y + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$2 + N[(t$95$4 + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := \mathsf{max}\left(t, \mathsf{max}\left(z, a\right)\right)\\
t_3 := \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, t\_1\right)\right)\\
t_4 := \mathsf{min}\left(t, \mathsf{max}\left(z, a\right)\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+197}:\\
\;\;\;\;t\_2 + t\_3\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+110}:\\
\;\;\;\;t\_2 + \left(t\_4 + \left(\mathsf{min}\left(z, a\right) + \mathsf{fma}\left(i, y, t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2 + \left(t\_4 + t\_3\right)\\
\end{array}
if x < -4.39999999999999979e197Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in t around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.2%
Applied rewrites69.2%
if -4.39999999999999979e197 < x < 5.40000000000000019e110Initial program 99.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.5%
Applied rewrites84.5%
if 5.40000000000000019e110 < x Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x -2.45e+210) (+ (fma (log y) x (fma (- b 0.5) (log c) t)) a) (+ a (+ t (+ z (fma i y (* (log c) (- b 0.5))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.45e+210) {
tmp = fma(log(y), x, fma((b - 0.5), log(c), t)) + a;
} else {
tmp = a + (t + (z + fma(i, y, (log(c) * (b - 0.5)))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.45e+210) tmp = Float64(fma(log(y), x, fma(Float64(b - 0.5), log(c), t)) + a); else tmp = Float64(a + Float64(t + Float64(z + fma(i, y, Float64(log(c) * Float64(b - 0.5)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.45e+210], N[(N[(N[Log[y], $MachinePrecision] * x + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(a + N[(t + N[(z + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+210}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, t\right)\right) + a\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\end{array}
if x < -2.45000000000000003e210Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6461.2%
Applied rewrites61.2%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6461.2%
Applied rewrites61.2%
if -2.45000000000000003e210 < x Initial program 99.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.5%
Applied rewrites84.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x -2.45e+210) (+ a (+ t (fma x (log y) (* (log c) -0.5)))) (+ a (+ t (+ z (fma i y (* (log c) (- b 0.5))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.45e+210) {
tmp = a + (t + fma(x, log(y), (log(c) * -0.5)));
} else {
tmp = a + (t + (z + fma(i, y, (log(c) * (b - 0.5)))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.45e+210) tmp = Float64(a + Float64(t + fma(x, log(y), Float64(log(c) * -0.5)))); else tmp = Float64(a + Float64(t + Float64(z + fma(i, y, Float64(log(c) * Float64(b - 0.5)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.45e+210], N[(a + N[(t + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq -2.45 \cdot 10^{+210}:\\
\;\;\;\;a + \left(t + \mathsf{fma}\left(x, \log y, \log c \cdot -0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\end{array}
if x < -2.45000000000000003e210Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6461.2%
Applied rewrites61.2%
Taylor expanded in b around 0
Applied rewrites46.3%
if -2.45000000000000003e210 < x Initial program 99.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.5%
Applied rewrites84.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x -6e+253) (* x (log y)) (+ a (+ t (+ z (fma i y (* (log c) (- b 0.5))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -6e+253) {
tmp = x * log(y);
} else {
tmp = a + (t + (z + fma(i, y, (log(c) * (b - 0.5)))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -6e+253) tmp = Float64(x * log(y)); else tmp = Float64(a + Float64(t + Float64(z + fma(i, y, Float64(log(c) * Float64(b - 0.5)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -6e+253], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+253}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\end{array}
if x < -5.9999999999999996e253Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6416.5%
Applied rewrites16.5%
if -5.9999999999999996e253 < x Initial program 99.8%
Taylor expanded in x around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.5%
Applied rewrites84.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x -6e+253) (* x (log y)) (fma y i (+ (+ (fma (log c) (- b 0.5) z) a) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -6e+253) {
tmp = x * log(y);
} else {
tmp = fma(y, i, ((fma(log(c), (b - 0.5), z) + a) + t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -6e+253) tmp = Float64(x * log(y)); else tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), z) + a) + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -6e+253], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{+253}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + a\right) + t\right)\\
\end{array}
if x < -5.9999999999999996e253Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6416.5%
Applied rewrites16.5%
if -5.9999999999999996e253 < x Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (fmax z a) (+ t (fma i y (* (log c) (- b 0.5)))))))
(if (<= b -5.9e+165)
t_1
(if (<= b 2.8e+96)
(fma y i (+ (+ (fma (log c) -0.5 (fmin z a)) (fmax z a)) t))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmax(z, a) + (t + fma(i, y, (log(c) * (b - 0.5))));
double tmp;
if (b <= -5.9e+165) {
tmp = t_1;
} else if (b <= 2.8e+96) {
tmp = fma(y, i, ((fma(log(c), -0.5, fmin(z, a)) + fmax(z, a)) + t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fmax(z, a) + Float64(t + fma(i, y, Float64(log(c) * Float64(b - 0.5))))) tmp = 0.0 if (b <= -5.9e+165) tmp = t_1; elseif (b <= 2.8e+96) tmp = fma(y, i, Float64(Float64(fma(log(c), -0.5, fmin(z, a)) + fmax(z, a)) + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Max[z, a], $MachinePrecision] + N[(t + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -5.9e+165], t$95$1, If[LessEqual[b, 2.8e+96], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * -0.5 + N[Min[z, a], $MachinePrecision]), $MachinePrecision] + N[Max[z, a], $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{max}\left(z, a\right) + \left(t + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{if}\;b \leq -5.9 \cdot 10^{+165}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+96}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, -0.5, \mathsf{min}\left(z, a\right)\right) + \mathsf{max}\left(z, a\right)\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -5.89999999999999996e165 or 2.8e96 < b Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.0%
Applied rewrites69.0%
if -5.89999999999999996e165 < b < 2.8e96Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in b around 0
Applied rewrites69.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= b -8.8e+195)
(+ a (+ (fmax z t) (* (log c) (- b 0.5))))
(if (<= b 4.2e+120)
(fma y i (+ (+ (fma (log c) -0.5 (fmin z t)) a) (fmax z t)))
(fma y i (/ (* b (* (fmax z t) (log c))) (fmax z t))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (b <= -8.8e+195) {
tmp = a + (fmax(z, t) + (log(c) * (b - 0.5)));
} else if (b <= 4.2e+120) {
tmp = fma(y, i, ((fma(log(c), -0.5, fmin(z, t)) + a) + fmax(z, t)));
} else {
tmp = fma(y, i, ((b * (fmax(z, t) * log(c))) / fmax(z, t)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (b <= -8.8e+195) tmp = Float64(a + Float64(fmax(z, t) + Float64(log(c) * Float64(b - 0.5)))); elseif (b <= 4.2e+120) tmp = fma(y, i, Float64(Float64(fma(log(c), -0.5, fmin(z, t)) + a) + fmax(z, t))); else tmp = fma(y, i, Float64(Float64(b * Float64(fmax(z, t) * log(c))) / fmax(z, t))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[b, -8.8e+195], N[(a + N[(N[Max[z, t], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.2e+120], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * -0.5 + N[Min[z, t], $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(N[(b * N[(N[Max[z, t], $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Max[z, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;b \leq -8.8 \cdot 10^{+195}:\\
\;\;\;\;a + \left(\mathsf{max}\left(z, t\right) + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{elif}\;b \leq 4.2 \cdot 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, -0.5, \mathsf{min}\left(z, t\right)\right) + a\right) + \mathsf{max}\left(z, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \frac{b \cdot \left(\mathsf{max}\left(z, t\right) \cdot \log c\right)}{\mathsf{max}\left(z, t\right)}\right)\\
\end{array}
if b < -8.7999999999999999e195Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6461.2%
Applied rewrites61.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6446.1%
Applied rewrites46.1%
if -8.7999999999999999e195 < b < 4.2000000000000001e120Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.5%
Taylor expanded in b around 0
Applied rewrites69.5%
if 4.2000000000000001e120 < b Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
lift-+.f64N/A
+-commutativeN/A
sum-to-mult-revN/A
add-to-fractionN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites69.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6434.5%
Applied rewrites34.5%
(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 (fma y i (/ (* b (* t_3 (log c))) t_3)))
(t_5 (fmax (fmax z t) t_2))
(t_6
(+
(+ (+ (+ (+ (* x (log y)) t_1) t_3) t_5) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_6 -5e+278)
t_4
(if (<= t_6 -2e+62)
(- (* -1.0 t_1))
(if (<= t_6 1e+308) (+ t_5 (+ t_3 (* (log c) (- b 0.5)))) t_4)))))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 = fma(y, i, ((b * (t_3 * log(c))) / t_3));
double t_5 = fmax(fmax(z, t), t_2);
double t_6 = (((((x * log(y)) + t_1) + t_3) + t_5) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_6 <= -5e+278) {
tmp = t_4;
} else if (t_6 <= -2e+62) {
tmp = -(-1.0 * t_1);
} else if (t_6 <= 1e+308) {
tmp = t_5 + (t_3 + (log(c) * (b - 0.5)));
} else {
tmp = t_4;
}
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 = fma(y, i, Float64(Float64(b * Float64(t_3 * log(c))) / t_3)) t_5 = fmax(fmax(z, t), t_2) t_6 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + t_3) + t_5) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_6 <= -5e+278) tmp = t_4; elseif (t_6 <= -2e+62) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_6 <= 1e+308) tmp = Float64(t_5 + Float64(t_3 + Float64(log(c) * Float64(b - 0.5)))); else tmp = t_4; end return 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[(y * i + N[(N[(b * N[(t$95$3 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $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$5), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, -5e+278], t$95$4, If[LessEqual[t$95$6, -2e+62], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$6, 1e+308], N[(t$95$5 + N[(t$95$3 + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$4]]]]]]]]]
\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{fma}\left(y, i, \frac{b \cdot \left(t\_3 \cdot \log c\right)}{t\_3}\right)\\
t_5 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
t_6 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + t\_3\right) + t\_5\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_6 \leq -5 \cdot 10^{+278}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_6 \leq -2 \cdot 10^{+62}:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_6 \leq 10^{+308}:\\
\;\;\;\;t\_5 + \left(t\_3 + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\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)) < -5.00000000000000029e278 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%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
lift-+.f64N/A
+-commutativeN/A
sum-to-mult-revN/A
add-to-fractionN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites69.3%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f64N/A
lower-log.f6434.5%
Applied rewrites34.5%
if -5.00000000000000029e278 < (+.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)) < -2.00000000000000007e62Initial program 99.8%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
Taylor expanded in z around inf
lower-*.f6416.7%
Applied rewrites16.7%
if -2.00000000000000007e62 < (+.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 z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6461.2%
Applied rewrites61.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6446.1%
Applied rewrites46.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 (fmin (fmax z t) t_2))
(t_4 (fmax (fmax z t) t_2))
(t_5
(+
(+ (+ (+ (+ (* x (log y)) t_1) t_3) t_4) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_5 (- INFINITY))
(+ (* 1.0 t_3) (* y i))
(if (<= t_5 -2e+62)
(- (* -1.0 t_1))
(if (<= t_5 1e+308)
(+ t_4 (+ t_3 (* (log c) (- b 0.5))))
(* -1.0 (* y (fma -1.0 i (* -1.0 (/ t_4 y))))))))))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 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = (1.0 * t_3) + (y * i);
} else if (t_5 <= -2e+62) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 1e+308) {
tmp = t_4 + (t_3 + (log(c) * (b - 0.5)));
} else {
tmp = -1.0 * (y * fma(-1.0, i, (-1.0 * (t_4 / y))));
}
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(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_5 <= Float64(-Inf)) tmp = Float64(Float64(1.0 * t_3) + Float64(y * i)); elseif (t_5 <= -2e+62) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_5 <= 1e+308) tmp = Float64(t_4 + Float64(t_3 + Float64(log(c) * Float64(b - 0.5)))); else tmp = Float64(-1.0 * Float64(y * fma(-1.0, i, Float64(-1.0 * Float64(t_4 / y))))); end return 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[(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$5, (-Infinity)], N[(N[(1.0 * t$95$3), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, -2e+62], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$5, 1e+308], N[(t$95$4 + N[(t$95$3 + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(y * N[(-1.0 * i + N[(-1.0 * N[(t$95$4 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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{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(\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\_5 \leq -\infty:\\
\;\;\;\;1 \cdot t\_3 + y \cdot i\\
\mathbf{elif}\;t\_5 \leq -2 \cdot 10^{+62}:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_5 \leq 10^{+308}:\\
\;\;\;\;t\_4 + \left(t\_3 + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(y \cdot \mathsf{fma}\left(-1, i, -1 \cdot \frac{t\_4}{y}\right)\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)) < -inf.0Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.9%
Taylor expanded in t around inf
Applied rewrites38.9%
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)) < -2.00000000000000007e62Initial program 99.8%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
Taylor expanded in z around inf
lower-*.f6416.7%
Applied rewrites16.7%
if -2.00000000000000007e62 < (+.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 z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6461.2%
Applied rewrites61.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6446.1%
Applied rewrites46.1%
if 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 y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-/.f6432.5%
Applied rewrites32.5%
(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
(+
(+ (+ (+ (+ (* x (log y)) t_1) t_3) t_4) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_5 (- INFINITY))
(+ (* 1.0 t_3) (* y i))
(if (<= t_5 -2e+62)
(- (* -1.0 t_1))
(if (<= t_5 4e+307)
(+ t_4 (+ t_3 (* (log c) (- b 0.5))))
(+ (* (/ t_4 t_3) 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 = fmin(fmax(z, t), t_2);
double t_4 = fmax(fmax(z, t), t_2);
double t_5 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = (1.0 * t_3) + (y * i);
} else if (t_5 <= -2e+62) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 4e+307) {
tmp = t_4 + (t_3 + (log(c) * (b - 0.5)));
} else {
tmp = ((t_4 / t_3) * 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 = fmin(fmax(z, t), t_2);
double t_4 = fmax(fmax(z, t), t_2);
double t_5 = (((((x * Math.log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_5 <= -Double.POSITIVE_INFINITY) {
tmp = (1.0 * t_3) + (y * i);
} else if (t_5 <= -2e+62) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 4e+307) {
tmp = t_4 + (t_3 + (Math.log(c) * (b - 0.5)));
} else {
tmp = ((t_4 / t_3) * 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 = fmin(fmax(z, t), t_2) t_4 = fmax(fmax(z, t), t_2) t_5 = (((((x * math.log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_5 <= -math.inf: tmp = (1.0 * t_3) + (y * i) elif t_5 <= -2e+62: tmp = -(-1.0 * t_1) elif t_5 <= 4e+307: tmp = t_4 + (t_3 + (math.log(c) * (b - 0.5))) else: tmp = ((t_4 / t_3) * 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 = fmin(fmax(z, t), t_2) t_4 = fmax(fmax(z, t), t_2) t_5 = 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_5 <= Float64(-Inf)) tmp = Float64(Float64(1.0 * t_3) + Float64(y * i)); elseif (t_5 <= -2e+62) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_5 <= 4e+307) tmp = Float64(t_4 + Float64(t_3 + Float64(log(c) * Float64(b - 0.5)))); else tmp = Float64(Float64(Float64(t_4 / t_3) * 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 = min(max(z, t), t_2); t_4 = max(max(z, t), t_2); t_5 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_5 <= -Inf) tmp = (1.0 * t_3) + (y * i); elseif (t_5 <= -2e+62) tmp = -(-1.0 * t_1); elseif (t_5 <= 4e+307) tmp = t_4 + (t_3 + (log(c) * (b - 0.5))); else tmp = ((t_4 / t_3) * 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[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[(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$5, (-Infinity)], N[(N[(1.0 * t$95$3), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, -2e+62], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$5, 4e+307], N[(t$95$4 + N[(t$95$3 + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$4 / t$95$3), $MachinePrecision] * 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{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(\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\_5 \leq -\infty:\\
\;\;\;\;1 \cdot t\_3 + y \cdot i\\
\mathbf{elif}\;t\_5 \leq -2 \cdot 10^{+62}:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_5 \leq 4 \cdot 10^{+307}:\\
\;\;\;\;t\_4 + \left(t\_3 + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_4}{t\_3} \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%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.9%
Taylor expanded in t around inf
Applied rewrites38.9%
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)) < -2.00000000000000007e62Initial program 99.8%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
Taylor expanded in z around inf
lower-*.f6416.7%
Applied rewrites16.7%
if -2.00000000000000007e62 < (+.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)) < 3.99999999999999994e307Initial program 99.8%
Taylor expanded in z around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6484.1%
Applied rewrites84.1%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6461.2%
Applied rewrites61.2%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6446.1%
Applied rewrites46.1%
if 3.99999999999999994e307 < (+.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
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.9%
Taylor expanded in a around inf
lower-/.f6431.9%
Applied rewrites31.9%
(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 (fma y i (/ (* t_4 t_3) t_3)))
(t_6
(+
(+ (+ (+ (+ (* x (log y)) t_1) t_3) t_4) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_6 (- INFINITY))
(+ (* 1.0 t_3) (* y i))
(if (<= t_6 -1e+103)
(- (* -1.0 t_1))
(if (<= t_6 2e+237) t_5 (if (<= t_6 4e+303) (- (- t_4)) 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 = fma(y, i, ((t_4 * t_3) / t_3));
double t_6 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_6 <= -((double) INFINITY)) {
tmp = (1.0 * t_3) + (y * i);
} else if (t_6 <= -1e+103) {
tmp = -(-1.0 * t_1);
} else if (t_6 <= 2e+237) {
tmp = t_5;
} else if (t_6 <= 4e+303) {
tmp = -(-t_4);
} 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 = fma(y, i, Float64(Float64(t_4 * t_3) / t_3)) 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 <= Float64(-Inf)) tmp = Float64(Float64(1.0 * t_3) + Float64(y * i)); elseif (t_6 <= -1e+103) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_6 <= 2e+237) tmp = t_5; elseif (t_6 <= 4e+303) tmp = Float64(-Float64(-t_4)); else tmp = t_5; end return 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[(y * i + N[(N[(t$95$4 * t$95$3), $MachinePrecision] / t$95$3), $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, (-Infinity)], N[(N[(1.0 * t$95$3), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$6, -1e+103], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$6, 2e+237], t$95$5, If[LessEqual[t$95$6, 4e+303], (-(-t$95$4)), 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 := \mathsf{fma}\left(y, i, \frac{t\_4 \cdot t\_3}{t\_3}\right)\\
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 -\infty:\\
\;\;\;\;1 \cdot t\_3 + y \cdot i\\
\mathbf{elif}\;t\_6 \leq -1 \cdot 10^{+103}:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_6 \leq 2 \cdot 10^{+237}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_6 \leq 4 \cdot 10^{+303}:\\
\;\;\;\;-\left(-t\_4\right)\\
\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)) < -inf.0Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.9%
Taylor expanded in t around inf
Applied rewrites38.9%
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)) < -1e103Initial program 99.8%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
Taylor expanded in z around inf
lower-*.f6416.7%
Applied rewrites16.7%
if -1e103 < (+.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.99999999999999988e237 or 4e303 < (+.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
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
lift-+.f64N/A
+-commutativeN/A
sum-to-mult-revN/A
add-to-fractionN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites69.3%
Taylor expanded in a around inf
lower-*.f6433.7%
Applied rewrites33.7%
if 1.99999999999999988e237 < (+.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)) < 4e303Initial program 99.8%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.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 (fmin (fmax z t) t_2))
(t_4 (fmax (fmax z t) t_2))
(t_5
(+
(+ (+ (+ (+ (* x (log y)) t_1) t_3) t_4) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_5 (- INFINITY))
(+ (* 1.0 t_3) (* y i))
(if (<= t_5 -1e+103)
(- (* -1.0 t_1))
(if (<= t_5 4e+295)
(fma y i (/ (* t_4 t_3) t_3))
(+ (* (/ t_4 t_3) 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 = fmin(fmax(z, t), t_2);
double t_4 = fmax(fmax(z, t), t_2);
double t_5 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_5 <= -((double) INFINITY)) {
tmp = (1.0 * t_3) + (y * i);
} else if (t_5 <= -1e+103) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 4e+295) {
tmp = fma(y, i, ((t_4 * t_3) / t_3));
} else {
tmp = ((t_4 / t_3) * 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 = fmin(fmax(z, t), t_2) t_4 = fmax(fmax(z, t), t_2) t_5 = 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_5 <= Float64(-Inf)) tmp = Float64(Float64(1.0 * t_3) + Float64(y * i)); elseif (t_5 <= -1e+103) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_5 <= 4e+295) tmp = fma(y, i, Float64(Float64(t_4 * t_3) / t_3)); else tmp = Float64(Float64(Float64(t_4 / t_3) * t_3) + Float64(y * i)); end return 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[(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$5, (-Infinity)], N[(N[(1.0 * t$95$3), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, -1e+103], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$5, 4e+295], N[(y * i + N[(N[(t$95$4 * t$95$3), $MachinePrecision] / t$95$3), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t$95$4 / t$95$3), $MachinePrecision] * 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{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(\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\_5 \leq -\infty:\\
\;\;\;\;1 \cdot t\_3 + y \cdot i\\
\mathbf{elif}\;t\_5 \leq -1 \cdot 10^{+103}:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_5 \leq 4 \cdot 10^{+295}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \frac{t\_4 \cdot t\_3}{t\_3}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_4}{t\_3} \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%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.9%
Taylor expanded in t around inf
Applied rewrites38.9%
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)) < -1e103Initial program 99.8%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
Taylor expanded in z around inf
lower-*.f6416.7%
Applied rewrites16.7%
if -1e103 < (+.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)) < 3.9999999999999999e295Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.8%
lift-+.f64N/A
+-commutativeN/A
sum-to-mult-revN/A
add-to-fractionN/A
associate-*l/N/A
lower-/.f64N/A
Applied rewrites69.3%
Taylor expanded in a around inf
lower-*.f6433.7%
Applied rewrites33.7%
if 3.9999999999999999e295 < (+.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
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.9%
Taylor expanded in a around inf
lower-/.f6431.9%
Applied rewrites31.9%
(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 (+ (* 1.0 t_3) (* y i)))
(t_5 (fmax (fmax z t) t_2))
(t_6
(+
(+ (+ (+ (+ (* x (log y)) t_1) t_3) t_5) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_6 (- INFINITY))
t_4
(if (<= t_6 -2e+17)
(- (* -1.0 t_1))
(if (<= t_6 1e+308) (- (- t_5)) t_4)))))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 = (1.0 * t_3) + (y * i);
double t_5 = fmax(fmax(z, t), t_2);
double t_6 = (((((x * log(y)) + t_1) + t_3) + t_5) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_6 <= -((double) INFINITY)) {
tmp = t_4;
} else if (t_6 <= -2e+17) {
tmp = -(-1.0 * t_1);
} else if (t_6 <= 1e+308) {
tmp = -(-t_5);
} else {
tmp = t_4;
}
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 = fmin(fmax(z, t), t_2);
double t_4 = (1.0 * t_3) + (y * i);
double t_5 = fmax(fmax(z, t), t_2);
double t_6 = (((((x * Math.log(y)) + t_1) + t_3) + t_5) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_6 <= -Double.POSITIVE_INFINITY) {
tmp = t_4;
} else if (t_6 <= -2e+17) {
tmp = -(-1.0 * t_1);
} else if (t_6 <= 1e+308) {
tmp = -(-t_5);
} else {
tmp = t_4;
}
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 = (1.0 * t_3) + (y * i) t_5 = fmax(fmax(z, t), t_2) t_6 = (((((x * math.log(y)) + t_1) + t_3) + t_5) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_6 <= -math.inf: tmp = t_4 elif t_6 <= -2e+17: tmp = -(-1.0 * t_1) elif t_6 <= 1e+308: tmp = -(-t_5) else: tmp = t_4 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 = Float64(Float64(1.0 * t_3) + Float64(y * i)) t_5 = fmax(fmax(z, t), t_2) t_6 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + t_3) + t_5) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_6 <= Float64(-Inf)) tmp = t_4; elseif (t_6 <= -2e+17) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_6 <= 1e+308) tmp = Float64(-Float64(-t_5)); else tmp = t_4; 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 = (1.0 * t_3) + (y * i); t_5 = max(max(z, t), t_2); t_6 = (((((x * log(y)) + t_1) + t_3) + t_5) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_6 <= -Inf) tmp = t_4; elseif (t_6 <= -2e+17) tmp = -(-1.0 * t_1); elseif (t_6 <= 1e+308) tmp = -(-t_5); else tmp = t_4; 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[(N[(1.0 * t$95$3), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $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$5), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$6, (-Infinity)], t$95$4, If[LessEqual[t$95$6, -2e+17], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$6, 1e+308], (-(-t$95$5)), t$95$4]]]]]]]]]
\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 := 1 \cdot t\_3 + y \cdot i\\
t_5 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
t_6 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + t\_3\right) + t\_5\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_6 \leq -\infty:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_6 \leq -2 \cdot 10^{+17}:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_6 \leq 10^{+308}:\\
\;\;\;\;-\left(-t\_5\right)\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\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%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.9%
Taylor expanded in t around inf
Applied rewrites38.9%
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)) < -2e17Initial program 99.8%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
Taylor expanded in z around inf
lower-*.f6416.7%
Applied rewrites16.7%
if -2e17 < (+.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 y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
(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 -2e+17)
(- (* -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 <= -2e+17) {
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 <= -2e+17) {
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 <= -2e+17: 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 <= -2e+17) 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 <= -2e+17) 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, -2e+17], (-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 -2 \cdot 10^{+17}:\\
\;\;\;\;--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 y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
Taylor expanded in y around inf
lower-*.f64N/A
lower-*.f6424.7%
Applied rewrites24.7%
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)) < -2e17Initial program 99.8%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
Taylor expanded in z around inf
lower-*.f6416.7%
Applied rewrites16.7%
if -2e17 < (+.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 y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.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))
-2e+17)
(- (* -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)) <= -2e+17) {
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)) <= (-2d+17)) 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)) <= -2e+17) {
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)) <= -2e+17: 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)) <= -2e+17) 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)) <= -2e+17) 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], -2e+17], (-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 -2 \cdot 10^{+17}:\\
\;\;\;\;--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)) < -2e17Initial program 99.8%
Taylor expanded in y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
Taylor expanded in z around inf
lower-*.f6416.7%
Applied rewrites16.7%
if -2e17 < (+.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 y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.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 y around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites68.8%
Taylor expanded in a around inf
lower-*.f6415.6%
Applied rewrites15.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.6%
Applied rewrites15.6%
herbie shell --seed 2025181
(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)))