
(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 14 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 (fmin z a))) (fmax 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, fmin(z, a))) + fmax(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, fmin(z, a))) + fmax(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 + N[Min[z, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Max[z, a], $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, \mathsf{fma}\left(\log y, x, \mathsf{min}\left(z, a\right)\right)\right) + \mathsf{max}\left(z, a\right)\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 (fma y i (fma (log y) x (+ (+ (fma -0.5 (log c) a) t) z)))))
(if (<= x -1.95e+139)
t_1
(if (<= x 1.22e+124)
(fma y i (+ z (fma (- b 0.5) (log c) (+ t a))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, i, fma(log(y), x, ((fma(-0.5, log(c), a) + t) + z)));
double tmp;
if (x <= -1.95e+139) {
tmp = t_1;
} else if (x <= 1.22e+124) {
tmp = fma(y, i, (z + fma((b - 0.5), log(c), (t + a))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, fma(log(y), x, Float64(Float64(fma(-0.5, log(c), a) + t) + z))) tmp = 0.0 if (x <= -1.95e+139) tmp = t_1; elseif (x <= 1.22e+124) tmp = fma(y, i, Float64(z + fma(Float64(b - 0.5), log(c), Float64(t + a)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(N[Log[y], $MachinePrecision] * x + N[(N[(N[(-0.5 * N[Log[c], $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.95e+139], t$95$1, If[LessEqual[x, 1.22e+124], N[(y * i + N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log y, x, \left(\mathsf{fma}\left(-0.5, \log c, a\right) + t\right) + z\right)\right)\\
\mathbf{if}\;x \leq -1.95 \cdot 10^{+139}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{+124}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z + \mathsf{fma}\left(b - 0.5, \log c, t + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -1.95000000000000003e139 or 1.22e124 < 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%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-+.f64N/A
lower-fma.f6499.8%
Applied rewrites99.8%
Taylor expanded in b around 0
Applied rewrites84.0%
if -1.95000000000000003e139 < x < 1.22e124Initial 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.1%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6484.1%
Applied rewrites84.1%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -7.1e+221)
(+ t (fma i y (fma x (log y) (* (log c) (- b 0.5)))))
(if (<= x 2.8e+209)
(fma y i (+ z (fma (- b 0.5) (log c) (+ t a))))
(+ (* 1.0 (* (log y) x)) (* y i)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -7.1e+221) {
tmp = t + fma(i, y, fma(x, log(y), (log(c) * (b - 0.5))));
} else if (x <= 2.8e+209) {
tmp = fma(y, i, (z + fma((b - 0.5), log(c), (t + a))));
} else {
tmp = (1.0 * (log(y) * x)) + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -7.1e+221) tmp = Float64(t + fma(i, y, fma(x, log(y), Float64(log(c) * Float64(b - 0.5))))); elseif (x <= 2.8e+209) tmp = fma(y, i, Float64(z + fma(Float64(b - 0.5), log(c), Float64(t + a)))); else tmp = Float64(Float64(1.0 * Float64(log(y) * x)) + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -7.1e+221], 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.8e+209], N[(y * i + N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 * N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;x \leq -7.1 \cdot 10^{+221}:\\
\;\;\;\;t + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+209}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z + \mathsf{fma}\left(b - 0.5, \log c, t + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\log y \cdot x\right) + y \cdot i\\
\end{array}
if x < -7.09999999999999985e221Initial 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--.f6484.5%
Applied rewrites84.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--.f6469.8%
Applied rewrites69.8%
if -7.09999999999999985e221 < x < 2.80000000000000013e209Initial 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.1%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6484.1%
Applied rewrites84.1%
if 2.80000000000000013e209 < x Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.6%
Taylor expanded in x around inf
Applied rewrites38.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* 1.0 (* (log y) x)) (* y i))))
(if (<= x -7.1e+221)
t_1
(if (<= x 2.8e+209)
(fma y i (+ z (fma (- b 0.5) (log c) (+ t a))))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (1.0 * (log(y) * x)) + (y * i);
double tmp;
if (x <= -7.1e+221) {
tmp = t_1;
} else if (x <= 2.8e+209) {
tmp = fma(y, i, (z + fma((b - 0.5), log(c), (t + a))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(1.0 * Float64(log(y) * x)) + Float64(y * i)) tmp = 0.0 if (x <= -7.1e+221) tmp = t_1; elseif (x <= 2.8e+209) tmp = fma(y, i, Float64(z + fma(Float64(b - 0.5), log(c), Float64(t + a)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(1.0 * N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.1e+221], t$95$1, If[LessEqual[x, 2.8e+209], N[(y * i + N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := 1 \cdot \left(\log y \cdot x\right) + y \cdot i\\
\mathbf{if}\;x \leq -7.1 \cdot 10^{+221}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.8 \cdot 10^{+209}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z + \mathsf{fma}\left(b - 0.5, \log c, t + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -7.09999999999999985e221 or 2.80000000000000013e209 < x Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.6%
Taylor expanded in x around inf
Applied rewrites38.7%
if -7.09999999999999985e221 < x < 2.80000000000000013e209Initial 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.1%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
*-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-+.f6484.1%
Applied rewrites84.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (+ (fma i y (* (log c) (- b 0.5))) z) (fmin t a))))
(if (<= b -1.15e+212)
t_1
(if (<= b 2.8e+143)
(fma y i (+ (+ (fma (log c) -0.5 z) (fmax t a)) (fmin t a)))
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 - 0.5))) + z) + fmin(t, a);
double tmp;
if (b <= -1.15e+212) {
tmp = t_1;
} else if (b <= 2.8e+143) {
tmp = fma(y, i, ((fma(log(c), -0.5, z) + fmax(t, a)) + fmin(t, a)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(fma(i, y, Float64(log(c) * Float64(b - 0.5))) + z) + fmin(t, a)) tmp = 0.0 if (b <= -1.15e+212) tmp = t_1; elseif (b <= 2.8e+143) tmp = fma(y, i, Float64(Float64(fma(log(c), -0.5, z) + fmax(t, a)) + fmin(t, a))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + N[Min[t, a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.15e+212], t$95$1, If[LessEqual[b, 2.8e+143], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * -0.5 + z), $MachinePrecision] + N[Max[t, a], $MachinePrecision]), $MachinePrecision] + N[Min[t, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \left(\mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right) + z\right) + \mathsf{min}\left(t, a\right)\\
\mathbf{if}\;b \leq -1.15 \cdot 10^{+212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+143}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, -0.5, z\right) + \mathsf{max}\left(t, a\right)\right) + \mathsf{min}\left(t, a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1.1499999999999999e212 or 2.79999999999999998e143 < b 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--.f6484.5%
Applied rewrites84.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.1%
Applied rewrites69.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6469.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6469.1%
Applied rewrites69.1%
if -1.1499999999999999e212 < b < 2.79999999999999998e143Initial 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.1%
Taylor expanded in b around 0
Applied rewrites68.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (log c))))
(if (<= b -1.15e+212)
t_1
(if (<= b 3.5e+240) (fma y i (+ (+ (fma (log c) -0.5 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 = b * log(c);
double tmp;
if (b <= -1.15e+212) {
tmp = t_1;
} else if (b <= 3.5e+240) {
tmp = fma(y, i, ((fma(log(c), -0.5, z) + a) + t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(b * log(c)) tmp = 0.0 if (b <= -1.15e+212) tmp = t_1; elseif (b <= 3.5e+240) tmp = fma(y, i, Float64(Float64(fma(log(c), -0.5, 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[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.15e+212], t$95$1, If[LessEqual[b, 3.5e+240], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * -0.5 + z), $MachinePrecision] + a), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;b \leq -1.15 \cdot 10^{+212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 3.5 \cdot 10^{+240}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, -0.5, z\right) + a\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if b < -1.1499999999999999e212 or 3.50000000000000033e240 < b Initial program 99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6416.8%
Applied rewrites16.8%
if -1.1499999999999999e212 < b < 3.50000000000000033e240Initial 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.1%
Taylor expanded in b around 0
Applied rewrites68.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin t (fmax z a)))
(t_2 (fmax t (fmax z a)))
(t_3
(+
(+
(+ (+ (+ (* x (log y)) (fmin z a)) t_1) t_2)
(* (- b 0.5) (log c)))
(* y i))))
(if (<= t_3 100.0)
(+ (+ (fma i y (* (log c) -0.5)) (fmin z a)) t_1)
(if (<= t_3 2e+180)
(* (- (- i) (/ t_2 y)) (- y))
(if (<= t_3 2e+305) (- (- t_2)) (+ (* 1.0 (* (log y) x)) (* y i)))))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(t, fmax(z, a));
double t_2 = fmax(t, fmax(z, a));
double t_3 = (((((x * log(y)) + fmin(z, a)) + t_1) + t_2) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_3 <= 100.0) {
tmp = (fma(i, y, (log(c) * -0.5)) + fmin(z, a)) + t_1;
} else if (t_3 <= 2e+180) {
tmp = (-i - (t_2 / y)) * -y;
} else if (t_3 <= 2e+305) {
tmp = -(-t_2);
} else {
tmp = (1.0 * (log(y) * x)) + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fmin(t, fmax(z, a)) t_2 = fmax(t, fmax(z, a)) t_3 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + fmin(z, a)) + t_1) + t_2) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_3 <= 100.0) tmp = Float64(Float64(fma(i, y, Float64(log(c) * -0.5)) + fmin(z, a)) + t_1); elseif (t_3 <= 2e+180) tmp = Float64(Float64(Float64(-i) - Float64(t_2 / y)) * Float64(-y)); elseif (t_3 <= 2e+305) tmp = Float64(-Float64(-t_2)); else tmp = Float64(Float64(1.0 * Float64(log(y) * x)) + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Max[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[Min[z, a], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, 100.0], N[(N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision] + N[Min[z, a], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$3, 2e+180], N[(N[((-i) - N[(t$95$2 / y), $MachinePrecision]), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[t$95$3, 2e+305], (-(-t$95$2)), N[(N[(1.0 * N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(t, \mathsf{max}\left(z, a\right)\right)\\
t_2 := \mathsf{max}\left(t, \mathsf{max}\left(z, a\right)\right)\\
t_3 := \left(\left(\left(\left(x \cdot \log y + \mathsf{min}\left(z, a\right)\right) + t\_1\right) + t\_2\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_3 \leq 100:\\
\;\;\;\;\left(\mathsf{fma}\left(i, y, \log c \cdot -0.5\right) + \mathsf{min}\left(z, a\right)\right) + t\_1\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+180}:\\
\;\;\;\;\left(\left(-i\right) - \frac{t\_2}{y}\right) \cdot \left(-y\right)\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;-\left(-t\_2\right)\\
\mathbf{else}:\\
\;\;\;\;1 \cdot \left(\log y \cdot x\right) + y \cdot i\\
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 100Initial 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--.f6484.5%
Applied rewrites84.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.1%
Applied rewrites69.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6469.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6469.1%
Applied rewrites69.1%
Taylor expanded in b around 0
Applied rewrites54.0%
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)) < 2e180Initial 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.9%
Taylor expanded in a around inf
lower-/.f6432.3%
Applied rewrites32.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites32.3%
if 2e180 < (+.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.9999999999999999e305Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
if 1.9999999999999999e305 < (+.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
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.6%
Taylor expanded in x around inf
Applied rewrites38.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (+ (* 1.0 (* (log y) x)) (* y i)))
(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 -4e+299)
t_2
(if (<= t_5 -0.5)
(- (* -1.0 t_1))
(if (<= t_5 2e+180)
(* (- (- i) (/ t_4 y)) (- y))
(if (<= t_5 2e+305) (- (- 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 * (log(y) * x)) + (y * i);
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 <= -4e+299) {
tmp = t_2;
} else if (t_5 <= -0.5) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 2e+180) {
tmp = (-i - (t_4 / y)) * -y;
} else if (t_5 <= 2e+305) {
tmp = -(-t_4);
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: tmp
t_1 = fmin(fmin(z, t), a)
t_2 = (1.0d0 * (log(y) * x)) + (y * i)
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.5d0) * log(c))) + (y * i)
if (t_5 <= (-4d+299)) then
tmp = t_2
else if (t_5 <= (-0.5d0)) then
tmp = -((-1.0d0) * t_1)
else if (t_5 <= 2d+180) then
tmp = (-i - (t_4 / y)) * -y
else if (t_5 <= 2d+305) then
tmp = -(-t_4)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = (1.0 * (Math.log(y) * x)) + (y * i);
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 <= -4e+299) {
tmp = t_2;
} else if (t_5 <= -0.5) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 2e+180) {
tmp = (-i - (t_4 / y)) * -y;
} else if (t_5 <= 2e+305) {
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 * (math.log(y) * x)) + (y * i) 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 <= -4e+299: tmp = t_2 elif t_5 <= -0.5: tmp = -(-1.0 * t_1) elif t_5 <= 2e+180: tmp = (-i - (t_4 / y)) * -y elif t_5 <= 2e+305: 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(log(y) * x)) + Float64(y * i)) 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 <= -4e+299) tmp = t_2; elseif (t_5 <= -0.5) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_5 <= 2e+180) tmp = Float64(Float64(Float64(-i) - Float64(t_4 / y)) * Float64(-y)); elseif (t_5 <= 2e+305) 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 * (log(y) * x)) + (y * i); 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 <= -4e+299) tmp = t_2; elseif (t_5 <= -0.5) tmp = -(-1.0 * t_1); elseif (t_5 <= 2e+180) tmp = (-i - (t_4 / y)) * -y; elseif (t_5 <= 2e+305) 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[(N[(1.0 * N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision] + N[(y * i), $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, -4e+299], t$95$2, If[LessEqual[t$95$5, -0.5], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$5, 2e+180], N[(N[((-i) - N[(t$95$4 / y), $MachinePrecision]), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[t$95$5, 2e+305], (-(-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(\log y \cdot x\right) + y \cdot i\\
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 -4 \cdot 10^{+299}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_5 \leq -0.5:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+180}:\\
\;\;\;\;\left(\left(-i\right) - \frac{t\_4}{y}\right) \cdot \left(-y\right)\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;-\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)) < -4.0000000000000002e299 or 1.9999999999999999e305 < (+.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
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.6%
Taylor expanded in x around inf
Applied rewrites38.7%
if -4.0000000000000002e299 < (+.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)) < -0.5Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
if -0.5 < (+.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)) < 2e180Initial 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.9%
Taylor expanded in a around inf
lower-/.f6432.3%
Applied rewrites32.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites32.3%
if 2e180 < (+.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.9999999999999999e305Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (fmax (fmin z t) a))
(t_3 (fmax (fmax z t) t_2))
(t_4 (* (- (- i) (/ t_3 y)) (- y)))
(t_5
(+
(+
(+ (+ (+ (* x (log y)) t_1) (fmin (fmax z t) t_2)) t_3)
(* (- b 0.5) (log c)))
(* y i))))
(if (<= t_5 -1e+292)
(* -1.0 (* y (fma -1.0 i (* -1.0 (/ t_1 y)))))
(if (<= t_5 -0.5)
(- (* -1.0 t_1))
(if (<= t_5 2e+180) t_4 (if (<= t_5 2e+305) (- (- t_3)) 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 = fmax(fmax(z, t), t_2);
double t_4 = (-i - (t_3 / y)) * -y;
double t_5 = (((((x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_5 <= -1e+292) {
tmp = -1.0 * (y * fma(-1.0, i, (-1.0 * (t_1 / y))));
} else if (t_5 <= -0.5) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 2e+180) {
tmp = t_4;
} else if (t_5 <= 2e+305) {
tmp = -(-t_3);
} 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 = fmax(fmax(z, t), t_2) t_4 = Float64(Float64(Float64(-i) - Float64(t_3 / y)) * Float64(-y)) t_5 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_5 <= -1e+292) tmp = Float64(-1.0 * Float64(y * fma(-1.0, i, Float64(-1.0 * Float64(t_1 / y))))); elseif (t_5 <= -0.5) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_5 <= 2e+180) tmp = t_4; elseif (t_5 <= 2e+305) tmp = Float64(-Float64(-t_3)); 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[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(N[((-i) - N[(t$95$3 / y), $MachinePrecision]), $MachinePrecision] * (-y)), $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$2], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -1e+292], N[(-1.0 * N[(y * N[(-1.0 * i + N[(-1.0 * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$5, -0.5], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$5, 2e+180], t$95$4, If[LessEqual[t$95$5, 2e+305], (-(-t$95$3)), 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{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
t_4 := \left(\left(-i\right) - \frac{t\_3}{y}\right) \cdot \left(-y\right)\\
t_5 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\right) + t\_3\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_5 \leq -1 \cdot 10^{+292}:\\
\;\;\;\;-1 \cdot \left(y \cdot \mathsf{fma}\left(-1, i, -1 \cdot \frac{t\_1}{y}\right)\right)\\
\mathbf{elif}\;t\_5 \leq -0.5:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+180}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;-\left(-t\_3\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)) < -1e292Initial 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.9%
Taylor expanded in z around inf
lower-/.f6432.2%
Applied rewrites32.2%
if -1e292 < (+.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)) < -0.5Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
if -0.5 < (+.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)) < 2e180 or 1.9999999999999999e305 < (+.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.9%
Taylor expanded in a around inf
lower-/.f6432.3%
Applied rewrites32.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites32.3%
if 2e180 < (+.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.9999999999999999e305Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
(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 (* (- (- i) (/ t_4 y)) (- y)))
(t_6
(+
(+ (+ (+ (+ (* x (log y)) t_1) t_3) t_4) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_6 -2e+300)
(* (- (- i) (/ t_3 y)) (- y))
(if (<= t_6 -0.5)
(- (* -1.0 t_1))
(if (<= t_6 2e+180) t_5 (if (<= t_6 2e+305) (- (- 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 = (-i - (t_4 / y)) * -y;
double t_6 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_6 <= -2e+300) {
tmp = (-i - (t_3 / y)) * -y;
} else if (t_6 <= -0.5) {
tmp = -(-1.0 * t_1);
} else if (t_6 <= 2e+180) {
tmp = t_5;
} else if (t_6 <= 2e+305) {
tmp = -(-t_4);
} else {
tmp = t_5;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
real(8) :: t_6
real(8) :: tmp
t_1 = fmin(fmin(z, t), a)
t_2 = fmax(fmin(z, t), a)
t_3 = fmin(fmax(z, t), t_2)
t_4 = fmax(fmax(z, t), t_2)
t_5 = (-i - (t_4 / y)) * -y
t_6 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5d0) * log(c))) + (y * i)
if (t_6 <= (-2d+300)) then
tmp = (-i - (t_3 / y)) * -y
else if (t_6 <= (-0.5d0)) then
tmp = -((-1.0d0) * t_1)
else if (t_6 <= 2d+180) then
tmp = t_5
else if (t_6 <= 2d+305) then
tmp = -(-t_4)
else
tmp = t_5
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmin(fmax(z, t), t_2);
double t_4 = fmax(fmax(z, t), t_2);
double t_5 = (-i - (t_4 / y)) * -y;
double t_6 = (((((x * Math.log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_6 <= -2e+300) {
tmp = (-i - (t_3 / y)) * -y;
} else if (t_6 <= -0.5) {
tmp = -(-1.0 * t_1);
} else if (t_6 <= 2e+180) {
tmp = t_5;
} else if (t_6 <= 2e+305) {
tmp = -(-t_4);
} else {
tmp = t_5;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmin(fmin(z, t), a) t_2 = fmax(fmin(z, t), a) t_3 = fmin(fmax(z, t), t_2) t_4 = fmax(fmax(z, t), t_2) t_5 = (-i - (t_4 / y)) * -y t_6 = (((((x * math.log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_6 <= -2e+300: tmp = (-i - (t_3 / y)) * -y elif t_6 <= -0.5: tmp = -(-1.0 * t_1) elif t_6 <= 2e+180: tmp = t_5 elif t_6 <= 2e+305: 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 = Float64(Float64(Float64(-i) - Float64(t_4 / y)) * Float64(-y)) 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 <= -2e+300) tmp = Float64(Float64(Float64(-i) - Float64(t_3 / y)) * Float64(-y)); elseif (t_6 <= -0.5) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_6 <= 2e+180) tmp = t_5; elseif (t_6 <= 2e+305) tmp = Float64(-Float64(-t_4)); else tmp = t_5; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = min(min(z, t), a); t_2 = max(min(z, t), a); t_3 = min(max(z, t), t_2); t_4 = max(max(z, t), t_2); t_5 = (-i - (t_4 / y)) * -y; t_6 = (((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_6 <= -2e+300) tmp = (-i - (t_3 / y)) * -y; elseif (t_6 <= -0.5) tmp = -(-1.0 * t_1); elseif (t_6 <= 2e+180) tmp = t_5; elseif (t_6 <= 2e+305) tmp = -(-t_4); else tmp = t_5; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$5 = N[(N[((-i) - N[(t$95$4 / y), $MachinePrecision]), $MachinePrecision] * (-y)), $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, -2e+300], N[(N[((-i) - N[(t$95$3 / y), $MachinePrecision]), $MachinePrecision] * (-y)), $MachinePrecision], If[LessEqual[t$95$6, -0.5], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$6, 2e+180], t$95$5, If[LessEqual[t$95$6, 2e+305], (-(-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 := \left(\left(-i\right) - \frac{t\_4}{y}\right) \cdot \left(-y\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 -2 \cdot 10^{+300}:\\
\;\;\;\;\left(\left(-i\right) - \frac{t\_3}{y}\right) \cdot \left(-y\right)\\
\mathbf{elif}\;t\_6 \leq -0.5:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_6 \leq 2 \cdot 10^{+180}:\\
\;\;\;\;t\_5\\
\mathbf{elif}\;t\_6 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;-\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)) < -2.0000000000000001e300Initial 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.9%
Taylor expanded in t around inf
lower-/.f6432.7%
Applied rewrites32.7%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites32.7%
if -2.0000000000000001e300 < (+.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)) < -0.5Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
if -0.5 < (+.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)) < 2e180 or 1.9999999999999999e305 < (+.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.9%
Taylor expanded in a around inf
lower-/.f6432.3%
Applied rewrites32.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites32.3%
if 2e180 < (+.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.9999999999999999e305Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (fmax (fmin z t) a))
(t_3 (fmax (fmax z t) t_2))
(t_4 (* (- (- i) (/ t_3 y)) (- y)))
(t_5
(+
(+
(+ (+ (+ (* x (log y)) t_1) (fmin (fmax z t) t_2)) t_3)
(* (- b 0.5) (log c)))
(* y i))))
(if (<= t_5 -2e+300)
(* i y)
(if (<= t_5 -0.5)
(- (* -1.0 t_1))
(if (<= t_5 2e+180) t_4 (if (<= t_5 2e+305) (- (- t_3)) 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 = fmax(fmax(z, t), t_2);
double t_4 = (-i - (t_3 / y)) * -y;
double t_5 = (((((x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_5 <= -2e+300) {
tmp = i * y;
} else if (t_5 <= -0.5) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 2e+180) {
tmp = t_4;
} else if (t_5 <= 2e+305) {
tmp = -(-t_3);
} else {
tmp = t_4;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: t_5
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)
t_4 = (-i - (t_3 / y)) * -y
t_5 = (((((x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5d0) * log(c))) + (y * i)
if (t_5 <= (-2d+300)) then
tmp = i * y
else if (t_5 <= (-0.5d0)) then
tmp = -((-1.0d0) * t_1)
else if (t_5 <= 2d+180) then
tmp = t_4
else if (t_5 <= 2d+305) then
tmp = -(-t_3)
else
tmp = t_4
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmax(fmax(z, t), t_2);
double t_4 = (-i - (t_3 / y)) * -y;
double t_5 = (((((x * Math.log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_5 <= -2e+300) {
tmp = i * y;
} else if (t_5 <= -0.5) {
tmp = -(-1.0 * t_1);
} else if (t_5 <= 2e+180) {
tmp = t_4;
} else if (t_5 <= 2e+305) {
tmp = -(-t_3);
} 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 = fmax(fmax(z, t), t_2) t_4 = (-i - (t_3 / y)) * -y t_5 = (((((x * math.log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_5 <= -2e+300: tmp = i * y elif t_5 <= -0.5: tmp = -(-1.0 * t_1) elif t_5 <= 2e+180: tmp = t_4 elif t_5 <= 2e+305: tmp = -(-t_3) 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 = fmax(fmax(z, t), t_2) t_4 = Float64(Float64(Float64(-i) - Float64(t_3 / y)) * Float64(-y)) t_5 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_5 <= -2e+300) tmp = Float64(i * y); elseif (t_5 <= -0.5) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_5 <= 2e+180) tmp = t_4; elseif (t_5 <= 2e+305) tmp = Float64(-Float64(-t_3)); 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 = max(max(z, t), t_2); t_4 = (-i - (t_3 / y)) * -y; t_5 = (((((x * log(y)) + t_1) + min(max(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_5 <= -2e+300) tmp = i * y; elseif (t_5 <= -0.5) tmp = -(-1.0 * t_1); elseif (t_5 <= 2e+180) tmp = t_4; elseif (t_5 <= 2e+305) tmp = -(-t_3); 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[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(N[((-i) - N[(t$95$3 / y), $MachinePrecision]), $MachinePrecision] * (-y)), $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$2], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -2e+300], N[(i * y), $MachinePrecision], If[LessEqual[t$95$5, -0.5], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$5, 2e+180], t$95$4, If[LessEqual[t$95$5, 2e+305], (-(-t$95$3)), 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{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
t_4 := \left(\left(-i\right) - \frac{t\_3}{y}\right) \cdot \left(-y\right)\\
t_5 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\right) + t\_3\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_5 \leq -2 \cdot 10^{+300}:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_5 \leq -0.5:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+180}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;t\_5 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;-\left(-t\_3\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)) < -2.0000000000000001e300Initial 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
lift-+.f64N/A
associate-+l+N/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-+.f64N/A
lower-fma.f6499.8%
Applied rewrites99.8%
Taylor expanded in y around inf
lower-*.f6424.1%
Applied rewrites24.1%
if -2.0000000000000001e300 < (+.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)) < -0.5Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
if -0.5 < (+.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)) < 2e180 or 1.9999999999999999e305 < (+.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.9%
Taylor expanded in a around inf
lower-/.f6432.3%
Applied rewrites32.3%
lift-*.f64N/A
mul-1-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
Applied rewrites32.3%
if 2e180 < (+.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.9999999999999999e305Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (fmax (fmin z t) a))
(t_3 (fmax (fmax z t) t_2))
(t_4
(+
(+
(+ (+ (+ (* x (log y)) t_1) (fmin (fmax z t) t_2)) t_3)
(* (- b 0.5) (log c)))
(* y i))))
(if (<= t_4 -2e+300)
(* i y)
(if (<= t_4 -0.5)
(- (* -1.0 t_1))
(if (<= t_4 2e+305) (- (- t_3)) (* i 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 = fmax(fmax(z, t), t_2);
double t_4 = (((((x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_4 <= -2e+300) {
tmp = i * y;
} else if (t_4 <= -0.5) {
tmp = -(-1.0 * t_1);
} else if (t_4 <= 2e+305) {
tmp = -(-t_3);
} 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) :: t_2
real(8) :: t_3
real(8) :: t_4
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)
t_4 = (((((x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5d0) * log(c))) + (y * i)
if (t_4 <= (-2d+300)) then
tmp = i * y
else if (t_4 <= (-0.5d0)) then
tmp = -((-1.0d0) * t_1)
else if (t_4 <= 2d+305) then
tmp = -(-t_3)
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 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmax(fmax(z, t), t_2);
double t_4 = (((((x * Math.log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_4 <= -2e+300) {
tmp = i * y;
} else if (t_4 <= -0.5) {
tmp = -(-1.0 * t_1);
} else if (t_4 <= 2e+305) {
tmp = -(-t_3);
} else {
tmp = i * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmin(fmin(z, t), a) t_2 = fmax(fmin(z, t), a) t_3 = fmax(fmax(z, t), t_2) t_4 = (((((x * math.log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_4 <= -2e+300: tmp = i * y elif t_4 <= -0.5: tmp = -(-1.0 * t_1) elif t_4 <= 2e+305: tmp = -(-t_3) else: tmp = i * 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 = fmax(fmax(z, t), t_2) t_4 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + t_1) + fmin(fmax(z, t), t_2)) + t_3) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_4 <= -2e+300) tmp = Float64(i * y); elseif (t_4 <= -0.5) tmp = Float64(-Float64(-1.0 * t_1)); elseif (t_4 <= 2e+305) tmp = Float64(-Float64(-t_3)); else tmp = Float64(i * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = min(min(z, t), a); t_2 = max(min(z, t), a); t_3 = max(max(z, t), t_2); t_4 = (((((x * log(y)) + t_1) + min(max(z, t), t_2)) + t_3) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_4 <= -2e+300) tmp = i * y; elseif (t_4 <= -0.5) tmp = -(-1.0 * t_1); elseif (t_4 <= 2e+305) tmp = -(-t_3); else tmp = i * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]), $MachinePrecision] + t$95$3), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$4, -2e+300], N[(i * y), $MachinePrecision], If[LessEqual[t$95$4, -0.5], (-N[(-1.0 * t$95$1), $MachinePrecision]), If[LessEqual[t$95$4, 2e+305], (-(-t$95$3)), N[(i * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_3 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
t_4 := \left(\left(\left(\left(x \cdot \log y + t\_1\right) + \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\right) + t\_3\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+300}:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_4 \leq -0.5:\\
\;\;\;\;--1 \cdot t\_1\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{+305}:\\
\;\;\;\;-\left(-t\_3\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y\\
\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)) < -2.0000000000000001e300 or 1.9999999999999999e305 < (+.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
lift-+.f64N/A
associate-+l+N/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-+.f64N/A
lower-fma.f6499.8%
Applied rewrites99.8%
Taylor expanded in y around inf
lower-*.f6424.1%
Applied rewrites24.1%
if -2.0000000000000001e300 < (+.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)) < -0.5Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
Taylor expanded in z around inf
lower-*.f6416.0%
Applied rewrites16.0%
if -0.5 < (+.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.9999999999999999e305Initial 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (fmax t (fmax z a)))) (if (<= t_1 1.5e+130) (* i y) (- (- t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmax(t, fmax(z, a));
double tmp;
if (t_1 <= 1.5e+130) {
tmp = i * y;
} else {
tmp = -(-t_1);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, 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 = fmax(t, fmax(z, a))
if (t_1 <= 1.5d+130) then
tmp = i * y
else
tmp = -(-t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmax(t, fmax(z, a));
double tmp;
if (t_1 <= 1.5e+130) {
tmp = i * y;
} else {
tmp = -(-t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = fmax(t, fmax(z, a)) tmp = 0 if t_1 <= 1.5e+130: tmp = i * y else: tmp = -(-t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = fmax(t, fmax(z, a)) tmp = 0.0 if (t_1 <= 1.5e+130) tmp = Float64(i * y); else tmp = Float64(-Float64(-t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = max(t, max(z, a)); tmp = 0.0; if (t_1 <= 1.5e+130) tmp = i * y; else tmp = -(-t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Max[t, N[Max[z, a], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t$95$1, 1.5e+130], N[(i * y), $MachinePrecision], (-(-t$95$1))]]
\begin{array}{l}
t_1 := \mathsf{max}\left(t, \mathsf{max}\left(z, a\right)\right)\\
\mathbf{if}\;t\_1 \leq 1.5 \cdot 10^{+130}:\\
\;\;\;\;i \cdot y\\
\mathbf{else}:\\
\;\;\;\;-\left(-t\_1\right)\\
\end{array}
if a < 1.5e130Initial 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
lift-+.f64N/A
associate-+l+N/A
lift-fma.f64N/A
lift-*.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-fma.f64N/A
lift-*.f64N/A
associate-+l+N/A
lift-*.f64N/A
lift-fma.f64N/A
lift-+.f64N/A
associate-+r+N/A
lift-*.f64N/A
lift-+.f64N/A
lower-fma.f6499.8%
Applied rewrites99.8%
Taylor expanded in y around inf
lower-*.f6424.1%
Applied rewrites24.1%
if 1.5e130 < a 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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
(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.9%
Taylor expanded in a around inf
lower-*.f6416.4%
Applied rewrites16.4%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.4%
lift-*.f64N/A
mul-1-negN/A
lift-neg.f6416.4%
Applied rewrites16.4%
herbie shell --seed 2025187
(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)))