
(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 (+ (+ (+ (+ (+ (* 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}
Initial program 99.5%
(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)))
(* y i))))
(if (<= t_1 (- INFINITY))
(* i y)
(if (<= t_1 -50.0)
(* (/ z y) y)
(if (<= t_1 INFINITY) (* (/ a y) y) (* i y))))))
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))) + (y * i);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = i * y;
} else if (t_1 <= -50.0) {
tmp = (z / y) * y;
} else if (t_1 <= ((double) INFINITY)) {
tmp = (a / y) * y;
} 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 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = i * y;
} else if (t_1 <= -50.0) {
tmp = (z / y) * y;
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = (a / y) * y;
} else {
tmp = i * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if t_1 <= -math.inf: tmp = i * y elif t_1 <= -50.0: tmp = (z / y) * y elif t_1 <= math.inf: tmp = (a / y) * y else: tmp = i * y 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(y * i)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(i * y); elseif (t_1 <= -50.0) tmp = Float64(Float64(z / y) * y); elseif (t_1 <= Inf) tmp = Float64(Float64(a / y) * y); else tmp = Float64(i * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if (t_1 <= -Inf) tmp = i * y; elseif (t_1 <= -50.0) tmp = (z / y) * y; elseif (t_1 <= Inf) tmp = (a / y) * y; else tmp = i * y; end tmp_2 = 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[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -50.0], N[(N[(z / y), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(a / y), $MachinePrecision] * y), $MachinePrecision], N[(i * y), $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) + y \cdot i\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq -50:\\
\;\;\;\;\frac{z}{y} \cdot y\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\frac{a}{y} \cdot y\\
\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 +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 94.4%
Taylor expanded in y around inf
lower-*.f64100.0
Applied rewrites100.0%
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)) < -50Initial program 99.8%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites62.9%
Taylor expanded in z around inf
Applied rewrites9.7%
if -50 < (+.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 y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.2%
Taylor expanded in t around inf
Applied rewrites12.9%
Taylor expanded in a around inf
Applied rewrites12.6%
(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)))
(* y i))))
(if (or (<= t_1 2e+25) (not (<= t_1 INFINITY))) (* i y) (* (/ a y) y))))
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))) + (y * i);
double tmp;
if ((t_1 <= 2e+25) || !(t_1 <= ((double) INFINITY))) {
tmp = i * y;
} else {
tmp = (a / y) * 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 = (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
double tmp;
if ((t_1 <= 2e+25) || !(t_1 <= Double.POSITIVE_INFINITY)) {
tmp = i * y;
} else {
tmp = (a / y) * y;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i) tmp = 0 if (t_1 <= 2e+25) or not (t_1 <= math.inf): tmp = i * y else: tmp = (a / y) * y 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(y * i)) tmp = 0.0 if ((t_1 <= 2e+25) || !(t_1 <= Inf)) tmp = Float64(i * y); else tmp = Float64(Float64(a / y) * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); tmp = 0.0; if ((t_1 <= 2e+25) || ~((t_1 <= Inf))) tmp = i * y; else tmp = (a / y) * y; end tmp_2 = 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[(y * i), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 2e+25], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(i * y), $MachinePrecision], N[(N[(a / y), $MachinePrecision] * y), $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) + y \cdot i\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+25} \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;i \cdot y\\
\mathbf{else}:\\
\;\;\;\;\frac{a}{y} \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)) < 2.00000000000000018e25 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.1%
Taylor expanded in y around inf
lower-*.f6426.9
Applied rewrites26.9%
if 2.00000000000000018e25 < (+.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.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites72.5%
Taylor expanded in t around inf
Applied rewrites13.1%
Taylor expanded in a around inf
Applied rewrites12.7%
Final simplification19.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (log y) x (fma (- b 0.5) (log c) t))))
(if (<=
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
2e+25)
(+ (fma i y z) t_1)
(+ (fma i y t_1) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(log(y), x, fma((b - 0.5), log(c), t));
double tmp;
if (((((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i)) <= 2e+25) {
tmp = fma(i, y, z) + t_1;
} else {
tmp = fma(i, y, t_1) + a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(log(y), x, fma(Float64(b - 0.5), log(c), t)) tmp = 0.0 if (Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) <= 2e+25) tmp = Float64(fma(i, y, z) + t_1); else tmp = Float64(fma(i, y, t_1) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]}, 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[(y * i), $MachinePrecision]), $MachinePrecision], 2e+25], N[(N[(i * y + z), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(i * y + t$95$1), $MachinePrecision] + a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, t\right)\right)\\
\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) + y \cdot i \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(i, y, z\right) + t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, y, t\_1\right) + a\\
\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)) < 2.00000000000000018e25Initial program 99.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6483.3
Applied rewrites83.3%
if 2.00000000000000018e25 < (+.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.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites84.2%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
2e+25)
(+ (fma (- b 0.5) (log c) (* i y)) (+ t z))
(+ (fma i y (fma (log c) (- b 0.5) t)) a)))
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))) + (y * i)) <= 2e+25) {
tmp = fma((b - 0.5), log(c), (i * y)) + (t + z);
} else {
tmp = fma(i, y, fma(log(c), (b - 0.5), t)) + a;
}
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(y * i)) <= 2e+25) tmp = Float64(fma(Float64(b - 0.5), log(c), Float64(i * y)) + Float64(t + z)); else tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), t)) + a); 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[(y * i), $MachinePrecision]), $MachinePrecision], 2e+25], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $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) + y \cdot i \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, i \cdot y\right) + \left(t + z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\
\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)) < 2.00000000000000018e25Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6485.1
Applied rewrites85.1%
Taylor expanded in a around 0
Applied rewrites68.9%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
lift-*.f64N/A
lower-fma.f6468.9
lift-*.f64N/A
*-commutativeN/A
lower-*.f6468.9
Applied rewrites68.9%
if 2.00000000000000018e25 < (+.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.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites84.2%
Taylor expanded in x around 0
Applied rewrites71.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i))
2e+25)
(fma y i (fma (- b 0.5) (log c) (+ t z)))
(+ (fma i y (fma (log c) (- b 0.5) t)) a)))
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))) + (y * i)) <= 2e+25) {
tmp = fma(y, i, fma((b - 0.5), log(c), (t + z)));
} else {
tmp = fma(i, y, fma(log(c), (b - 0.5), t)) + a;
}
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(y * i)) <= 2e+25) tmp = fma(y, i, fma(Float64(b - 0.5), log(c), Float64(t + z))); else tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), t)) + a); 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[(y * i), $MachinePrecision]), $MachinePrecision], 2e+25], N[(y * i + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $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) + y \cdot i \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, t + z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\
\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)) < 2.00000000000000018e25Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6485.1
Applied rewrites85.1%
Taylor expanded in a around 0
Applied rewrites68.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6468.9
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6468.9
Applied rewrites68.9%
if 2.00000000000000018e25 < (+.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.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites84.2%
Taylor expanded in x around 0
Applied rewrites71.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= x -1.35e+188)
(+ (fma i y (fma (log y) x (fma -0.5 (log c) t))) a)
(if (<= x 1.6e+168)
(+ (+ (+ (+ t z) a) (* (- b 0.5) (log c))) (* y i))
(+ (fma i y z) (fma (log y) x (fma (- b 0.5) (log c) t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -1.35e+188) {
tmp = fma(i, y, fma(log(y), x, fma(-0.5, log(c), t))) + a;
} else if (x <= 1.6e+168) {
tmp = (((t + z) + a) + ((b - 0.5) * log(c))) + (y * i);
} else {
tmp = fma(i, y, z) + fma(log(y), x, fma((b - 0.5), log(c), t));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -1.35e+188) tmp = Float64(fma(i, y, fma(log(y), x, fma(-0.5, log(c), t))) + a); elseif (x <= 1.6e+168) tmp = Float64(Float64(Float64(Float64(t + z) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)); else tmp = Float64(fma(i, y, z) + fma(log(y), x, fma(Float64(b - 0.5), log(c), t))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -1.35e+188], N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x + N[(-0.5 * N[Log[c], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], If[LessEqual[x, 1.6e+168], N[(N[(N[(N[(t + z), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(i * y + z), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+188}:\\
\;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(-0.5, \log c, t\right)\right)\right) + a\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+168}:\\
\;\;\;\;\left(\left(\left(t + z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, y, z\right) + \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(b - 0.5, \log c, t\right)\right)\\
\end{array}
\end{array}
if x < -1.35e188Initial program 94.7%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites90.3%
Taylor expanded in b around 0
Applied rewrites90.3%
if -1.35e188 < x < 1.6000000000000001e168Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6497.3
Applied rewrites97.3%
if 1.6000000000000001e168 < x Initial program 99.8%
Taylor expanded in a around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-fma.f64N/A
+-commutativeN/A
associate-+l+N/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6489.2
Applied rewrites89.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.35e+188) (not (<= x 5.2e+178))) (+ (fma i y (fma (log y) x (fma -0.5 (log c) t))) a) (+ (+ (+ (+ t z) 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) {
double tmp;
if ((x <= -1.35e+188) || !(x <= 5.2e+178)) {
tmp = fma(i, y, fma(log(y), x, fma(-0.5, log(c), t))) + a;
} else {
tmp = (((t + z) + a) + ((b - 0.5) * log(c))) + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.35e+188) || !(x <= 5.2e+178)) tmp = Float64(fma(i, y, fma(log(y), x, fma(-0.5, log(c), t))) + a); else tmp = Float64(Float64(Float64(Float64(t + z) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.35e+188], N[Not[LessEqual[x, 5.2e+178]], $MachinePrecision]], N[(N[(i * y + N[(N[Log[y], $MachinePrecision] * x + N[(-0.5 * N[Log[c], $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision], N[(N[(N[(N[(t + z), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{+188} \lor \neg \left(x \leq 5.2 \cdot 10^{+178}\right):\\
\;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(-0.5, \log c, t\right)\right)\right) + a\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(t + z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\end{array}
\end{array}
if x < -1.35e188 or 5.2000000000000001e178 < x Initial program 97.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites91.3%
Taylor expanded in b around 0
Applied rewrites89.1%
if -1.35e188 < x < 5.2000000000000001e178Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6497.1
Applied rewrites97.1%
Final simplification95.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -3.7e+219) (not (<= x 1.45e+180))) (+ (+ a t) (fma (log c) (+ -0.5 b) (* (log y) x))) (+ (+ (+ (+ t z) 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) {
double tmp;
if ((x <= -3.7e+219) || !(x <= 1.45e+180)) {
tmp = (a + t) + fma(log(c), (-0.5 + b), (log(y) * x));
} else {
tmp = (((t + z) + a) + ((b - 0.5) * log(c))) + (y * i);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -3.7e+219) || !(x <= 1.45e+180)) tmp = Float64(Float64(a + t) + fma(log(c), Float64(-0.5 + b), Float64(log(y) * x))); else tmp = Float64(Float64(Float64(Float64(t + z) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -3.7e+219], N[Not[LessEqual[x, 1.45e+180]], $MachinePrecision]], N[(N[(a + t), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(-0.5 + b), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(t + z), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.7 \cdot 10^{+219} \lor \neg \left(x \leq 1.45 \cdot 10^{+180}\right):\\
\;\;\;\;\left(a + t\right) + \mathsf{fma}\left(\log c, -0.5 + b, \log y \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(t + z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\end{array}
\end{array}
if x < -3.7e219 or 1.45000000000000004e180 < x Initial program 97.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites92.5%
Taylor expanded in y around 0
Applied rewrites83.8%
if -3.7e219 < x < 1.45000000000000004e180Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6496.7
Applied rewrites96.7%
Final simplification94.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -8.8e+223) (not (<= x 1.8e+200))) (* (log y) x) (+ (+ (+ (+ t z) 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) {
double tmp;
if ((x <= -8.8e+223) || !(x <= 1.8e+200)) {
tmp = log(y) * x;
} else {
tmp = (((t + z) + a) + ((b - 0.5) * log(c))) + (y * i);
}
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 ((x <= (-8.8d+223)) .or. (.not. (x <= 1.8d+200))) then
tmp = log(y) * x
else
tmp = (((t + z) + a) + ((b - 0.5d0) * log(c))) + (y * i)
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 ((x <= -8.8e+223) || !(x <= 1.8e+200)) {
tmp = Math.log(y) * x;
} else {
tmp = (((t + z) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -8.8e+223) or not (x <= 1.8e+200): tmp = math.log(y) * x else: tmp = (((t + z) + a) + ((b - 0.5) * math.log(c))) + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -8.8e+223) || !(x <= 1.8e+200)) tmp = Float64(log(y) * x); else tmp = Float64(Float64(Float64(Float64(t + z) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -8.8e+223) || ~((x <= 1.8e+200))) tmp = log(y) * x; else tmp = (((t + z) + a) + ((b - 0.5) * log(c))) + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -8.8e+223], N[Not[LessEqual[x, 1.8e+200]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(N[(t + z), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+223} \lor \neg \left(x \leq 1.8 \cdot 10^{+200}\right):\\
\;\;\;\;\log y \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\left(t + z\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i\\
\end{array}
\end{array}
if x < -8.7999999999999999e223 or 1.7999999999999999e200 < x Initial program 96.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6424.3
Applied rewrites24.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6476.0
Applied rewrites76.0%
if -8.7999999999999999e223 < x < 1.7999999999999999e200Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6495.9
Applied rewrites95.9%
Final simplification93.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -8.8e+223) (not (<= x 1.8e+200))) (* (log y) x) (+ (+ a t) (fma (- b 0.5) (log c) (fma i y z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -8.8e+223) || !(x <= 1.8e+200)) {
tmp = log(y) * x;
} else {
tmp = (a + t) + fma((b - 0.5), log(c), fma(i, y, z));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -8.8e+223) || !(x <= 1.8e+200)) tmp = Float64(log(y) * x); else tmp = Float64(Float64(a + t) + fma(Float64(b - 0.5), log(c), fma(i, y, z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -8.8e+223], N[Not[LessEqual[x, 1.8e+200]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(a + t), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.8 \cdot 10^{+223} \lor \neg \left(x \leq 1.8 \cdot 10^{+200}\right):\\
\;\;\;\;\log y \cdot x\\
\mathbf{else}:\\
\;\;\;\;\left(a + t\right) + \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(i, y, z\right)\right)\\
\end{array}
\end{array}
if x < -8.7999999999999999e223 or 1.7999999999999999e200 < x Initial program 96.7%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6424.3
Applied rewrites24.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6476.0
Applied rewrites76.0%
if -8.7999999999999999e223 < x < 1.7999999999999999e200Initial 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.f6495.9
Applied rewrites95.9%
Final simplification93.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -4.2e+221) (not (<= x 3.5e+176))) (* (log y) x) (+ (fma i y (fma (log c) (- b 0.5) t)) a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -4.2e+221) || !(x <= 3.5e+176)) {
tmp = log(y) * x;
} else {
tmp = fma(i, y, fma(log(c), (b - 0.5), t)) + a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -4.2e+221) || !(x <= 3.5e+176)) tmp = Float64(log(y) * x); else tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), t)) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -4.2e+221], N[Not[LessEqual[x, 3.5e+176]], $MachinePrecision]], N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.2 \cdot 10^{+221} \lor \neg \left(x \leq 3.5 \cdot 10^{+176}\right):\\
\;\;\;\;\log y \cdot x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\
\end{array}
\end{array}
if x < -4.20000000000000004e221 or 3.50000000000000003e176 < x Initial program 97.3%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6430.6
Applied rewrites30.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6469.0
Applied rewrites69.0%
if -4.20000000000000004e221 < x < 3.50000000000000003e176Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites83.0%
Taylor expanded in x around 0
Applied rewrites80.2%
Final simplification78.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -5.8e+38) (fma y i (fma (log c) -0.5 (+ (+ t z) a))) (+ (fma i y (fma (log c) (- b 0.5) t)) a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -5.8e+38) {
tmp = fma(y, i, fma(log(c), -0.5, ((t + z) + a)));
} else {
tmp = fma(i, y, fma(log(c), (b - 0.5), t)) + a;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -5.8e+38) tmp = fma(y, i, fma(log(c), -0.5, Float64(Float64(t + z) + a))); else tmp = Float64(fma(i, y, fma(log(c), Float64(b - 0.5), t)) + a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5.8e+38], N[(y * i + N[(N[Log[c], $MachinePrecision] * -0.5 + N[(N[(t + z), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(i * y + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(y, i, \mathsf{fma}\left(\log c, -0.5, \left(t + z\right) + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(i, y, \mathsf{fma}\left(\log c, b - 0.5, t\right)\right) + a\\
\end{array}
\end{array}
if z < -5.80000000000000013e38Initial program 100.0%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
lower-+.f6490.4
Applied rewrites90.4%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6490.4
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6490.4
Applied rewrites90.4%
Taylor expanded in b around 0
Applied rewrites86.1%
if -5.80000000000000013e38 < z Initial program 99.4%
Taylor expanded in z around 0
+-commutativeN/A
lower-+.f64N/A
Applied rewrites89.3%
Taylor expanded in x around 0
Applied rewrites74.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= i -2.7e+72) (not (<= i 1.9e+65))) (* i y) (fma (/ z a) a a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((i <= -2.7e+72) || !(i <= 1.9e+65)) {
tmp = i * y;
} else {
tmp = fma((z / a), a, a);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -2.7e+72) || !(i <= 1.9e+65)) tmp = Float64(i * y); else tmp = fma(Float64(z / a), a, a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[i, -2.7e+72], N[Not[LessEqual[i, 1.9e+65]], $MachinePrecision]], N[(i * y), $MachinePrecision], N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \leq -2.7 \cdot 10^{+72} \lor \neg \left(i \leq 1.9 \cdot 10^{+65}\right):\\
\;\;\;\;i \cdot y\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\
\end{array}
\end{array}
if i < -2.7000000000000001e72 or 1.90000000000000006e65 < i Initial program 98.8%
Taylor expanded in y around inf
lower-*.f6456.8
Applied rewrites56.8%
if -2.7000000000000001e72 < i < 1.90000000000000006e65Initial 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
Applied rewrites67.5%
Applied rewrites67.4%
Taylor expanded in z around inf
Applied rewrites31.3%
Final simplification40.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.7e+144) (fma (/ z a) a a) (fma (/ (* i y) a) a a)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.7e+144) {
tmp = fma((z / a), a, a);
} else {
tmp = fma(((i * y) / a), a, a);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.7e+144) tmp = fma(Float64(z / a), a, a); else tmp = fma(Float64(Float64(i * y) / a), a, a); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.7e+144], N[(N[(z / a), $MachinePrecision] * a + a), $MachinePrecision], N[(N[(N[(i * y), $MachinePrecision] / a), $MachinePrecision] * a + a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.7 \cdot 10^{+144}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z}{a}, a, a\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{i \cdot y}{a}, a, a\right)\\
\end{array}
\end{array}
if z < -2.70000000000000015e144Initial program 100.0%
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
Applied rewrites62.9%
Applied rewrites62.6%
Taylor expanded in z around inf
Applied rewrites36.3%
if -2.70000000000000015e144 < z Initial program 99.4%
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
Applied rewrites70.9%
Taylor expanded in y around inf
Applied rewrites40.0%
Final simplification39.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.5%
Taylor expanded in y around inf
lower-*.f6427.3
Applied rewrites27.3%
herbie shell --seed 2024313
(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)))