
(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 17 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}
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (fma y i (fma (+ b -0.5) (log c) (+ (fma x (log y) a) (+ z t)))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, fma((b + -0.5), log(c), (fma(x, log(y), a) + (z + t))));
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(fma(x, log(y), a) + Float64(z + t)))) end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision] + a), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(x, \log y, a\right) + \left(z + t\right)\right)\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Final simplification99.9%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5))) (* y i)))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0))) + (y * i)
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((a + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5))) + (y * i);
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return ((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5))) + (y * i)
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i
\end{array}
Initial program 99.8%
Final simplification99.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (or (<= x -6e+193) (not (<= x 4e+234)))
(+ t (+ z (+ (* x (log y)) t_1)))
(+ (* y i) (+ a (+ t (+ z t_1)))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(c) * (b - 0.5);
double tmp;
if ((x <= -6e+193) || !(x <= 4e+234)) {
tmp = t + (z + ((x * log(y)) + t_1));
} else {
tmp = (y * i) + (a + (t + (z + t_1)));
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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 = log(c) * (b - 0.5d0)
if ((x <= (-6d+193)) .or. (.not. (x <= 4d+234))) then
tmp = t + (z + ((x * log(y)) + t_1))
else
tmp = (y * i) + (a + (t + (z + t_1)))
end if
code = tmp
end function
assert z < t && t < a;
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(c) * (b - 0.5);
double tmp;
if ((x <= -6e+193) || !(x <= 4e+234)) {
tmp = t + (z + ((x * Math.log(y)) + t_1));
} else {
tmp = (y * i) + (a + (t + (z + t_1)));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = math.log(c) * (b - 0.5) tmp = 0 if (x <= -6e+193) or not (x <= 4e+234): tmp = t + (z + ((x * math.log(y)) + t_1)) else: tmp = (y * i) + (a + (t + (z + t_1))) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(c) * Float64(b - 0.5)) tmp = 0.0 if ((x <= -6e+193) || !(x <= 4e+234)) tmp = Float64(t + Float64(z + Float64(Float64(x * log(y)) + t_1))); else tmp = Float64(Float64(y * i) + Float64(a + Float64(t + Float64(z + t_1)))); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = log(c) * (b - 0.5);
tmp = 0.0;
if ((x <= -6e+193) || ~((x <= 4e+234)))
tmp = t + (z + ((x * log(y)) + t_1));
else
tmp = (y * i) + (a + (t + (z + t_1)));
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -6e+193], N[Not[LessEqual[x, 4e+234]], $MachinePrecision]], N[(t + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{+193} \lor \neg \left(x \leq 4 \cdot 10^{+234}\right):\\
\;\;\;\;t + \left(z + \left(x \cdot \log y + t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(t + \left(z + t_1\right)\right)\right)\\
\end{array}
\end{array}
if x < -6e193 or 4.00000000000000007e234 < x Initial program 99.6%
add-cube-cbrt98.7%
pow398.5%
Applied egg-rr98.5%
Taylor expanded in a around 0 89.4%
associate-+r+89.4%
sub-neg89.4%
metadata-eval89.4%
fma-def89.4%
pow-base-189.4%
*-lft-identity89.4%
Simplified89.4%
Taylor expanded in y around 0 83.4%
if -6e193 < x < 4.00000000000000007e234Initial program 99.9%
Taylor expanded in x around 0 95.5%
Final simplification94.0%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.95e+195) (not (<= x 6e+234))) (+ t (+ z (+ (* x (log y)) (* (log c) (- b 0.5))))) (+ (* y i) (fma (log c) (+ b -0.5) (+ a (+ z t))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.95e+195) || !(x <= 6e+234)) {
tmp = t + (z + ((x * log(y)) + (log(c) * (b - 0.5))));
} else {
tmp = (y * i) + fma(log(c), (b + -0.5), (a + (z + t)));
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.95e+195) || !(x <= 6e+234)) tmp = Float64(t + Float64(z + Float64(Float64(x * log(y)) + Float64(log(c) * Float64(b - 0.5))))); else tmp = Float64(Float64(y * i) + fma(log(c), Float64(b + -0.5), Float64(a + Float64(z + t)))); end return tmp end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.95e+195], N[Not[LessEqual[x, 6e+234]], $MachinePrecision]], N[(t + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.95 \cdot 10^{+195} \lor \neg \left(x \leq 6 \cdot 10^{+234}\right):\\
\;\;\;\;t + \left(z + \left(x \cdot \log y + \log c \cdot \left(b - 0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \mathsf{fma}\left(\log c, b + -0.5, a + \left(z + t\right)\right)\\
\end{array}
\end{array}
if x < -1.9499999999999999e195 or 5.9999999999999998e234 < x Initial program 99.6%
add-cube-cbrt98.7%
pow398.5%
Applied egg-rr98.5%
Taylor expanded in a around 0 89.4%
associate-+r+89.4%
sub-neg89.4%
metadata-eval89.4%
fma-def89.4%
pow-base-189.4%
*-lft-identity89.4%
Simplified89.4%
Taylor expanded in y around 0 83.4%
if -1.9499999999999999e195 < x < 5.9999999999999998e234Initial program 99.9%
Taylor expanded in x around 0 95.5%
associate-+r+95.5%
+-commutative95.5%
*-commutative95.5%
sub-neg95.5%
metadata-eval95.5%
associate-+r+95.5%
+-commutative95.5%
+-commutative95.5%
associate-+r+95.5%
+-commutative95.5%
*-commutative95.5%
fma-def95.5%
+-commutative95.5%
associate-+r+95.5%
+-commutative95.5%
+-commutative95.5%
+-commutative95.5%
Simplified95.5%
Final simplification94.0%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* b (log c)))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)));
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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) + ((a + (t + (z + (x * log(y))))) + (b * log(c)))
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * Math.log(y))))) + (b * Math.log(c)));
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (b * math.log(c)))
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(b * log(c)))) end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)));
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + b \cdot \log c\right)
\end{array}
Initial program 99.8%
Taylor expanded in b around inf 97.0%
*-commutative97.0%
Simplified97.0%
Final simplification97.0%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x (log y)) (* y i)))
(t_2 (+ a (+ z (* (log c) (- b 0.5))))))
(if (<= y 6.55e+47)
t_2
(if (<= y 7.2e+76)
t_1
(if (<= y 3e+93)
t_2
(if (<= y 3.8e+128)
t_1
(if (<= y 5.2e+139)
t_2
(if (<= y 8.2e+189)
(+ (* y i) (* b (log c)))
(if (<= y 3.6e+242) (+ z (* y i)) t_1)))))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * log(y)) + (y * i);
double t_2 = a + (z + (log(c) * (b - 0.5)));
double tmp;
if (y <= 6.55e+47) {
tmp = t_2;
} else if (y <= 7.2e+76) {
tmp = t_1;
} else if (y <= 3e+93) {
tmp = t_2;
} else if (y <= 3.8e+128) {
tmp = t_1;
} else if (y <= 5.2e+139) {
tmp = t_2;
} else if (y <= 8.2e+189) {
tmp = (y * i) + (b * log(c));
} else if (y <= 3.6e+242) {
tmp = z + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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 = (x * log(y)) + (y * i)
t_2 = a + (z + (log(c) * (b - 0.5d0)))
if (y <= 6.55d+47) then
tmp = t_2
else if (y <= 7.2d+76) then
tmp = t_1
else if (y <= 3d+93) then
tmp = t_2
else if (y <= 3.8d+128) then
tmp = t_1
else if (y <= 5.2d+139) then
tmp = t_2
else if (y <= 8.2d+189) then
tmp = (y * i) + (b * log(c))
else if (y <= 3.6d+242) then
tmp = z + (y * i)
else
tmp = t_1
end if
code = tmp
end function
assert z < t && t < a;
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)) + (y * i);
double t_2 = a + (z + (Math.log(c) * (b - 0.5)));
double tmp;
if (y <= 6.55e+47) {
tmp = t_2;
} else if (y <= 7.2e+76) {
tmp = t_1;
} else if (y <= 3e+93) {
tmp = t_2;
} else if (y <= 3.8e+128) {
tmp = t_1;
} else if (y <= 5.2e+139) {
tmp = t_2;
} else if (y <= 8.2e+189) {
tmp = (y * i) + (b * Math.log(c));
} else if (y <= 3.6e+242) {
tmp = z + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = (x * math.log(y)) + (y * i) t_2 = a + (z + (math.log(c) * (b - 0.5))) tmp = 0 if y <= 6.55e+47: tmp = t_2 elif y <= 7.2e+76: tmp = t_1 elif y <= 3e+93: tmp = t_2 elif y <= 3.8e+128: tmp = t_1 elif y <= 5.2e+139: tmp = t_2 elif y <= 8.2e+189: tmp = (y * i) + (b * math.log(c)) elif y <= 3.6e+242: tmp = z + (y * i) else: tmp = t_1 return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * log(y)) + Float64(y * i)) t_2 = Float64(a + Float64(z + Float64(log(c) * Float64(b - 0.5)))) tmp = 0.0 if (y <= 6.55e+47) tmp = t_2; elseif (y <= 7.2e+76) tmp = t_1; elseif (y <= 3e+93) tmp = t_2; elseif (y <= 3.8e+128) tmp = t_1; elseif (y <= 5.2e+139) tmp = t_2; elseif (y <= 8.2e+189) tmp = Float64(Float64(y * i) + Float64(b * log(c))); elseif (y <= 3.6e+242) tmp = Float64(z + Float64(y * i)); else tmp = t_1; end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (x * log(y)) + (y * i);
t_2 = a + (z + (log(c) * (b - 0.5)));
tmp = 0.0;
if (y <= 6.55e+47)
tmp = t_2;
elseif (y <= 7.2e+76)
tmp = t_1;
elseif (y <= 3e+93)
tmp = t_2;
elseif (y <= 3.8e+128)
tmp = t_1;
elseif (y <= 5.2e+139)
tmp = t_2;
elseif (y <= 8.2e+189)
tmp = (y * i) + (b * log(c));
elseif (y <= 3.6e+242)
tmp = z + (y * i);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 6.55e+47], t$95$2, If[LessEqual[y, 7.2e+76], t$95$1, If[LessEqual[y, 3e+93], t$95$2, If[LessEqual[y, 3.8e+128], t$95$1, If[LessEqual[y, 5.2e+139], t$95$2, If[LessEqual[y, 8.2e+189], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.6e+242], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot \log y + y \cdot i\\
t_2 := a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{if}\;y \leq 6.55 \cdot 10^{+47}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 3 \cdot 10^{+93}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 3.8 \cdot 10^{+128}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+139}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+189}:\\
\;\;\;\;y \cdot i + b \cdot \log c\\
\mathbf{elif}\;y \leq 3.6 \cdot 10^{+242}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if y < 6.55000000000000025e47 or 7.2000000000000006e76 < y < 2.99999999999999978e93 or 3.7999999999999999e128 < y < 5.20000000000000044e139Initial program 99.8%
Taylor expanded in x around 0 86.3%
associate-+r+86.3%
+-commutative86.3%
*-commutative86.3%
sub-neg86.3%
metadata-eval86.3%
associate-+r+86.3%
+-commutative86.3%
+-commutative86.3%
associate-+r+86.3%
+-commutative86.3%
*-commutative86.3%
fma-def86.3%
+-commutative86.3%
associate-+r+86.3%
+-commutative86.3%
+-commutative86.3%
+-commutative86.3%
Simplified86.3%
Taylor expanded in t around 0 69.2%
Taylor expanded in y around 0 65.8%
if 6.55000000000000025e47 < y < 7.2000000000000006e76 or 2.99999999999999978e93 < y < 3.7999999999999999e128 or 3.59999999999999995e242 < y Initial program 99.8%
Taylor expanded in x around inf 82.6%
if 5.20000000000000044e139 < y < 8.2000000000000004e189Initial program 99.9%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in b around inf 77.7%
*-commutative77.7%
Simplified77.7%
if 8.2000000000000004e189 < y < 3.59999999999999995e242Initial program 99.8%
Taylor expanded in z around inf 57.6%
Final simplification69.9%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.05e+192) (not (<= x 4.1e+207))) (+ (* x (log y)) (* y i)) (+ (* y i) (+ a (+ t (+ z (* (log c) (- b 0.5))))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.05e+192) || !(x <= 4.1e+207)) {
tmp = (x * log(y)) + (y * i);
} else {
tmp = (y * i) + (a + (t + (z + (log(c) * (b - 0.5)))));
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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 <= (-1.05d+192)) .or. (.not. (x <= 4.1d+207))) then
tmp = (x * log(y)) + (y * i)
else
tmp = (y * i) + (a + (t + (z + (log(c) * (b - 0.5d0)))))
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.05e+192) || !(x <= 4.1e+207)) {
tmp = (x * Math.log(y)) + (y * i);
} else {
tmp = (y * i) + (a + (t + (z + (Math.log(c) * (b - 0.5)))));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.05e+192) or not (x <= 4.1e+207): tmp = (x * math.log(y)) + (y * i) else: tmp = (y * i) + (a + (t + (z + (math.log(c) * (b - 0.5))))) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.05e+192) || !(x <= 4.1e+207)) tmp = Float64(Float64(x * log(y)) + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5)))))); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((x <= -1.05e+192) || ~((x <= 4.1e+207)))
tmp = (x * log(y)) + (y * i);
else
tmp = (y * i) + (a + (t + (z + (log(c) * (b - 0.5)))));
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.05e+192], N[Not[LessEqual[x, 4.1e+207]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.05 \cdot 10^{+192} \lor \neg \left(x \leq 4.1 \cdot 10^{+207}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.04999999999999997e192 or 4.1e207 < x Initial program 99.7%
Taylor expanded in x around inf 74.6%
if -1.04999999999999997e192 < x < 4.1e207Initial program 99.9%
Taylor expanded in x around 0 97.1%
Final simplification93.5%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -9.5e+193) (not (<= x 1.5e+206))) (+ (* x (log y)) (* y i)) (+ (* y i) (+ a (+ z (* (log c) (- b 0.5)))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -9.5e+193) || !(x <= 1.5e+206)) {
tmp = (x * log(y)) + (y * i);
} else {
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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 <= (-9.5d+193)) .or. (.not. (x <= 1.5d+206))) then
tmp = (x * log(y)) + (y * i)
else
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5d0))))
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -9.5e+193) || !(x <= 1.5e+206)) {
tmp = (x * Math.log(y)) + (y * i);
} else {
tmp = (y * i) + (a + (z + (Math.log(c) * (b - 0.5))));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -9.5e+193) or not (x <= 1.5e+206): tmp = (x * math.log(y)) + (y * i) else: tmp = (y * i) + (a + (z + (math.log(c) * (b - 0.5)))) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -9.5e+193) || !(x <= 1.5e+206)) tmp = Float64(Float64(x * log(y)) + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(a + Float64(z + Float64(log(c) * Float64(b - 0.5))))); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if ((x <= -9.5e+193) || ~((x <= 1.5e+206)))
tmp = (x * log(y)) + (y * i);
else
tmp = (y * i) + (a + (z + (log(c) * (b - 0.5))));
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -9.5e+193], N[Not[LessEqual[x, 1.5e+206]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9.5 \cdot 10^{+193} \lor \neg \left(x \leq 1.5 \cdot 10^{+206}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\\
\end{array}
\end{array}
if x < -9.4999999999999997e193 or 1.5000000000000001e206 < x Initial program 99.7%
Taylor expanded in x around inf 74.6%
if -9.4999999999999997e193 < x < 1.5000000000000001e206Initial program 99.9%
Taylor expanded in x around 0 97.1%
associate-+r+97.1%
+-commutative97.1%
*-commutative97.1%
sub-neg97.1%
metadata-eval97.1%
associate-+r+97.1%
+-commutative97.1%
+-commutative97.1%
associate-+r+97.1%
+-commutative97.1%
*-commutative97.1%
fma-def97.1%
+-commutative97.1%
associate-+r+97.1%
+-commutative97.1%
+-commutative97.1%
+-commutative97.1%
Simplified97.1%
Taylor expanded in t around 0 82.5%
Final simplification81.2%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= y 6.55e+47)
(+ a (+ z (* (log c) (- b 0.5))))
(if (<= y 5e+59)
(+ (* x (log y)) (* y i))
(+ (* y i) (+ (* b (log c)) (+ z t))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 6.55e+47) {
tmp = a + (z + (log(c) * (b - 0.5)));
} else if (y <= 5e+59) {
tmp = (x * log(y)) + (y * i);
} else {
tmp = (y * i) + ((b * log(c)) + (z + t));
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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 <= 6.55d+47) then
tmp = a + (z + (log(c) * (b - 0.5d0)))
else if (y <= 5d+59) then
tmp = (x * log(y)) + (y * i)
else
tmp = (y * i) + ((b * log(c)) + (z + t))
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 6.55e+47) {
tmp = a + (z + (Math.log(c) * (b - 0.5)));
} else if (y <= 5e+59) {
tmp = (x * Math.log(y)) + (y * i);
} else {
tmp = (y * i) + ((b * Math.log(c)) + (z + t));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 6.55e+47: tmp = a + (z + (math.log(c) * (b - 0.5))) elif y <= 5e+59: tmp = (x * math.log(y)) + (y * i) else: tmp = (y * i) + ((b * math.log(c)) + (z + t)) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 6.55e+47) tmp = Float64(a + Float64(z + Float64(log(c) * Float64(b - 0.5)))); elseif (y <= 5e+59) tmp = Float64(Float64(x * log(y)) + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(Float64(b * log(c)) + Float64(z + t))); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (y <= 6.55e+47)
tmp = a + (z + (log(c) * (b - 0.5)));
elseif (y <= 5e+59)
tmp = (x * log(y)) + (y * i);
else
tmp = (y * i) + ((b * log(c)) + (z + t));
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 6.55e+47], N[(a + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5e+59], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.55 \cdot 10^{+47}:\\
\;\;\;\;a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{elif}\;y \leq 5 \cdot 10^{+59}:\\
\;\;\;\;x \cdot \log y + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(b \cdot \log c + \left(z + t\right)\right)\\
\end{array}
\end{array}
if y < 6.55000000000000025e47Initial program 99.8%
Taylor expanded in x around 0 84.8%
associate-+r+84.8%
+-commutative84.8%
*-commutative84.8%
sub-neg84.8%
metadata-eval84.8%
associate-+r+84.8%
+-commutative84.8%
+-commutative84.8%
associate-+r+84.8%
+-commutative84.8%
*-commutative84.8%
fma-def84.8%
+-commutative84.8%
associate-+r+84.8%
+-commutative84.8%
+-commutative84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in t around 0 68.1%
Taylor expanded in y around 0 65.8%
if 6.55000000000000025e47 < y < 4.9999999999999997e59Initial program 99.3%
Taylor expanded in x around inf 85.9%
if 4.9999999999999997e59 < y Initial program 99.9%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 90.8%
associate-+r+90.8%
sub-neg90.8%
metadata-eval90.8%
fma-def90.8%
pow-base-190.8%
*-lft-identity90.8%
Simplified90.8%
Taylor expanded in b around inf 84.0%
*-commutative84.0%
Simplified84.0%
Final simplification74.0%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(if (<= a 3.15e-21)
(fma y i z)
(if (<= a 1.95e+19)
(+ (* y i) (* b (log c)))
(if (<= a 1.66e+128) (+ z (* y i)) (fma y i a)))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 3.15e-21) {
tmp = fma(y, i, z);
} else if (a <= 1.95e+19) {
tmp = (y * i) + (b * log(c));
} else if (a <= 1.66e+128) {
tmp = z + (y * i);
} else {
tmp = fma(y, i, a);
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 3.15e-21) tmp = fma(y, i, z); elseif (a <= 1.95e+19) tmp = Float64(Float64(y * i) + Float64(b * log(c))); elseif (a <= 1.66e+128) tmp = Float64(z + Float64(y * i)); else tmp = fma(y, i, a); end return tmp end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 3.15e-21], N[(y * i + z), $MachinePrecision], If[LessEqual[a, 1.95e+19], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.66e+128], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(y * i + a), $MachinePrecision]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.15 \cdot 10^{-21}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
\mathbf{elif}\;a \leq 1.95 \cdot 10^{+19}:\\
\;\;\;\;y \cdot i + b \cdot \log c\\
\mathbf{elif}\;a \leq 1.66 \cdot 10^{+128}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
\end{array}
\end{array}
if a < 3.15e-21Initial program 99.8%
Taylor expanded in z around inf 45.1%
Taylor expanded in z around 0 45.1%
+-commutative45.1%
*-commutative45.1%
fma-udef45.1%
Simplified45.1%
if 3.15e-21 < a < 1.95e19Initial program 99.7%
add-cube-cbrt99.5%
pow399.5%
Applied egg-rr99.5%
Taylor expanded in b around inf 67.4%
*-commutative67.4%
Simplified67.4%
if 1.95e19 < a < 1.6599999999999999e128Initial program 100.0%
Taylor expanded in z around inf 51.0%
if 1.6599999999999999e128 < a Initial program 99.9%
Taylor expanded in a around inf 56.0%
Taylor expanded in a around 0 56.0%
+-commutative56.0%
*-commutative56.0%
fma-def56.0%
Simplified56.0%
Final simplification48.3%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= a 4.2e+128) (+ z (* y i)) (fma y i a)))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 4.2e+128) {
tmp = z + (y * i);
} else {
tmp = fma(y, i, a);
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 4.2e+128) tmp = Float64(z + Float64(y * i)); else tmp = fma(y, i, a); end return tmp end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 4.2e+128], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(y * i + a), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.2 \cdot 10^{+128}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
\end{array}
\end{array}
if a < 4.1999999999999999e128Initial program 99.8%
Taylor expanded in z around inf 45.2%
if 4.1999999999999999e128 < a Initial program 99.9%
Taylor expanded in a around inf 56.0%
Taylor expanded in a around 0 56.0%
+-commutative56.0%
*-commutative56.0%
fma-def56.0%
Simplified56.0%
Final simplification46.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= a 5.8e+128) (fma y i z) (fma y i a)))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 5.8e+128) {
tmp = fma(y, i, z);
} else {
tmp = fma(y, i, a);
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 5.8e+128) tmp = fma(y, i, z); else tmp = fma(y, i, a); end return tmp end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 5.8e+128], N[(y * i + z), $MachinePrecision], N[(y * i + a), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 5.8 \cdot 10^{+128}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a\right)\\
\end{array}
\end{array}
if a < 5.8000000000000001e128Initial program 99.8%
Taylor expanded in z around inf 45.2%
Taylor expanded in z around 0 45.2%
+-commutative45.2%
*-commutative45.2%
fma-udef45.2%
Simplified45.2%
if 5.8000000000000001e128 < a Initial program 99.9%
Taylor expanded in a around inf 56.0%
Taylor expanded in a around 0 56.0%
+-commutative56.0%
*-commutative56.0%
fma-def56.0%
Simplified56.0%
Final simplification46.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= y 1.1e-126) z (if (<= y 1.2e+57) a (* y i))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 1.1e-126) {
tmp = z;
} else if (y <= 1.2e+57) {
tmp = a;
} else {
tmp = y * i;
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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 <= 1.1d-126) then
tmp = z
else if (y <= 1.2d+57) then
tmp = a
else
tmp = y * i
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 1.1e-126) {
tmp = z;
} else if (y <= 1.2e+57) {
tmp = a;
} else {
tmp = y * i;
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 1.1e-126: tmp = z elif y <= 1.2e+57: tmp = a else: tmp = y * i return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 1.1e-126) tmp = z; elseif (y <= 1.2e+57) tmp = a; else tmp = Float64(y * i); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (y <= 1.1e-126)
tmp = z;
elseif (y <= 1.2e+57)
tmp = a;
else
tmp = y * i;
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.1e-126], z, If[LessEqual[y, 1.2e+57], a, N[(y * i), $MachinePrecision]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.1 \cdot 10^{-126}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 1.2 \cdot 10^{+57}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if y < 1.10000000000000007e-126Initial program 99.8%
Taylor expanded in x around 0 82.6%
associate-+r+82.6%
+-commutative82.6%
*-commutative82.6%
sub-neg82.6%
metadata-eval82.6%
associate-+r+82.6%
+-commutative82.6%
+-commutative82.6%
associate-+r+82.6%
+-commutative82.6%
*-commutative82.6%
fma-def82.6%
+-commutative82.6%
associate-+r+82.6%
+-commutative82.6%
+-commutative82.6%
+-commutative82.6%
Simplified82.6%
Taylor expanded in b around 0 56.5%
associate-+r+56.5%
*-commutative56.5%
Simplified56.5%
Taylor expanded in z around inf 21.2%
if 1.10000000000000007e-126 < y < 1.20000000000000002e57Initial program 99.9%
Taylor expanded in x around 0 83.8%
associate-+r+83.8%
+-commutative83.8%
*-commutative83.8%
sub-neg83.8%
metadata-eval83.8%
associate-+r+83.8%
+-commutative83.8%
+-commutative83.8%
associate-+r+83.8%
+-commutative83.8%
*-commutative83.8%
fma-def83.8%
+-commutative83.8%
associate-+r+83.8%
+-commutative83.8%
+-commutative83.8%
+-commutative83.8%
Simplified83.8%
Taylor expanded in b around 0 67.8%
associate-+r+67.8%
*-commutative67.8%
Simplified67.8%
Taylor expanded in a around inf 18.1%
if 1.20000000000000002e57 < y Initial program 99.8%
Taylor expanded in a around inf 60.9%
Taylor expanded in a around 0 52.6%
*-commutative52.6%
Simplified52.6%
Final simplification33.9%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.65e+216) z (+ a (* y i))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.65e+216) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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 (z <= (-1.65d+216)) then
tmp = z
else
tmp = a + (y * i)
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.65e+216) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -1.65e+216: tmp = z else: tmp = a + (y * i) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -1.65e+216) tmp = z; else tmp = Float64(a + Float64(y * i)); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (z <= -1.65e+216)
tmp = z;
else
tmp = a + (y * i);
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.65e+216], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.65 \cdot 10^{+216}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -1.65e216Initial program 99.9%
Taylor expanded in x around 0 95.1%
associate-+r+95.1%
+-commutative95.1%
*-commutative95.1%
sub-neg95.1%
metadata-eval95.1%
associate-+r+95.1%
+-commutative95.1%
+-commutative95.1%
associate-+r+95.1%
+-commutative95.1%
*-commutative95.1%
fma-def95.1%
+-commutative95.1%
associate-+r+95.1%
+-commutative95.1%
+-commutative95.1%
+-commutative95.1%
Simplified95.1%
Taylor expanded in b around 0 95.1%
associate-+r+95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in z around inf 68.5%
if -1.65e216 < z Initial program 99.8%
Taylor expanded in a around inf 39.9%
Final simplification41.9%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= a 3.1e+128) (+ z (* y i)) (+ a (* y i))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 3.1e+128) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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 (a <= 3.1d+128) then
tmp = z + (y * i)
else
tmp = a + (y * i)
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 3.1e+128) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 3.1e+128: tmp = z + (y * i) else: tmp = a + (y * i) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 3.1e+128) tmp = Float64(z + Float64(y * i)); else tmp = Float64(a + Float64(y * i)); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (a <= 3.1e+128)
tmp = z + (y * i);
else
tmp = a + (y * i);
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 3.1e+128], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 3.1 \cdot 10^{+128}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if a < 3.10000000000000004e128Initial program 99.8%
Taylor expanded in z around inf 45.2%
if 3.10000000000000004e128 < a Initial program 99.9%
Taylor expanded in a around inf 56.0%
Final simplification46.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= a 4.4e+128) z a))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 4.4e+128) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
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 (a <= 4.4d+128) then
tmp = z
else
tmp = a
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 4.4e+128) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 4.4e+128: tmp = z else: tmp = a return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 4.4e+128) tmp = z; else tmp = a; end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
tmp = 0.0;
if (a <= 4.4e+128)
tmp = z;
else
tmp = a;
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 4.4e+128], z, a]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 4.4 \cdot 10^{+128}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < 4.40000000000000033e128Initial program 99.8%
Taylor expanded in x around 0 85.0%
associate-+r+85.0%
+-commutative85.0%
*-commutative85.0%
sub-neg85.0%
metadata-eval85.0%
associate-+r+85.0%
+-commutative85.0%
+-commutative85.0%
associate-+r+85.0%
+-commutative85.0%
*-commutative85.0%
fma-def85.0%
+-commutative85.0%
associate-+r+85.0%
+-commutative85.0%
+-commutative85.0%
+-commutative85.0%
Simplified85.0%
Taylor expanded in b around 0 68.0%
associate-+r+68.0%
*-commutative68.0%
Simplified68.0%
Taylor expanded in z around inf 19.8%
if 4.40000000000000033e128 < a Initial program 99.9%
Taylor expanded in x around 0 94.3%
associate-+r+94.3%
+-commutative94.3%
*-commutative94.3%
sub-neg94.3%
metadata-eval94.3%
associate-+r+94.3%
+-commutative94.3%
+-commutative94.3%
associate-+r+94.3%
+-commutative94.3%
*-commutative94.3%
fma-def94.3%
+-commutative94.3%
associate-+r+94.3%
+-commutative94.3%
+-commutative94.3%
+-commutative94.3%
Simplified94.3%
Taylor expanded in b around 0 77.1%
associate-+r+77.1%
*-commutative77.1%
Simplified77.1%
Taylor expanded in a around inf 45.7%
Final simplification23.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 a)
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return a
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return a end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = a;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
a
\end{array}
Initial program 99.8%
Taylor expanded in x around 0 86.4%
associate-+r+86.4%
+-commutative86.4%
*-commutative86.4%
sub-neg86.4%
metadata-eval86.4%
associate-+r+86.4%
+-commutative86.4%
+-commutative86.4%
associate-+r+86.4%
+-commutative86.4%
*-commutative86.4%
fma-def86.4%
+-commutative86.4%
associate-+r+86.4%
+-commutative86.4%
+-commutative86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in b around 0 69.4%
associate-+r+69.4%
*-commutative69.4%
Simplified69.4%
Taylor expanded in a around inf 15.6%
Final simplification15.6%
herbie shell --seed 2023301
(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)))