
(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 16 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 (log y) x (+ (+ z t) (fma (+ b -0.5) (log c) a))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(log(y), x, ((z + t) + fma((b + -0.5), log(c), a))) + (y * i);
}
function code(x, y, z, t, a, b, c, i) return Float64(fma(log(y), x, Float64(Float64(z + t) + fma(Float64(b + -0.5), log(c), a))) + Float64(y * i)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[Log[y], $MachinePrecision] * x + N[(N[(z + t), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\log y, x, \left(z + t\right) + \mathsf{fma}\left(b + -0.5, \log c, a\right)\right) + y \cdot i
\end{array}
Initial program 99.9%
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-log.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
Applied rewrites99.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* y i)
(+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))))
(if (<= t_1 -10.0) (* y i) (if (<= t_1 INFINITY) a (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
double tmp;
if (t_1 <= -10.0) {
tmp = y * i;
} else if (t_1 <= ((double) INFINITY)) {
tmp = a;
} else {
tmp = y * i;
}
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 = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))));
double tmp;
if (t_1 <= -10.0) {
tmp = y * i;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = a;
} else {
tmp = y * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (y * i) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x))))) tmp = 0 if t_1 <= -10.0: tmp = y * i elif t_1 <= math.inf: tmp = a else: tmp = y * i return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) tmp = 0.0 if (t_1 <= -10.0) tmp = Float64(y * i); elseif (t_1 <= Inf) tmp = a; else tmp = Float64(y * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (y * i) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x))))); tmp = 0.0; if (t_1 <= -10.0) tmp = y * i; elseif (t_1 <= Inf) tmp = a; else tmp = y * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -10.0], N[(y * i), $MachinePrecision], If[LessEqual[t$95$1, Infinity], a, N[(y * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)\\
\mathbf{if}\;t\_1 \leq -10:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\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)) < -10 or +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)) Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6420.5
Applied rewrites20.5%
if -10 < (+.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.0Initial program 99.8%
Taylor expanded in i around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites65.3%
Taylor expanded in a around inf
lower-/.f645.5
Applied rewrites5.5%
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
associate-*l*N/A
lift-/.f64N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lower-*.f6413.7
Applied rewrites13.7%
*-rgt-identity13.7
Applied rewrites13.7%
Final simplification17.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (<= t_1 -1e+157)
(fma y i (* b (log c)))
(if (<= t_1 5e+173)
(+ a (fma i y (fma x (log y) z)))
(+ t (+ a (fma (log c) (+ b -0.5) z)))))))
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 tmp;
if (t_1 <= -1e+157) {
tmp = fma(y, i, (b * log(c)));
} else if (t_1 <= 5e+173) {
tmp = a + fma(i, y, fma(x, log(y), z));
} else {
tmp = t + (a + fma(log(c), (b + -0.5), z));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(c) * Float64(b - 0.5)) tmp = 0.0 if (t_1 <= -1e+157) tmp = fma(y, i, Float64(b * log(c))); elseif (t_1 <= 5e+173) tmp = Float64(a + fma(i, y, fma(x, log(y), z))); else tmp = Float64(t + Float64(a + fma(log(c), Float64(b + -0.5), z))); 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]}, If[LessEqual[t$95$1, -1e+157], N[(y * i + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e+173], N[(a + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(a + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(y, i, b \cdot \log c\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+173}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t + \left(a + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -9.99999999999999983e156Initial program 99.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6474.4
Applied rewrites74.4%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f6474.4
Applied rewrites74.4%
if -9.99999999999999983e156 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 5.00000000000000034e173Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites73.6%
Taylor expanded in z around inf
lower-/.f6457.8
Applied rewrites57.8%
Taylor expanded in x around 0
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6476.0
Applied rewrites76.0%
if 5.00000000000000034e173 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.6%
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-log.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
Applied rewrites99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6494.6
Applied rewrites94.6%
Taylor expanded in y around 0
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6488.4
Applied rewrites88.4%
Final simplification77.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* b (log c))) (t_2 (* (log c) (- b 0.5))))
(if (<= t_2 -1e+157)
(fma y i t_1)
(if (<= t_2 5e+173) (+ a (fma i y (fma x (log 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 = log(c) * (b - 0.5);
double tmp;
if (t_2 <= -1e+157) {
tmp = fma(y, i, t_1);
} else if (t_2 <= 5e+173) {
tmp = a + fma(i, y, fma(x, log(y), z));
} else {
tmp = t + (a + t_1);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(b * log(c)) t_2 = Float64(log(c) * Float64(b - 0.5)) tmp = 0.0 if (t_2 <= -1e+157) tmp = fma(y, i, t_1); elseif (t_2 <= 5e+173) tmp = Float64(a + fma(i, y, fma(x, log(y), z))); else tmp = Float64(t + Float64(a + 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[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+157], N[(y * i + t$95$1), $MachinePrecision], If[LessEqual[t$95$2, 5e+173], N[(a + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \log c\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+157}:\\
\;\;\;\;\mathsf{fma}\left(y, i, t\_1\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+173}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t + \left(a + t\_1\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -9.99999999999999983e156Initial program 99.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6474.4
Applied rewrites74.4%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f6474.4
Applied rewrites74.4%
if -9.99999999999999983e156 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 5.00000000000000034e173Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites73.6%
Taylor expanded in z around inf
lower-/.f6457.8
Applied rewrites57.8%
Taylor expanded in x around 0
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6476.0
Applied rewrites76.0%
if 5.00000000000000034e173 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.6%
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-log.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
Applied rewrites99.6%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6494.6
Applied rewrites94.6%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6475.6
Applied rewrites75.6%
Final simplification75.7%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* b (log c))) (t_2 (* (log c) (- b 0.5)))) (if (<= t_2 -1e+201) t_1 (if (<= t_2 5e+227) (+ a (fma i y z)) 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 = log(c) * (b - 0.5);
double tmp;
if (t_2 <= -1e+201) {
tmp = t_1;
} else if (t_2 <= 5e+227) {
tmp = a + fma(i, y, z);
} 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(log(c) * Float64(b - 0.5)) tmp = 0.0 if (t_2 <= -1e+201) tmp = t_1; elseif (t_2 <= 5e+227) tmp = Float64(a + fma(i, y, z)); 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[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+201], t$95$1, If[LessEqual[t$95$2, 5e+227], N[(a + N[(i * y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \log c\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+201}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+227}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -1.00000000000000004e201 or 4.9999999999999996e227 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.5%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6478.6
Applied rewrites78.6%
if -1.00000000000000004e201 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 4.9999999999999996e227Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites72.2%
Taylor expanded in z around inf
lower-/.f6454.9
Applied rewrites54.9%
Taylor expanded in x around 0
lower-+.f64N/A
+-commutativeN/A
lower-fma.f6456.9
Applied rewrites56.9%
Final simplification60.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (log c) (+ b -0.5) z)))
(if (<= x -7.5e+99)
(+ a (+ t_1 (fma x (log y) t)))
(if (<= x 7.6e+138)
(+ t (+ a (fma y i t_1)))
(fma (/ z x) x (fma x (+ (log y) (/ a x)) (* y i)))))))
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 tmp;
if (x <= -7.5e+99) {
tmp = a + (t_1 + fma(x, log(y), t));
} else if (x <= 7.6e+138) {
tmp = t + (a + fma(y, i, t_1));
} else {
tmp = fma((z / x), x, fma(x, (log(y) + (a / x)), (y * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(log(c), Float64(b + -0.5), z) tmp = 0.0 if (x <= -7.5e+99) tmp = Float64(a + Float64(t_1 + fma(x, log(y), t))); elseif (x <= 7.6e+138) tmp = Float64(t + Float64(a + fma(y, i, t_1))); else tmp = fma(Float64(z / x), x, fma(x, Float64(log(y) + Float64(a / x)), Float64(y * i))); 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]}, If[LessEqual[x, -7.5e+99], N[(a + N[(t$95$1 + N[(x * N[Log[y], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.6e+138], N[(t + N[(a + N[(y * i + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / x), $MachinePrecision] * x + N[(x * N[(N[Log[y], $MachinePrecision] + N[(a / x), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\log c, b + -0.5, z\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+99}:\\
\;\;\;\;a + \left(t\_1 + \mathsf{fma}\left(x, \log y, t\right)\right)\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{+138}:\\
\;\;\;\;t + \left(a + \mathsf{fma}\left(y, i, t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{x}, x, \mathsf{fma}\left(x, \log y + \frac{a}{x}, y \cdot i\right)\right)\\
\end{array}
\end{array}
if x < -7.49999999999999963e99Initial program 99.8%
Taylor expanded in y around 0
lower-+.f64N/A
associate-+r+N/A
cancel-sign-subN/A
log-recN/A
unsub-negN/A
mul-1-negN/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
Applied rewrites86.5%
if -7.49999999999999963e99 < x < 7.60000000000000025e138Initial program 99.9%
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-log.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
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6497.9
Applied rewrites97.9%
if 7.60000000000000025e138 < x Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites99.7%
Taylor expanded in z around inf
lower-/.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift-log.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f6483.7
Applied rewrites83.7%
Final simplification94.9%
(FPCore (x y z t a b c i) :precision binary64 (+ a (fma i y (fma (log c) (+ b -0.5) (fma x (log y) z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + fma(i, y, fma(log(c), (b + -0.5), fma(x, log(y), z)));
}
function code(x, y, z, t, a, b, c, i) return Float64(a + fma(i, y, fma(log(c), Float64(b + -0.5), fma(x, log(y), z)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b + -0.5, \mathsf{fma}\left(x, \log y, z\right)\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in t around 0
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6483.7
Applied rewrites83.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -1.2e+112)
(+ a (fma i y (fma x (log y) z)))
(if (<= x 7.6e+138)
(+ t (+ a (fma y i (fma (log c) (+ b -0.5) z))))
(fma (/ z x) x (fma x (+ (log y) (/ a x)) (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -1.2e+112) {
tmp = a + fma(i, y, fma(x, log(y), z));
} else if (x <= 7.6e+138) {
tmp = t + (a + fma(y, i, fma(log(c), (b + -0.5), z)));
} else {
tmp = fma((z / x), x, fma(x, (log(y) + (a / x)), (y * i)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -1.2e+112) tmp = Float64(a + fma(i, y, fma(x, log(y), z))); elseif (x <= 7.6e+138) tmp = Float64(t + Float64(a + fma(y, i, fma(log(c), Float64(b + -0.5), z)))); else tmp = fma(Float64(z / x), x, fma(x, Float64(log(y) + Float64(a / x)), Float64(y * i))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -1.2e+112], N[(a + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 7.6e+138], N[(t + N[(a + N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z / x), $MachinePrecision] * x + N[(x * N[(N[Log[y], $MachinePrecision] + N[(a / x), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+112}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, z\right)\right)\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{+138}:\\
\;\;\;\;t + \left(a + \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{x}, x, \mathsf{fma}\left(x, \log y + \frac{a}{x}, y \cdot i\right)\right)\\
\end{array}
\end{array}
if x < -1.2e112Initial program 99.8%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites99.7%
Taylor expanded in z around inf
lower-/.f6475.9
Applied rewrites75.9%
Taylor expanded in x around 0
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6475.9
Applied rewrites75.9%
if -1.2e112 < x < 7.60000000000000025e138Initial program 99.9%
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-log.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
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6497.5
Applied rewrites97.5%
if 7.60000000000000025e138 < x Initial program 99.7%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites99.7%
Taylor expanded in z around inf
lower-/.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift-log.f64N/A
lift-/.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-+.f64N/A
distribute-rgt-inN/A
associate-+l+N/A
lower-fma.f64N/A
*-commutativeN/A
lower-fma.f6483.7
Applied rewrites83.7%
Final simplification93.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (fma i y (fma x (log y) z)))))
(if (<= x -1.2e+112)
t_1
(if (<= x 3.4e+108)
(+ t (+ a (fma y i (fma (log c) (+ b -0.5) z))))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + fma(i, y, fma(x, log(y), z));
double tmp;
if (x <= -1.2e+112) {
tmp = t_1;
} else if (x <= 3.4e+108) {
tmp = t + (a + fma(y, i, fma(log(c), (b + -0.5), z)));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + fma(i, y, fma(x, log(y), z))) tmp = 0.0 if (x <= -1.2e+112) tmp = t_1; elseif (x <= 3.4e+108) tmp = Float64(t + Float64(a + fma(y, i, fma(log(c), Float64(b + -0.5), z)))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+112], t$95$1, If[LessEqual[x, 3.4e+108], N[(t + N[(a + N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, z\right)\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+108}:\\
\;\;\;\;t + \left(a + \mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, b + -0.5, z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.2e112 or 3.39999999999999996e108 < x Initial program 99.8%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites99.7%
Taylor expanded in z around inf
lower-/.f6479.4
Applied rewrites79.4%
Taylor expanded in x around 0
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6479.5
Applied rewrites79.5%
if -1.2e112 < x < 3.39999999999999996e108Initial program 99.9%
lift-log.f64N/A
lift-*.f64N/A
lift-+.f64N/A
lift-+.f64N/A
lift--.f64N/A
lift-log.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
Applied rewrites99.9%
Taylor expanded in x around 0
+-commutativeN/A
associate-+l+N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6497.4
Applied rewrites97.4%
Final simplification92.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (fma i y (fma x (log y) z)))))
(if (<= x -1.2e+112)
t_1
(if (<= x 3.4e+108)
(+ a (+ (fma i y z) (fma (log c) (+ b -0.5) t)))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + fma(i, y, fma(x, log(y), z));
double tmp;
if (x <= -1.2e+112) {
tmp = t_1;
} else if (x <= 3.4e+108) {
tmp = a + (fma(i, y, z) + fma(log(c), (b + -0.5), t));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + fma(i, y, fma(x, log(y), z))) tmp = 0.0 if (x <= -1.2e+112) tmp = t_1; elseif (x <= 3.4e+108) tmp = Float64(a + Float64(fma(i, y, z) + fma(log(c), Float64(b + -0.5), t))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(i * y + N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.2e+112], t$95$1, If[LessEqual[x, 3.4e+108], N[(a + N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \mathsf{fma}\left(i, y, \mathsf{fma}\left(x, \log y, z\right)\right)\\
\mathbf{if}\;x \leq -1.2 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3.4 \cdot 10^{+108}:\\
\;\;\;\;a + \left(\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log c, b + -0.5, t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.2e112 or 3.39999999999999996e108 < x Initial program 99.8%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites99.7%
Taylor expanded in z around inf
lower-/.f6479.4
Applied rewrites79.4%
Taylor expanded in x around 0
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6479.5
Applied rewrites79.5%
if -1.2e112 < x < 3.39999999999999996e108Initial program 99.9%
Taylor expanded in x around 0
lower-+.f64N/A
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-fma.f64N/A
lower-log.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f6497.4
Applied rewrites97.4%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* b (log c)))))
(if (<= b -1.9e+151)
t_1
(if (<= b 7.6e-45)
(+ a (fma i y z))
(if (<= b 4.4e+170) (fma x (log y) (+ 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 = fma(y, i, (b * log(c)));
double tmp;
if (b <= -1.9e+151) {
tmp = t_1;
} else if (b <= 7.6e-45) {
tmp = a + fma(i, y, z);
} else if (b <= 4.4e+170) {
tmp = fma(x, log(y), (z + a));
} 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))) tmp = 0.0 if (b <= -1.9e+151) tmp = t_1; elseif (b <= 7.6e-45) tmp = Float64(a + fma(i, y, z)); elseif (b <= 4.4e+170) tmp = fma(x, log(y), Float64(z + a)); 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]}, If[LessEqual[b, -1.9e+151], t$95$1, If[LessEqual[b, 7.6e-45], N[(a + N[(i * y + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 4.4e+170], N[(x * N[Log[y], $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, b \cdot \log c\right)\\
\mathbf{if}\;b \leq -1.9 \cdot 10^{+151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 7.6 \cdot 10^{-45}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\
\mathbf{elif}\;b \leq 4.4 \cdot 10^{+170}:\\
\;\;\;\;\mathsf{fma}\left(x, \log y, z + a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.9e151 or 4.39999999999999978e170 < b Initial program 99.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6475.0
Applied rewrites75.0%
Taylor expanded in c around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-log.f6475.0
Applied rewrites75.0%
if -1.9e151 < b < 7.59999999999999994e-45Initial program 100.0%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites73.3%
Taylor expanded in z around inf
lower-/.f6456.9
Applied rewrites56.9%
Taylor expanded in x around 0
lower-+.f64N/A
+-commutativeN/A
lower-fma.f6462.7
Applied rewrites62.7%
if 7.59999999999999994e-45 < b < 4.39999999999999978e170Initial program 99.8%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites74.9%
Taylor expanded in z around inf
lower-/.f6457.8
Applied rewrites57.8%
Taylor expanded in x around 0
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6470.9
Applied rewrites70.9%
Taylor expanded in i around 0
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6453.8
Applied rewrites53.8%
Final simplification64.4%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (fma x (log y) (+ z a)))) (if (<= x -7.5e+99) t_1 (if (<= x 7e+90) (+ a (fma i y z)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(x, log(y), (z + a));
double tmp;
if (x <= -7.5e+99) {
tmp = t_1;
} else if (x <= 7e+90) {
tmp = a + fma(i, y, z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(x, log(y), Float64(z + a)) tmp = 0.0 if (x <= -7.5e+99) tmp = t_1; elseif (x <= 7e+90) tmp = Float64(a + fma(i, y, z)); 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] + N[(z + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.5e+99], t$95$1, If[LessEqual[x, 7e+90], N[(a + N[(i * y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(x, \log y, z + a\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+99}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+90}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.49999999999999963e99 or 6.9999999999999997e90 < x Initial program 99.8%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites99.7%
Taylor expanded in z around inf
lower-/.f6475.2
Applied rewrites75.2%
Taylor expanded in x around 0
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f6475.3
Applied rewrites75.3%
Taylor expanded in i around 0
associate-+r+N/A
+-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
+-commutativeN/A
lower-+.f6465.2
Applied rewrites65.2%
if -7.49999999999999963e99 < x < 6.9999999999999997e90Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites57.1%
Taylor expanded in z around inf
lower-/.f6438.9
Applied rewrites38.9%
Taylor expanded in x around 0
lower-+.f64N/A
+-commutativeN/A
lower-fma.f6459.8
Applied rewrites59.8%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* (log y) x))) (if (<= x -5.8e+171) t_1 (if (<= x 1.1e+214) (+ a (fma i y z)) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(y) * x;
double tmp;
if (x <= -5.8e+171) {
tmp = t_1;
} else if (x <= 1.1e+214) {
tmp = a + fma(i, y, z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) tmp = 0.0 if (x <= -5.8e+171) tmp = t_1; elseif (x <= 1.1e+214) tmp = Float64(a + fma(i, y, z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[x, -5.8e+171], t$95$1, If[LessEqual[x, 1.1e+214], N[(a + N[(i * y + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
\mathbf{if}\;x \leq -5.8 \cdot 10^{+171}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.1 \cdot 10^{+214}:\\
\;\;\;\;a + \mathsf{fma}\left(i, y, z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -5.79999999999999969e171 or 1.10000000000000012e214 < x Initial program 99.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6465.8
Applied rewrites65.8%
if -5.79999999999999969e171 < x < 1.10000000000000012e214Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites63.0%
Taylor expanded in z around inf
lower-/.f6441.4
Applied rewrites41.4%
Taylor expanded in x around 0
lower-+.f64N/A
+-commutativeN/A
lower-fma.f6457.1
Applied rewrites57.1%
Final simplification58.6%
(FPCore (x y z t a b c i) :precision binary64 (+ a (fma i y z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + fma(i, y, z);
}
function code(x, y, z, t, a, b, c, i) return Float64(a + fma(i, y, z)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(i * y + z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \mathsf{fma}\left(i, y, z\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites69.4%
Taylor expanded in z around inf
lower-/.f6449.4
Applied rewrites49.4%
Taylor expanded in x around 0
lower-+.f64N/A
+-commutativeN/A
lower-fma.f6450.7
Applied rewrites50.7%
(FPCore (x y z t a b c i) :precision binary64 (fma y i a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, a);
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, a) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + a), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, a\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
associate-+r+N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-log.f64N/A
lower-/.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites69.4%
Taylor expanded in a around inf
lower-/.f6428.6
Applied rewrites28.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
associate-*l*N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
*-rgt-identityN/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6434.8
Applied rewrites34.8%
(FPCore (x y z t a b c i) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
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 = a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
def code(x, y, z, t, a, b, c, i): return a
function code(x, y, z, t, a, b, c, i) return a end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
lower-+.f64N/A
lower-/.f64N/A
Applied rewrites69.2%
Taylor expanded in a around inf
lower-/.f647.2
Applied rewrites7.2%
lift-/.f64N/A
*-commutativeN/A
lift-/.f64N/A
div-invN/A
lift-/.f64N/A
associate-*l*N/A
lift-/.f64N/A
inv-powN/A
pow-plusN/A
metadata-evalN/A
metadata-evalN/A
lower-*.f6414.3
Applied rewrites14.3%
*-rgt-identity14.3
Applied rewrites14.3%
herbie shell --seed 2024219
(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)))