
(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 15 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 (fma y i (fma (log c) (- b 0.5) (+ (+ (fma (log y) x z) t) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, fma(log(c), (b - 0.5), ((fma(log(y), x, z) + t) + a)));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(log(c), Float64(b - 0.5), Float64(Float64(fma(log(y), x, z) + t) + a))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + N[(N[(N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b - 0.5, \left(\mathsf{fma}\left(\log y, x, z\right) + t\right) + a\right)\right)
\end{array}
Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* i y)
(+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))))))
(if (<= t_1 (- INFINITY))
(* i y)
(if (<= t_1 -200.0)
(* (/ z i) i)
(if (<= t_1 5e+194)
(* (/ a i) i)
(if (<= t_1 1.7e+308) (fma (/ a t) t t) (* i y)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = i * y;
} else if (t_1 <= -200.0) {
tmp = (z / i) * i;
} else if (t_1 <= 5e+194) {
tmp = (a / i) * i;
} else if (t_1 <= 1.7e+308) {
tmp = fma((a / t), t, t);
} else {
tmp = i * y;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(i * y); elseif (t_1 <= -200.0) tmp = Float64(Float64(z / i) * i); elseif (t_1 <= 5e+194) tmp = Float64(Float64(a / i) * i); elseif (t_1 <= 1.7e+308) tmp = fma(Float64(a / t), t, t); else tmp = Float64(i * y); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y), $MachinePrecision] + 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]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -200.0], N[(N[(z / i), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 5e+194], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 1.7e+308], N[(N[(a / t), $MachinePrecision] * t + t), $MachinePrecision], N[(i * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq -200:\\
\;\;\;\;\frac{z}{i} \cdot i\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+194}:\\
\;\;\;\;\frac{a}{i} \cdot i\\
\mathbf{elif}\;t\_1 \leq 1.7 \cdot 10^{+308}:\\
\;\;\;\;\mathsf{fma}\left(\frac{a}{t}, t, t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y\\
\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)) < -inf.0 or 1.6999999999999999e308 < (+.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 100.0%
Taylor expanded in y around inf
lower-*.f6492.1
Applied rewrites92.1%
if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -200Initial program 99.8%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.5%
Taylor expanded in z around inf
Applied rewrites9.6%
if -200 < (+.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.99999999999999989e194Initial program 99.9%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites85.0%
Taylor expanded in a around inf
Applied rewrites10.7%
if 4.99999999999999989e194 < (+.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.6999999999999999e308Initial 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 rewrites55.5%
Taylor expanded in a around inf
Applied rewrites26.5%
Final simplification26.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* i y)
(+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))))))
(if (<= t_1 (- INFINITY))
(* i y)
(if (<= t_1 -200.0)
(* (/ z i) i)
(if (<= t_1 5e+302) (* (/ a i) i) (* i y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c)));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = i * y;
} else if (t_1 <= -200.0) {
tmp = (z / i) * i;
} else if (t_1 <= 5e+302) {
tmp = (a / i) * i;
} else {
tmp = i * y;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c)));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = i * y;
} else if (t_1 <= -200.0) {
tmp = (z / i) * i;
} else if (t_1 <= 5e+302) {
tmp = (a / i) * i;
} else {
tmp = i * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (i * y) + (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) tmp = 0 if t_1 <= -math.inf: tmp = i * y elif t_1 <= -200.0: tmp = (z / i) * i elif t_1 <= 5e+302: tmp = (a / i) * i else: tmp = i * y return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c)))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(i * y); elseif (t_1 <= -200.0) tmp = Float64(Float64(z / i) * i); elseif (t_1 <= 5e+302) tmp = Float64(Float64(a / i) * i); else tmp = Float64(i * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (i * y) + (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))); tmp = 0.0; if (t_1 <= -Inf) tmp = i * y; elseif (t_1 <= -200.0) tmp = (z / i) * i; elseif (t_1 <= 5e+302) tmp = (a / i) * i; else tmp = i * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y), $MachinePrecision] + 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]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -200.0], N[(N[(z / i), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 5e+302], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision], N[(i * y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right)\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq -200:\\
\;\;\;\;\frac{z}{i} \cdot i\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+302}:\\
\;\;\;\;\frac{a}{i} \cdot i\\
\mathbf{else}:\\
\;\;\;\;i \cdot y\\
\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)) < -inf.0 or 5e302 < (+.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.9%
Taylor expanded in y around inf
lower-*.f6479.9
Applied rewrites79.9%
if -inf.0 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -200Initial program 99.8%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites65.5%
Taylor expanded in z around inf
Applied rewrites9.6%
if -200 < (+.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)) < 5e302Initial program 99.9%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites64.4%
Taylor expanded in a around inf
Applied rewrites10.1%
Final simplification21.9%
(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 -1.2e+176)
t_1
(if (<= t_2 5e+201) (+ (+ (fma -0.5 (log c) (fma i y z)) t) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = b * log(c);
double t_2 = (b - 0.5) * log(c);
double tmp;
if (t_2 <= -1.2e+176) {
tmp = t_1;
} else if (t_2 <= 5e+201) {
tmp = (fma(-0.5, log(c), fma(i, y, z)) + t) + a;
} 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 <= -1.2e+176) tmp = t_1; elseif (t_2 <= 5e+201) tmp = Float64(Float64(fma(-0.5, log(c), fma(i, y, z)) + t) + a); 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, -1.2e+176], t$95$1, If[LessEqual[t$95$2, 5e+201], N[(N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision] + t), $MachinePrecision] + a), $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 -1.2 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+201}:\\
\;\;\;\;\left(\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right) + t\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1.2000000000000001e176 or 4.9999999999999995e201 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6467.2
Applied rewrites67.2%
if -1.2000000000000001e176 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.9999999999999995e201Initial 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
lower-*.f6496.2
Applied rewrites96.2%
Taylor expanded in x around 0
Applied rewrites78.3%
Taylor expanded in x around 0
Applied rewrites78.3%
Final simplification76.1%
(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 -1.2e+176)
t_1
(if (<= t_2 5e+201) (+ (fma -0.5 (log c) (fma i y t)) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = b * log(c);
double t_2 = (b - 0.5) * log(c);
double tmp;
if (t_2 <= -1.2e+176) {
tmp = t_1;
} else if (t_2 <= 5e+201) {
tmp = fma(-0.5, log(c), fma(i, y, t)) + a;
} 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 <= -1.2e+176) tmp = t_1; elseif (t_2 <= 5e+201) tmp = Float64(fma(-0.5, log(c), fma(i, y, t)) + a); 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, -1.2e+176], t$95$1, If[LessEqual[t$95$2, 5e+201], N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(i * y + t), $MachinePrecision]), $MachinePrecision] + a), $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 -1.2 \cdot 10^{+176}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+201}:\\
\;\;\;\;\mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(i, y, t\right)\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1.2000000000000001e176 or 4.9999999999999995e201 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6467.2
Applied rewrites67.2%
if -1.2000000000000001e176 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.9999999999999995e201Initial 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
lower-*.f6496.2
Applied rewrites96.2%
Taylor expanded in z around 0
Applied rewrites80.5%
Taylor expanded in x around 0
Applied rewrites62.5%
Final simplification63.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (log c) (- b 0.5) z)) (t_2 (+ (fma (log y) x t_1) a)))
(if (<= x -5.2e+187)
t_2
(if (<= x 9.2e+114) (fma y i (+ (+ t_1 t) a)) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(log(c), (b - 0.5), z);
double t_2 = fma(log(y), x, t_1) + a;
double tmp;
if (x <= -5.2e+187) {
tmp = t_2;
} else if (x <= 9.2e+114) {
tmp = fma(y, i, ((t_1 + t) + a));
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(log(c), Float64(b - 0.5), z) t_2 = Float64(fma(log(y), x, t_1) + a) tmp = 0.0 if (x <= -5.2e+187) tmp = t_2; elseif (x <= 9.2e+114) tmp = fma(y, i, Float64(Float64(t_1 + t) + a)); 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] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[y], $MachinePrecision] * x + t$95$1), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[x, -5.2e+187], t$95$2, If[LessEqual[x, 9.2e+114], N[(y * i + N[(N[(t$95$1 + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\log c, b - 0.5, z\right)\\
t_2 := \mathsf{fma}\left(\log y, x, t\_1\right) + a\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+187}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;x \leq 9.2 \cdot 10^{+114}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(t\_1 + t\right) + a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if x < -5.1999999999999997e187 or 9.2000000000000001e114 < x Initial program 99.7%
Taylor expanded in t around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites93.3%
Taylor expanded in y around 0
Applied rewrites81.3%
if -5.1999999999999997e187 < x < 9.2000000000000001e114Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f6497.2
Applied rewrites97.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (fma -0.5 (log c) (fma (log y) x t)) a)))
(if (<= x -7.2e+254)
t_1
(if (<= x 2.7e+171)
(fma y i (+ (+ (fma (log c) (- b 0.5) z) t) a))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(-0.5, log(c), fma(log(y), x, t)) + a;
double tmp;
if (x <= -7.2e+254) {
tmp = t_1;
} else if (x <= 2.7e+171) {
tmp = fma(y, i, ((fma(log(c), (b - 0.5), z) + t) + a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(-0.5, log(c), fma(log(y), x, t)) + a) tmp = 0.0 if (x <= -7.2e+254) tmp = t_1; elseif (x <= 2.7e+171) tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), z) + t) + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(-0.5 * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]}, If[LessEqual[x, -7.2e+254], t$95$1, If[LessEqual[x, 2.7e+171], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(-0.5, \log c, \mathsf{fma}\left(\log y, x, t\right)\right) + a\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.7 \cdot 10^{+171}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.19999999999999954e254 or 2.6999999999999998e171 < x Initial program 99.6%
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
lower-*.f6489.8
Applied rewrites89.8%
Taylor expanded in z around 0
Applied rewrites85.3%
Taylor expanded in y around 0
Applied rewrites76.2%
if -7.19999999999999954e254 < x < 2.6999999999999998e171Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f6493.8
Applied rewrites93.8%
(FPCore (x y z t a b c i) :precision binary64 (+ (fma i y (fma (log y) x (fma (- b 0.5) (log c) z))) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(i, y, fma(log(y), x, fma((b - 0.5), log(c), z))) + a;
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(i, y, fma(log(y), x, fma(Float64(b - 0.5), log(c), z))) + a) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, z\right)\right)\right) + a
\end{array}
Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites85.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -7.8e+254)
t_1
(if (<= x 8e+183)
(fma y i (+ (+ (fma (log c) (- b 0.5) z) t) a))
(+ (+ (+ (* (+ (/ t_1 y) i) y) z) t) a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * log(y);
double tmp;
if (x <= -7.8e+254) {
tmp = t_1;
} else if (x <= 8e+183) {
tmp = fma(y, i, ((fma(log(c), (b - 0.5), z) + t) + a));
} else {
tmp = (((((t_1 / y) + i) * y) + z) + t) + a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -7.8e+254) tmp = t_1; elseif (x <= 8e+183) tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), z) + t) + a)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(t_1 / y) + i) * y) + z) + t) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.8e+254], t$95$1, If[LessEqual[x, 8e+183], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(t$95$1 / y), $MachinePrecision] + i), $MachinePrecision] * y), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+183}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\frac{t\_1}{y} + i\right) \cdot y + z\right) + t\right) + a\\
\end{array}
\end{array}
if x < -7.8000000000000003e254Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.3
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.3
Applied rewrites99.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6480.2
Applied rewrites80.2%
if -7.8000000000000003e254 < x < 7.99999999999999957e183Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f6493.0
Applied rewrites93.0%
if 7.99999999999999957e183 < x Initial 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
lower-*.f6484.3
Applied rewrites84.3%
Taylor expanded in y around inf
Applied rewrites72.1%
Taylor expanded in x around inf
Applied rewrites72.3%
Final simplification90.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -7.8e+254)
(* x (log y))
(if (<= x 8e+183)
(fma y i (+ (+ (fma (log c) (- b 0.5) z) t) a))
(+ (+ (+ (* (+ (* (/ x y) (log y)) i) y) z) t) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -7.8e+254) {
tmp = x * log(y);
} else if (x <= 8e+183) {
tmp = fma(y, i, ((fma(log(c), (b - 0.5), z) + t) + a));
} else {
tmp = ((((((x / y) * log(y)) + i) * y) + z) + t) + a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -7.8e+254) tmp = Float64(x * log(y)); elseif (x <= 8e+183) tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), z) + t) + a)); else tmp = Float64(Float64(Float64(Float64(Float64(Float64(Float64(x / y) * log(y)) + i) * y) + z) + t) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -7.8e+254], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e+183], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(N[(N[(x / y), $MachinePrecision] * N[Log[y], $MachinePrecision]), $MachinePrecision] + i), $MachinePrecision] * y), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.8 \cdot 10^{+254}:\\
\;\;\;\;x \cdot \log y\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+183}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(\frac{x}{y} \cdot \log y + i\right) \cdot y + z\right) + t\right) + a\\
\end{array}
\end{array}
if x < -7.8000000000000003e254Initial program 99.3%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.3
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.3
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.3
Applied rewrites99.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6480.2
Applied rewrites80.2%
if -7.8000000000000003e254 < x < 7.99999999999999957e183Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f6493.0
Applied rewrites93.0%
if 7.99999999999999957e183 < x Initial 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
lower-*.f6484.3
Applied rewrites84.3%
Taylor expanded in y around inf
Applied rewrites72.1%
Taylor expanded in x around inf
Applied rewrites72.3%
Applied rewrites72.1%
Final simplification90.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -7.8e+254)
t_1
(if (<= x 3.6e+224)
(fma y i (+ (+ (fma (log c) (- b 0.5) z) t) a))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * log(y);
double tmp;
if (x <= -7.8e+254) {
tmp = t_1;
} else if (x <= 3.6e+224) {
tmp = fma(y, i, ((fma(log(c), (b - 0.5), z) + t) + a));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -7.8e+254) tmp = t_1; elseif (x <= 3.6e+224) tmp = fma(y, i, Float64(Float64(fma(log(c), Float64(b - 0.5), z) + t) + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.8e+254], t$95$1, If[LessEqual[x, 3.6e+224], N[(y * i + N[(N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+224}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \left(\mathsf{fma}\left(\log c, b - 0.5, z\right) + t\right) + a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.8000000000000003e254 or 3.6e224 < x Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.4
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.4
Applied rewrites99.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6480.8
Applied rewrites80.8%
if -7.8000000000000003e254 < x < 3.6e224Initial program 99.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.9
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.9
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
lower--.f6491.3
Applied rewrites91.3%
Final simplification90.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -7.8e+254)
t_1
(if (<= x 3.6e+224)
(+ (fma (- b 0.5) (log c) (fma i y z)) (+ t a))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * log(y);
double tmp;
if (x <= -7.8e+254) {
tmp = t_1;
} else if (x <= 3.6e+224) {
tmp = fma((b - 0.5), log(c), fma(i, y, z)) + (t + a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -7.8e+254) tmp = t_1; elseif (x <= 3.6e+224) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(i, y, z)) + Float64(t + a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.8e+254], t$95$1, If[LessEqual[x, 3.6e+224], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+224}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right) + \left(t + a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.8000000000000003e254 or 3.6e224 < x Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.4
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.4
Applied rewrites99.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6480.8
Applied rewrites80.8%
if -7.8000000000000003e254 < x < 3.6e224Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/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
lower-fma.f6491.3
Applied rewrites91.3%
Final simplification90.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* x (log y))))
(if (<= x -7.8e+254)
t_1
(if (<= x 3.6e+224) (+ (fma i y (fma (log c) (- b 0.5) z)) a) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = x * log(y);
double tmp;
if (x <= -7.8e+254) {
tmp = t_1;
} else if (x <= 3.6e+224) {
tmp = fma(i, y, fma(log(c), (b - 0.5), z)) + a;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -7.8e+254) tmp = t_1; elseif (x <= 3.6e+224) tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), z)) + a); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.8e+254], t$95$1, If[LessEqual[x, 3.6e+224], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -7.8 \cdot 10^{+254}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.6 \cdot 10^{+224}:\\
\;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, z\right)\right) + a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.8000000000000003e254 or 3.6e224 < x Initial program 99.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.4
lift-+.f64N/A
+-commutativeN/A
lower-+.f6499.4
lift-+.f64N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.4
Applied rewrites99.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6480.8
Applied rewrites80.8%
if -7.8000000000000003e254 < x < 3.6e224Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites84.0%
Taylor expanded in x around 0
Applied rewrites75.8%
Final simplification76.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 2500.0) (* (/ a i) i) (* i y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 2500.0) {
tmp = (a / i) * i;
} else {
tmp = i * y;
}
return tmp;
}
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
real(8) :: tmp
if (y <= 2500.0d0) then
tmp = (a / i) * i
else
tmp = i * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 2500.0) {
tmp = (a / i) * i;
} else {
tmp = i * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 2500.0: tmp = (a / i) * i else: tmp = i * y return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 2500.0) tmp = Float64(Float64(a / i) * i); else tmp = Float64(i * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 2500.0) tmp = (a / i) * i; else tmp = i * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 2500.0], N[(N[(a / i), $MachinePrecision] * i), $MachinePrecision], N[(i * y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2500:\\
\;\;\;\;\frac{a}{i} \cdot i\\
\mathbf{else}:\\
\;\;\;\;i \cdot y\\
\end{array}
\end{array}
if y < 2500Initial program 99.8%
Taylor expanded in i around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites71.8%
Taylor expanded in a around inf
Applied rewrites14.4%
if 2500 < y Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6443.6
Applied rewrites43.6%
(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.9%
Taylor expanded in y around inf
lower-*.f6425.2
Applied rewrites25.2%
herbie shell --seed 2024296
(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)))