
(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 20 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 (+ t (fma y i (fma x (log y) (+ a (fma (+ b -0.5) (log c) z))))))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return t + fma(y, i, fma(x, log(y), (a + fma((b + -0.5), log(c), z))));
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(t + fma(y, i, fma(x, log(y), Float64(a + fma(Float64(b + -0.5), log(c), z))))) 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[(t + N[(y * i + N[(x * N[Log[y], $MachinePrecision] + N[(a + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
t + \mathsf{fma}\left(y, i, \mathsf{fma}\left(x, \log y, a + \mathsf{fma}\left(b + -0.5, \log c, z\right)\right)\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.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
(let* ((t_1 (* x (log y)))
(t_2 (+ a t_1))
(t_3 (* (log c) (- b 0.5)))
(t_4 (+ (* y i) (+ t_3 (+ z (+ t a))))))
(if (<= x -4.1e+204)
(+ t (fma y i (+ z t_1)))
(if (<= x 1.6e+79)
t_4
(if (<= x 2.5e+154)
(+ t (+ t_3 t_2))
(if (<= x 9e+202) t_4 (+ t (fma y i t_2))))))))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);
double t_2 = a + t_1;
double t_3 = log(c) * (b - 0.5);
double t_4 = (y * i) + (t_3 + (z + (t + a)));
double tmp;
if (x <= -4.1e+204) {
tmp = t + fma(y, i, (z + t_1));
} else if (x <= 1.6e+79) {
tmp = t_4;
} else if (x <= 2.5e+154) {
tmp = t + (t_3 + t_2);
} else if (x <= 9e+202) {
tmp = t_4;
} else {
tmp = t + fma(y, i, t_2);
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * log(y)) t_2 = Float64(a + t_1) t_3 = Float64(log(c) * Float64(b - 0.5)) t_4 = Float64(Float64(y * i) + Float64(t_3 + Float64(z + Float64(t + a)))) tmp = 0.0 if (x <= -4.1e+204) tmp = Float64(t + fma(y, i, Float64(z + t_1))); elseif (x <= 1.6e+79) tmp = t_4; elseif (x <= 2.5e+154) tmp = Float64(t + Float64(t_3 + t_2)); elseif (x <= 9e+202) tmp = t_4; else tmp = Float64(t + fma(y, i, t_2)); 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_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[(y * i), $MachinePrecision] + N[(t$95$3 + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -4.1e+204], N[(t + N[(y * i + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+79], t$95$4, If[LessEqual[x, 2.5e+154], N[(t + N[(t$95$3 + t$95$2), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 9e+202], t$95$4, N[(t + N[(y * i + t$95$2), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := a + t_1\\
t_3 := \log c \cdot \left(b - 0.5\right)\\
t_4 := y \cdot i + \left(t_3 + \left(z + \left(t + a\right)\right)\right)\\
\mathbf{if}\;x \leq -4.1 \cdot 10^{+204}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, z + t_1\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+79}:\\
\;\;\;\;t_4\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{+154}:\\
\;\;\;\;t + \left(t_3 + t_2\right)\\
\mathbf{elif}\;x \leq 9 \cdot 10^{+202}:\\
\;\;\;\;t_4\\
\mathbf{else}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, t_2\right)\\
\end{array}
\end{array}
if x < -4.09999999999999975e204Initial program 99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
associate-+l+99.6%
fma-def99.6%
+-commutative99.6%
associate-+l+99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 95.4%
Taylor expanded in a around 0 94.3%
if -4.09999999999999975e204 < x < 1.60000000000000001e79 or 2.50000000000000002e154 < x < 8.99999999999999955e202Initial program 99.9%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
+-commutative99.7%
Simplified99.7%
if 1.60000000000000001e79 < x < 2.50000000000000002e154Initial program 99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
associate-+l+99.7%
fma-def99.7%
+-commutative99.7%
associate-+l+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 90.5%
Taylor expanded in z around 0 72.7%
if 8.99999999999999955e202 < x Initial program 99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
fma-def99.6%
associate-+l+99.6%
fma-def99.5%
+-commutative99.5%
associate-+l+99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around inf 97.6%
Taylor expanded in z around 0 93.3%
Final simplification96.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
(let* ((t_1 (* x (log y))) (t_2 (* (log c) (- b 0.5))) (t_3 (+ a t_1)))
(if (<= x -5e+205)
(+ t (fma y i (+ z t_1)))
(if (<= x 1.6e+79)
(+ (* y i) (+ a (fma (log c) (+ b -0.5) (+ t z))))
(if (<= x 1.35e+155)
(+ t (+ t_2 t_3))
(if (<= x 3.3e+201)
(+ (* y i) (+ t_2 (+ z (+ t a))))
(+ t (fma y i t_3))))))))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);
double t_2 = log(c) * (b - 0.5);
double t_3 = a + t_1;
double tmp;
if (x <= -5e+205) {
tmp = t + fma(y, i, (z + t_1));
} else if (x <= 1.6e+79) {
tmp = (y * i) + (a + fma(log(c), (b + -0.5), (t + z)));
} else if (x <= 1.35e+155) {
tmp = t + (t_2 + t_3);
} else if (x <= 3.3e+201) {
tmp = (y * i) + (t_2 + (z + (t + a)));
} else {
tmp = t + fma(y, i, t_3);
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * log(y)) t_2 = Float64(log(c) * Float64(b - 0.5)) t_3 = Float64(a + t_1) tmp = 0.0 if (x <= -5e+205) tmp = Float64(t + fma(y, i, Float64(z + t_1))); elseif (x <= 1.6e+79) tmp = Float64(Float64(y * i) + Float64(a + fma(log(c), Float64(b + -0.5), Float64(t + z)))); elseif (x <= 1.35e+155) tmp = Float64(t + Float64(t_2 + t_3)); elseif (x <= 3.3e+201) tmp = Float64(Float64(y * i) + Float64(t_2 + Float64(z + Float64(t + a)))); else tmp = Float64(t + fma(y, i, t_3)); 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_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(a + t$95$1), $MachinePrecision]}, If[LessEqual[x, -5e+205], N[(t + N[(y * i + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.6e+79], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+155], N[(t + N[(t$95$2 + t$95$3), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 3.3e+201], N[(N[(y * i), $MachinePrecision] + N[(t$95$2 + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(y * i + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
t_2 := \log c \cdot \left(b - 0.5\right)\\
t_3 := a + t_1\\
\mathbf{if}\;x \leq -5 \cdot 10^{+205}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, z + t_1\right)\\
\mathbf{elif}\;x \leq 1.6 \cdot 10^{+79}:\\
\;\;\;\;y \cdot i + \left(a + \mathsf{fma}\left(\log c, b + -0.5, t + z\right)\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+155}:\\
\;\;\;\;t + \left(t_2 + t_3\right)\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{+201}:\\
\;\;\;\;y \cdot i + \left(t_2 + \left(z + \left(t + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, t_3\right)\\
\end{array}
\end{array}
if x < -5.0000000000000002e205Initial program 99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
associate-+l+99.6%
fma-def99.6%
+-commutative99.6%
associate-+l+99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 95.4%
Taylor expanded in a around 0 94.3%
if -5.0000000000000002e205 < x < 1.60000000000000001e79Initial program 99.9%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
associate-+r+99.8%
*-commutative99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
+-commutative99.8%
+-commutative99.8%
Simplified99.8%
if 1.60000000000000001e79 < x < 1.34999999999999997e155Initial program 99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+l+99.7%
+-commutative99.7%
fma-def99.7%
associate-+l+99.7%
fma-def99.7%
+-commutative99.7%
associate-+l+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 90.5%
Taylor expanded in z around 0 72.7%
if 1.34999999999999997e155 < x < 3.3e201Initial program 100.0%
Taylor expanded in x around 0 98.1%
+-commutative98.1%
+-commutative98.1%
associate-+l+98.1%
+-commutative98.1%
Simplified98.1%
if 3.3e201 < x Initial program 99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
fma-def99.6%
associate-+l+99.6%
fma-def99.5%
+-commutative99.5%
associate-+l+99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in z around inf 97.6%
Taylor expanded in z around 0 93.3%
Final simplification96.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 (+ (+ (+ 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.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
(let* ((t_1 (* (log c) (- b 0.5))))
(if (<= y 2e-29)
(+ t (+ t_1 (+ a (+ z (* x (log y))))))
(+ (* y i) (+ t_1 (+ z (+ t 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 t_1 = log(c) * (b - 0.5);
double tmp;
if (y <= 2e-29) {
tmp = t + (t_1 + (a + (z + (x * log(y)))));
} else {
tmp = (y * i) + (t_1 + (z + (t + 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) :: t_1
real(8) :: tmp
t_1 = log(c) * (b - 0.5d0)
if (y <= 2d-29) then
tmp = t + (t_1 + (a + (z + (x * log(y)))))
else
tmp = (y * i) + (t_1 + (z + (t + 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 t_1 = Math.log(c) * (b - 0.5);
double tmp;
if (y <= 2e-29) {
tmp = t + (t_1 + (a + (z + (x * Math.log(y)))));
} else {
tmp = (y * i) + (t_1 + (z + (t + a)));
}
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 y <= 2e-29: tmp = t + (t_1 + (a + (z + (x * math.log(y))))) else: tmp = (y * i) + (t_1 + (z + (t + a))) 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 (y <= 2e-29) tmp = Float64(t + Float64(t_1 + Float64(a + Float64(z + Float64(x * log(y)))))); else tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(z + Float64(t + 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)
t_1 = log(c) * (b - 0.5);
tmp = 0.0;
if (y <= 2e-29)
tmp = t + (t_1 + (a + (z + (x * log(y)))));
else
tmp = (y * i) + (t_1 + (z + (t + 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_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2e-29], N[(t + N[(t$95$1 + N[(a + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(z + N[(t + a), $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}\;y \leq 2 \cdot 10^{-29}:\\
\;\;\;\;t + \left(t_1 + \left(a + \left(z + x \cdot \log y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t_1 + \left(z + \left(t + a\right)\right)\right)\\
\end{array}
\end{array}
if y < 1.99999999999999989e-29Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.8%
associate-+l+99.8%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 99.0%
if 1.99999999999999989e-29 < y Initial program 99.9%
Taylor expanded in x around 0 91.3%
+-commutative91.3%
+-commutative91.3%
associate-+l+91.3%
+-commutative91.3%
Simplified91.3%
Final simplification95.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 -9e+201) (not (<= x 4.3e+85))) (+ t (fma y i (+ a (* x (log y))))) (+ (* y i) (+ (* (log c) (- b 0.5)) (+ z (+ t 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 ((x <= -9e+201) || !(x <= 4.3e+85)) {
tmp = t + fma(y, i, (a + (x * log(y))));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a)));
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -9e+201) || !(x <= 4.3e+85)) tmp = Float64(t + fma(y, i, Float64(a + Float64(x * log(y))))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + 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[Or[LessEqual[x, -9e+201], N[Not[LessEqual[x, 4.3e+85]], $MachinePrecision]], N[(t + N[(y * i + N[(a + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+201} \lor \neg \left(x \leq 4.3 \cdot 10^{+85}\right):\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a + x \cdot \log y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\
\end{array}
\end{array}
if x < -9.0000000000000002e201 or 4.2999999999999999e85 < x Initial program 99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.7%
associate-+l+99.7%
fma-def99.6%
+-commutative99.6%
associate-+l+99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 89.4%
Taylor expanded in z around 0 78.0%
if -9.0000000000000002e201 < x < 4.2999999999999999e85Initial program 99.9%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Simplified99.8%
Final simplification93.7%
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))))
(if (<= x -8e+201)
(+ t (fma y i (+ z t_1)))
(if (<= x 4.3e+85)
(+ (* y i) (+ (* (log c) (- b 0.5)) (+ z (+ t a))))
(+ t (fma y i (+ a 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);
double tmp;
if (x <= -8e+201) {
tmp = t + fma(y, i, (z + t_1));
} else if (x <= 4.3e+85) {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a)));
} else {
tmp = t + fma(y, i, (a + t_1));
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(x * log(y)) tmp = 0.0 if (x <= -8e+201) tmp = Float64(t + fma(y, i, Float64(z + t_1))); elseif (x <= 4.3e+85) tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + a)))); else tmp = Float64(t + fma(y, i, Float64(a + t_1))); 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_] := Block[{t$95$1 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -8e+201], N[(t + N[(y * i + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.3e+85], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(y * i + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := x \cdot \log y\\
\mathbf{if}\;x \leq -8 \cdot 10^{+201}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, z + t_1\right)\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{+85}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a + t_1\right)\\
\end{array}
\end{array}
if x < -8.0000000000000003e201Initial program 99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
associate-+l+99.6%
fma-def99.6%
+-commutative99.6%
associate-+l+99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 95.4%
Taylor expanded in a around 0 94.3%
if -8.0000000000000003e201 < x < 4.2999999999999999e85Initial program 99.9%
Taylor expanded in x around 0 99.8%
+-commutative99.8%
+-commutative99.8%
associate-+l+99.8%
+-commutative99.8%
Simplified99.8%
if 4.2999999999999999e85 < x Initial program 99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.7%
associate-+l+99.7%
fma-def99.6%
+-commutative99.6%
associate-+l+99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 86.8%
Taylor expanded in z around 0 74.7%
Final simplification94.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 -2.4e+207) (not (<= x 1.22e+201))) (+ t (fma y i (* x (log y)))) (+ (* y i) (+ (* (log c) (- b 0.5)) (+ z (+ t 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 ((x <= -2.4e+207) || !(x <= 1.22e+201)) {
tmp = t + fma(y, i, (x * log(y)));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a)));
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -2.4e+207) || !(x <= 1.22e+201)) tmp = Float64(t + fma(y, i, Float64(x * log(y)))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + 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[Or[LessEqual[x, -2.4e+207], N[Not[LessEqual[x, 1.22e+201]], $MachinePrecision]], N[(t + N[(y * i + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.4 \cdot 10^{+207} \lor \neg \left(x \leq 1.22 \cdot 10^{+201}\right):\\
\;\;\;\;t + \mathsf{fma}\left(y, i, x \cdot \log y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\
\end{array}
\end{array}
if x < -2.4000000000000001e207 or 1.22000000000000004e201 < x Initial program 99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+l+99.6%
associate-+l+99.6%
+-commutative99.6%
fma-def99.6%
associate-+l+99.6%
fma-def99.5%
+-commutative99.5%
associate-+l+99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around inf 86.6%
if -2.4000000000000001e207 < x < 1.22000000000000004e201Initial program 99.9%
Taylor expanded in x around 0 95.9%
+-commutative95.9%
+-commutative95.9%
associate-+l+95.9%
+-commutative95.9%
Simplified95.9%
Final simplification94.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 (or (<= i -3.4e-15) (not (<= i 4e+21))) (+ t (fma y i (+ a z))) (+ t (+ (* (log c) (- b 0.5)) (+ a z)))))
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 ((i <= -3.4e-15) || !(i <= 4e+21)) {
tmp = t + fma(y, i, (a + z));
} else {
tmp = t + ((log(c) * (b - 0.5)) + (a + z));
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((i <= -3.4e-15) || !(i <= 4e+21)) tmp = Float64(t + fma(y, i, Float64(a + z))); else tmp = Float64(t + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + z))); 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[i, -3.4e-15], N[Not[LessEqual[i, 4e+21]], $MachinePrecision]], N[(t + N[(y * i + N[(a + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -3.4 \cdot 10^{-15} \lor \neg \left(i \leq 4 \cdot 10^{+21}\right):\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a + z\right)\\
\mathbf{else}:\\
\;\;\;\;t + \left(\log c \cdot \left(b - 0.5\right) + \left(a + z\right)\right)\\
\end{array}
\end{array}
if i < -3.4e-15 or 4e21 < i Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 89.0%
Taylor expanded in x around 0 74.8%
if -3.4e-15 < i < 4e21Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 97.2%
Taylor expanded in x around 0 80.5%
Final simplification77.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 (+ (* y i) (+ (* (log c) (- b 0.5)) (+ z (+ t 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 (y * i) + ((log(c) * (b - 0.5)) + (z + (t + 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 = (y * i) + ((log(c) * (b - 0.5d0)) + (z + (t + 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 (y * i) + ((Math.log(c) * (b - 0.5)) + (z + (t + a)));
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return (y * i) + ((math.log(c) * (b - 0.5)) + (z + (t + a)))
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + a)))) end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + 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_] := N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 84.2%
+-commutative84.2%
+-commutative84.2%
associate-+l+84.2%
+-commutative84.2%
Simplified84.2%
Final simplification84.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 (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a z))))
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) + ((log(c) * (b - 0.5)) + (a + z));
}
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) + ((log(c) * (b - 0.5d0)) + (a + z))
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) + ((Math.log(c) * (b - 0.5)) + (a + z));
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return (y * i) + ((math.log(c) * (b - 0.5)) + (a + z))
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + z))) end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + z));
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[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + z\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 84.2%
+-commutative84.2%
+-commutative84.2%
associate-+l+84.2%
+-commutative84.2%
Simplified84.2%
Taylor expanded in t around 0 73.5%
Final simplification73.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 (<= b -7.2e+229) (not (<= b 1.5e+183))) (* b (log c)) (+ t (fma y i (+ a z)))))
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 ((b <= -7.2e+229) || !(b <= 1.5e+183)) {
tmp = b * log(c);
} else {
tmp = t + fma(y, i, (a + z));
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -7.2e+229) || !(b <= 1.5e+183)) tmp = Float64(b * log(c)); else tmp = Float64(t + fma(y, i, Float64(a + z))); 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[b, -7.2e+229], N[Not[LessEqual[b, 1.5e+183]], $MachinePrecision]], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision], N[(t + N[(y * i + N[(a + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7.2 \cdot 10^{+229} \lor \neg \left(b \leq 1.5 \cdot 10^{+183}\right):\\
\;\;\;\;b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a + z\right)\\
\end{array}
\end{array}
if b < -7.19999999999999973e229 or 1.49999999999999998e183 < b Initial program 99.8%
Taylor expanded in x around 0 91.6%
+-commutative91.6%
+-commutative91.6%
associate-+l+91.6%
+-commutative91.6%
Simplified91.6%
Taylor expanded in b around inf 78.6%
Taylor expanded in b around inf 68.3%
if -7.19999999999999973e229 < b < 1.49999999999999998e183Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 91.3%
Taylor expanded in x around 0 74.4%
Final simplification73.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 (or (<= b -2.7e+172) (not (<= b 3.4e+121))) (+ (* y i) (* b (log c))) (+ t (fma y i (+ a z)))))
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 ((b <= -2.7e+172) || !(b <= 3.4e+121)) {
tmp = (y * i) + (b * log(c));
} else {
tmp = t + fma(y, i, (a + z));
}
return tmp;
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -2.7e+172) || !(b <= 3.4e+121)) tmp = Float64(Float64(y * i) + Float64(b * log(c))); else tmp = Float64(t + fma(y, i, Float64(a + z))); 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[b, -2.7e+172], N[Not[LessEqual[b, 3.4e+121]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t + N[(y * i + N[(a + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.7 \cdot 10^{+172} \lor \neg \left(b \leq 3.4 \cdot 10^{+121}\right):\\
\;\;\;\;y \cdot i + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a + z\right)\\
\end{array}
\end{array}
if b < -2.7e172 or 3.4000000000000001e121 < b Initial program 99.8%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
+-commutative92.1%
associate-+l+92.1%
+-commutative92.1%
Simplified92.1%
Taylor expanded in b around inf 75.6%
if -2.7e172 < b < 3.4000000000000001e121Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 94.8%
Taylor expanded in x around 0 76.6%
Final simplification76.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 2.9e+131) (+ z (* y i)) (+ t (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 <= 2.9e+131) {
tmp = z + (y * i);
} else {
tmp = t + 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 <= 2.9e+131) tmp = Float64(z + Float64(y * i)); else tmp = Float64(t + 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, 2.9e+131], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(t + N[(y * i + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.9 \cdot 10^{+131}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a\right)\\
\end{array}
\end{array}
if a < 2.9000000000000001e131Initial program 99.8%
Taylor expanded in x around 0 83.5%
+-commutative83.5%
+-commutative83.5%
associate-+l+83.5%
+-commutative83.5%
Simplified83.5%
Taylor expanded in z around inf 41.7%
if 2.9000000000000001e131 < a Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 66.3%
Final simplification45.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 (<= a 7e+131) (+ t (fma y i z)) (+ t (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 <= 7e+131) {
tmp = t + fma(y, i, z);
} else {
tmp = t + 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 <= 7e+131) tmp = Float64(t + fma(y, i, z)); else tmp = Float64(t + 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, 7e+131], N[(t + N[(y * i + z), $MachinePrecision]), $MachinePrecision], N[(t + N[(y * i + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7 \cdot 10^{+131}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, z\right)\\
\mathbf{else}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a\right)\\
\end{array}
\end{array}
if a < 6.9999999999999998e131Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.9%
associate-+l+99.9%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around inf 78.9%
Taylor expanded in z around inf 52.2%
if 6.9999999999999998e131 < a Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 66.3%
Final simplification54.1%
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 -7e+161)
(+ t z)
(if (<= z -1.38e+57)
(* y i)
(if (<= z -2.9e-111) a (if (<= z -1.55e-140) (* 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 (z <= -7e+161) {
tmp = t + z;
} else if (z <= -1.38e+57) {
tmp = y * i;
} else if (z <= -2.9e-111) {
tmp = a;
} else if (z <= -1.55e-140) {
tmp = y * i;
} 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 (z <= (-7d+161)) then
tmp = t + z
else if (z <= (-1.38d+57)) then
tmp = y * i
else if (z <= (-2.9d-111)) then
tmp = a
else if (z <= (-1.55d-140)) then
tmp = y * i
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 (z <= -7e+161) {
tmp = t + z;
} else if (z <= -1.38e+57) {
tmp = y * i;
} else if (z <= -2.9e-111) {
tmp = a;
} else if (z <= -1.55e-140) {
tmp = y * i;
} 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 z <= -7e+161: tmp = t + z elif z <= -1.38e+57: tmp = y * i elif z <= -2.9e-111: tmp = a elif z <= -1.55e-140: tmp = y * i 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 (z <= -7e+161) tmp = Float64(t + z); elseif (z <= -1.38e+57) tmp = Float64(y * i); elseif (z <= -2.9e-111) tmp = a; elseif (z <= -1.55e-140) tmp = Float64(y * i); 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 (z <= -7e+161)
tmp = t + z;
elseif (z <= -1.38e+57)
tmp = y * i;
elseif (z <= -2.9e-111)
tmp = a;
elseif (z <= -1.55e-140)
tmp = y * i;
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[z, -7e+161], N[(t + z), $MachinePrecision], If[LessEqual[z, -1.38e+57], N[(y * i), $MachinePrecision], If[LessEqual[z, -2.9e-111], a, If[LessEqual[z, -1.55e-140], N[(y * i), $MachinePrecision], a]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+161}:\\
\;\;\;\;t + z\\
\mathbf{elif}\;z \leq -1.38 \cdot 10^{+57}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-111}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-140}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -6.99999999999999976e161Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 85.7%
Taylor expanded in x around 0 67.9%
Taylor expanded in z around inf 55.9%
if -6.99999999999999976e161 < z < -1.38e57 or -2.90000000000000002e-111 < z < -1.55e-140Initial program 100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+l+100.0%
associate-+l+100.0%
+-commutative100.0%
fma-def100.0%
associate-+l+100.0%
fma-def100.0%
+-commutative100.0%
associate-+l+100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 40.4%
*-commutative40.4%
Simplified40.4%
Taylor expanded in t around 0 35.5%
*-commutative35.5%
Simplified35.5%
if -1.38e57 < z < -2.90000000000000002e-111 or -1.55e-140 < z Initial program 99.8%
Taylor expanded in x around 0 84.9%
+-commutative84.9%
+-commutative84.9%
associate-+l+84.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in a around inf 38.6%
Taylor expanded in a around inf 18.8%
Final simplification26.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 (<= z -7.8e+161) (+ t 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 <= -7.8e+161) {
tmp = t + 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 <= (-7.8d+161)) then
tmp = t + 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 <= -7.8e+161) {
tmp = t + 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 <= -7.8e+161: tmp = t + 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 <= -7.8e+161) tmp = Float64(t + 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 <= -7.8e+161)
tmp = t + 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, -7.8e+161], N[(t + z), $MachinePrecision], 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 -7.8 \cdot 10^{+161}:\\
\;\;\;\;t + z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -7.8000000000000004e161Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
associate-+l+99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 85.7%
Taylor expanded in x around 0 67.9%
Taylor expanded in z around inf 55.9%
if -7.8000000000000004e161 < z Initial program 99.8%
Taylor expanded in x around 0 84.8%
+-commutative84.8%
+-commutative84.8%
associate-+l+84.8%
+-commutative84.8%
Simplified84.8%
Taylor expanded in a around inf 40.6%
Final simplification43.1%
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 6e+131) (+ 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 <= 6e+131) {
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 <= 6d+131) 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 <= 6e+131) {
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 <= 6e+131: 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 <= 6e+131) 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 <= 6e+131)
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, 6e+131], 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 6 \cdot 10^{+131}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if a < 6.0000000000000003e131Initial program 99.8%
Taylor expanded in x around 0 83.5%
+-commutative83.5%
+-commutative83.5%
associate-+l+83.5%
+-commutative83.5%
Simplified83.5%
Taylor expanded in z around inf 41.7%
if 6.0000000000000003e131 < a Initial program 99.9%
Taylor expanded in x around 0 88.8%
+-commutative88.8%
+-commutative88.8%
associate-+l+88.8%
+-commutative88.8%
Simplified88.8%
Taylor expanded in a around inf 62.1%
Final simplification44.6%
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 2.2e+102) (* 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 <= 2.2e+102) {
tmp = y * i;
} 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 <= 2.2d+102) then
tmp = y * i
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 <= 2.2e+102) {
tmp = y * i;
} 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 <= 2.2e+102: tmp = y * i 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 <= 2.2e+102) tmp = Float64(y * i); 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 <= 2.2e+102)
tmp = y * i;
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, 2.2e+102], N[(y * i), $MachinePrecision], a]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.2 \cdot 10^{+102}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < 2.20000000000000007e102Initial program 99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
fma-def99.9%
associate-+l+99.9%
fma-def99.8%
+-commutative99.8%
associate-+l+99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 34.9%
*-commutative34.9%
Simplified34.9%
Taylor expanded in t around 0 24.4%
*-commutative24.4%
Simplified24.4%
if 2.20000000000000007e102 < a Initial program 99.9%
Taylor expanded in x around 0 88.2%
+-commutative88.2%
+-commutative88.2%
associate-+l+88.2%
+-commutative88.2%
Simplified88.2%
Taylor expanded in a around inf 58.2%
Taylor expanded in a around inf 48.5%
Final simplification28.4%
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.9%
Taylor expanded in x around 0 84.2%
+-commutative84.2%
+-commutative84.2%
associate-+l+84.2%
+-commutative84.2%
Simplified84.2%
Taylor expanded in a around inf 38.0%
Taylor expanded in a around inf 17.8%
Final simplification17.8%
herbie shell --seed 2023221
(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)))