
(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 17 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 (+ (+ (+ (+ (+ (* 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}
Initial program 99.8%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (fma (log c) (- b 0.5) (+ t (fma (log y) x z))) a) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (fma(log(c), (b - 0.5), (t + fma(log(y), x, z))) + a) + (y * i);
}
function code(x, y, z, t, a, b, c, i) return Float64(Float64(fma(log(c), Float64(b - 0.5), Float64(t + fma(log(y), x, z))) + a) + Float64(y * i)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(t + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(\log c, b - 0.5, t + \mathsf{fma}\left(\log y, x, z\right)\right) + a\right) + y \cdot i
\end{array}
Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a b c i) :precision binary64 (+ a (+ z (fma i y (fma x (log y) (* (log c) (- b 0.5)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + (z + fma(i, y, fma(x, log(y), (log(c) * (b - 0.5)))));
}
function code(x, y, z, t, a, b, c, i) return Float64(a + Float64(z + fma(i, y, fma(x, log(y), Float64(log(c) * Float64(b - 0.5)))))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + 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]
\begin{array}{l}
\\
a + \left(z + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\right)
\end{array}
Initial program 99.8%
Taylor expanded in t 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.4
Applied rewrites84.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma x (log y) (* (log c) (- b 0.5)))))
(if (<= x -6.2e+106)
(+ a (+ t (+ z t_1)))
(if (<= x 1.2e+150)
(+ (+ (fma (log c) (- b 0.5) (+ t z)) a) (* y i))
(+ (fma i y t_1) t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(x, log(y), (log(c) * (b - 0.5)));
double tmp;
if (x <= -6.2e+106) {
tmp = a + (t + (z + t_1));
} else if (x <= 1.2e+150) {
tmp = (fma(log(c), (b - 0.5), (t + z)) + a) + (y * i);
} else {
tmp = fma(i, y, t_1) + t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(x, log(y), Float64(log(c) * Float64(b - 0.5))) tmp = 0.0 if (x <= -6.2e+106) tmp = Float64(a + Float64(t + Float64(z + t_1))); elseif (x <= 1.2e+150) tmp = Float64(Float64(fma(log(c), Float64(b - 0.5), Float64(t + z)) + a) + Float64(y * i)); else tmp = Float64(fma(i, y, t_1) + t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -6.2e+106], N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.2e+150], N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(i * y + t$95$1), $MachinePrecision] + t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{if}\;x \leq -6.2 \cdot 10^{+106}:\\
\;\;\;\;a + \left(t + \left(z + t\_1\right)\right)\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+150}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, t + z\right) + a\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, y, t\_1\right) + t\\
\end{array}
\end{array}
if x < -6.1999999999999999e106Initial 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 rewrites73.0%
Taylor expanded in a around inf
lower-*.f6416.0
Applied rewrites16.0%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6477.9
Applied rewrites77.9%
if -6.1999999999999999e106 < x < 1.20000000000000001e150Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
if 1.20000000000000001e150 < 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--.f6484.8
Applied rewrites84.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6463.1
Applied rewrites63.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6463.1
Applied rewrites63.1%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.6
Applied rewrites69.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.8e+151)
(+ (- (fma (log y) x z) (* (- 0.5 b) (log c))) t)
(if (<= x 1.2e+150)
(+ (+ (fma (log c) (- b 0.5) (+ t z)) a) (* y i))
(+ (fma i y (fma x (log y) (* (log c) (- b 0.5)))) t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.8e+151) {
tmp = (fma(log(y), x, z) - ((0.5 - b) * log(c))) + t;
} else if (x <= 1.2e+150) {
tmp = (fma(log(c), (b - 0.5), (t + z)) + a) + (y * i);
} else {
tmp = fma(i, y, fma(x, log(y), (log(c) * (b - 0.5)))) + t;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.8e+151) tmp = Float64(Float64(fma(log(y), x, z) - Float64(Float64(0.5 - b) * log(c))) + t); elseif (x <= 1.2e+150) tmp = Float64(Float64(fma(log(c), Float64(b - 0.5), Float64(t + z)) + a) + Float64(y * i)); else tmp = Float64(fma(i, y, fma(x, log(y), Float64(log(c) * Float64(b - 0.5)))) + t); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.8e+151], N[(N[(N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision] - N[(N[(0.5 - b), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[x, 1.2e+150], N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(i * y + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+151}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log y, x, z\right) - \left(0.5 - b\right) \cdot \log c\right) + t\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{+150}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, t + z\right) + a\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right) + t\\
\end{array}
\end{array}
if x < -2.79999999999999987e151Initial 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.8
Applied rewrites84.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6463.1
Applied rewrites63.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6463.1
Applied rewrites63.1%
if -2.79999999999999987e151 < x < 1.20000000000000001e150Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
if 1.20000000000000001e150 < 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--.f6484.8
Applied rewrites84.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6463.1
Applied rewrites63.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6463.1
Applied rewrites63.1%
Taylor expanded in z around 0
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.6
Applied rewrites69.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.8e+151)
(+ (- (fma (log y) x z) (* (- 0.5 b) (log c))) t)
(if (<= x 7.5e+233)
(+ (+ (fma (log c) (- b 0.5) (+ t z)) a) (* y i))
(* -1.0 (* x (fma -1.0 (log y) (* -1.0 (/ (* i y) x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.8e+151) {
tmp = (fma(log(y), x, z) - ((0.5 - b) * log(c))) + t;
} else if (x <= 7.5e+233) {
tmp = (fma(log(c), (b - 0.5), (t + z)) + a) + (y * i);
} else {
tmp = -1.0 * (x * fma(-1.0, log(y), (-1.0 * ((i * y) / x))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.8e+151) tmp = Float64(Float64(fma(log(y), x, z) - Float64(Float64(0.5 - b) * log(c))) + t); elseif (x <= 7.5e+233) tmp = Float64(Float64(fma(log(c), Float64(b - 0.5), Float64(t + z)) + a) + Float64(y * i)); else tmp = Float64(-1.0 * Float64(x * fma(-1.0, log(y), Float64(-1.0 * Float64(Float64(i * y) / x))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.8e+151], N[(N[(N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision] - N[(N[(0.5 - b), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[x, 7.5e+233], N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(x * N[(-1.0 * N[Log[y], $MachinePrecision] + N[(-1.0 * N[(N[(i * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.8 \cdot 10^{+151}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log y, x, z\right) - \left(0.5 - b\right) \cdot \log c\right) + t\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+233}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, t + z\right) + a\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \log y, -1 \cdot \frac{i \cdot y}{x}\right)\right)\\
\end{array}
\end{array}
if x < -2.79999999999999987e151Initial 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.8
Applied rewrites84.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6463.1
Applied rewrites63.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6463.1
Applied rewrites63.1%
if -2.79999999999999987e151 < x < 7.4999999999999997e233Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
if 7.4999999999999997e233 < 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 rewrites73.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6435.0
Applied rewrites35.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -1.0 (* x (fma -1.0 (log y) (* -1.0 (/ (* i y) x)))))))
(if (<= x -8e+200)
t_1
(if (<= x 7.5e+233)
(+ (+ (fma (log c) (- b 0.5) (+ t z)) a) (* y i))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -1.0 * (x * fma(-1.0, log(y), (-1.0 * ((i * y) / x))));
double tmp;
if (x <= -8e+200) {
tmp = t_1;
} else if (x <= 7.5e+233) {
tmp = (fma(log(c), (b - 0.5), (t + z)) + a) + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-1.0 * Float64(x * fma(-1.0, log(y), Float64(-1.0 * Float64(Float64(i * y) / x))))) tmp = 0.0 if (x <= -8e+200) tmp = t_1; elseif (x <= 7.5e+233) tmp = Float64(Float64(fma(log(c), Float64(b - 0.5), Float64(t + z)) + a) + Float64(y * i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-1.0 * N[(x * N[(-1.0 * N[Log[y], $MachinePrecision] + N[(-1.0 * N[(N[(i * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+200], t$95$1, If[LessEqual[x, 7.5e+233], N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \log y, -1 \cdot \frac{i \cdot y}{x}\right)\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{+200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+233}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, t + z\right) + a\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.9999999999999998e200 or 7.4999999999999997e233 < 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 rewrites73.0%
Taylor expanded in y around inf
lower-/.f64N/A
lower-*.f6435.0
Applied rewrites35.0%
if -7.9999999999999998e200 < x < 7.4999999999999997e233Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -3e+151)
(+ (- (fma (log y) x z) (* 0.5 (log c))) t)
(if (<= x 7.5e+233)
(+ (+ (fma (log c) (- b 0.5) (+ t z)) a) (* y i))
(+ t (+ z (fma x (log y) (* (log c) -0.5)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -3e+151) {
tmp = (fma(log(y), x, z) - (0.5 * log(c))) + t;
} else if (x <= 7.5e+233) {
tmp = (fma(log(c), (b - 0.5), (t + z)) + a) + (y * i);
} else {
tmp = t + (z + fma(x, log(y), (log(c) * -0.5)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -3e+151) tmp = Float64(Float64(fma(log(y), x, z) - Float64(0.5 * log(c))) + t); elseif (x <= 7.5e+233) tmp = Float64(Float64(fma(log(c), Float64(b - 0.5), Float64(t + z)) + a) + Float64(y * i)); else tmp = Float64(t + Float64(z + fma(x, log(y), Float64(log(c) * -0.5)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -3e+151], N[(N[(N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision] - N[(0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[x, 7.5e+233], N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+151}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log y, x, z\right) - 0.5 \cdot \log c\right) + t\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+233}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, t + z\right) + a\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t + \left(z + \mathsf{fma}\left(x, \log y, \log c \cdot -0.5\right)\right)\\
\end{array}
\end{array}
if x < -2.9999999999999999e151Initial 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.8
Applied rewrites84.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6463.1
Applied rewrites63.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6463.1
Applied rewrites63.1%
Taylor expanded in b around 0
Applied rewrites47.9%
if -2.9999999999999999e151 < x < 7.4999999999999997e233Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
if 7.4999999999999997e233 < 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--.f6484.8
Applied rewrites84.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6463.1
Applied rewrites63.1%
Taylor expanded in b around 0
Applied rewrites47.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -3e+151)
(+ (- (fma (log y) x z) (* 0.5 (log c))) t)
(if (<= x 7.5e+233)
(+ (+ (fma (log c) (- b 0.5) (+ t z)) a) (* y i))
(* -1.0 (* x (fma -1.0 (log y) (* -1.0 (/ z x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -3e+151) {
tmp = (fma(log(y), x, z) - (0.5 * log(c))) + t;
} else if (x <= 7.5e+233) {
tmp = (fma(log(c), (b - 0.5), (t + z)) + a) + (y * i);
} else {
tmp = -1.0 * (x * fma(-1.0, log(y), (-1.0 * (z / x))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -3e+151) tmp = Float64(Float64(fma(log(y), x, z) - Float64(0.5 * log(c))) + t); elseif (x <= 7.5e+233) tmp = Float64(Float64(fma(log(c), Float64(b - 0.5), Float64(t + z)) + a) + Float64(y * i)); else tmp = Float64(-1.0 * Float64(x * fma(-1.0, log(y), Float64(-1.0 * Float64(z / x))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -3e+151], N[(N[(N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision] - N[(0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[x, 7.5e+233], N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(x * N[(-1.0 * N[Log[y], $MachinePrecision] + N[(-1.0 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+151}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log y, x, z\right) - 0.5 \cdot \log c\right) + t\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+233}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, t + z\right) + a\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \log y, -1 \cdot \frac{z}{x}\right)\right)\\
\end{array}
\end{array}
if x < -2.9999999999999999e151Initial 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.8
Applied rewrites84.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6463.1
Applied rewrites63.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6463.1
Applied rewrites63.1%
Taylor expanded in b around 0
Applied rewrites47.9%
if -2.9999999999999999e151 < x < 7.4999999999999997e233Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
if 7.4999999999999997e233 < 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 rewrites73.0%
Taylor expanded in z around inf
lower-/.f6426.6
Applied rewrites26.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -1.0 (* x (fma -1.0 (log y) (* -1.0 (/ z x)))))))
(if (<= x -3e+151)
t_1
(if (<= x 7.5e+233)
(+ (+ (fma (log c) (- b 0.5) (+ t z)) a) (* y i))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -1.0 * (x * fma(-1.0, log(y), (-1.0 * (z / x))));
double tmp;
if (x <= -3e+151) {
tmp = t_1;
} else if (x <= 7.5e+233) {
tmp = (fma(log(c), (b - 0.5), (t + z)) + a) + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-1.0 * Float64(x * fma(-1.0, log(y), Float64(-1.0 * Float64(z / x))))) tmp = 0.0 if (x <= -3e+151) tmp = t_1; elseif (x <= 7.5e+233) tmp = Float64(Float64(fma(log(c), Float64(b - 0.5), Float64(t + z)) + a) + Float64(y * i)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-1.0 * N[(x * N[(-1.0 * N[Log[y], $MachinePrecision] + N[(-1.0 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3e+151], t$95$1, If[LessEqual[x, 7.5e+233], N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \log y, -1 \cdot \frac{z}{x}\right)\right)\\
\mathbf{if}\;x \leq -3 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+233}:\\
\;\;\;\;\left(\mathsf{fma}\left(\log c, b - 0.5, t + z\right) + a\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.9999999999999999e151 or 7.4999999999999997e233 < 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 rewrites73.0%
Taylor expanded in z around inf
lower-/.f6426.6
Applied rewrites26.6%
if -2.9999999999999999e151 < x < 7.4999999999999997e233Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.7e+151)
(* -1.0 (* x (fma -1.0 (log y) (* -1.0 (/ z x)))))
(if (<= x 1.6e+161)
(+ t (+ z (fma i y (* (log c) (- b 0.5)))))
(* -1.0 (* x (fma -1.0 (log y) (* -1.0 (/ a x))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.7e+151) {
tmp = -1.0 * (x * fma(-1.0, log(y), (-1.0 * (z / x))));
} else if (x <= 1.6e+161) {
tmp = t + (z + fma(i, y, (log(c) * (b - 0.5))));
} else {
tmp = -1.0 * (x * fma(-1.0, log(y), (-1.0 * (a / x))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.7e+151) tmp = Float64(-1.0 * Float64(x * fma(-1.0, log(y), Float64(-1.0 * Float64(z / x))))); elseif (x <= 1.6e+161) tmp = Float64(t + Float64(z + fma(i, y, Float64(log(c) * Float64(b - 0.5))))); else tmp = Float64(-1.0 * Float64(x * fma(-1.0, log(y), Float64(-1.0 * Float64(a / x))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.7e+151], N[(-1.0 * N[(x * N[(-1.0 * N[Log[y], $MachinePrecision] + N[(-1.0 * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+161], N[(t + N[(z + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(x * N[(-1.0 * N[Log[y], $MachinePrecision] + N[(-1.0 * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.7 \cdot 10^{+151}:\\
\;\;\;\;-1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \log y, -1 \cdot \frac{z}{x}\right)\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+161}:\\
\;\;\;\;t + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;-1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \log y, -1 \cdot \frac{a}{x}\right)\right)\\
\end{array}
\end{array}
if x < -2.7000000000000001e151Initial 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 rewrites73.0%
Taylor expanded in z around inf
lower-/.f6426.6
Applied rewrites26.6%
if -2.7000000000000001e151 < x < 1.60000000000000001e161Initial 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.8
Applied rewrites84.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.3
Applied rewrites69.3%
if 1.60000000000000001e161 < 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 rewrites73.0%
Taylor expanded in a around inf
lower-/.f6426.2
Applied rewrites26.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* -1.0 (* x (fma -1.0 (log y) (* -1.0 (/ a x)))))))
(if (<= x -1e+200)
t_1
(if (<= x 1.6e+161) (+ t (+ z (fma i y (* (log c) (- b 0.5))))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = -1.0 * (x * fma(-1.0, log(y), (-1.0 * (a / x))));
double tmp;
if (x <= -1e+200) {
tmp = t_1;
} else if (x <= 1.6e+161) {
tmp = t + (z + fma(i, y, (log(c) * (b - 0.5))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(-1.0 * Float64(x * fma(-1.0, log(y), Float64(-1.0 * Float64(a / x))))) tmp = 0.0 if (x <= -1e+200) tmp = t_1; elseif (x <= 1.6e+161) tmp = Float64(t + Float64(z + fma(i, y, Float64(log(c) * Float64(b - 0.5))))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(-1.0 * N[(x * N[(-1.0 * N[Log[y], $MachinePrecision] + N[(-1.0 * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1e+200], t$95$1, If[LessEqual[x, 1.6e+161], N[(t + N[(z + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := -1 \cdot \left(x \cdot \mathsf{fma}\left(-1, \log y, -1 \cdot \frac{a}{x}\right)\right)\\
\mathbf{if}\;x \leq -1 \cdot 10^{+200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+161}:\\
\;\;\;\;t + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.9999999999999997e199 or 1.60000000000000001e161 < 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 rewrites73.0%
Taylor expanded in a around inf
lower-/.f6426.2
Applied rewrites26.2%
if -9.9999999999999997e199 < x < 1.60000000000000001e161Initial 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.8
Applied rewrites84.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.3
Applied rewrites69.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -2.4e+200)
t_1
(if (<= x 7.5e+233) (+ t (+ z (fma i y (* (log c) (- b 0.5))))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * log(y);
double tmp;
if (x <= -2.4e+200) {
tmp = t_1;
} else if (x <= 7.5e+233) {
tmp = t + (z + fma(i, y, (log(c) * (b - 0.5))));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -2.4e+200) tmp = t_1; elseif (x <= 7.5e+233) tmp = Float64(t + Float64(z + fma(i, y, Float64(log(c) * Float64(b - 0.5))))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.4e+200], t$95$1, If[LessEqual[x, 7.5e+233], N[(t + N[(z + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+200}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7.5 \cdot 10^{+233}:\\
\;\;\;\;t + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.4000000000000001e200 or 7.4999999999999997e233 < x Initial program 99.8%
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.8
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6417.0
Applied rewrites17.0%
if -2.4000000000000001e200 < x < 7.4999999999999997e233Initial 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.8
Applied rewrites84.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.3
Applied rewrites69.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 (* 1.0 (* i y))))
(if (<= t_1 -6e+296)
t_2
(if (<= t_1 1e+16)
(+ (- z (* (log c) (- 0.5 b))) t)
(if (<= t_1 1e+307) (- (- 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 = 1.0 * (i * y);
double tmp;
if (t_1 <= -6e+296) {
tmp = t_2;
} else if (t_1 <= 1e+16) {
tmp = (z - (log(c) * (0.5 - b))) + t;
} else if (t_1 <= 1e+307) {
tmp = -(-a);
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
t_2 = 1.0d0 * (i * y)
if (t_1 <= (-6d+296)) then
tmp = t_2
else if (t_1 <= 1d+16) then
tmp = (z - (log(c) * (0.5d0 - b))) + t
else if (t_1 <= 1d+307) then
tmp = -(-a)
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 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
double t_2 = 1.0 * (i * y);
double tmp;
if (t_1 <= -6e+296) {
tmp = t_2;
} else if (t_1 <= 1e+16) {
tmp = (z - (Math.log(c) * (0.5 - b))) + t;
} else if (t_1 <= 1e+307) {
tmp = -(-a);
} else {
tmp = t_2;
}
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) t_2 = 1.0 * (i * y) tmp = 0 if t_1 <= -6e+296: tmp = t_2 elif t_1 <= 1e+16: tmp = (z - (math.log(c) * (0.5 - b))) + t elif t_1 <= 1e+307: 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(1.0 * Float64(i * y)) tmp = 0.0 if (t_1 <= -6e+296) tmp = t_2; elseif (t_1 <= 1e+16) tmp = Float64(Float64(z - Float64(log(c) * Float64(0.5 - b))) + t); elseif (t_1 <= 1e+307) tmp = Float64(-Float64(-a)); else tmp = t_2; 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); t_2 = 1.0 * (i * y); tmp = 0.0; if (t_1 <= -6e+296) tmp = t_2; elseif (t_1 <= 1e+16) tmp = (z - (log(c) * (0.5 - b))) + t; elseif (t_1 <= 1e+307) tmp = -(-a); else tmp = t_2; 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]}, Block[{t$95$2 = N[(1.0 * N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -6e+296], t$95$2, If[LessEqual[t$95$1, 1e+16], N[(N[(z - N[(N[Log[c], $MachinePrecision] * N[(0.5 - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], If[LessEqual[t$95$1, 1e+307], (-(-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 := 1 \cdot \left(i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq -6 \cdot 10^{+296}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+16}:\\
\;\;\;\;\left(z - \log c \cdot \left(0.5 - b\right)\right) + t\\
\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;-\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)) < -6.00000000000000025e296 or 9.99999999999999986e306 < (+.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
sum-to-multN/A
lower-*.f64N/A
Applied rewrites65.5%
Taylor expanded in y around inf
Applied rewrites23.4%
if -6.00000000000000025e296 < (+.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)) < 1e16Initial 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.8
Applied rewrites84.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6463.1
Applied rewrites63.1%
lift-+.f64N/A
+-commutativeN/A
lower-+.f6463.1
Applied rewrites63.1%
Taylor expanded in x around 0
lower--.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6447.7
Applied rewrites47.7%
if 1e16 < (+.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)) < 9.99999999999999986e306Initial 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 rewrites73.0%
Taylor expanded in a around inf
lower-*.f6416.0
Applied rewrites16.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
Applied rewrites16.0%
(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 (* 1.0 (* i y))))
(if (<= t_1 -6e+296)
t_2
(if (<= t_1 -2e+15) (- (* -1.0 z)) (if (<= t_1 1e+307) (- (- 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 = 1.0 * (i * y);
double tmp;
if (t_1 <= -6e+296) {
tmp = t_2;
} else if (t_1 <= -2e+15) {
tmp = -(-1.0 * z);
} else if (t_1 <= 1e+307) {
tmp = -(-a);
} else {
tmp = t_2;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
t_2 = 1.0d0 * (i * y)
if (t_1 <= (-6d+296)) then
tmp = t_2
else if (t_1 <= (-2d+15)) then
tmp = -((-1.0d0) * z)
else if (t_1 <= 1d+307) then
tmp = -(-a)
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 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
double t_2 = 1.0 * (i * y);
double tmp;
if (t_1 <= -6e+296) {
tmp = t_2;
} else if (t_1 <= -2e+15) {
tmp = -(-1.0 * z);
} else if (t_1 <= 1e+307) {
tmp = -(-a);
} else {
tmp = t_2;
}
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) t_2 = 1.0 * (i * y) tmp = 0 if t_1 <= -6e+296: tmp = t_2 elif t_1 <= -2e+15: tmp = -(-1.0 * z) elif t_1 <= 1e+307: 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(1.0 * Float64(i * y)) tmp = 0.0 if (t_1 <= -6e+296) tmp = t_2; elseif (t_1 <= -2e+15) tmp = Float64(-Float64(-1.0 * z)); elseif (t_1 <= 1e+307) tmp = Float64(-Float64(-a)); else tmp = t_2; 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); t_2 = 1.0 * (i * y); tmp = 0.0; if (t_1 <= -6e+296) tmp = t_2; elseif (t_1 <= -2e+15) tmp = -(-1.0 * z); elseif (t_1 <= 1e+307) tmp = -(-a); else tmp = t_2; 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]}, Block[{t$95$2 = N[(1.0 * N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -6e+296], t$95$2, If[LessEqual[t$95$1, -2e+15], (-N[(-1.0 * z), $MachinePrecision]), If[LessEqual[t$95$1, 1e+307], (-(-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 := 1 \cdot \left(i \cdot y\right)\\
\mathbf{if}\;t\_1 \leq -6 \cdot 10^{+296}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{+15}:\\
\;\;\;\;--1 \cdot z\\
\mathbf{elif}\;t\_1 \leq 10^{+307}:\\
\;\;\;\;-\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)) < -6.00000000000000025e296 or 9.99999999999999986e306 < (+.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
sum-to-multN/A
lower-*.f64N/A
Applied rewrites65.5%
Taylor expanded in y around inf
Applied rewrites23.4%
if -6.00000000000000025e296 < (+.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)) < -2e15Initial 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 rewrites73.0%
Taylor expanded in a around inf
lower-*.f6416.0
Applied rewrites16.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
Applied rewrites16.0%
Taylor expanded in z around inf
lower-*.f6416.6
Applied rewrites16.6%
if -2e15 < (+.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)) < 9.99999999999999986e306Initial 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 rewrites73.0%
Taylor expanded in a around inf
lower-*.f6416.0
Applied rewrites16.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
Applied rewrites16.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
-2e+15)
(- (* -1.0 z))
(- (- a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -2e+15) {
tmp = -(-1.0 * z);
} else {
tmp = -(-a);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)) <= (-2d+15)) then
tmp = -((-1.0d0) * z)
else
tmp = -(-a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i)) <= -2e+15) {
tmp = -(-1.0 * z);
} else {
tmp = -(-a);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)) <= -2e+15: tmp = -(-1.0 * z) else: tmp = -(-a) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= -2e+15) tmp = Float64(-Float64(-1.0 * z)); else tmp = Float64(-Float64(-a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= -2e+15) tmp = -(-1.0 * z); else tmp = -(-a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[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], -2e+15], (-N[(-1.0 * z), $MachinePrecision]), (-(-a))]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\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 \leq -2 \cdot 10^{+15}:\\
\;\;\;\;--1 \cdot z\\
\mathbf{else}:\\
\;\;\;\;-\left(-a\right)\\
\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)) < -2e15Initial 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 rewrites73.0%
Taylor expanded in a around inf
lower-*.f6416.0
Applied rewrites16.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
Applied rewrites16.0%
Taylor expanded in z around inf
lower-*.f6416.6
Applied rewrites16.6%
if -2e15 < (+.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 x around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites73.0%
Taylor expanded in a around inf
lower-*.f6416.0
Applied rewrites16.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
Applied rewrites16.0%
(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 rewrites73.0%
Taylor expanded in a around inf
lower-*.f6416.0
Applied rewrites16.0%
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
lift-*.f64N/A
mul-1-negN/A
lower-neg.f6416.0
Applied rewrites16.0%
herbie shell --seed 2025156
(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)))