
(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]
\begin{array}{l}
\\
\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
\end{array}
Herbie found 13 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]
\begin{array}{l}
\\
\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
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma (- b 0.5) (log c) (+ (fma i y (+ a (fma (log y) x z))) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma((b - 0.5), log(c), (fma(i, y, (a + fma(log(y), x, z))) + t));
}
function code(x, y, z, t, a, b, c, i) return fma(Float64(b - 0.5), log(c), Float64(fma(i, y, Float64(a + fma(log(y), x, z))) + t)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(i * y + N[(a + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, a + \mathsf{fma}\left(\log y, x, z\right)\right) + t\right)
\end{array}
Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
(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]
\begin{array}{l}
\\
\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)
\end{array}
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 (* (- b 0.5) (log c))) (t_2 (* x (log y))))
(if (<= (+ (+ (+ (+ (+ t_2 z) t) a) t_1) (* y i)) -120.0)
(+ t (+ z (fma i y (fma x (log y) (* (log c) (- b 0.5))))))
(+ (+ (+ (+ t t_2) a) t_1) (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (b - 0.5) * log(c);
double t_2 = x * log(y);
double tmp;
if ((((((t_2 + z) + t) + a) + t_1) + (y * i)) <= -120.0) {
tmp = t + (z + fma(i, y, fma(x, log(y), (log(c) * (b - 0.5)))));
} else {
tmp = (((t + t_2) + a) + t_1) + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(b - 0.5) * log(c)) t_2 = Float64(x * log(y)) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(t_2 + z) + t) + a) + t_1) + Float64(y * i)) <= -120.0) tmp = Float64(t + Float64(z + fma(i, y, fma(x, log(y), Float64(log(c) * Float64(b - 0.5)))))); else tmp = Float64(Float64(Float64(Float64(t + t_2) + a) + t_1) + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(N[(N[(t$95$2 + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], -120.0], N[(t + N[(z + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t + t$95$2), $MachinePrecision] + a), $MachinePrecision] + t$95$1), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - 0.5\right) \cdot \log c\\
t_2 := x \cdot \log y\\
\mathbf{if}\;\left(\left(\left(\left(t\_2 + z\right) + t\right) + a\right) + t\_1\right) + y \cdot i \leq -120:\\
\;\;\;\;t + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(t + t\_2\right) + a\right) + t\_1\right) + y \cdot i\\
\end{array}
\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)) < -120Initial program 99.8%
Taylor expanded in a 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--.f6485.5
Applied rewrites85.5%
if -120 < (+.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 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6484.4
Applied rewrites84.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 4e+58) (+ t (+ z (fma i y (fma x (log y) (* (log c) (- b 0.5)))))) (+ (fma (- b 0.5) (log c) (fma y i (+ z a))) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 4e+58) {
tmp = t + (z + fma(i, y, fma(x, log(y), (log(c) * (b - 0.5)))));
} else {
tmp = fma((b - 0.5), log(c), fma(y, i, (z + a))) + t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 4e+58) tmp = Float64(t + Float64(z + fma(i, y, fma(x, log(y), Float64(log(c) * Float64(b - 0.5)))))); else tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, Float64(z + a))) + t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 4e+58], N[(t + N[(z + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4 \cdot 10^{+58}:\\
\;\;\;\;t + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z + a\right)\right) + t\\
\end{array}
\end{array}
if a < 3.99999999999999978e58Initial program 99.8%
Taylor expanded in a 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--.f6485.5
Applied rewrites85.5%
if 3.99999999999999978e58 < a Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites83.7%
lift--.f64N/A
lift-fma.f64N/A
lift-log.f64N/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites83.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 1.15e-29) (fma (- b 0.5) (log c) (+ a (+ t (+ z (* x (log y)))))) (+ (fma (- b 0.5) (log c) (fma y i (+ z a))) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 1.15e-29) {
tmp = fma((b - 0.5), log(c), (a + (t + (z + (x * log(y))))));
} else {
tmp = fma((b - 0.5), log(c), fma(y, i, (z + a))) + t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 1.15e-29) tmp = fma(Float64(b - 0.5), log(c), Float64(a + Float64(t + Float64(z + Float64(x * log(y)))))); else tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, Float64(z + a))) + t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.15e-29], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.15 \cdot 10^{-29}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, a + \left(t + \left(z + x \cdot \log y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z + a\right)\right) + t\\
\end{array}
\end{array}
if y < 1.14999999999999996e-29Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6477.1
Applied rewrites77.1%
if 1.14999999999999996e-29 < y Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites83.7%
lift--.f64N/A
lift-fma.f64N/A
lift-log.f64N/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites83.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ t (fma i y (fma x (log y) (* (log c) (- b 0.5)))))))
(if (<= x -2.15e+197)
t_1
(if (<= x 1.95e+229)
(+ (fma (- b 0.5) (log c) (fma y i (+ 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 = t + fma(i, y, fma(x, log(y), (log(c) * (b - 0.5))));
double tmp;
if (x <= -2.15e+197) {
tmp = t_1;
} else if (x <= 1.95e+229) {
tmp = fma((b - 0.5), log(c), fma(y, i, (z + a))) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(t + fma(i, y, fma(x, log(y), Float64(log(c) * Float64(b - 0.5))))) tmp = 0.0 if (x <= -2.15e+197) tmp = t_1; elseif (x <= 1.95e+229) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, Float64(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[(t + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.15e+197], t$95$1, If[LessEqual[x, 1.95e+229], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{if}\;x \leq -2.15 \cdot 10^{+197}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.95 \cdot 10^{+229}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z + a\right)\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.14999999999999998e197 or 1.9499999999999999e229 < x Initial program 99.8%
Taylor expanded in a 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--.f6485.5
Applied rewrites85.5%
Taylor expanded in z 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--.f6470.4
Applied rewrites70.4%
if -2.14999999999999998e197 < x < 1.9499999999999999e229Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites83.7%
lift--.f64N/A
lift-fma.f64N/A
lift-log.f64N/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites83.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (- (log y))))
(if (<= x -1.05e+198)
(* (- t_1 (* (/ y x) i)) (- x))
(if (<= x 4.6e+229)
(+ (fma (- b 0.5) (log c) (fma y i (+ z a))) t)
(* (- t_1 (/ (* y i) x)) (- x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -log(y);
double tmp;
if (x <= -1.05e+198) {
tmp = (t_1 - ((y / x) * i)) * -x;
} else if (x <= 4.6e+229) {
tmp = fma((b - 0.5), log(c), fma(y, i, (z + a))) + t;
} else {
tmp = (t_1 - ((y * i) / x)) * -x;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-log(y)) tmp = 0.0 if (x <= -1.05e+198) tmp = Float64(Float64(t_1 - Float64(Float64(y / x) * i)) * Float64(-x)); elseif (x <= 4.6e+229) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, Float64(z + a))) + t); else tmp = Float64(Float64(t_1 - Float64(Float64(y * i) / x)) * Float64(-x)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = (-N[Log[y], $MachinePrecision])}, If[LessEqual[x, -1.05e+198], N[(N[(t$95$1 - N[(N[(y / x), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision], If[LessEqual[x, 4.6e+229], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], N[(N[(t$95$1 - N[(N[(y * i), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] * (-x)), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -\log y\\
\mathbf{if}\;x \leq -1.05 \cdot 10^{+198}:\\
\;\;\;\;\left(t\_1 - \frac{y}{x} \cdot i\right) \cdot \left(-x\right)\\
\mathbf{elif}\;x \leq 4.6 \cdot 10^{+229}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z + a\right)\right) + t\\
\mathbf{else}:\\
\;\;\;\;\left(t\_1 - \frac{y \cdot i}{x}\right) \cdot \left(-x\right)\\
\end{array}
\end{array}
if x < -1.05000000000000006e198Initial program 99.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites74.2%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6435.7
Applied rewrites35.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6435.3
Applied rewrites35.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites35.3%
if -1.05000000000000006e198 < x < 4.5999999999999999e229Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites83.7%
lift--.f64N/A
lift-fma.f64N/A
lift-log.f64N/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites83.7%
if 4.5999999999999999e229 < x Initial program 99.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites74.2%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6435.7
Applied rewrites35.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites35.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (fma i y (* (log c) b)) (+ t z))) (t_2 (* (- b 0.5) (log c))))
(if (<= t_2 -5e+190)
t_1
(if (<= t_2 1e+164) (+ (fma -0.5 (log c) (fma y i (+ 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 = fma(i, y, (log(c) * b)) + (t + z);
double t_2 = (b - 0.5) * log(c);
double tmp;
if (t_2 <= -5e+190) {
tmp = t_1;
} else if (t_2 <= 1e+164) {
tmp = fma(-0.5, log(c), fma(y, i, (z + a))) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(i, y, Float64(log(c) * b)) + Float64(t + z)) t_2 = Float64(Float64(b - 0.5) * log(c)) tmp = 0.0 if (t_2 <= -5e+190) tmp = t_1; elseif (t_2 <= 1e+164) tmp = Float64(fma(-0.5, log(c), fma(y, i, Float64(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[(i * y + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e+190], t$95$1, If[LessEqual[t$95$2, 1e+164], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(y * i + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(i, y, \log c \cdot b\right) + \left(t + z\right)\\
t_2 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{+190}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+164}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(y, i, z + a\right)\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -5.00000000000000036e190 or 1e164 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.8%
Taylor expanded in a 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--.f6485.5
Applied rewrites85.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6476.0
Applied rewrites76.0%
Taylor expanded in b around inf
lower-log.f6467.9
Applied rewrites67.9%
lift-+.f64N/A
lift-+.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites67.9%
if -5.00000000000000036e190 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 1e164Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites83.7%
lift--.f64N/A
lift-fma.f64N/A
lift-log.f64N/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites83.7%
Taylor expanded in b around 0
Applied rewrites68.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 5.05e+61) (+ t (+ z (fma i y (* (log c) (- b 0.5))))) (+ (fma -0.5 (log c) (fma y i (+ z a))) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 5.05e+61) {
tmp = t + (z + fma(i, y, (log(c) * (b - 0.5))));
} else {
tmp = fma(-0.5, log(c), fma(y, i, (z + a))) + t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 5.05e+61) tmp = Float64(t + Float64(z + fma(i, y, Float64(log(c) * Float64(b - 0.5))))); else tmp = Float64(fma(-0.5, log(c), fma(y, i, Float64(z + a))) + t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 5.05e+61], N[(t + N[(z + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(y * i + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.05 \cdot 10^{+61}:\\
\;\;\;\;t + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(y, i, z + a\right)\right) + t\\
\end{array}
\end{array}
if a < 5.0500000000000001e61Initial program 99.8%
Taylor expanded in a 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--.f6485.5
Applied rewrites85.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.7
Applied rewrites69.7%
if 5.0500000000000001e61 < a Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
Taylor expanded in x around 0
Applied rewrites83.7%
lift--.f64N/A
lift-fma.f64N/A
lift-log.f64N/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites83.7%
Taylor expanded in b around 0
Applied rewrites68.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
(t_2 (+ (fma i y (* (log c) b)) (+ t z))))
(if (<= t_1 5e+80) t_2 (if (<= t_1 1e+289) (- (- a)) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
double t_2 = fma(i, y, (log(c) * b)) + (t + z);
double tmp;
if (t_1 <= 5e+80) {
tmp = t_2;
} else if (t_1 <= 1e+289) {
tmp = -(-a);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) t_2 = Float64(fma(i, y, Float64(log(c) * b)) + Float64(t + z)) tmp = 0.0 if (t_1 <= 5e+80) tmp = t_2; elseif (t_1 <= 1e+289) tmp = Float64(-Float64(-a)); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, Block[{t$95$2 = N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+80], t$95$2, If[LessEqual[t$95$1, 1e+289], (-(-a)), t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \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\\
t_2 := \mathsf{fma}\left(i, y, \log c \cdot b\right) + \left(t + z\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+80}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+289}:\\
\;\;\;\;-\left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 4.99999999999999961e80 or 1.0000000000000001e289 < (+.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 a 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--.f6485.5
Applied rewrites85.5%
Taylor expanded in b around inf
lower-*.f64N/A
lower-+.f64N/A
lower-log.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lower-log.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower-log.f6476.0
Applied rewrites76.0%
Taylor expanded in b around inf
lower-log.f6467.9
Applied rewrites67.9%
lift-+.f64N/A
lift-+.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites67.9%
if 4.99999999999999961e80 < (+.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.0000000000000001e289Initial program 99.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites74.2%
Taylor expanded in a around inf
lower-*.f6415.3
Applied rewrites15.3%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.3
Applied rewrites15.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_1 (- INFINITY))
(* i y)
(if (<= t_1 -100.0)
(* -1.0 (* -1.0 z))
(if (<= t_1 6e+307) (- (- a)) (* i y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = i * y;
} else if (t_1 <= -100.0) {
tmp = -1.0 * (-1.0 * z);
} else if (t_1 <= 6e+307) {
tmp = -(-a);
} else {
tmp = i * y;
}
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 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = i * y;
} else if (t_1 <= -100.0) {
tmp = -1.0 * (-1.0 * z);
} else if (t_1 <= 6e+307) {
tmp = -(-a);
} else {
tmp = i * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_1 <= -math.inf: tmp = i * y elif t_1 <= -100.0: tmp = -1.0 * (-1.0 * z) elif t_1 <= 6e+307: tmp = -(-a) else: tmp = i * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(i * y); elseif (t_1 <= -100.0) tmp = Float64(-1.0 * Float64(-1.0 * z)); elseif (t_1 <= 6e+307) tmp = Float64(-Float64(-a)); else tmp = Float64(i * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_1 <= -Inf) tmp = i * y; elseif (t_1 <= -100.0) tmp = -1.0 * (-1.0 * z); elseif (t_1 <= 6e+307) tmp = -(-a); else tmp = i * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -100.0], N[(-1.0 * N[(-1.0 * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 6e+307], (-(-a)), N[(i * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \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\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq -100:\\
\;\;\;\;-1 \cdot \left(-1 \cdot z\right)\\
\mathbf{elif}\;t\_1 \leq 6 \cdot 10^{+307}:\\
\;\;\;\;-\left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y\\
\end{array}
\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 5.9999999999999997e307 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
Taylor expanded in y around inf
lower-*.f6424.1
Applied rewrites24.1%
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)) < -100Initial program 99.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites74.2%
Taylor expanded in z around inf
lower-*.f6416.6
Applied rewrites16.6%
if -100 < (+.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.9999999999999997e307Initial program 99.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites74.2%
Taylor expanded in a around inf
lower-*.f6415.3
Applied rewrites15.3%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.3
Applied rewrites15.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_1 2e+33) (* i y) (if (<= t_1 6e+307) (- (- a)) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_1 <= 2e+33) {
tmp = i * y;
} else if (t_1 <= 6e+307) {
tmp = -(-a);
} else {
tmp = i * y;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
if (t_1 <= 2d+33) then
tmp = i * y
else if (t_1 <= 6d+307) then
tmp = -(-a)
else
tmp = i * y
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 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_1 <= 2e+33) {
tmp = i * y;
} else if (t_1 <= 6e+307) {
tmp = -(-a);
} else {
tmp = i * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_1 <= 2e+33: tmp = i * y elif t_1 <= 6e+307: tmp = -(-a) else: tmp = i * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_1 <= 2e+33) tmp = Float64(i * y); elseif (t_1 <= 6e+307) tmp = Float64(-Float64(-a)); else tmp = Float64(i * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_1 <= 2e+33) tmp = i * y; elseif (t_1 <= 6e+307) tmp = -(-a); else tmp = i * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, 2e+33], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, 6e+307], (-(-a)), N[(i * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \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\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+33}:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq 6 \cdot 10^{+307}:\\
\;\;\;\;-\left(-a\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y\\
\end{array}
\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)) < 1.9999999999999999e33 or 5.9999999999999997e307 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.9%
Taylor expanded in y around inf
lower-*.f6424.1
Applied rewrites24.1%
if 1.9999999999999999e33 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 5.9999999999999997e307Initial program 99.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites74.2%
Taylor expanded in a around inf
lower-*.f6415.3
Applied rewrites15.3%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.3
Applied rewrites15.3%
(FPCore (x y z t a b c i) :precision binary64 (- (- a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return -(-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 = -(-a)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return -(-a);
}
def code(x, y, z, t, a, b, c, i): return -(-a)
function code(x, y, z, t, a, b, c, i) return Float64(-Float64(-a)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = -(-a); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := (-(-a))
\begin{array}{l}
\\
-\left(-a\right)
\end{array}
Initial program 99.8%
Taylor expanded in x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites74.2%
Taylor expanded in a around inf
lower-*.f6415.3
Applied rewrites15.3%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.3
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6415.3
Applied rewrites15.3%
herbie shell --seed 2025149
(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)))