
(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 9 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 (+ a (+ t (+ z (fma -0.5 (log c) (fma b (log c) (fma i y (* x (log y)))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + (t + (z + fma(-0.5, log(c), fma(b, log(c), fma(i, y, (x * log(y)))))));
}
function code(x, y, z, t, a, b, c, i) return Float64(a + Float64(t + Float64(z + fma(-0.5, log(c), fma(b, log(c), fma(i, y, Float64(x * log(y)))))))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(t + N[(z + N[(-0.5 * N[Log[c], $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision] + N[(i * y + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \left(t + \left(z + \mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(b, \log c, \mathsf{fma}\left(i, y, x \cdot \log y\right)\right)\right)\right)\right)
\end{array}
Initial program 99.8%
Taylor expanded in i around -inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites34.2%
Taylor expanded in b around 0
lower-+.f64N/A
lower-+.f64N/A
lower-+.f64N/A
lower-fma.f64N/A
lift-log.f64N/A
lower-fma.f64N/A
lift-log.f64N/A
lower-fma.f64N/A
lower-*.f64N/A
lift-log.f6499.8
Applied rewrites99.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(*
(+
(+
(+ (/ (+ t z) x) (fma (log c) (/ (- b 0.5) x) (/ (* i y) x)))
(/ a x))
(log y))
x)))
(if (<= x -6.4e-86)
t_1
(if (<= x 1.15e-39)
(*
(+
(+ y (/ a i))
(+
(+ (fma (log c) (/ (- b 0.5) i) (/ (* (log y) x) i)) (/ z i))
(/ t i)))
i)
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) / x) + fma(log(c), ((b - 0.5) / x), ((i * y) / x))) + (a / x)) + log(y)) * x;
double tmp;
if (x <= -6.4e-86) {
tmp = t_1;
} else if (x <= 1.15e-39) {
tmp = ((y + (a / i)) + ((fma(log(c), ((b - 0.5) / i), ((log(y) * x) / i)) + (z / i)) + (t / i))) * i;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(Float64(Float64(Float64(Float64(t + z) / x) + fma(log(c), Float64(Float64(b - 0.5) / x), Float64(Float64(i * y) / x))) + Float64(a / x)) + log(y)) * x) tmp = 0.0 if (x <= -6.4e-86) tmp = t_1; elseif (x <= 1.15e-39) tmp = Float64(Float64(Float64(y + Float64(a / i)) + Float64(Float64(fma(log(c), Float64(Float64(b - 0.5) / i), Float64(Float64(log(y) * x) / i)) + Float64(z / i)) + Float64(t / i))) * i); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(t + z), $MachinePrecision] / x), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(N[(b - 0.5), $MachinePrecision] / x), $MachinePrecision] + N[(N[(i * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / x), $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -6.4e-86], t$95$1, If[LessEqual[x, 1.15e-39], N[(N[(N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(N[(b - 0.5), $MachinePrecision] / i), $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision] + N[(z / i), $MachinePrecision]), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(\frac{t + z}{x} + \mathsf{fma}\left(\log c, \frac{b - 0.5}{x}, \frac{i \cdot y}{x}\right)\right) + \frac{a}{x}\right) + \log y\right) \cdot x\\
\mathbf{if}\;x \leq -6.4 \cdot 10^{-86}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.15 \cdot 10^{-39}:\\
\;\;\;\;\left(\left(y + \frac{a}{i}\right) + \left(\left(\mathsf{fma}\left(\log c, \frac{b - 0.5}{i}, \frac{\log y \cdot x}{i}\right) + \frac{z}{i}\right) + \frac{t}{i}\right)\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -6.40000000000000011e-86 or 1.15000000000000004e-39 < x Initial program 99.7%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites96.8%
if -6.40000000000000011e-86 < x < 1.15000000000000004e-39Initial program 99.9%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites70.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (/ (log c) x))
(t_2
(*
(+
(+ y (/ a i))
(+
(+ (fma (log c) (/ (- b 0.5) i) (/ (* (log y) x) i)) (/ z i))
(/ t i)))
i)))
(if (<= i -4.6e-32)
t_2
(if (<= i 1.08e-32)
(*
(+
(+
(+
(/ (+ t z) x)
(*
-1.0
(* b (fma -1.0 t_1 (* -1.0 (/ (fma -0.5 t_1 (/ (* i y) x)) b))))))
(/ a x))
(log y))
x)
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(c) / x;
double t_2 = ((y + (a / i)) + ((fma(log(c), ((b - 0.5) / i), ((log(y) * x) / i)) + (z / i)) + (t / i))) * i;
double tmp;
if (i <= -4.6e-32) {
tmp = t_2;
} else if (i <= 1.08e-32) {
tmp = (((((t + z) / x) + (-1.0 * (b * fma(-1.0, t_1, (-1.0 * (fma(-0.5, t_1, ((i * y) / x)) / b)))))) + (a / x)) + log(y)) * x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(c) / x) t_2 = Float64(Float64(Float64(y + Float64(a / i)) + Float64(Float64(fma(log(c), Float64(Float64(b - 0.5) / i), Float64(Float64(log(y) * x) / i)) + Float64(z / i)) + Float64(t / i))) * i) tmp = 0.0 if (i <= -4.6e-32) tmp = t_2; elseif (i <= 1.08e-32) tmp = Float64(Float64(Float64(Float64(Float64(Float64(t + z) / x) + Float64(-1.0 * Float64(b * fma(-1.0, t_1, Float64(-1.0 * Float64(fma(-0.5, t_1, Float64(Float64(i * y) / x)) / b)))))) + Float64(a / x)) + log(y)) * x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] / x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(N[(b - 0.5), $MachinePrecision] / i), $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision] + N[(z / i), $MachinePrecision]), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -4.6e-32], t$95$2, If[LessEqual[i, 1.08e-32], N[(N[(N[(N[(N[(N[(t + z), $MachinePrecision] / x), $MachinePrecision] + N[(-1.0 * N[(b * N[(-1.0 * t$95$1 + N[(-1.0 * N[(N[(-0.5 * t$95$1 + N[(N[(i * y), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / x), $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\log c}{x}\\
t_2 := \left(\left(y + \frac{a}{i}\right) + \left(\left(\mathsf{fma}\left(\log c, \frac{b - 0.5}{i}, \frac{\log y \cdot x}{i}\right) + \frac{z}{i}\right) + \frac{t}{i}\right)\right) \cdot i\\
\mathbf{if}\;i \leq -4.6 \cdot 10^{-32}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq 1.08 \cdot 10^{-32}:\\
\;\;\;\;\left(\left(\left(\frac{t + z}{x} + -1 \cdot \left(b \cdot \mathsf{fma}\left(-1, t\_1, -1 \cdot \frac{\mathsf{fma}\left(-0.5, t\_1, \frac{i \cdot y}{x}\right)}{b}\right)\right)\right) + \frac{a}{x}\right) + \log y\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if i < -4.6000000000000001e-32 or 1.08e-32 < i Initial program 99.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites98.7%
if -4.6000000000000001e-32 < i < 1.08e-32Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites70.8%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites66.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5)))
(t_2 (+ (/ a x) (+ (/ t x) (+ (/ z x) (/ t_1 x)))))
(t_3 (fabs (log y)))
(t_4
(*
(+
(+ y (/ a i))
(+
(+ (fma (log c) (/ (- b 0.5) i) (/ (* (log y) x) i)) (/ z i))
(/ t i)))
i)))
(if (<= i -2.45e-119)
t_4
(if (<= i -4.5e-205)
(*
(+
(+
(*
z
(+
(pow x -1.0)
(+
(/ t (* x z))
(/ (fma (* i y) (* x z) (* (* x z) t_1)) (* (* x z) (* x z))))))
(/ a x))
(log y))
x)
(if (<= i 4.5e-74)
(*
(/
(fma (pow (log y) 2.0) (log y) (pow t_2 3.0))
(- (fma t_3 t_3 (* t_2 t_2)) (* (log y) t_2)))
x)
t_4)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(c) * (b - 0.5);
double t_2 = (a / x) + ((t / x) + ((z / x) + (t_1 / x)));
double t_3 = fabs(log(y));
double t_4 = ((y + (a / i)) + ((fma(log(c), ((b - 0.5) / i), ((log(y) * x) / i)) + (z / i)) + (t / i))) * i;
double tmp;
if (i <= -2.45e-119) {
tmp = t_4;
} else if (i <= -4.5e-205) {
tmp = (((z * (pow(x, -1.0) + ((t / (x * z)) + (fma((i * y), (x * z), ((x * z) * t_1)) / ((x * z) * (x * z)))))) + (a / x)) + log(y)) * x;
} else if (i <= 4.5e-74) {
tmp = (fma(pow(log(y), 2.0), log(y), pow(t_2, 3.0)) / (fma(t_3, t_3, (t_2 * t_2)) - (log(y) * t_2))) * x;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(c) * Float64(b - 0.5)) t_2 = Float64(Float64(a / x) + Float64(Float64(t / x) + Float64(Float64(z / x) + Float64(t_1 / x)))) t_3 = abs(log(y)) t_4 = Float64(Float64(Float64(y + Float64(a / i)) + Float64(Float64(fma(log(c), Float64(Float64(b - 0.5) / i), Float64(Float64(log(y) * x) / i)) + Float64(z / i)) + Float64(t / i))) * i) tmp = 0.0 if (i <= -2.45e-119) tmp = t_4; elseif (i <= -4.5e-205) tmp = Float64(Float64(Float64(Float64(z * Float64((x ^ -1.0) + Float64(Float64(t / Float64(x * z)) + Float64(fma(Float64(i * y), Float64(x * z), Float64(Float64(x * z) * t_1)) / Float64(Float64(x * z) * Float64(x * z)))))) + Float64(a / x)) + log(y)) * x); elseif (i <= 4.5e-74) tmp = Float64(Float64(fma((log(y) ^ 2.0), log(y), (t_2 ^ 3.0)) / Float64(fma(t_3, t_3, Float64(t_2 * t_2)) - Float64(log(y) * t_2))) * x); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a / x), $MachinePrecision] + N[(N[(t / x), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] + N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Abs[N[Log[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[(N[(N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(N[(b - 0.5), $MachinePrecision] / i), $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision] + N[(z / i), $MachinePrecision]), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, If[LessEqual[i, -2.45e-119], t$95$4, If[LessEqual[i, -4.5e-205], N[(N[(N[(N[(z * N[(N[Power[x, -1.0], $MachinePrecision] + N[(N[(t / N[(x * z), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(i * y), $MachinePrecision] * N[(x * z), $MachinePrecision] + N[(N[(x * z), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(N[(x * z), $MachinePrecision] * N[(x * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a / x), $MachinePrecision]), $MachinePrecision] + N[Log[y], $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[i, 4.5e-74], N[(N[(N[(N[Power[N[Log[y], $MachinePrecision], 2.0], $MachinePrecision] * N[Log[y], $MachinePrecision] + N[Power[t$95$2, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$3 * t$95$3 + N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$4]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := \frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{t\_1}{x}\right)\right)\\
t_3 := \left|\log y\right|\\
t_4 := \left(\left(y + \frac{a}{i}\right) + \left(\left(\mathsf{fma}\left(\log c, \frac{b - 0.5}{i}, \frac{\log y \cdot x}{i}\right) + \frac{z}{i}\right) + \frac{t}{i}\right)\right) \cdot i\\
\mathbf{if}\;i \leq -2.45 \cdot 10^{-119}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;i \leq -4.5 \cdot 10^{-205}:\\
\;\;\;\;\left(\left(z \cdot \left({x}^{-1} + \left(\frac{t}{x \cdot z} + \frac{\mathsf{fma}\left(i \cdot y, x \cdot z, \left(x \cdot z\right) \cdot t\_1\right)}{\left(x \cdot z\right) \cdot \left(x \cdot z\right)}\right)\right) + \frac{a}{x}\right) + \log y\right) \cdot x\\
\mathbf{elif}\;i \leq 4.5 \cdot 10^{-74}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\log y}^{2}, \log y, {t\_2}^{3}\right)}{\mathsf{fma}\left(t\_3, t\_3, t\_2 \cdot t\_2\right) - \log y \cdot t\_2} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if i < -2.45e-119 or 4.4999999999999999e-74 < i Initial program 99.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.7%
if -2.45e-119 < i < -4.49999999999999956e-205Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.2%
Taylor expanded in b around -inf
lower-*.f64N/A
lower-*.f64N/A
lower-fma.f64N/A
lower-/.f64N/A
lift-log.f64N/A
lower-*.f64N/A
lower-/.f64N/A
Applied rewrites66.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower-+.f64N/A
inv-powN/A
lower-pow.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower-*.f64N/A
frac-addN/A
lower-/.f64N/A
Applied rewrites36.4%
if -4.49999999999999956e-205 < i < 4.4999999999999999e-74Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.1%
Applied rewrites35.9%
Taylor expanded in y around 0
Applied rewrites35.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fabs (log y)))
(t_2
(*
(+
(+ y (/ a i))
(+
(+ (fma (log c) (/ (- b 0.5) i) (/ (* (log y) x) i)) (/ z i))
(/ t i)))
i))
(t_3 (+ (/ a x) (+ (/ t x) (+ (/ z x) (/ (* (log c) (- b 0.5)) x))))))
(if (<= i -1.7e-167)
t_2
(if (<= i 4.5e-74)
(*
(/
(fma (pow (log y) 2.0) (log y) (pow t_3 3.0))
(- (fma t_1 t_1 (* t_3 t_3)) (* (log y) t_3)))
x)
t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fabs(log(y));
double t_2 = ((y + (a / i)) + ((fma(log(c), ((b - 0.5) / i), ((log(y) * x) / i)) + (z / i)) + (t / i))) * i;
double t_3 = (a / x) + ((t / x) + ((z / x) + ((log(c) * (b - 0.5)) / x)));
double tmp;
if (i <= -1.7e-167) {
tmp = t_2;
} else if (i <= 4.5e-74) {
tmp = (fma(pow(log(y), 2.0), log(y), pow(t_3, 3.0)) / (fma(t_1, t_1, (t_3 * t_3)) - (log(y) * t_3))) * x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = abs(log(y)) t_2 = Float64(Float64(Float64(y + Float64(a / i)) + Float64(Float64(fma(log(c), Float64(Float64(b - 0.5) / i), Float64(Float64(log(y) * x) / i)) + Float64(z / i)) + Float64(t / i))) * i) t_3 = Float64(Float64(a / x) + Float64(Float64(t / x) + Float64(Float64(z / x) + Float64(Float64(log(c) * Float64(b - 0.5)) / x)))) tmp = 0.0 if (i <= -1.7e-167) tmp = t_2; elseif (i <= 4.5e-74) tmp = Float64(Float64(fma((log(y) ^ 2.0), log(y), (t_3 ^ 3.0)) / Float64(fma(t_1, t_1, Float64(t_3 * t_3)) - Float64(log(y) * t_3))) * x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Abs[N[Log[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(N[(b - 0.5), $MachinePrecision] / i), $MachinePrecision] + N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision] + N[(z / i), $MachinePrecision]), $MachinePrecision] + N[(t / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * i), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a / x), $MachinePrecision] + N[(N[(t / x), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.7e-167], t$95$2, If[LessEqual[i, 4.5e-74], N[(N[(N[(N[Power[N[Log[y], $MachinePrecision], 2.0], $MachinePrecision] * N[Log[y], $MachinePrecision] + N[Power[t$95$3, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$1 * t$95$1 + N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\log y\right|\\
t_2 := \left(\left(y + \frac{a}{i}\right) + \left(\left(\mathsf{fma}\left(\log c, \frac{b - 0.5}{i}, \frac{\log y \cdot x}{i}\right) + \frac{z}{i}\right) + \frac{t}{i}\right)\right) \cdot i\\
t_3 := \frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\\
\mathbf{if}\;i \leq -1.7 \cdot 10^{-167}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq 4.5 \cdot 10^{-74}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\log y}^{2}, \log y, {t\_3}^{3}\right)}{\mathsf{fma}\left(t\_1, t\_1, t\_3 \cdot t\_3\right) - \log y \cdot t\_3} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if i < -1.6999999999999999e-167 or 4.4999999999999999e-74 < i Initial program 99.7%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites89.2%
if -1.6999999999999999e-167 < i < 4.4999999999999999e-74Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.4%
Applied rewrites36.1%
Taylor expanded in y around 0
Applied rewrites35.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fabs (log y)))
(t_2
(*
(* -1.0 i)
(fma
(/
(fma
(- a)
i
(* (* -1.0 i) (+ (+ t z) (fma (log c) (- b 0.5) (* (log y) x)))))
(* (* -1.0 i) i))
-1.0
(* -1.0 y))))
(t_3 (* (log c) (- b 0.5)))
(t_4
(*
(* -1.0 i)
(fma
(*
x
(fma
-1.0
(/ (fma -1.0 (/ a i) (* -1.0 (/ (+ t (+ z t_3)) i))) x)
(/ (log y) i)))
-1.0
(* -1.0 y))))
(t_5 (+ (/ a x) (+ (/ t x) (+ (/ z x) (/ t_3 x))))))
(if (<= i -500000.0)
t_4
(if (<= i -1.05e-149)
t_2
(if (<= i 4.5e-74)
(*
(/
(fma (pow (log y) 2.0) (log y) (pow t_5 3.0))
(- (fma t_1 t_1 (* t_5 t_5)) (* (log y) t_5)))
x)
(if (<= i 8.5e+47) t_2 t_4))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fabs(log(y));
double t_2 = (-1.0 * i) * fma((fma(-a, i, ((-1.0 * i) * ((t + z) + fma(log(c), (b - 0.5), (log(y) * x))))) / ((-1.0 * i) * i)), -1.0, (-1.0 * y));
double t_3 = log(c) * (b - 0.5);
double t_4 = (-1.0 * i) * fma((x * fma(-1.0, (fma(-1.0, (a / i), (-1.0 * ((t + (z + t_3)) / i))) / x), (log(y) / i))), -1.0, (-1.0 * y));
double t_5 = (a / x) + ((t / x) + ((z / x) + (t_3 / x)));
double tmp;
if (i <= -500000.0) {
tmp = t_4;
} else if (i <= -1.05e-149) {
tmp = t_2;
} else if (i <= 4.5e-74) {
tmp = (fma(pow(log(y), 2.0), log(y), pow(t_5, 3.0)) / (fma(t_1, t_1, (t_5 * t_5)) - (log(y) * t_5))) * x;
} else if (i <= 8.5e+47) {
tmp = t_2;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = abs(log(y)) t_2 = Float64(Float64(-1.0 * i) * fma(Float64(fma(Float64(-a), i, Float64(Float64(-1.0 * i) * Float64(Float64(t + z) + fma(log(c), Float64(b - 0.5), Float64(log(y) * x))))) / Float64(Float64(-1.0 * i) * i)), -1.0, Float64(-1.0 * y))) t_3 = Float64(log(c) * Float64(b - 0.5)) t_4 = Float64(Float64(-1.0 * i) * fma(Float64(x * fma(-1.0, Float64(fma(-1.0, Float64(a / i), Float64(-1.0 * Float64(Float64(t + Float64(z + t_3)) / i))) / x), Float64(log(y) / i))), -1.0, Float64(-1.0 * y))) t_5 = Float64(Float64(a / x) + Float64(Float64(t / x) + Float64(Float64(z / x) + Float64(t_3 / x)))) tmp = 0.0 if (i <= -500000.0) tmp = t_4; elseif (i <= -1.05e-149) tmp = t_2; elseif (i <= 4.5e-74) tmp = Float64(Float64(fma((log(y) ^ 2.0), log(y), (t_5 ^ 3.0)) / Float64(fma(t_1, t_1, Float64(t_5 * t_5)) - Float64(log(y) * t_5))) * x); elseif (i <= 8.5e+47) tmp = t_2; else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Abs[N[Log[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(-1.0 * i), $MachinePrecision] * N[(N[(N[((-a) * i + N[(N[(-1.0 * i), $MachinePrecision] * N[(N[(t + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(N[(-1.0 * i), $MachinePrecision] * i), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(-1.0 * i), $MachinePrecision] * N[(N[(x * N[(-1.0 * N[(N[(-1.0 * N[(a / i), $MachinePrecision] + N[(-1.0 * N[(N[(t + N[(z + t$95$3), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$5 = N[(N[(a / x), $MachinePrecision] + N[(N[(t / x), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] + N[(t$95$3 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -500000.0], t$95$4, If[LessEqual[i, -1.05e-149], t$95$2, If[LessEqual[i, 4.5e-74], N[(N[(N[(N[Power[N[Log[y], $MachinePrecision], 2.0], $MachinePrecision] * N[Log[y], $MachinePrecision] + N[Power[t$95$5, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$1 * t$95$1 + N[(t$95$5 * t$95$5), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * t$95$5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[i, 8.5e+47], t$95$2, t$95$4]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\log y\right|\\
t_2 := \left(-1 \cdot i\right) \cdot \mathsf{fma}\left(\frac{\mathsf{fma}\left(-a, i, \left(-1 \cdot i\right) \cdot \left(\left(t + z\right) + \mathsf{fma}\left(\log c, b - 0.5, \log y \cdot x\right)\right)\right)}{\left(-1 \cdot i\right) \cdot i}, -1, -1 \cdot y\right)\\
t_3 := \log c \cdot \left(b - 0.5\right)\\
t_4 := \left(-1 \cdot i\right) \cdot \mathsf{fma}\left(x \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{a}{i}, -1 \cdot \frac{t + \left(z + t\_3\right)}{i}\right)}{x}, \frac{\log y}{i}\right), -1, -1 \cdot y\right)\\
t_5 := \frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{t\_3}{x}\right)\right)\\
\mathbf{if}\;i \leq -500000:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;i \leq -1.05 \cdot 10^{-149}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;i \leq 4.5 \cdot 10^{-74}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\log y}^{2}, \log y, {t\_5}^{3}\right)}{\mathsf{fma}\left(t\_1, t\_1, t\_5 \cdot t\_5\right) - \log y \cdot t\_5} \cdot x\\
\mathbf{elif}\;i \leq 8.5 \cdot 10^{+47}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if i < -5e5 or 8.5000000000000008e47 < i Initial program 99.7%
Taylor expanded in i around -inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites29.2%
Taylor expanded in x around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites91.2%
if -5e5 < i < -1.05000000000000005e-149 or 4.4999999999999999e-74 < i < 8.5000000000000008e47Initial program 99.8%
Taylor expanded in i around -inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites69.9%
if -1.05000000000000005e-149 < i < 4.4999999999999999e-74Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.5%
Applied rewrites36.2%
Taylor expanded in y around 0
Applied rewrites35.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fabs (log y)))
(t_2 (* (log c) (- b 0.5)))
(t_3 (+ (/ a x) (+ (/ t x) (+ (/ z x) (/ t_2 x)))))
(t_4
(*
(* -1.0 i)
(fma
(*
x
(fma
-1.0
(/ (fma -1.0 (/ a i) (* -1.0 (/ (+ t (+ z t_2)) i))) x)
(/ (log y) i)))
-1.0
(* -1.0 y)))))
(if (<= i -4.8e-51)
t_4
(if (<= i 5.8e-73)
(*
(/
(fma (pow (log y) 2.0) (log y) (pow t_3 3.0))
(- (fma t_1 t_1 (* t_3 t_3)) (* (log y) t_3)))
x)
t_4))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fabs(log(y));
double t_2 = log(c) * (b - 0.5);
double t_3 = (a / x) + ((t / x) + ((z / x) + (t_2 / x)));
double t_4 = (-1.0 * i) * fma((x * fma(-1.0, (fma(-1.0, (a / i), (-1.0 * ((t + (z + t_2)) / i))) / x), (log(y) / i))), -1.0, (-1.0 * y));
double tmp;
if (i <= -4.8e-51) {
tmp = t_4;
} else if (i <= 5.8e-73) {
tmp = (fma(pow(log(y), 2.0), log(y), pow(t_3, 3.0)) / (fma(t_1, t_1, (t_3 * t_3)) - (log(y) * t_3))) * x;
} else {
tmp = t_4;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = abs(log(y)) t_2 = Float64(log(c) * Float64(b - 0.5)) t_3 = Float64(Float64(a / x) + Float64(Float64(t / x) + Float64(Float64(z / x) + Float64(t_2 / x)))) t_4 = Float64(Float64(-1.0 * i) * fma(Float64(x * fma(-1.0, Float64(fma(-1.0, Float64(a / i), Float64(-1.0 * Float64(Float64(t + Float64(z + t_2)) / i))) / x), Float64(log(y) / i))), -1.0, Float64(-1.0 * y))) tmp = 0.0 if (i <= -4.8e-51) tmp = t_4; elseif (i <= 5.8e-73) tmp = Float64(Float64(fma((log(y) ^ 2.0), log(y), (t_3 ^ 3.0)) / Float64(fma(t_1, t_1, Float64(t_3 * t_3)) - Float64(log(y) * t_3))) * x); else tmp = t_4; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[Abs[N[Log[y], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a / x), $MachinePrecision] + N[(N[(t / x), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] + N[(t$95$2 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(-1.0 * i), $MachinePrecision] * N[(N[(x * N[(-1.0 * N[(N[(-1.0 * N[(a / i), $MachinePrecision] + N[(-1.0 * N[(N[(t + N[(z + t$95$2), $MachinePrecision]), $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -4.8e-51], t$95$4, If[LessEqual[i, 5.8e-73], N[(N[(N[(N[Power[N[Log[y], $MachinePrecision], 2.0], $MachinePrecision] * N[Log[y], $MachinePrecision] + N[Power[t$95$3, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$1 * t$95$1 + N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$4]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left|\log y\right|\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
t_3 := \frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{t\_2}{x}\right)\right)\\
t_4 := \left(-1 \cdot i\right) \cdot \mathsf{fma}\left(x \cdot \mathsf{fma}\left(-1, \frac{\mathsf{fma}\left(-1, \frac{a}{i}, -1 \cdot \frac{t + \left(z + t\_2\right)}{i}\right)}{x}, \frac{\log y}{i}\right), -1, -1 \cdot y\right)\\
\mathbf{if}\;i \leq -4.8 \cdot 10^{-51}:\\
\;\;\;\;t\_4\\
\mathbf{elif}\;i \leq 5.8 \cdot 10^{-73}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\log y}^{2}, \log y, {t\_3}^{3}\right)}{\mathsf{fma}\left(t\_1, t\_1, t\_3 \cdot t\_3\right) - \log y \cdot t\_3} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_4\\
\end{array}
\end{array}
if i < -4.8e-51 or 5.8e-73 < i Initial program 99.7%
Taylor expanded in i around -inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites41.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-fma.f64N/A
Applied rewrites84.2%
if -4.8e-51 < i < 5.8e-73Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.1%
Applied rewrites36.5%
Taylor expanded in y around 0
Applied rewrites35.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5)))
(t_2 (+ (/ a x) (+ (/ t x) (+ (/ z x) (/ t_1 x)))))
(t_3
(*
(* -1.0 i)
(fma
(*
-1.0
(*
z
(-
(fma
-1.0
(/ a (* i z))
(* -1.0 (+ (/ t (* i z)) (/ (fma x (log y) t_1) (* i z)))))
(pow i -1.0))))
-1.0
(* -1.0 y))))
(t_4 (fabs (log y))))
(if (<= i -4.4e-168)
t_3
(if (<= i 5e-74)
(*
(/
(fma (pow (log y) 2.0) (log y) (pow t_2 3.0))
(- (fma t_4 t_4 (* t_2 t_2)) (* (log y) t_2)))
x)
t_3))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(c) * (b - 0.5);
double t_2 = (a / x) + ((t / x) + ((z / x) + (t_1 / x)));
double t_3 = (-1.0 * i) * fma((-1.0 * (z * (fma(-1.0, (a / (i * z)), (-1.0 * ((t / (i * z)) + (fma(x, log(y), t_1) / (i * z))))) - pow(i, -1.0)))), -1.0, (-1.0 * y));
double t_4 = fabs(log(y));
double tmp;
if (i <= -4.4e-168) {
tmp = t_3;
} else if (i <= 5e-74) {
tmp = (fma(pow(log(y), 2.0), log(y), pow(t_2, 3.0)) / (fma(t_4, t_4, (t_2 * t_2)) - (log(y) * t_2))) * x;
} else {
tmp = t_3;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(c) * Float64(b - 0.5)) t_2 = Float64(Float64(a / x) + Float64(Float64(t / x) + Float64(Float64(z / x) + Float64(t_1 / x)))) t_3 = Float64(Float64(-1.0 * i) * fma(Float64(-1.0 * Float64(z * Float64(fma(-1.0, Float64(a / Float64(i * z)), Float64(-1.0 * Float64(Float64(t / Float64(i * z)) + Float64(fma(x, log(y), t_1) / Float64(i * z))))) - (i ^ -1.0)))), -1.0, Float64(-1.0 * y))) t_4 = abs(log(y)) tmp = 0.0 if (i <= -4.4e-168) tmp = t_3; elseif (i <= 5e-74) tmp = Float64(Float64(fma((log(y) ^ 2.0), log(y), (t_2 ^ 3.0)) / Float64(fma(t_4, t_4, Float64(t_2 * t_2)) - Float64(log(y) * t_2))) * x); else tmp = t_3; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(a / x), $MachinePrecision] + N[(N[(t / x), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] + N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(-1.0 * i), $MachinePrecision] * N[(N[(-1.0 * N[(z * N[(N[(-1.0 * N[(a / N[(i * z), $MachinePrecision]), $MachinePrecision] + N[(-1.0 * N[(N[(t / N[(i * z), $MachinePrecision]), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision] + t$95$1), $MachinePrecision] / N[(i * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[Power[i, -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * -1.0 + N[(-1.0 * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[Abs[N[Log[y], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[i, -4.4e-168], t$95$3, If[LessEqual[i, 5e-74], N[(N[(N[(N[Power[N[Log[y], $MachinePrecision], 2.0], $MachinePrecision] * N[Log[y], $MachinePrecision] + N[Power[t$95$2, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$4 * t$95$4 + N[(t$95$2 * t$95$2), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
t_2 := \frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{t\_1}{x}\right)\right)\\
t_3 := \left(-1 \cdot i\right) \cdot \mathsf{fma}\left(-1 \cdot \left(z \cdot \left(\mathsf{fma}\left(-1, \frac{a}{i \cdot z}, -1 \cdot \left(\frac{t}{i \cdot z} + \frac{\mathsf{fma}\left(x, \log y, t\_1\right)}{i \cdot z}\right)\right) - {i}^{-1}\right)\right), -1, -1 \cdot y\right)\\
t_4 := \left|\log y\right|\\
\mathbf{if}\;i \leq -4.4 \cdot 10^{-168}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;i \leq 5 \cdot 10^{-74}:\\
\;\;\;\;\frac{\mathsf{fma}\left({\log y}^{2}, \log y, {t\_2}^{3}\right)}{\mathsf{fma}\left(t\_4, t\_4, t\_2 \cdot t\_2\right) - \log y \cdot t\_2} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if i < -4.3999999999999996e-168 or 4.99999999999999998e-74 < i Initial program 99.7%
Taylor expanded in i around -inf
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites41.9%
Taylor expanded in z around -inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f64N/A
Applied rewrites71.6%
if -4.3999999999999996e-168 < i < 4.99999999999999998e-74Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.4%
Applied rewrites36.2%
Taylor expanded in y around 0
Applied rewrites35.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (/ a x) (+ (/ t x) (+ (/ z x) (/ (* (log c) (- b 0.5)) x)))))
(t_2 (fabs (log y))))
(*
(/
(fma (pow (log y) 2.0) (log y) (pow t_1 3.0))
(- (fma t_2 t_2 (* t_1 t_1)) (* (log y) t_1)))
x)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a / x) + ((t / x) + ((z / x) + ((log(c) * (b - 0.5)) / x)));
double t_2 = fabs(log(y));
return (fma(pow(log(y), 2.0), log(y), pow(t_1, 3.0)) / (fma(t_2, t_2, (t_1 * t_1)) - (log(y) * t_1))) * x;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a / x) + Float64(Float64(t / x) + Float64(Float64(z / x) + Float64(Float64(log(c) * Float64(b - 0.5)) / x)))) t_2 = abs(log(y)) return Float64(Float64(fma((log(y) ^ 2.0), log(y), (t_1 ^ 3.0)) / Float64(fma(t_2, t_2, Float64(t_1 * t_1)) - Float64(log(y) * t_1))) * x) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a / x), $MachinePrecision] + N[(N[(t / x), $MachinePrecision] + N[(N[(z / x), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Abs[N[Log[y], $MachinePrecision]], $MachinePrecision]}, N[(N[(N[(N[Power[N[Log[y], $MachinePrecision], 2.0], $MachinePrecision] * N[Log[y], $MachinePrecision] + N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(t$95$2 * t$95$2 + N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] - N[(N[Log[y], $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{a}{x} + \left(\frac{t}{x} + \left(\frac{z}{x} + \frac{\log c \cdot \left(b - 0.5\right)}{x}\right)\right)\\
t_2 := \left|\log y\right|\\
\frac{\mathsf{fma}\left({\log y}^{2}, \log y, {t\_1}^{3}\right)}{\mathsf{fma}\left(t\_2, t\_2, t\_1 \cdot t\_1\right) - \log y \cdot t\_1} \cdot x
\end{array}
\end{array}
Initial program 99.8%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites70.4%
Applied rewrites29.8%
Taylor expanded in y around 0
Applied rewrites28.4%
herbie shell --seed 2025093
(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)))