
(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 (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-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.9
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-eval99.9
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 -1e+308)
(* y i)
(if (<= t_1 -10.0)
(* i (/ z i))
(if (<= t_1 INFINITY) (* i (/ a i)) (* 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 <= -1e+308) {
tmp = y * i;
} else if (t_1 <= -10.0) {
tmp = i * (z / i);
} else if (t_1 <= ((double) INFINITY)) {
tmp = i * (a / i);
} 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 <= -1e+308) {
tmp = y * i;
} else if (t_1 <= -10.0) {
tmp = i * (z / i);
} else if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = i * (a / i);
} 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 <= -1e+308: tmp = y * i elif t_1 <= -10.0: tmp = i * (z / i) elif t_1 <= math.inf: tmp = i * (a / i) 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 <= -1e+308) tmp = Float64(y * i); elseif (t_1 <= -10.0) tmp = Float64(i * Float64(z / i)); elseif (t_1 <= Inf) tmp = Float64(i * Float64(a / i)); 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 <= -1e+308) tmp = y * i; elseif (t_1 <= -10.0) tmp = i * (z / i); elseif (t_1 <= Inf) tmp = i * (a / i); 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, -1e+308], N[(y * i), $MachinePrecision], If[LessEqual[t$95$1, -10.0], N[(i * N[(z / i), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(i * N[(a / i), $MachinePrecision]), $MachinePrecision], 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 -1 \cdot 10^{+308}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;t\_1 \leq -10:\\
\;\;\;\;i \cdot \frac{z}{i}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;i \cdot \frac{a}{i}\\
\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)) < -1e308 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 100.0%
Taylor expanded in y around inf
lower-*.f6479.1
Applied rewrites79.1%
if -1e308 < (+.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)) < -10Initial 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 rewrites69.6%
Taylor expanded in z around inf
Applied rewrites13.4%
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
Applied rewrites5.5%
Final simplification13.2%
(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 -1e+308)
(* y i)
(if (<= t_1 -1e+53) (* i (/ z i)) (* i (+ y (/ a 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 <= -1e+308) {
tmp = y * i;
} else if (t_1 <= -1e+53) {
tmp = i * (z / i);
} else {
tmp = i * (y + (a / 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) :: t_1
real(8) :: tmp
t_1 = (y * i) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))
if (t_1 <= (-1d+308)) then
tmp = y * i
else if (t_1 <= (-1d+53)) then
tmp = i * (z / i)
else
tmp = i * (y + (a / 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 t_1 = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))));
double tmp;
if (t_1 <= -1e+308) {
tmp = y * i;
} else if (t_1 <= -1e+53) {
tmp = i * (z / i);
} else {
tmp = i * (y + (a / 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 <= -1e+308: tmp = y * i elif t_1 <= -1e+53: tmp = i * (z / i) else: tmp = i * (y + (a / 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 <= -1e+308) tmp = Float64(y * i); elseif (t_1 <= -1e+53) tmp = Float64(i * Float64(z / i)); else tmp = Float64(i * Float64(y + Float64(a / 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 <= -1e+308) tmp = y * i; elseif (t_1 <= -1e+53) tmp = i * (z / i); else tmp = i * (y + (a / 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, -1e+308], N[(y * i), $MachinePrecision], If[LessEqual[t$95$1, -1e+53], N[(i * N[(z / i), $MachinePrecision]), $MachinePrecision], N[(i * N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision]), $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 -1 \cdot 10^{+308}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+53}:\\
\;\;\;\;i \cdot \frac{z}{i}\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(y + \frac{a}{i}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1e308Initial program 100.0%
Taylor expanded in y around inf
lower-*.f6479.1
Applied rewrites79.1%
if -1e308 < (+.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)) < -9.9999999999999999e52Initial 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 rewrites68.8%
Taylor expanded in z around inf
Applied rewrites13.6%
if -9.9999999999999999e52 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
Taylor expanded in 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 rewrites66.1%
Taylor expanded in a around inf
Applied rewrites27.8%
Final simplification24.2%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (fma y i (* b (log c)))) (t_2 (* (log c) (- b 0.5)))) (if (<= t_2 -1e+157) t_1 (if (<= t_2 2e+144) (* i (+ y (/ z i))) t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma(y, i, (b * log(c)));
double t_2 = log(c) * (b - 0.5);
double tmp;
if (t_2 <= -1e+157) {
tmp = t_1;
} else if (t_2 <= 2e+144) {
tmp = i * (y + (z / i));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = fma(y, i, Float64(b * log(c))) t_2 = Float64(log(c) * Float64(b - 0.5)) tmp = 0.0 if (t_2 <= -1e+157) tmp = t_1; elseif (t_2 <= 2e+144) tmp = Float64(i * Float64(y + Float64(z / i))); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(y * i + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+157], t$95$1, If[LessEqual[t$95$2, 2e+144], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, i, b \cdot \log c\right)\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+157}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+144}:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -9.99999999999999983e156 or 2.00000000000000005e144 < (*.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.f6471.7
Applied rewrites71.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6471.7
Applied rewrites71.7%
if -9.99999999999999983e156 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 2.00000000000000005e144Initial 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.5%
Taylor expanded in z around inf
Applied rewrites34.1%
Final simplification44.8%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))
-10.0)
(* i (+ y (/ z i)))
(+ (* y i) (* x (/ a x)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((y * i) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))))) <= -10.0) {
tmp = i * (y + (z / i));
} else {
tmp = (y * i) + (x * (a / x));
}
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 * i) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))) <= (-10.0d0)) then
tmp = i * (y + (z / i))
else
tmp = (y * i) + (x * (a / x))
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 * i) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))))) <= -10.0) {
tmp = i * (y + (z / i));
} else {
tmp = (y * i) + (x * (a / x));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((y * i) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x)))))) <= -10.0: tmp = i * (y + (z / i)) else: tmp = (y * i) + (x * (a / x)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) <= -10.0) tmp = Float64(i * Float64(y + Float64(z / i))); else tmp = Float64(Float64(y * i) + Float64(x * Float64(a / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((y * i) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))))) <= -10.0) tmp = i * (y + (z / i)); else tmp = (y * i) + (x * (a / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[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], -10.0], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(x * N[(a / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;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) \leq -10:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + x \cdot \frac{a}{x}\\
\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)) < -10Initial 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 rewrites72.8%
Taylor expanded in z around inf
Applied rewrites31.3%
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)) 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 rewrites71.4%
Taylor expanded in a around inf
Applied rewrites30.8%
Final simplification31.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))
-10.0)
(* i (+ y (/ z i)))
(* i (+ y (/ a i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((y * i) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))))) <= -10.0) {
tmp = i * (y + (z / i));
} else {
tmp = i * (y + (a / 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 (((y * i) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))) <= (-10.0d0)) then
tmp = i * (y + (z / i))
else
tmp = i * (y + (a / 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 (((y * i) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))))) <= -10.0) {
tmp = i * (y + (z / i));
} else {
tmp = i * (y + (a / i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((y * i) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x)))))) <= -10.0: tmp = i * (y + (z / i)) else: tmp = i * (y + (a / i)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) <= -10.0) tmp = Float64(i * Float64(y + Float64(z / i))); else tmp = Float64(i * Float64(y + Float64(a / i))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((y * i) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))))) <= -10.0) tmp = i * (y + (z / i)); else tmp = i * (y + (a / i)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[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], -10.0], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(i * N[(y + N[(a / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;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) \leq -10:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot \left(y + \frac{a}{i}\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -10Initial 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 rewrites72.8%
Taylor expanded in z around inf
Applied rewrites31.3%
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)) Initial 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
Applied rewrites28.0%
Final simplification29.7%
(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 3e+107)
(+ t (+ a (fma y i t_1)))
(fma (log y) x (fma y i (+ (+ z t) (* a 1.0))))))))
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 <= 3e+107) {
tmp = t + (a + fma(y, i, t_1));
} else {
tmp = fma(log(y), x, fma(y, i, ((z + t) + (a * 1.0))));
}
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 <= 3e+107) tmp = Float64(t + Float64(a + fma(y, i, t_1))); else tmp = fma(log(y), x, fma(y, i, Float64(Float64(z + t) + Float64(a * 1.0)))); 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, 3e+107], N[(t + N[(a + N[(y * i + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[(y * i + N[(N[(z + t), $MachinePrecision] + N[(a * 1.0), $MachinePrecision]), $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 3 \cdot 10^{+107}:\\
\;\;\;\;t + \left(a + \mathsf{fma}\left(y, i, t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, \left(z + t\right) + a \cdot 1\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 < 3.00000000000000023e107Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6426.5
Applied rewrites26.5%
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 3.00000000000000023e107 < x Initial program 99.7%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-eval99.8
Applied rewrites99.8%
Taylor expanded in a around inf
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
lower-log.f6490.7
Applied rewrites90.7%
Taylor expanded in a around inf
Applied rewrites99.3%
lift-+.f64N/A
lift-fma.f64N/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
Applied rewrites99.3%
Final simplification96.3%
(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
(let* ((t_1 (+ (+ z t) (* a 1.0))))
(if (<= x -1.45e+112)
(+ (* y i) (fma (log y) x t_1))
(if (<= x 3e+107)
(+ t (+ a (fma y i (fma (log c) (+ b -0.5) z))))
(fma (log y) x (fma y i t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (z + t) + (a * 1.0);
double tmp;
if (x <= -1.45e+112) {
tmp = (y * i) + fma(log(y), x, t_1);
} else if (x <= 3e+107) {
tmp = t + (a + fma(y, i, fma(log(c), (b + -0.5), z)));
} else {
tmp = fma(log(y), x, fma(y, i, t_1));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(z + t) + Float64(a * 1.0)) tmp = 0.0 if (x <= -1.45e+112) tmp = Float64(Float64(y * i) + fma(log(y), x, t_1)); elseif (x <= 3e+107) tmp = Float64(t + Float64(a + fma(y, i, fma(log(c), Float64(b + -0.5), z)))); else tmp = fma(log(y), x, fma(y, i, t_1)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(z + t), $MachinePrecision] + N[(a * 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+112], N[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3e+107], N[(t + N[(a + N[(y * i + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[Log[y], $MachinePrecision] * x + N[(y * i + t$95$1), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z + t\right) + a \cdot 1\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+112}:\\
\;\;\;\;y \cdot i + \mathsf{fma}\left(\log y, x, t\_1\right)\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+107}:\\
\;\;\;\;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(\log y, x, \mathsf{fma}\left(y, i, t\_1\right)\right)\\
\end{array}
\end{array}
if x < -1.4500000000000001e112Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-eval99.8
Applied rewrites99.8%
Taylor expanded in a around inf
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
lower-log.f6486.9
Applied rewrites86.9%
Taylor expanded in a around inf
Applied rewrites88.1%
if -1.4500000000000001e112 < x < 3.00000000000000023e107Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6426.1
Applied rewrites26.1%
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%
if 3.00000000000000023e107 < x Initial program 99.7%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-eval99.8
Applied rewrites99.8%
Taylor expanded in a around inf
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
lower-log.f6490.7
Applied rewrites90.7%
Taylor expanded in a around inf
Applied rewrites99.3%
lift-+.f64N/A
lift-fma.f64N/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.3
Applied rewrites99.3%
Final simplification96.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma (log y) x (fma y i (+ (+ z t) (* a 1.0))))))
(if (<= x -1.45e+112)
t_1
(if (<= x 3e+107) (+ 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 = fma(log(y), x, fma(y, i, ((z + t) + (a * 1.0))));
double tmp;
if (x <= -1.45e+112) {
tmp = t_1;
} else if (x <= 3e+107) {
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 = fma(log(y), x, fma(y, i, Float64(Float64(z + t) + Float64(a * 1.0)))) tmp = 0.0 if (x <= -1.45e+112) tmp = t_1; elseif (x <= 3e+107) 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[(N[Log[y], $MachinePrecision] * x + N[(y * i + N[(N[(z + t), $MachinePrecision] + N[(a * 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.45e+112], t$95$1, If[LessEqual[x, 3e+107], 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 := \mathsf{fma}\left(\log y, x, \mathsf{fma}\left(y, i, \left(z + t\right) + a \cdot 1\right)\right)\\
\mathbf{if}\;x \leq -1.45 \cdot 10^{+112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 3 \cdot 10^{+107}:\\
\;\;\;\;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.4500000000000001e112 or 3.00000000000000023e107 < x Initial program 99.8%
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
lift-+.f64N/A
lift-+.f64N/A
associate-+l+N/A
associate-+l+N/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower-+.f64N/A
lower-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6499.8
lift--.f64N/A
sub-negN/A
lower-+.f64N/A
metadata-eval99.8
Applied rewrites99.8%
Taylor expanded in a around inf
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
sub-negN/A
metadata-evalN/A
lower-+.f64N/A
lower-/.f64N/A
lower-log.f6488.7
Applied rewrites88.7%
Taylor expanded in a around inf
Applied rewrites93.2%
lift-+.f64N/A
lift-fma.f64N/A
associate-+l+N/A
lower-fma.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6493.2
Applied rewrites93.2%
if -1.4500000000000001e112 < x < 3.00000000000000023e107Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6426.1
Applied rewrites26.1%
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 simplification96.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (* (log y) x))))
(if (<= x -3.8e+173)
t_1
(if (<= x 1.7e+213)
(+ 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 = (y * i) + (log(y) * x);
double tmp;
if (x <= -3.8e+173) {
tmp = t_1;
} else if (x <= 1.7e+213) {
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(Float64(y * i) + Float64(log(y) * x)) tmp = 0.0 if (x <= -3.8e+173) tmp = t_1; elseif (x <= 1.7e+213) 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[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+173], t$95$1, If[LessEqual[x, 1.7e+213], 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 := y \cdot i + \log y \cdot x\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+213}:\\
\;\;\;\;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 < -3.80000000000000011e173 or 1.69999999999999996e213 < x Initial program 99.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6478.7
Applied rewrites78.7%
if -3.80000000000000011e173 < x < 1.69999999999999996e213Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6424.2
Applied rewrites24.2%
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-+.f6496.1
Applied rewrites96.1%
Final simplification93.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (* (log y) x))))
(if (<= x -3.8e+173)
t_1
(if (<= x 1.7e+213)
(+ 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 = (y * i) + (log(y) * x);
double tmp;
if (x <= -3.8e+173) {
tmp = t_1;
} else if (x <= 1.7e+213) {
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(Float64(y * i) + Float64(log(y) * x)) tmp = 0.0 if (x <= -3.8e+173) tmp = t_1; elseif (x <= 1.7e+213) 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[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.8e+173], t$95$1, If[LessEqual[x, 1.7e+213], 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 := y \cdot i + \log y \cdot x\\
\mathbf{if}\;x \leq -3.8 \cdot 10^{+173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+213}:\\
\;\;\;\;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 < -3.80000000000000011e173 or 1.69999999999999996e213 < x Initial program 99.8%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6478.7
Applied rewrites78.7%
if -3.80000000000000011e173 < x < 1.69999999999999996e213Initial 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-+.f6496.1
Applied rewrites96.1%
Final simplification93.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (fma y i (* b (log c)))))
(if (<= b -3.1e+141)
t_1
(if (<= b 2.2e-224)
(* i (+ y (/ z i)))
(if (<= b 2.45e+141) (+ (* y i) (* (log y) x)) 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 <= -3.1e+141) {
tmp = t_1;
} else if (b <= 2.2e-224) {
tmp = i * (y + (z / i));
} else if (b <= 2.45e+141) {
tmp = (y * i) + (log(y) * x);
} 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 <= -3.1e+141) tmp = t_1; elseif (b <= 2.2e-224) tmp = Float64(i * Float64(y + Float64(z / i))); elseif (b <= 2.45e+141) tmp = Float64(Float64(y * i) + Float64(log(y) * x)); 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, -3.1e+141], t$95$1, If[LessEqual[b, 2.2e-224], N[(i * N[(y + N[(z / i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.45e+141], N[(N[(y * i), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x), $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 -3.1 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.2 \cdot 10^{-224}:\\
\;\;\;\;i \cdot \left(y + \frac{z}{i}\right)\\
\mathbf{elif}\;b \leq 2.45 \cdot 10^{+141}:\\
\;\;\;\;y \cdot i + \log y \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -3.10000000000000004e141 or 2.45000000000000005e141 < b Initial program 99.7%
Taylor expanded in b around inf
*-commutativeN/A
lower-*.f64N/A
lower-log.f6471.1
Applied rewrites71.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lower-fma.f6471.1
Applied rewrites71.1%
if -3.10000000000000004e141 < b < 2.2000000000000001e-224Initial program 100.0%
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 rewrites74.3%
Taylor expanded in z around inf
Applied rewrites36.5%
if 2.2000000000000001e-224 < b < 2.45000000000000005e141Initial program 99.9%
Taylor expanded in x around inf
lower-*.f64N/A
lower-log.f6444.0
Applied rewrites44.0%
Final simplification48.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 4.4e-79) (* i (/ a i)) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 4.4e-79) {
tmp = i * (a / i);
} else {
tmp = 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 (y <= 4.4d-79) then
tmp = i * (a / i)
else
tmp = 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 (y <= 4.4e-79) {
tmp = i * (a / i);
} else {
tmp = y * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 4.4e-79: tmp = i * (a / i) else: tmp = y * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 4.4e-79) tmp = Float64(i * Float64(a / i)); else tmp = Float64(y * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 4.4e-79) tmp = i * (a / i); else tmp = y * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 4.4e-79], N[(i * N[(a / i), $MachinePrecision]), $MachinePrecision], N[(y * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.4 \cdot 10^{-79}:\\
\;\;\;\;i \cdot \frac{a}{i}\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if y < 4.3999999999999998e-79Initial 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 rewrites71.5%
Taylor expanded in a around inf
Applied rewrites10.7%
if 4.3999999999999998e-79 < y Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6434.0
Applied rewrites34.0%
Final simplification25.7%
(FPCore (x y z t a b c i) :precision binary64 (* y i))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return 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 = 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 y * i;
}
def code(x, y, z, t, a, b, c, i): return y * i
function code(x, y, z, t, a, b, c, i) return Float64(y * i) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = y * i; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i
\end{array}
Initial program 99.9%
Taylor expanded in y around inf
lower-*.f6422.7
Applied rewrites22.7%
Final simplification22.7%
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)))