
(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 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]
\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 (- b 0.5) (log c) (+ (fma i y (+ (fmax z a) (fma (log y) x (fmin z a)))) t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma((b - 0.5), log(c), (fma(i, y, (fmax(z, a) + fma(log(y), x, fmin(z, a)))) + t));
}
function code(x, y, z, t, a, b, c, i) return fma(Float64(b - 0.5), log(c), Float64(fma(i, y, Float64(fmax(z, a) + fma(log(y), x, fmin(z, a)))) + t)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(i * y + N[(N[Max[z, a], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + N[Min[z, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, \mathsf{max}\left(z, a\right) + \mathsf{fma}\left(\log y, x, \mathsf{min}\left(z, a\right)\right)\right) + t\right)
Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
(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 t))) a) (fmax z 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, t))) + a) + fmax(z, 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, t))) + a) + fmax(z, 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, t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision] + N[Max[z, t], $MachinePrecision]), $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, t\right)\right)\right) + a\right) + \mathsf{max}\left(z, t\right)\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 (+ (fmax (fmax z t) (fmax (fmin z t) a)) (+ (fmin (fmin z t) a) (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 fmax(fmax(z, t), fmax(fmin(z, t), a)) + (fmin(fmin(z, t), a) + fma(i, y, fma(x, log(y), (log(c) * (b - 0.5)))));
}
function code(x, y, z, t, a, b, c, i) return Float64(fmax(fmax(z, t), fmax(fmin(z, t), a)) + Float64(fmin(fmin(z, t), a) + 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[(N[Max[N[Max[z, t], $MachinePrecision], N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]], $MachinePrecision] + N[(N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision] + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\mathsf{max}\left(\mathsf{max}\left(z, t\right), \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\right) + \left(\mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right) + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\right)
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--.f6485.1
Applied rewrites85.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (- b 0.5) (log c) (+ a (+ t (+ z (* x (log y))))))))
(if (<= x -9e+169)
t_1
(if (<= x 6e+172) (fma (- b 0.5) (log c) (+ (fma i y (+ a z)) t)) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma((b - 0.5), log(c), (a + (t + (z + (x * log(y))))));
double tmp;
if (x <= -9e+169) {
tmp = t_1;
} else if (x <= 6e+172) {
tmp = fma((b - 0.5), log(c), (fma(i, y, (a + z)) + t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(Float64(b - 0.5), log(c), Float64(a + Float64(t + Float64(z + Float64(x * log(y)))))) tmp = 0.0 if (x <= -9e+169) tmp = t_1; elseif (x <= 6e+172) tmp = fma(Float64(b - 0.5), log(c), Float64(fma(i, y, Float64(a + z)) + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e+169], t$95$1, If[LessEqual[x, 6e+172], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(i * y + N[(a + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - 0.5, \log c, a + \left(t + \left(z + x \cdot \log y\right)\right)\right)\\
\mathbf{if}\;x \leq -9 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+172}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, a + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -8.9999999999999999e169 or 5.9999999999999998e172 < x Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6477.1
Applied rewrites77.1%
if -8.9999999999999999e169 < x < 5.9999999999999998e172Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (- b 0.5) (log c) (+ (fmax z a) (+ t (* x (log y)))))))
(if (<= x -9e+169)
t_1
(if (<= x 2.9e+241)
(fma (- b 0.5) (log c) (+ (fma i y (+ (fmax z a) (fmin z a))) t))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma((b - 0.5), log(c), (fmax(z, a) + (t + (x * log(y)))));
double tmp;
if (x <= -9e+169) {
tmp = t_1;
} else if (x <= 2.9e+241) {
tmp = fma((b - 0.5), log(c), (fma(i, y, (fmax(z, a) + fmin(z, a))) + t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(Float64(b - 0.5), log(c), Float64(fmax(z, a) + Float64(t + Float64(x * log(y))))) tmp = 0.0 if (x <= -9e+169) tmp = t_1; elseif (x <= 2.9e+241) tmp = fma(Float64(b - 0.5), log(c), Float64(fma(i, y, Float64(fmax(z, a) + fmin(z, a))) + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Max[z, a], $MachinePrecision] + N[(t + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e+169], t$95$1, If[LessEqual[x, 2.9e+241], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(i * y + N[(N[Max[z, a], $MachinePrecision] + N[Min[z, a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - 0.5, \log c, \mathsf{max}\left(z, a\right) + \left(t + x \cdot \log y\right)\right)\\
\mathbf{if}\;x \leq -9 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.9 \cdot 10^{+241}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, \mathsf{max}\left(z, a\right) + \mathsf{min}\left(z, a\right)\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -8.9999999999999999e169 or 2.9000000000000002e241 < x Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6477.1
Applied rewrites77.1%
Taylor expanded in z around 0
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6461.4
Applied rewrites61.4%
if -8.9999999999999999e169 < x < 2.9000000000000002e241Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ t (+ z (fma x (log y) (* (log c) (- b 0.5)))))))
(if (<= x -9e+169)
t_1
(if (<= x 1.5e+243)
(fma (- b 0.5) (log c) (+ (fma i y (+ a z)) t))
t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = t + (z + fma(x, log(y), (log(c) * (b - 0.5))));
double tmp;
if (x <= -9e+169) {
tmp = t_1;
} else if (x <= 1.5e+243) {
tmp = fma((b - 0.5), log(c), (fma(i, y, (a + z)) + t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(t + Float64(z + fma(x, log(y), Float64(log(c) * Float64(b - 0.5))))) tmp = 0.0 if (x <= -9e+169) tmp = t_1; elseif (x <= 1.5e+243) tmp = fma(Float64(b - 0.5), log(c), Float64(fma(i, y, Float64(a + z)) + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e+169], t$95$1, If[LessEqual[x, 1.5e+243], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(i * y + N[(a + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := t + \left(z + \mathsf{fma}\left(x, \log y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{if}\;x \leq -9 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+243}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, a + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -8.9999999999999999e169 or 1.49999999999999992e243 < 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.7
Applied rewrites84.7%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-*.f64N/A
lower-log.f64N/A
lower--.f6462.3
Applied rewrites62.3%
if -8.9999999999999999e169 < x < 1.49999999999999992e243Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -9e+169)
t_1
(if (<= x 1.5e+243)
(fma (- b 0.5) (log c) (+ (fma i y (+ a z)) t))
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 <= -9e+169) {
tmp = t_1;
} else if (x <= 1.5e+243) {
tmp = fma((b - 0.5), log(c), (fma(i, y, (a + z)) + t));
} 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 <= -9e+169) tmp = t_1; elseif (x <= 1.5e+243) tmp = fma(Float64(b - 0.5), log(c), Float64(fma(i, y, Float64(a + z)) + t)); 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, -9e+169], t$95$1, If[LessEqual[x, 1.5e+243], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(i * y + N[(a + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -9 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+243}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, a + z\right) + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -8.9999999999999999e169 or 1.49999999999999992e243 < x Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
lower-fma.f6484.0
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6484.0
Applied rewrites84.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6416.8
Applied rewrites16.8%
if -8.9999999999999999e169 < x < 1.49999999999999992e243Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -9e+169)
t_1
(if (<= x 1.5e+243)
(+ (fma i y z) (+ a (fma (- b 0.5) (log c) t)))
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 <= -9e+169) {
tmp = t_1;
} else if (x <= 1.5e+243) {
tmp = fma(i, y, z) + (a + fma((b - 0.5), log(c), t));
} 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 <= -9e+169) tmp = t_1; elseif (x <= 1.5e+243) tmp = Float64(fma(i, y, z) + Float64(a + fma(Float64(b - 0.5), log(c), t))); 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, -9e+169], t$95$1, If[LessEqual[x, 1.5e+243], N[(N[(i * y + z), $MachinePrecision] + N[(a + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -9 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+243}:\\
\;\;\;\;\mathsf{fma}\left(i, y, z\right) + \left(a + \mathsf{fma}\left(b - 0.5, \log c, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -8.9999999999999999e169 or 1.49999999999999992e243 < x Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
lower-fma.f6484.0
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6484.0
Applied rewrites84.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6416.8
Applied rewrites16.8%
if -8.9999999999999999e169 < x < 1.49999999999999992e243Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
lower-fma.f6484.0
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6484.0
Applied rewrites84.0%
lift-+.f64N/A
+-commutativeN/A
lift-fma.f64N/A
lift-*.f64N/A
lift-+.f64N/A
associate-+r+N/A
associate-+l+N/A
lower-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f6484.0
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.0
Applied rewrites84.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (fmax t a) 2.15e+125) (+ (fmin t a) (+ z (fma i y (* (log c) (- b 0.5))))) (+ (fma -0.5 (log c) (fma i y (+ (fmax t a) z))) (fmin t a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (fmax(t, a) <= 2.15e+125) {
tmp = fmin(t, a) + (z + fma(i, y, (log(c) * (b - 0.5))));
} else {
tmp = fma(-0.5, log(c), fma(i, y, (fmax(t, a) + z))) + fmin(t, a);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (fmax(t, a) <= 2.15e+125) tmp = Float64(fmin(t, a) + Float64(z + fma(i, y, Float64(log(c) * Float64(b - 0.5))))); else tmp = Float64(fma(-0.5, log(c), fma(i, y, Float64(fmax(t, a) + z))) + fmin(t, a)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[Max[t, a], $MachinePrecision], 2.15e+125], N[(N[Min[t, a], $MachinePrecision] + N[(z + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(i * y + N[(N[Max[t, a], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[Min[t, a], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;\mathsf{max}\left(t, a\right) \leq 2.15 \cdot 10^{+125}:\\
\;\;\;\;\mathsf{min}\left(t, a\right) + \left(z + \mathsf{fma}\left(i, y, \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(i, y, \mathsf{max}\left(t, a\right) + z\right)\right) + \mathsf{min}\left(t, a\right)\\
\end{array}
if a < 2.15000000000000018e125Initial 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.7
Applied rewrites84.7%
Taylor expanded in x around 0
lower-*.f64N/A
lower-log.f64N/A
lower--.f6469.2
Applied rewrites69.2%
if 2.15000000000000018e125 < a Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
Taylor expanded in b around 0
Applied rewrites68.7%
lift-fma.f64N/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lower-fma.f6468.7
Applied rewrites68.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (- b 0.5) (log c) (+ a (+ t z))))
(t_2 (* (- b 0.5) (log c))))
(if (<= t_2 -1e+71)
t_1
(if (<= t_2 5e+227) (+ (fma -0.5 (log c) (fma i y (+ a z))) t) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma((b - 0.5), log(c), (a + (t + z)));
double t_2 = (b - 0.5) * log(c);
double tmp;
if (t_2 <= -1e+71) {
tmp = t_1;
} else if (t_2 <= 5e+227) {
tmp = fma(-0.5, log(c), fma(i, y, (a + z))) + t;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(Float64(b - 0.5), log(c), Float64(a + Float64(t + z))) t_2 = Float64(Float64(b - 0.5) * log(c)) tmp = 0.0 if (t_2 <= -1e+71) tmp = t_1; elseif (t_2 <= 5e+227) tmp = Float64(fma(-0.5, log(c), fma(i, y, Float64(a + z))) + t); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+71], t$95$1, If[LessEqual[t$95$2, 5e+227], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(i * y + N[(a + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - 0.5, \log c, a + \left(t + z\right)\right)\\
t_2 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+227}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(i, y, a + z\right)\right) + t\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1e71 or 4.9999999999999996e227 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6477.1
Applied rewrites77.1%
Taylor expanded in x around 0
lower-+.f6461.5
Applied rewrites61.5%
if -1e71 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.9999999999999996e227Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
Taylor expanded in b around 0
Applied rewrites68.7%
lift-fma.f64N/A
lift-+.f64N/A
associate-+r+N/A
lower-+.f64N/A
lower-fma.f6468.7
Applied rewrites68.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* 1.0 (* y i)))
(t_2
(+
(+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c)))
(* y i))))
(if (<= t_2 (- INFINITY))
t_1
(if (<= t_2 2e+306) (fma (- b 0.5) (log c) (+ a (+ t z))) 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 * (y * i);
double t_2 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 2e+306) {
tmp = fma((b - 0.5), log(c), (a + (t + z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(1.0 * Float64(y * i)) t_2 = Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 2e+306) tmp = fma(Float64(b - 0.5), log(c), Float64(a + Float64(t + z))); 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[(y * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 2e+306], N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := 1 \cdot \left(y \cdot i\right)\\
t_2 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+306}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, a + \left(t + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -inf.0 or 2.00000000000000003e306 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.8%
Taylor expanded in t around inf
Applied rewrites37.7%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sum-to-multN/A
lower-unsound-*.f64N/A
lower-unsound-+.f64N/A
lower-unsound-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6431.7
Applied rewrites31.7%
Taylor expanded in y around inf
Applied rewrites24.2%
if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 2.00000000000000003e306Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in y around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-log.f6477.1
Applied rewrites77.1%
Taylor expanded in x around 0
lower-+.f6461.5
Applied rewrites61.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fmin (fmin z t) a))
(t_2 (fmax (fmin z t) a))
(t_3 (fmin (fmax z t) t_2))
(t_4 (fmax (fmax z t) t_2)))
(if (<=
(+
(+ (+ (+ (+ (* x (log y)) t_1) t_3) t_4) (* (- b 0.5) (log c)))
(* y i))
-1e+36)
(fma (/ t_1 t_3) t_3 (* y i))
(fma (/ t_4 t_3) t_3 (* y i)))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fmin(fmin(z, t), a);
double t_2 = fmax(fmin(z, t), a);
double t_3 = fmin(fmax(z, t), t_2);
double t_4 = fmax(fmax(z, t), t_2);
double tmp;
if (((((((x * log(y)) + t_1) + t_3) + t_4) + ((b - 0.5) * log(c))) + (y * i)) <= -1e+36) {
tmp = fma((t_1 / t_3), t_3, (y * i));
} else {
tmp = fma((t_4 / t_3), t_3, (y * i));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fmin(fmin(z, t), a) t_2 = fmax(fmin(z, t), a) t_3 = fmin(fmax(z, t), t_2) t_4 = fmax(fmax(z, t), t_2) tmp = 0.0 if (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)) <= -1e+36) tmp = fma(Float64(t_1 / t_3), t_3, Float64(y * i)); else tmp = fma(Float64(t_4 / t_3), t_3, Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Min[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Min[z, t], $MachinePrecision], a], $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[z, t], $MachinePrecision], t$95$2], $MachinePrecision]}, If[LessEqual[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], -1e+36], N[(N[(t$95$1 / t$95$3), $MachinePrecision] * t$95$3 + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$4 / t$95$3), $MachinePrecision] * t$95$3 + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_1 := \mathsf{min}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_2 := \mathsf{max}\left(\mathsf{min}\left(z, t\right), a\right)\\
t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
t_4 := \mathsf{max}\left(\mathsf{max}\left(z, t\right), t\_2\right)\\
\mathbf{if}\;\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 \leq -1 \cdot 10^{+36}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_1}{t\_3}, t\_3, y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t\_4}{t\_3}, t\_3, y \cdot i\right)\\
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.00000000000000004e36Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.8%
Taylor expanded in t around inf
Applied rewrites37.7%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6437.7
Applied rewrites37.7%
Taylor expanded in z around inf
lower-/.f6432.1
Applied rewrites32.1%
if -1.00000000000000004e36 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.8%
Taylor expanded in t around inf
Applied rewrites37.7%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6437.7
Applied rewrites37.7%
Taylor expanded in a around inf
lower-/.f6432.2
Applied rewrites32.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (log c)))
(t_2 (* (- b 0.5) (log c)))
(t_3 (fmin (fmax z t) a)))
(if (<= t_2 -1e+71)
t_1
(if (<= t_2 5e+227) (fma (/ (fmax (fmax z t) a) t_3) t_3 (* y i)) t_1))))double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = b * log(c);
double t_2 = (b - 0.5) * log(c);
double t_3 = fmin(fmax(z, t), a);
double tmp;
if (t_2 <= -1e+71) {
tmp = t_1;
} else if (t_2 <= 5e+227) {
tmp = fma((fmax(fmax(z, t), a) / t_3), t_3, (y * i));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(b * log(c)) t_2 = Float64(Float64(b - 0.5) * log(c)) t_3 = fmin(fmax(z, t), a) tmp = 0.0 if (t_2 <= -1e+71) tmp = t_1; elseif (t_2 <= 5e+227) tmp = fma(Float64(fmax(fmax(z, t), a) / t_3), t_3, 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[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Min[N[Max[z, t], $MachinePrecision], a], $MachinePrecision]}, If[LessEqual[t$95$2, -1e+71], t$95$1, If[LessEqual[t$95$2, 5e+227], N[(N[(N[Max[N[Max[z, t], $MachinePrecision], a], $MachinePrecision] / t$95$3), $MachinePrecision] * t$95$3 + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := b \cdot \log c\\
t_2 := \left(b - 0.5\right) \cdot \log c\\
t_3 := \mathsf{min}\left(\mathsf{max}\left(z, t\right), a\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+71}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+227}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\mathsf{max}\left(\mathsf{max}\left(z, t\right), a\right)}{t\_3}, t\_3, y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1e71 or 4.9999999999999996e227 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6416.6
Applied rewrites16.6%
if -1e71 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.9999999999999996e227Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.8%
Taylor expanded in t around inf
Applied rewrites37.7%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6437.7
Applied rewrites37.7%
Taylor expanded in a around inf
lower-/.f6432.2
Applied rewrites32.2%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (fma 1.0 t (* y i)))) (if (<= i -1.15e+20) t_1 (if (<= i 7.2e-46) (* b (log c)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(1.0, t, (y * i));
double tmp;
if (i <= -1.15e+20) {
tmp = t_1;
} else if (i <= 7.2e-46) {
tmp = b * log(c);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(1.0, t, Float64(y * i)) tmp = 0.0 if (i <= -1.15e+20) tmp = t_1; elseif (i <= 7.2e-46) tmp = Float64(b * log(c)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(1.0 * t + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.15e+20], t$95$1, If[LessEqual[i, 7.2e-46], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(1, t, y \cdot i\right)\\
\mathbf{if}\;i \leq -1.15 \cdot 10^{+20}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;i \leq 7.2 \cdot 10^{-46}:\\
\;\;\;\;b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if i < -1.15e20 or 7.2e-46 < i Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.8%
Taylor expanded in t around inf
Applied rewrites37.7%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6437.7
Applied rewrites37.7%
if -1.15e20 < i < 7.2e-46Initial program 99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6416.6
Applied rewrites16.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -9e+169)
t_1
(if (<= x 1.5e+243) (fma 1.0 (fmin t 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 = x * log(y);
double tmp;
if (x <= -9e+169) {
tmp = t_1;
} else if (x <= 1.5e+243) {
tmp = fma(1.0, fmin(t, a), (y * i));
} 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 <= -9e+169) tmp = t_1; elseif (x <= 1.5e+243) tmp = fma(1.0, fmin(t, 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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -9e+169], t$95$1, If[LessEqual[x, 1.5e+243], N[(1.0 * N[Min[t, a], $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -9 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+243}:\\
\;\;\;\;\mathsf{fma}\left(1, \mathsf{min}\left(t, a\right), y \cdot i\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if x < -8.9999999999999999e169 or 1.49999999999999992e243 < x Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
lift-*.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift-+.f64N/A
+-commutativeN/A
lift-+.f64N/A
associate-+r+N/A
associate-+r+N/A
lower-+.f64N/A
Applied rewrites99.8%
Taylor expanded in x around 0
Applied rewrites84.0%
lift-fma.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-+.f64N/A
+-commutativeN/A
associate-+r+N/A
lower-+.f64N/A
lift-*.f64N/A
lower-fma.f6484.0
lift-fma.f64N/A
*-commutativeN/A
lower-fma.f6484.0
lift-+.f64N/A
+-commutativeN/A
lower-+.f6484.0
Applied rewrites84.0%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6416.8
Applied rewrites16.8%
if -8.9999999999999999e169 < x < 1.49999999999999992e243Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.8%
Taylor expanded in t around inf
Applied rewrites37.7%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6437.7
Applied rewrites37.7%
(FPCore (x y z t a b c i) :precision binary64 (fma 1.0 (fmin t a) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(1.0, fmin(t, a), (y * i));
}
function code(x, y, z, t, a, b, c, i) return fma(1.0, fmin(t, a), Float64(y * i)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(1.0 * N[Min[t, a], $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\mathsf{fma}\left(1, \mathsf{min}\left(t, a\right), y \cdot i\right)
Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.8%
Taylor expanded in t around inf
Applied rewrites37.7%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lift-*.f6437.7
Applied rewrites37.7%
(FPCore (x y z t a b c i) :precision binary64 (* 1.0 (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 1.0 * (y * i);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, a, b, c, i)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = 1.0d0 * (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 1.0 * (y * i);
}
def code(x, y, z, t, a, b, c, i): return 1.0 * (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(1.0 * Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = 1.0 * (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(1.0 * N[(y * i), $MachinePrecision]), $MachinePrecision]
1 \cdot \left(y \cdot i\right)
Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
+-commutativeN/A
associate-+l+N/A
sum-to-multN/A
lower-unsound-*.f64N/A
Applied rewrites73.8%
Taylor expanded in t around inf
Applied rewrites37.7%
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
+-commutativeN/A
sum-to-multN/A
lower-unsound-*.f64N/A
lower-unsound-+.f64N/A
lower-unsound-/.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f6431.7
Applied rewrites31.7%
Taylor expanded in y around inf
Applied rewrites24.2%
herbie shell --seed 2025172
(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)))