
(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 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
}
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) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))
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) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))));
}
def code(x, y, z, t, a, b, c, i): return (i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x)))))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x))))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y), $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]
\begin{array}{l}
\\
i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + \log y \cdot x\right)\right)\right)\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z t_1)))))))
(if (<= t_2 -2e+39)
(+ (* (log c) b) (fma y i z))
(if (<= t_2 5e+242) (+ t_1 (+ a t)) (+ (* i y) (+ a t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(y) * x;
double t_2 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + t_1))));
double tmp;
if (t_2 <= -2e+39) {
tmp = (log(c) * b) + fma(y, i, z);
} else if (t_2 <= 5e+242) {
tmp = t_1 + (a + t);
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + t_1))))) tmp = 0.0 if (t_2 <= -2e+39) tmp = Float64(Float64(log(c) * b) + fma(y, i, z)); elseif (t_2 <= 5e+242) tmp = Float64(t_1 + Float64(a + t)); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+39], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+242], N[(t$95$1 + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + t\_1\right)\right)\right)\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+39}:\\
\;\;\;\;\log c \cdot b + \mathsf{fma}\left(y, i, z\right)\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+242}:\\
\;\;\;\;t\_1 + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.99999999999999988e39Initial 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
*-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6484.8
Applied rewrites84.8%
Taylor expanded in b around inf
Applied rewrites50.3%
if -1.99999999999999988e39 < (+.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)) < 5.0000000000000004e242Initial program 99.7%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6494.1
Applied rewrites94.1%
Taylor expanded in x around inf
Applied rewrites62.8%
if 5.0000000000000004e242 < (+.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 x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.9
Applied rewrites90.9%
Taylor expanded in y around inf
Applied rewrites61.0%
Final simplification56.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log y) x))
(t_2 (+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z t_1)))))))
(if (<= t_2 -2e+39)
(* (+ (/ z i) y) i)
(if (<= t_2 5e+242) (+ t_1 (+ a t)) (+ (* i y) (+ a t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(y) * x;
double t_2 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + t_1))));
double tmp;
if (t_2 <= -2e+39) {
tmp = ((z / i) + y) * i;
} else if (t_2 <= 5e+242) {
tmp = t_1 + (a + t);
} else {
tmp = (i * y) + (a + t);
}
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) :: t_2
real(8) :: tmp
t_1 = log(y) * x
t_2 = (i * y) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + t_1))))
if (t_2 <= (-2d+39)) then
tmp = ((z / i) + y) * i
else if (t_2 <= 5d+242) then
tmp = t_1 + (a + t)
else
tmp = (i * y) + (a + t)
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 = Math.log(y) * x;
double t_2 = (i * y) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + t_1))));
double tmp;
if (t_2 <= -2e+39) {
tmp = ((z / i) + y) * i;
} else if (t_2 <= 5e+242) {
tmp = t_1 + (a + t);
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = math.log(y) * x t_2 = (i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + t_1)))) tmp = 0 if t_2 <= -2e+39: tmp = ((z / i) + y) * i elif t_2 <= 5e+242: tmp = t_1 + (a + t) else: tmp = (i * y) + (a + t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(y) * x) t_2 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + t_1))))) tmp = 0.0 if (t_2 <= -2e+39) tmp = Float64(Float64(Float64(z / i) + y) * i); elseif (t_2 <= 5e+242) tmp = Float64(t_1 + Float64(a + t)); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = log(y) * x; t_2 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + t_1)))); tmp = 0.0; if (t_2 <= -2e+39) tmp = ((z / i) + y) * i; elseif (t_2 <= 5e+242) tmp = t_1 + (a + t); else tmp = (i * y) + (a + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+39], N[(N[(N[(z / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$2, 5e+242], N[(t$95$1 + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x\\
t_2 := i \cdot y + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + \left(z + t\_1\right)\right)\right)\right)\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+39}:\\
\;\;\;\;\left(\frac{z}{i} + y\right) \cdot i\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+242}:\\
\;\;\;\;t\_1 + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -1.99999999999999988e39Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites68.6%
Taylor expanded in z around inf
Applied rewrites26.9%
if -1.99999999999999988e39 < (+.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)) < 5.0000000000000004e242Initial program 99.7%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6494.1
Applied rewrites94.1%
Taylor expanded in x around inf
Applied rewrites62.8%
if 5.0000000000000004e242 < (+.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 x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6490.9
Applied rewrites90.9%
Taylor expanded in y around inf
Applied rewrites61.0%
Final simplification45.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* i y)
(+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))))
(if (<= t_1 -2e+63)
(* (+ (/ z i) y) i)
(if (<= t_1 5e+246) (+ (* (log c) b) (+ a t)) (+ (* i y) (+ a t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
double tmp;
if (t_1 <= -2e+63) {
tmp = ((z / i) + y) * i;
} else if (t_1 <= 5e+246) {
tmp = (log(c) * b) + (a + t);
} else {
tmp = (i * y) + (a + t);
}
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 = (i * y) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))
if (t_1 <= (-2d+63)) then
tmp = ((z / i) + y) * i
else if (t_1 <= 5d+246) then
tmp = (log(c) * b) + (a + t)
else
tmp = (i * y) + (a + t)
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 = (i * y) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))));
double tmp;
if (t_1 <= -2e+63) {
tmp = ((z / i) + y) * i;
} else if (t_1 <= 5e+246) {
tmp = (Math.log(c) * b) + (a + t);
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x))))) tmp = 0 if t_1 <= -2e+63: tmp = ((z / i) + y) * i elif t_1 <= 5e+246: tmp = (math.log(c) * b) + (a + t) else: tmp = (i * y) + (a + t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) tmp = 0.0 if (t_1 <= -2e+63) tmp = Float64(Float64(Float64(z / i) + y) * i); elseif (t_1 <= 5e+246) tmp = Float64(Float64(log(c) * b) + Float64(a + t)); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x))))); tmp = 0.0; if (t_1 <= -2e+63) tmp = ((z / i) + y) * i; elseif (t_1 <= 5e+246) tmp = (log(c) * b) + (a + t); else tmp = (i * y) + (a + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[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, -2e+63], N[(N[(N[(z / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision], If[LessEqual[t$95$1, 5e+246], N[(N[(N[Log[c], $MachinePrecision] * b), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \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 -2 \cdot 10^{+63}:\\
\;\;\;\;\left(\frac{z}{i} + y\right) \cdot i\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+246}:\\
\;\;\;\;\log c \cdot b + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -2.00000000000000012e63Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites68.0%
Taylor expanded in z around inf
Applied rewrites27.3%
if -2.00000000000000012e63 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 4.99999999999999976e246Initial program 99.7%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6472.3
Applied rewrites72.3%
Taylor expanded in b around inf
Applied rewrites49.4%
if 4.99999999999999976e246 < (+.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 x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6489.8
Applied rewrites89.8%
Taylor expanded in y around inf
Applied rewrites63.1%
Final simplification41.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1
(+
(* i y)
(+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))))
(if (<= t_1 -9e+303)
(* i y)
(if (<= t_1 -200.0) (* (/ z i) i) (+ (* i y) (+ a t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))));
double tmp;
if (t_1 <= -9e+303) {
tmp = i * y;
} else if (t_1 <= -200.0) {
tmp = (z / i) * i;
} else {
tmp = (i * y) + (a + t);
}
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 = (i * y) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))
if (t_1 <= (-9d+303)) then
tmp = i * y
else if (t_1 <= (-200.0d0)) then
tmp = (z / i) * i
else
tmp = (i * y) + (a + t)
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 = (i * y) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))));
double tmp;
if (t_1 <= -9e+303) {
tmp = i * y;
} else if (t_1 <= -200.0) {
tmp = (z / i) * i;
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x))))) tmp = 0 if t_1 <= -9e+303: tmp = i * y elif t_1 <= -200.0: tmp = (z / i) * i else: tmp = (i * y) + (a + t) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) tmp = 0.0 if (t_1 <= -9e+303) tmp = Float64(i * y); elseif (t_1 <= -200.0) tmp = Float64(Float64(z / i) * i); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x))))); tmp = 0.0; if (t_1 <= -9e+303) tmp = i * y; elseif (t_1 <= -200.0) tmp = (z / i) * i; else tmp = (i * y) + (a + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(i * y), $MachinePrecision] + N[(N[(N[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, -9e+303], N[(i * y), $MachinePrecision], If[LessEqual[t$95$1, -200.0], N[(N[(z / i), $MachinePrecision] * i), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := i \cdot y + \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 -9 \cdot 10^{+303}:\\
\;\;\;\;i \cdot y\\
\mathbf{elif}\;t\_1 \leq -200:\\
\;\;\;\;\frac{z}{i} \cdot i\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -8.9999999999999997e303Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6475.1
Applied rewrites75.1%
if -8.9999999999999997e303 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < -200Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites64.4%
Taylor expanded in z around inf
Applied rewrites9.3%
if -200 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6479.7
Applied rewrites79.7%
Taylor expanded in y around inf
Applied rewrites49.9%
Final simplification35.4%
(FPCore (x y z t a b c i)
:precision binary64
(if (<=
(+ (* i y) (+ (* (log c) (- b 0.5)) (+ a (+ t (+ z (* (log y) x))))))
1e+54)
(* (+ (/ z i) y) i)
(+ (* i y) (+ a t))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))))) <= 1e+54) {
tmp = ((z / i) + y) * i;
} else {
tmp = (i * y) + (a + t);
}
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 (((i * y) + ((log(c) * (b - 0.5d0)) + (a + (t + (z + (log(y) * x)))))) <= 1d+54) then
tmp = ((z / i) + y) * i
else
tmp = (i * y) + (a + t)
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 (((i * y) + ((Math.log(c) * (b - 0.5)) + (a + (t + (z + (Math.log(y) * x)))))) <= 1e+54) {
tmp = ((z / i) + y) * i;
} else {
tmp = (i * y) + (a + t);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((i * y) + ((math.log(c) * (b - 0.5)) + (a + (t + (z + (math.log(y) * x)))))) <= 1e+54: tmp = ((z / i) + y) * i else: tmp = (i * y) + (a + t) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(i * y) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + Float64(z + Float64(log(y) * x)))))) <= 1e+54) tmp = Float64(Float64(Float64(z / i) + y) * i); else tmp = Float64(Float64(i * y) + Float64(a + t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((i * y) + ((log(c) * (b - 0.5)) + (a + (t + (z + (log(y) * x)))))) <= 1e+54) tmp = ((z / i) + y) * i; else tmp = (i * y) + (a + t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(i * y), $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], 1e+54], N[(N[(N[(z / i), $MachinePrecision] + y), $MachinePrecision] * i), $MachinePrecision], N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;i \cdot y + \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^{+54}:\\
\;\;\;\;\left(\frac{z}{i} + y\right) \cdot i\\
\mathbf{else}:\\
\;\;\;\;i \cdot y + \left(a + t\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) < 1.0000000000000001e54Initial program 99.9%
Taylor expanded in i around -inf
mul-1-negN/A
*-commutativeN/A
distribute-lft-neg-inN/A
distribute-lft-outN/A
mul-1-negN/A
remove-double-negN/A
lower-*.f64N/A
Applied rewrites69.5%
Taylor expanded in z around inf
Applied rewrites26.2%
if 1.0000000000000001e54 < (+.f64 (+.f64 (+.f64 (+.f64 (+.f64 (*.f64 x (log.f64 y)) z) t) a) (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c))) (*.f64 y i)) Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6480.3
Applied rewrites80.3%
Taylor expanded in y around inf
Applied rewrites50.3%
Final simplification38.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (fma (- b 0.5) (log c) (fma (log y) x z)) (+ a t))))
(if (<= x -3.1e+113)
t_1
(if (<= x 7e+119)
(+ (+ (+ (fma (- b 0.5) (log c) z) t) a) (* i y))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = fma((b - 0.5), log(c), fma(log(y), x, z)) + (a + t);
double tmp;
if (x <= -3.1e+113) {
tmp = t_1;
} else if (x <= 7e+119) {
tmp = ((fma((b - 0.5), log(c), z) + t) + a) + (i * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(fma(Float64(b - 0.5), log(c), fma(log(y), x, z)) + Float64(a + t)) tmp = 0.0 if (x <= -3.1e+113) tmp = t_1; elseif (x <= 7e+119) tmp = Float64(Float64(Float64(fma(Float64(b - 0.5), log(c), z) + t) + a) + Float64(i * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.1e+113], t$95$1, If[LessEqual[x, 7e+119], N[(N[(N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, z\right)\right) + \left(a + t\right)\\
\mathbf{if}\;x \leq -3.1 \cdot 10^{+113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 7 \cdot 10^{+119}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(b - 0.5, \log c, z\right) + t\right) + a\right) + i \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.09999999999999991e113 or 7.0000000000000001e119 < x Initial program 99.8%
Taylor expanded in y around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6487.3
Applied rewrites87.3%
if -3.09999999999999991e113 < x < 7.0000000000000001e119Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6497.7
Applied rewrites97.7%
Final simplification94.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 2.1e+116) (+ (fma (- b 0.5) (log c) (fma (log y) x t)) (fma y i z)) (+ (+ (+ (fma (- b 0.5) (log c) z) t) a) (* i y))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 2.1e+116) {
tmp = fma((b - 0.5), log(c), fma(log(y), x, t)) + fma(y, i, z);
} else {
tmp = ((fma((b - 0.5), log(c), z) + t) + a) + (i * y);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 2.1e+116) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(log(y), x, t)) + fma(y, i, z)); else tmp = Float64(Float64(Float64(fma(Float64(b - 0.5), log(c), z) + t) + a) + Float64(i * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 2.1e+116], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + t), $MachinePrecision]), $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.1 \cdot 10^{+116}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(\log y, x, t\right)\right) + \mathsf{fma}\left(y, i, z\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(b - 0.5, \log c, z\right) + t\right) + a\right) + i \cdot y\\
\end{array}
\end{array}
if a < 2.1000000000000001e116Initial 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
*-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6490.5
Applied rewrites90.5%
if 2.1000000000000001e116 < a Initial program 99.8%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6492.2
Applied rewrites92.2%
Final simplification90.8%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (fma (- b 0.5) (log c) a) (fma (log y) x z)) (* i y)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (fma((b - 0.5), log(c), a) + fma(log(y), x, z)) + (i * y);
}
function code(x, y, z, t, a, b, c, i) return Float64(Float64(fma(Float64(b - 0.5), log(c), a) + fma(log(y), x, z)) + Float64(i * y)) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + a), $MachinePrecision] + N[(N[Log[y], $MachinePrecision] * x + z), $MachinePrecision]), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(b - 0.5, \log c, a\right) + \mathsf{fma}\left(\log y, x, z\right)\right) + i \cdot y
\end{array}
Initial program 99.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-+r+N/A
associate-+l+N/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6483.0
Applied rewrites83.0%
Final simplification83.0%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* (log y) x) (fma y i z))))
(if (<= x -1.15e+144)
t_1
(if (<= x 1.8e+119)
(+ (+ (+ (fma (- b 0.5) (log c) z) t) a) (* i y))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (log(y) * x) + fma(y, i, z);
double tmp;
if (x <= -1.15e+144) {
tmp = t_1;
} else if (x <= 1.8e+119) {
tmp = ((fma((b - 0.5), log(c), z) + t) + a) + (i * y);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(log(y) * x) + fma(y, i, z)) tmp = 0.0 if (x <= -1.15e+144) tmp = t_1; elseif (x <= 1.8e+119) tmp = Float64(Float64(Float64(fma(Float64(b - 0.5), log(c), z) + t) + a) + Float64(i * y)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+144], t$95$1, If[LessEqual[x, 1.8e+119], N[(N[(N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(i * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x + \mathsf{fma}\left(y, i, z\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+119}:\\
\;\;\;\;\left(\left(\mathsf{fma}\left(b - 0.5, \log c, z\right) + t\right) + a\right) + i \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.1500000000000001e144 or 1.80000000000000001e119 < 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
*-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6494.5
Applied rewrites94.5%
Taylor expanded in x around inf
Applied rewrites80.5%
if -1.1500000000000001e144 < x < 1.80000000000000001e119Initial program 99.9%
Taylor expanded in x around 0
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f6497.3
Applied rewrites97.3%
Final simplification92.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* (log y) x) (fma y i z))))
(if (<= x -1.15e+144)
t_1
(if (<= x 1.8e+119)
(+ (fma (- b 0.5) (log c) (fma y i z)) (+ a t))
t_1))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (log(y) * x) + fma(y, i, z);
double tmp;
if (x <= -1.15e+144) {
tmp = t_1;
} else if (x <= 1.8e+119) {
tmp = fma((b - 0.5), log(c), fma(y, i, z)) + (a + t);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(log(y) * x) + fma(y, i, z)) tmp = 0.0 if (x <= -1.15e+144) tmp = t_1; elseif (x <= 1.8e+119) tmp = Float64(fma(Float64(b - 0.5), log(c), fma(y, i, z)) + Float64(a + t)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+144], t$95$1, If[LessEqual[x, 1.8e+119], N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x + \mathsf{fma}\left(y, i, z\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{+119}:\\
\;\;\;\;\mathsf{fma}\left(b - 0.5, \log c, \mathsf{fma}\left(y, i, z\right)\right) + \left(a + t\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.1500000000000001e144 or 1.80000000000000001e119 < 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
*-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6494.5
Applied rewrites94.5%
Taylor expanded in x around inf
Applied rewrites80.5%
if -1.1500000000000001e144 < x < 1.80000000000000001e119Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.3
Applied rewrites97.3%
Final simplification92.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* (log y) x) (fma y i z))))
(if (<= x -1.15e+144)
t_1
(if (<= x 1.4e+118) (+ (fma y i z) (fma (- b 0.5) (log c) a)) 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) + fma(y, i, z);
double tmp;
if (x <= -1.15e+144) {
tmp = t_1;
} else if (x <= 1.4e+118) {
tmp = fma(y, i, z) + fma((b - 0.5), log(c), a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(log(y) * x) + fma(y, i, z)) tmp = 0.0 if (x <= -1.15e+144) tmp = t_1; elseif (x <= 1.4e+118) tmp = Float64(fma(y, i, z) + fma(Float64(b - 0.5), log(c), a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(N[Log[y], $MachinePrecision] * x), $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.15e+144], t$95$1, If[LessEqual[x, 1.4e+118], N[(N[(y * i + z), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log y \cdot x + \mathsf{fma}\left(y, i, z\right)\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z\right) + \mathsf{fma}\left(b - 0.5, \log c, a\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.1500000000000001e144 or 1.39999999999999993e118 < 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
*-commutativeN/A
lower-fma.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f6494.5
Applied rewrites94.5%
Taylor expanded in x around inf
Applied rewrites80.5%
if -1.1500000000000001e144 < x < 1.39999999999999993e118Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6497.3
Applied rewrites97.3%
Taylor expanded in t around 0
Applied rewrites76.8%
Final simplification77.8%
(FPCore (x y z t a b c i) :precision binary64 (+ (* i y) (+ a t)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + (a + t);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (i * y) + (a + t)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (i * y) + (a + t);
}
def code(x, y, z, t, a, b, c, i): return (i * y) + (a + t)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(i * y) + Float64(a + t)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (i * y) + (a + t); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(i * y), $MachinePrecision] + N[(a + t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y + \left(a + t\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
associate-+r+N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower--.f64N/A
lower-log.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f6481.0
Applied rewrites81.0%
Taylor expanded in y around inf
Applied rewrites50.9%
Final simplification50.9%
(FPCore (x y z t a b c i) :precision binary64 (* i y))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return i * y;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = i * y
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return i * y;
}
def code(x, y, z, t, a, b, c, i): return i * y
function code(x, y, z, t, a, b, c, i) return Float64(i * y) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = i * y; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(i * y), $MachinePrecision]
\begin{array}{l}
\\
i \cdot y
\end{array}
Initial program 99.9%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6420.8
Applied rewrites20.8%
Final simplification20.8%
herbie shell --seed 2024243
(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)))