
(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);
}
real(8) function code(x, y, z, t, a, b, c, i)
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}
Sampling outcomes in binary64 precision:
Herbie found 18 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);
}
real(8) function code(x, y, z, t, a, b, c, i)
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 (+ (* i y) (fma (log y) x (+ (fma (log c) (- b 0.5) a) (+ z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + fma(log(y), x, (fma(log(c), (b - 0.5), a) + (z + t)));
}
function code(x, y, z, t, a, b, c, i) return Float64(Float64(i * y) + fma(log(y), x, Float64(fma(log(c), Float64(b - 0.5), a) + Float64(z + t)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + a), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(\log c, b - 0.5, a\right) + \left(z + t\right)\right)
\end{array}
Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Final simplification99.8%
(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)))
(* i y))))
(if (<= t_1 -1.9e+307)
(* i y)
(if (<= t_1 -4e+27) (fma (/ z t) t t) (+ (* i y) (+ a t))))))
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))) + (i * y);
double tmp;
if (t_1 <= -1.9e+307) {
tmp = i * y;
} else if (t_1 <= -4e+27) {
tmp = fma((z / t), t, t);
} else {
tmp = (i * y) + (a + t);
}
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(i * y)) tmp = 0.0 if (t_1 <= -1.9e+307) tmp = Float64(i * y); elseif (t_1 <= -4e+27) tmp = fma(Float64(z / t), t, t); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1.9e+307], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -4e+27], N[(N[(z / t), $MachinePrecision] * t + t), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + i \cdot y\\
\mathbf{if}\;t\_1 \leq -1.9 \cdot 10^{+307}:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq -4 \cdot 10^{+27}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{t}, t, t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\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)) < -1.90000000000000011e307Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64100.0
Applied rewrites100.0%
if -1.90000000000000011e307 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -4.0000000000000001e27Initial program 99.8%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
Applied rewrites65.5%
Taylor expanded in z around inf
Applied rewrites25.7%
if -4.0000000000000001e27 < (+.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 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.2
Applied rewrites85.2%
Taylor expanded in y around inf
Applied rewrites50.8%
Final simplification41.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (- b 0.5) (log c))))
(if (<= t_1 -4e+101)
(+ (fma (- b 0.5) (log c) z) (+ a t))
(if (<= t_1 -275.0)
(+ (* x (log y)) (+ a t))
(if (<= t_1 2e+166)
(+ (fma -0.5 (log c) (fma i y z)) (+ a t))
(fma y i (* b (log c))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (b - 0.5) * log(c);
double tmp;
if (t_1 <= -4e+101) {
tmp = fma((b - 0.5), log(c), z) + (a + t);
} else if (t_1 <= -275.0) {
tmp = (x * log(y)) + (a + t);
} else if (t_1 <= 2e+166) {
tmp = fma(-0.5, log(c), fma(i, y, z)) + (a + t);
} else {
tmp = fma(y, i, (b * log(c)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(b - 0.5) * log(c)) tmp = 0.0 if (t_1 <= -4e+101) tmp = Float64(fma(Float64(b - 0.5), log(c), z) + Float64(a + t)); elseif (t_1 <= -275.0) tmp = Float64(Float64(x * log(y)) + Float64(a + t)); elseif (t_1 <= 2e+166) tmp = Float64(fma(-0.5, log(c), fma(i, y, z)) + Float64(a + t)); else tmp = fma(y, i, Float64(b * log(c))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+101], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -275.0], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+166], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+101}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\
\mathbf{elif}\;t\_1 \leq -275:\\
\;\;\;\;x \cdot \log y + \left(a + t\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+166}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, b \cdot \log c\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -3.9999999999999999e101Initial program 99.7%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.3
Applied rewrites87.3%
Taylor expanded in y around 0
Applied rewrites74.7%
if -3.9999999999999999e101 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -275Initial program 99.8%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6493.7
Applied rewrites93.7%
Taylor expanded in x around inf
Applied rewrites78.5%
if -275 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 1.99999999999999988e166Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.8
Applied rewrites85.8%
Taylor expanded in y around inf
Applied rewrites57.8%
Taylor expanded in b around 0
Applied rewrites83.1%
if 1.99999999999999988e166 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.7%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites66.6%
Taylor expanded in a around inf
Applied rewrites30.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6430.1
Applied rewrites30.1%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6488.1
Applied rewrites88.1%
Final simplification81.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (- b 0.5) (log c))))
(if (<= t_1 -2e+120)
(+ (fma (- b 0.5) (log c) (fma (log y) x z)) (+ a t))
(if (<= t_1 5e+85)
(+ (+ (+ (fma -0.5 (log c) (fma (log y) x (* i y))) z) t) a)
(+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (b - 0.5) * log(c);
double tmp;
if (t_1 <= -2e+120) {
tmp = fma((b - 0.5), log(c), fma(log(y), x, z)) + (a + t);
} else if (t_1 <= 5e+85) {
tmp = ((fma(-0.5, log(c), fma(log(y), x, (i * y))) + z) + t) + a;
} else {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(b - 0.5) * log(c)) tmp = 0.0 if (t_1 <= -2e+120) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(log(y), x, z)) + Float64(a + t)); elseif (t_1 <= 5e+85) tmp = Float64(Float64(Float64(fma(-0.5, log(c), fma(log(y), x, Float64(i * y))) + z) + t) + a); else tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e+120], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+85], N[(N[(N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + N[(i * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, z\right)\right) + \left(a + t\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+85}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(\log y, x, i \cdot y\right)\right) + z\right) + t\right) + a\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -2e120Initial program 99.7%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6491.3
Applied rewrites91.3%
if -2e120 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 5.0000000000000001e85Initial program 99.9%
Taylor expanded in b around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-*.f6497.9
Applied rewrites97.9%
if 5.0000000000000001e85 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6494.5
Applied rewrites94.5%
Final simplification96.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* b (log c)))) (t_2 (* (- b 0.5) (log c))))
(if (<= t_2 -4e+101)
t_1
(if (<= t_2 -275.0)
(+ (* x (log y)) (+ a t))
(if (<= t_2 2e+166) (+ (fma (/ z a) a a) (* i y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, i, (b * log(c)));
double t_2 = (b - 0.5) * log(c);
double tmp;
if (t_2 <= -4e+101) {
tmp = t_1;
} else if (t_2 <= -275.0) {
tmp = (x * log(y)) + (a + t);
} else if (t_2 <= 2e+166) {
tmp = fma((z / a), a, a) + (i * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(b * log(c))) t_2 = Float64(Float64(b - 0.5) * log(c)) tmp = 0.0 if (t_2 <= -4e+101) tmp = t_1; elseif (t_2 <= -275.0) tmp = Float64(Float64(x * log(y)) + Float64(a + t)); elseif (t_2 <= 2e+166) tmp = Float64(fma(Float64(z / a), a, a) + Float64(i * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e+101], t$95$1, If[LessEqual[t$95$2, -275.0], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+166], N[(N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, b \cdot \log c\right)\\
t_2 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+101}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq -275:\\
\;\;\;\;x \cdot \log y + \left(a + t\right)\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+166}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right) + i \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -3.9999999999999999e101 or 1.99999999999999988e166 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.7%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites67.5%
Taylor expanded in a around inf
Applied rewrites31.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6431.3
Applied rewrites31.4%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6470.7
Applied rewrites70.7%
if -3.9999999999999999e101 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -275Initial program 99.8%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6493.7
Applied rewrites93.7%
Taylor expanded in x around inf
Applied rewrites78.5%
if -275 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 1.99999999999999988e166Initial program 99.9%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
Applied rewrites81.9%
Taylor expanded in z around inf
Applied rewrites56.7%
Final simplification63.7%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (log c))) (t_2 (* (- b 0.5) (log c))))
(if (<= t_2 -4e+101)
(+ t_1 (+ a t))
(if (<= t_2 -275.0)
(+ (* x (log y)) (+ a t))
(if (<= t_2 1e+250) (+ (fma (/ z a) a a) (* i y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = b * log(c);
double t_2 = (b - 0.5) * log(c);
double tmp;
if (t_2 <= -4e+101) {
tmp = t_1 + (a + t);
} else if (t_2 <= -275.0) {
tmp = (x * log(y)) + (a + t);
} else if (t_2 <= 1e+250) {
tmp = fma((z / a), a, a) + (i * y);
} 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)) tmp = 0.0 if (t_2 <= -4e+101) tmp = Float64(t_1 + Float64(a + t)); elseif (t_2 <= -275.0) tmp = Float64(Float64(x * log(y)) + Float64(a + t)); elseif (t_2 <= 1e+250) tmp = Float64(fma(Float64(z / a), a, a) + Float64(i * y)); 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]}, If[LessEqual[t$95$2, -4e+101], N[(t$95$1 + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -275.0], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+250], N[(N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \log c\\
t_2 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{+101}:\\
\;\;\;\;t\_1 + \left(a + t\right)\\
\mathbf{elif}\;t\_2 \leq -275:\\
\;\;\;\;x \cdot \log y + \left(a + t\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+250}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right) + i \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -3.9999999999999999e101Initial program 99.7%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.3
Applied rewrites87.3%
Taylor expanded in b around inf
Applied rewrites72.2%
if -3.9999999999999999e101 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -275Initial program 99.8%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6493.7
Applied rewrites93.7%
Taylor expanded in x around inf
Applied rewrites78.5%
if -275 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 9.9999999999999992e249Initial program 99.9%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
Applied rewrites80.6%
Taylor expanded in z around inf
Applied rewrites57.1%
if 9.9999999999999992e249 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.6%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6488.6
Applied rewrites88.6%
Final simplification64.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (log c))) (t_2 (* (- b 0.5) (log c))))
(if (<= t_2 -2e+120)
(+ t_1 (+ a t))
(if (<= t_2 1e+250) (+ (fma (/ z a) a a) (* i y)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = b * log(c);
double t_2 = (b - 0.5) * log(c);
double tmp;
if (t_2 <= -2e+120) {
tmp = t_1 + (a + t);
} else if (t_2 <= 1e+250) {
tmp = fma((z / a), a, a) + (i * y);
} 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)) tmp = 0.0 if (t_2 <= -2e+120) tmp = Float64(t_1 + Float64(a + t)); elseif (t_2 <= 1e+250) tmp = Float64(fma(Float64(z / a), a, a) + Float64(i * y)); 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]}, If[LessEqual[t$95$2, -2e+120], N[(t$95$1 + N[(a + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+250], N[(N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \log c\\
t_2 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+120}:\\
\;\;\;\;t\_1 + \left(a + t\right)\\
\mathbf{elif}\;t\_2 \leq 10^{+250}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right) + i \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -2e120Initial program 99.7%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6487.6
Applied rewrites87.6%
Taylor expanded in b around inf
Applied rewrites77.1%
if -2e120 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 9.9999999999999992e249Initial program 99.9%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
Applied rewrites79.0%
Taylor expanded in z around inf
Applied rewrites53.1%
if 9.9999999999999992e249 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.6%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6488.6
Applied rewrites88.6%
Final simplification59.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (log c))) (t_2 (* (- b 0.5) (log c))))
(if (<= t_2 -2e+120)
t_1
(if (<= t_2 1e+250) (+ (fma (/ z a) a a) (* i y)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = b * log(c);
double t_2 = (b - 0.5) * log(c);
double tmp;
if (t_2 <= -2e+120) {
tmp = t_1;
} else if (t_2 <= 1e+250) {
tmp = fma((z / a), a, a) + (i * y);
} 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)) tmp = 0.0 if (t_2 <= -2e+120) tmp = t_1; elseif (t_2 <= 1e+250) tmp = Float64(fma(Float64(z / a), a, a) + Float64(i * y)); 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]}, If[LessEqual[t$95$2, -2e+120], t$95$1, If[LessEqual[t$95$2, 1e+250], N[(N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \log c\\
t_2 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+120}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{+250}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right) + i \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -2e120 or 9.9999999999999992e249 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.6%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6461.5
Applied rewrites61.5%
if -2e120 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 9.9999999999999992e249Initial program 99.9%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
Applied rewrites79.0%
Taylor expanded in z around inf
Applied rewrites53.1%
Final simplification55.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* i y))
-100.0)
(fma y i (fma (/ z t) t t))
(+ (* i y) (+ a t))))
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))) + (i * y)) <= -100.0) {
tmp = fma(y, i, fma((z / t), t, t));
} else {
tmp = (i * y) + (a + t);
}
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(i * y)) <= -100.0) tmp = fma(y, i, fma(Float64(z / t), t, t)); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return 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[(i * y), $MachinePrecision]), $MachinePrecision], -100.0], N[(y * i + N[(N[(z / t), $MachinePrecision] * t + t), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]
\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) + i \cdot y \leq -100:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\frac{z}{t}, t, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\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)) < -100Initial program 99.8%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites70.6%
Taylor expanded in a around inf
Applied rewrites55.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6455.0
Applied rewrites55.1%
Taylor expanded in z around inf
Applied rewrites40.0%
if -100 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6485.1
Applied rewrites85.1%
Taylor expanded in y around inf
Applied rewrites51.2%
Final simplification45.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (fma (- b 0.5) (log c) (fma (log y) x z)) (+ a t))))
(if (<= x -2.1e+107)
t_1
(if (<= x 4e+88) (+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma((b - 0.5), log(c), fma(log(y), x, z)) + (a + t);
double tmp;
if (x <= -2.1e+107) {
tmp = t_1;
} else if (x <= 4e+88) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(Float64(b - 0.5), log(c), fma(log(y), x, z)) + Float64(a + t)) tmp = 0.0 if (x <= -2.1e+107) tmp = t_1; elseif (x <= 4e+88) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(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[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+107], t$95$1, If[LessEqual[x, 4e+88], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, z\right)\right) + \left(a + t\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+107}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4 \cdot 10^{+88}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.1e107 or 3.99999999999999984e88 < x Initial program 99.7%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6486.3
Applied rewrites86.3%
if -2.1e107 < x < 3.99999999999999984e88Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6498.8
Applied rewrites98.8%
Final simplification94.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.4e+218)
(fma y i (* x (log y)))
(if (<= x 1.3e+155)
(+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t))
(+ (fma (log y) x (* b (log c))) (* i y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.4e+218) {
tmp = fma(y, i, (x * log(y)));
} else if (x <= 1.3e+155) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
} else {
tmp = fma(log(y), x, (b * log(c))) + (i * y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.4e+218) tmp = fma(y, i, Float64(x * log(y))); elseif (x <= 1.3e+155) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t)); else tmp = Float64(fma(log(y), x, Float64(b * log(c))) + Float64(i * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.4e+218], N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.3e+155], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[Log[y], $MachinePrecision] * x + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+218}:\\
\;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\
\mathbf{elif}\;x \leq 1.3 \cdot 10^{+155}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, b \cdot \log c\right) + i \cdot y\\
\end{array}
\end{array}
if x < -2.39999999999999981e218Initial program 99.7%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites61.4%
Taylor expanded in a around inf
Applied rewrites62.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.2
Applied rewrites62.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6483.2
Applied rewrites83.2%
if -2.39999999999999981e218 < x < 1.3000000000000001e155Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6494.8
Applied rewrites94.8%
if 1.3000000000000001e155 < x Initial program 99.7%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.8
Applied rewrites99.8%
Taylor expanded in b around inf
lower-*.f64N/A
lower-log.f6482.4
Applied rewrites82.4%
Final simplification92.6%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -2.4e+218)
(fma y i (* x (log y)))
(if (<= x 1.1e+156)
(+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t))
(+ (fma (- b 0.5) (log c) t) (fma (log y) x z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -2.4e+218) {
tmp = fma(y, i, (x * log(y)));
} else if (x <= 1.1e+156) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
} else {
tmp = fma((b - 0.5), log(c), t) + fma(log(y), x, z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -2.4e+218) tmp = fma(y, i, Float64(x * log(y))); elseif (x <= 1.1e+156) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t)); else tmp = Float64(fma(Float64(b - 0.5), log(c), t) + fma(log(y), x, z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -2.4e+218], N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.1e+156], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + t), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+218}:\\
\;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+156}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, t\right) + \mathsf{fma}\left(\log y, x, z\right)\\
\end{array}
\end{array}
if x < -2.39999999999999981e218Initial program 99.7%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites61.4%
Taylor expanded in a around inf
Applied rewrites62.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6462.2
Applied rewrites62.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6483.2
Applied rewrites83.2%
if -2.39999999999999981e218 < x < 1.10000000000000002e156Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6494.8
Applied rewrites94.8%
if 1.10000000000000002e156 < x Initial program 99.7%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6487.2
Applied rewrites87.2%
Taylor expanded in a around 0
Applied rewrites80.3%
Final simplification92.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* x (log y)))))
(if (<= x -2.4e+218)
t_1
(if (<= x 5e+228) (+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, i, (x * log(y)));
double tmp;
if (x <= -2.4e+218) {
tmp = t_1;
} else if (x <= 5e+228) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(x * log(y))) tmp = 0.0 if (x <= -2.4e+218) tmp = t_1; elseif (x <= 5e+228) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.4e+218], t$95$1, If[LessEqual[x, 5e+228], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, x \cdot \log y\right)\\
\mathbf{if}\;x \leq -2.4 \cdot 10^{+218}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5 \cdot 10^{+228}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -2.39999999999999981e218 or 5e228 < x Initial program 99.7%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites51.9%
Taylor expanded in a around inf
Applied rewrites49.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6449.3
Applied rewrites49.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6481.4
Applied rewrites81.4%
if -2.39999999999999981e218 < x < 5e228Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6492.4
Applied rewrites92.4%
Final simplification91.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= i -210000000000.0)
(+ (fma (/ z a) a a) (* i y))
(if (<= i 3.4e+189)
(+ (fma (- b 0.5) (log c) z) (+ a t))
(fma y i (* x (log y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (i <= -210000000000.0) {
tmp = fma((z / a), a, a) + (i * y);
} else if (i <= 3.4e+189) {
tmp = fma((b - 0.5), log(c), z) + (a + t);
} else {
tmp = fma(y, i, (x * log(y)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (i <= -210000000000.0) tmp = Float64(fma(Float64(z / a), a, a) + Float64(i * y)); elseif (i <= 3.4e+189) tmp = Float64(fma(Float64(b - 0.5), log(c), z) + Float64(a + t)); else tmp = fma(y, i, Float64(x * log(y))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[i, -210000000000.0], N[(N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.4e+189], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -210000000000:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right) + i \cdot y\\
\mathbf{elif}\;i \leq 3.4 \cdot 10^{+189}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, z\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, x \cdot \log y\right)\\
\end{array}
\end{array}
if i < -2.1e11Initial program 99.8%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
Applied rewrites83.9%
Taylor expanded in z around inf
Applied rewrites67.2%
if -2.1e11 < i < 3.39999999999999983e189Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6482.6
Applied rewrites82.6%
Taylor expanded in y around 0
Applied rewrites74.6%
if 3.39999999999999983e189 < i Initial program 99.8%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites74.0%
Taylor expanded in a around inf
Applied rewrites69.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6469.5
Applied rewrites69.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6484.2
Applied rewrites84.2%
Final simplification73.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 1.4e-55) (+ (fma (+ (/ a t) (/ z t)) t t) (* i y)) (+ (fma (/ z a) a a) (* i y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 1.4e-55) {
tmp = fma(((a / t) + (z / t)), t, t) + (i * y);
} else {
tmp = fma((z / a), a, a) + (i * y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 1.4e-55) tmp = Float64(fma(Float64(Float64(a / t) + Float64(z / t)), t, t) + Float64(i * y)); else tmp = Float64(fma(Float64(z / a), a, a) + Float64(i * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.4e-55], N[(N[(N[(N[(a / t), $MachinePrecision] + N[(z / t), $MachinePrecision]), $MachinePrecision] * t + t), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.4 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{t} + \frac{z}{t}, t, t\right) + i \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right) + i \cdot y\\
\end{array}
\end{array}
if a < 1.39999999999999992e-55Initial program 99.8%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites71.4%
Taylor expanded in a around inf
Applied rewrites55.7%
Taylor expanded in z around inf
Applied rewrites48.6%
if 1.39999999999999992e-55 < a Initial program 99.9%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites63.4%
Final simplification53.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 1.4e-55) (fma y i (fma (/ z t) t t)) (+ (fma (/ z a) a a) (* i y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 1.4e-55) {
tmp = fma(y, i, fma((z / t), t, t));
} else {
tmp = fma((z / a), a, a) + (i * y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 1.4e-55) tmp = fma(y, i, fma(Float64(z / t), t, t)); else tmp = Float64(fma(Float64(z / a), a, a) + Float64(i * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.4e-55], N[(y * i + N[(N[(z / t), $MachinePrecision] * t + t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.4 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\frac{z}{t}, t, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right) + i \cdot y\\
\end{array}
\end{array}
if a < 1.39999999999999992e-55Initial program 99.8%
Taylor expanded in t around inf
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
lower-fma.f64N/A
Applied rewrites71.4%
Taylor expanded in a around inf
Applied rewrites55.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6455.7
Applied rewrites55.8%
Taylor expanded in z around inf
Applied rewrites44.1%
if 1.39999999999999992e-55 < a Initial program 99.9%
Taylor expanded in a around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
*-commutativeN/A
associate-*l*N/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
Applied rewrites99.8%
Taylor expanded in z around inf
Applied rewrites63.4%
Final simplification50.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (* i y) (+ a t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + (a + t);
}
real(8) function code(x, y, z, t, a, b, c, i)
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 = (i * y) + (a + t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + (a + t);
}
def code(x, y, z, t, a, b, c, i): return (i * y) + (a + t)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(i * y) + Float64(a + t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (i * y) + (a + t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y + \left(a + t\right)
\end{array}
Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6483.9
Applied rewrites83.9%
Taylor expanded in y around inf
Applied rewrites47.8%
Final simplification47.8%
(FPCore (x y z t a b c i) :precision binary64 (* i y))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return i * y;
}
real(8) function code(x, y, z, t, a, b, c, i)
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 = i * y
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return i * y;
}
def code(x, y, z, t, a, b, c, i): return i * y
function code(x, y, z, t, a, b, c, i) return Float64(i * y) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = i * y; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(i * y), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y
\end{array}
Initial program 99.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6419.5
Applied rewrites19.5%
Final simplification19.5%
herbie shell --seed 2024270
(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)))