
(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 22 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.9%
+-commutative99.9%
associate-+l+99.9%
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 (* (log c) (- b 0.5))) (t_2 (* x (log y))))
(if (or (<= t_1 -5e+173) (not (<= t_1 2e+43)))
(+ (* y i) (+ t_1 (+ a t_2)))
(+ a (+ t_2 (+ t (+ z (+ (* y i) (* -0.5 (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) {
double t_1 = log(c) * (b - 0.5);
double t_2 = x * log(y);
double tmp;
if ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) {
tmp = (y * i) + (t_1 + (a + t_2));
} else {
tmp = a + (t_2 + (t + (z + ((y * i) + (-0.5 * log(c))))));
}
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 = log(c) * (b - 0.5d0)
t_2 = x * log(y)
if ((t_1 <= (-5d+173)) .or. (.not. (t_1 <= 2d+43))) then
tmp = (y * i) + (t_1 + (a + t_2))
else
tmp = a + (t_2 + (t + (z + ((y * i) + ((-0.5d0) * log(c))))))
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 t_2 = x * Math.log(y);
double tmp;
if ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) {
tmp = (y * i) + (t_1 + (a + t_2));
} else {
tmp = a + (t_2 + (t + (z + ((y * i) + (-0.5 * Math.log(c))))));
}
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) t_2 = x * math.log(y) tmp = 0 if (t_1 <= -5e+173) or not (t_1 <= 2e+43): tmp = (y * i) + (t_1 + (a + t_2)) else: tmp = a + (t_2 + (t + (z + ((y * i) + (-0.5 * math.log(c)))))) 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)) t_2 = Float64(x * log(y)) tmp = 0.0 if ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + t_2))); else tmp = Float64(a + Float64(t_2 + Float64(t + Float64(z + Float64(Float64(y * i) + Float64(-0.5 * log(c))))))); 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);
t_2 = x * log(y);
tmp = 0.0;
if ((t_1 <= -5e+173) || ~((t_1 <= 2e+43)))
tmp = (y * i) + (t_1 + (a + t_2));
else
tmp = a + (t_2 + (t + (z + ((y * i) + (-0.5 * log(c))))));
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]}, Block[{t$95$2 = N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e+173], N[Not[LessEqual[t$95$1, 2e+43]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t$95$2 + N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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)\\
t_2 := x \cdot \log y\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+173} \lor \neg \left(t_1 \leq 2 \cdot 10^{+43}\right):\\
\;\;\;\;y \cdot i + \left(t_1 + \left(a + t_2\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(t_2 + \left(t + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 b 1/2) (log.f64 c)) < -5.00000000000000034e173 or 2.00000000000000003e43 < (*.f64 (-.f64 b 1/2) (log.f64 c)) Initial program 99.8%
Taylor expanded in t around 0 98.4%
Taylor expanded in z around 0 85.3%
if -5.00000000000000034e173 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 2.00000000000000003e43Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 98.1%
Final simplification93.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
(let* ((t_1 (* (log c) (- b 0.5))))
(if (or (<= t_1 -5e+173) (not (<= t_1 2e+43)))
(+ (* y i) (+ a t_1))
(+ a (+ z (+ (* y i) (* -0.5 (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) {
double t_1 = log(c) * (b - 0.5);
double tmp;
if ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) {
tmp = (y * i) + (a + t_1);
} else {
tmp = a + (z + ((y * i) + (-0.5 * log(c))));
}
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 ((t_1 <= (-5d+173)) .or. (.not. (t_1 <= 2d+43))) then
tmp = (y * i) + (a + t_1)
else
tmp = a + (z + ((y * i) + ((-0.5d0) * log(c))))
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 ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) {
tmp = (y * i) + (a + t_1);
} else {
tmp = a + (z + ((y * i) + (-0.5 * Math.log(c))));
}
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 (t_1 <= -5e+173) or not (t_1 <= 2e+43): tmp = (y * i) + (a + t_1) else: tmp = a + (z + ((y * i) + (-0.5 * math.log(c)))) 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 ((t_1 <= -5e+173) || !(t_1 <= 2e+43)) tmp = Float64(Float64(y * i) + Float64(a + t_1)); else tmp = Float64(a + Float64(z + Float64(Float64(y * i) + Float64(-0.5 * log(c))))); 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 ((t_1 <= -5e+173) || ~((t_1 <= 2e+43)))
tmp = (y * i) + (a + t_1);
else
tmp = a + (z + ((y * i) + (-0.5 * log(c))));
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[t$95$1, -5e+173], N[Not[LessEqual[t$95$1, 2e+43]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision], N[(a + N[(z + N[(N[(y * i), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $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}\;t_1 \leq -5 \cdot 10^{+173} \lor \neg \left(t_1 \leq 2 \cdot 10^{+43}\right):\\
\;\;\;\;y \cdot i + \left(a + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 b 1/2) (log.f64 c)) < -5.00000000000000034e173 or 2.00000000000000003e43 < (*.f64 (-.f64 b 1/2) (log.f64 c)) Initial program 99.8%
Taylor expanded in t around 0 98.4%
Taylor expanded in z around 0 85.3%
Taylor expanded in x around 0 71.2%
if -5.00000000000000034e173 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 2.00000000000000003e43Initial program 99.9%
Taylor expanded in t around 0 80.5%
Taylor expanded in b around 0 78.7%
Taylor expanded in x around 0 64.5%
Final simplification66.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 (+ (+ (fma x (log y) z) (+ t a)) (+ (* (+ b -0.5) (log c)) (* 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 (fma(x, log(y), z) + (t + a)) + (((b + -0.5) * log(c)) + (y * i));
}
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(fma(x, log(y), z) + Float64(t + a)) + Float64(Float64(Float64(b + -0.5) * log(c)) + Float64(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[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
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 (if (or (<= x -2.45e+176) (not (<= x 1.55e+187))) (+ (* y i) (+ (+ a (+ z (* x (log y)))) (* -0.5 (log c)))) (+ (* 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.45e+176) || !(x <= 1.55e+187)) {
tmp = (y * i) + ((a + (z + (x * log(y)))) + (-0.5 * log(c)));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (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) :: tmp
if ((x <= (-2.45d+176)) .or. (.not. (x <= 1.55d+187))) then
tmp = (y * i) + ((a + (z + (x * log(y)))) + ((-0.5d0) * log(c)))
else
tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (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 tmp;
if ((x <= -2.45e+176) || !(x <= 1.55e+187)) {
tmp = (y * i) + ((a + (z + (x * Math.log(y)))) + (-0.5 * Math.log(c)));
} else {
tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (z + (t + a)));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -2.45e+176) or not (x <= 1.55e+187): tmp = (y * i) + ((a + (z + (x * math.log(y)))) + (-0.5 * math.log(c))) else: tmp = (y * i) + ((math.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.45e+176) || !(x <= 1.55e+187)) tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(z + Float64(x * log(y)))) + Float64(-0.5 * log(c)))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + 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)
tmp = 0.0;
if ((x <= -2.45e+176) || ~((x <= 1.55e+187)))
tmp = (y * i) + ((a + (z + (x * log(y)))) + (-0.5 * log(c)));
else
tmp = (y * i) + ((log(c) * (b - 0.5)) + (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_] := If[Or[LessEqual[x, -2.45e+176], N[Not[LessEqual[x, 1.55e+187]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[Log[c], $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.45 \cdot 10^{+176} \lor \neg \left(x \leq 1.55 \cdot 10^{+187}\right):\\
\;\;\;\;y \cdot i + \left(\left(a + \left(z + x \cdot \log y\right)\right) + -0.5 \cdot \log c\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.45e176 or 1.55000000000000006e187 < x Initial program 99.7%
Taylor expanded in t around 0 92.2%
Taylor expanded in b around 0 88.5%
if -2.45e176 < x < 1.55000000000000006e187Initial program 99.9%
Taylor expanded in x around 0 96.3%
associate-+r+96.3%
+-commutative96.3%
Simplified96.3%
Final simplification94.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 (* (log c) (- b 0.5))))
(if (or (<= x -1.9e+170) (not (<= x 1.8e+143)))
(+ (* y i) (+ t_1 (+ a (* 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 ((x <= -1.9e+170) || !(x <= 1.8e+143)) {
tmp = (y * i) + (t_1 + (a + (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 ((x <= (-1.9d+170)) .or. (.not. (x <= 1.8d+143))) then
tmp = (y * i) + (t_1 + (a + (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 ((x <= -1.9e+170) || !(x <= 1.8e+143)) {
tmp = (y * i) + (t_1 + (a + (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 (x <= -1.9e+170) or not (x <= 1.8e+143): tmp = (y * i) + (t_1 + (a + (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 ((x <= -1.9e+170) || !(x <= 1.8e+143)) tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + 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 ((x <= -1.9e+170) || ~((x <= 1.8e+143)))
tmp = (y * i) + (t_1 + (a + (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[Or[LessEqual[x, -1.9e+170], N[Not[LessEqual[x, 1.8e+143]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(x * N[Log[y], $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}\;x \leq -1.9 \cdot 10^{+170} \lor \neg \left(x \leq 1.8 \cdot 10^{+143}\right):\\
\;\;\;\;y \cdot i + \left(t_1 + \left(a + x \cdot \log y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t_1 + \left(z + \left(t + a\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.8999999999999999e170 or 1.8e143 < x Initial program 99.7%
Taylor expanded in t around 0 92.5%
Taylor expanded in z around 0 81.4%
if -1.8999999999999999e170 < x < 1.8e143Initial program 99.9%
Taylor expanded in x around 0 97.3%
associate-+r+97.3%
+-commutative97.3%
Simplified97.3%
Final simplification93.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) (+ (+ a (+ t (+ z (* x (log y))))) (* (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) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5)));
}
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))))) + (log(c) * (b - 0.5d0)))
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))))) + (Math.log(c) * (b - 0.5)));
}
[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))))) + (math.log(c) * (b - 0.5)))
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(log(c) * Float64(b - 0.5)))) 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))))) + (log(c) * (b - 0.5)));
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[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $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) + \log c \cdot \left(b - 0.5\right)\right)
\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 (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ z (* x (log y)))))))
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 + (x * log(y)))));
}
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 + (x * log(y)))))
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 + (x * Math.log(y)))));
}
[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 + (x * math.log(y)))))
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 + Float64(z + Float64(x * log(y)))))) 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 + (x * log(y)))));
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 + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $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(a + \left(z + x \cdot \log y\right)\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in t around 0 86.8%
Final simplification86.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 (* x (log y))))
(if (<= x -1.5e+196)
(+ t (+ (* y i) t_1))
(if (<= x 1.35e+209)
(+ (* y i) (+ (* (log c) (- b 0.5)) (+ z (+ t a))))
(+ t_1 (+ a (+ z (* -0.5 (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) {
double t_1 = x * log(y);
double tmp;
if (x <= -1.5e+196) {
tmp = t + ((y * i) + t_1);
} else if (x <= 1.35e+209) {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a)));
} else {
tmp = t_1 + (a + (z + (-0.5 * log(c))));
}
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 = x * log(y)
if (x <= (-1.5d+196)) then
tmp = t + ((y * i) + t_1)
else if (x <= 1.35d+209) then
tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (z + (t + a)))
else
tmp = t_1 + (a + (z + ((-0.5d0) * log(c))))
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);
double tmp;
if (x <= -1.5e+196) {
tmp = t + ((y * i) + t_1);
} else if (x <= 1.35e+209) {
tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (z + (t + a)));
} else {
tmp = t_1 + (a + (z + (-0.5 * Math.log(c))));
}
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) tmp = 0 if x <= -1.5e+196: tmp = t + ((y * i) + t_1) elif x <= 1.35e+209: tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (z + (t + a))) else: tmp = t_1 + (a + (z + (-0.5 * math.log(c)))) 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 <= -1.5e+196) tmp = Float64(t + Float64(Float64(y * i) + t_1)); elseif (x <= 1.35e+209) tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + a)))); else tmp = Float64(t_1 + Float64(a + Float64(z + Float64(-0.5 * log(c))))); 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);
tmp = 0.0;
if (x <= -1.5e+196)
tmp = t + ((y * i) + t_1);
elseif (x <= 1.35e+209)
tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a)));
else
tmp = t_1 + (a + (z + (-0.5 * log(c))));
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[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1.5e+196], N[(t + N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.35e+209], 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$95$1 + N[(a + N[(z + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $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 -1.5 \cdot 10^{+196}:\\
\;\;\;\;t + \left(y \cdot i + t_1\right)\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+209}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(z + \left(t + a\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(a + \left(z + -0.5 \cdot \log c\right)\right)\\
\end{array}
\end{array}
if x < -1.4999999999999999e196Initial 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 x around inf 82.2%
Taylor expanded in y around 0 82.2%
if -1.4999999999999999e196 < x < 1.35e209Initial program 99.9%
Taylor expanded in x around 0 95.4%
associate-+r+95.4%
+-commutative95.4%
Simplified95.4%
if 1.35e209 < x Initial program 99.6%
Taylor expanded in t around 0 91.3%
Taylor expanded in b around 0 91.3%
Taylor expanded in y around 0 86.8%
Final simplification93.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
(let* ((t_1 (+ (* y i) (* b (log c)))) (t_2 (+ (* y i) (+ t a))))
(if (<= z -3.2e+164)
(+ z (* y i))
(if (<= z -5e+92)
t_1
(if (<= z -4.4e+72)
t_2
(if (<= z -10.0)
t_1
(if (<= z -1.8e-174)
t_2
(if (<= z 8.2e-241) t_1 (+ 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 t_1 = (y * i) + (b * log(c));
double t_2 = (y * i) + (t + a);
double tmp;
if (z <= -3.2e+164) {
tmp = z + (y * i);
} else if (z <= -5e+92) {
tmp = t_1;
} else if (z <= -4.4e+72) {
tmp = t_2;
} else if (z <= -10.0) {
tmp = t_1;
} else if (z <= -1.8e-174) {
tmp = t_2;
} else if (z <= 8.2e-241) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (y * i) + (b * log(c))
t_2 = (y * i) + (t + a)
if (z <= (-3.2d+164)) then
tmp = z + (y * i)
else if (z <= (-5d+92)) then
tmp = t_1
else if (z <= (-4.4d+72)) then
tmp = t_2
else if (z <= (-10.0d0)) then
tmp = t_1
else if (z <= (-1.8d-174)) then
tmp = t_2
else if (z <= 8.2d-241) then
tmp = t_1
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 t_1 = (y * i) + (b * Math.log(c));
double t_2 = (y * i) + (t + a);
double tmp;
if (z <= -3.2e+164) {
tmp = z + (y * i);
} else if (z <= -5e+92) {
tmp = t_1;
} else if (z <= -4.4e+72) {
tmp = t_2;
} else if (z <= -10.0) {
tmp = t_1;
} else if (z <= -1.8e-174) {
tmp = t_2;
} else if (z <= 8.2e-241) {
tmp = t_1;
} else {
tmp = a + (y * i);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = (y * i) + (b * math.log(c)) t_2 = (y * i) + (t + a) tmp = 0 if z <= -3.2e+164: tmp = z + (y * i) elif z <= -5e+92: tmp = t_1 elif z <= -4.4e+72: tmp = t_2 elif z <= -10.0: tmp = t_1 elif z <= -1.8e-174: tmp = t_2 elif z <= 8.2e-241: tmp = t_1 else: tmp = a + (y * i) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(b * log(c))) t_2 = Float64(Float64(y * i) + Float64(t + a)) tmp = 0.0 if (z <= -3.2e+164) tmp = Float64(z + Float64(y * i)); elseif (z <= -5e+92) tmp = t_1; elseif (z <= -4.4e+72) tmp = t_2; elseif (z <= -10.0) tmp = t_1; elseif (z <= -1.8e-174) tmp = t_2; elseif (z <= 8.2e-241) tmp = t_1; 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)
t_1 = (y * i) + (b * log(c));
t_2 = (y * i) + (t + a);
tmp = 0.0;
if (z <= -3.2e+164)
tmp = z + (y * i);
elseif (z <= -5e+92)
tmp = t_1;
elseif (z <= -4.4e+72)
tmp = t_2;
elseif (z <= -10.0)
tmp = t_1;
elseif (z <= -1.8e-174)
tmp = t_2;
elseif (z <= 8.2e-241)
tmp = t_1;
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_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.2e+164], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5e+92], t$95$1, If[LessEqual[z, -4.4e+72], t$95$2, If[LessEqual[z, -10.0], t$95$1, If[LessEqual[z, -1.8e-174], t$95$2, If[LessEqual[z, 8.2e-241], t$95$1, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := y \cdot i + b \cdot \log c\\
t_2 := y \cdot i + \left(t + a\right)\\
\mathbf{if}\;z \leq -3.2 \cdot 10^{+164}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{elif}\;z \leq -5 \cdot 10^{+92}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -4.4 \cdot 10^{+72}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -10:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-174}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-241}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -3.1999999999999998e164Initial program 99.9%
Taylor expanded in t around 0 92.6%
Taylor expanded in z around inf 77.4%
if -3.1999999999999998e164 < z < -5.00000000000000022e92 or -4.4e72 < z < -10 or -1.79999999999999999e-174 < z < 8.1999999999999997e-241Initial program 99.8%
Taylor expanded in t around 0 84.0%
Taylor expanded in b around inf 45.4%
if -5.00000000000000022e92 < z < -4.4e72 or -10 < z < -1.79999999999999999e-174Initial 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 75.4%
Taylor expanded in t around 0 75.4%
if 8.1999999999999997e-241 < z Initial 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.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 48.1%
Taylor expanded in t around 0 35.4%
Final simplification50.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.4e+196) (not (<= x 2.2e+212))) (+ t (+ (* 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 <= -1.4e+196) || !(x <= 2.2e+212)) {
tmp = t + ((y * i) + (x * log(y)));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (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) :: tmp
if ((x <= (-1.4d+196)) .or. (.not. (x <= 2.2d+212))) then
tmp = t + ((y * i) + (x * log(y)))
else
tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (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 tmp;
if ((x <= -1.4e+196) || !(x <= 2.2e+212)) {
tmp = t + ((y * i) + (x * Math.log(y)));
} else {
tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (z + (t + a)));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.4e+196) or not (x <= 2.2e+212): tmp = t + ((y * i) + (x * math.log(y))) else: tmp = (y * i) + ((math.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 <= -1.4e+196) || !(x <= 2.2e+212)) tmp = Float64(t + Float64(Float64(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
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.4e+196) || ~((x <= 2.2e+212)))
tmp = t + ((y * i) + (x * log(y)));
else
tmp = (y * i) + ((log(c) * (b - 0.5)) + (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_] := If[Or[LessEqual[x, -1.4e+196], N[Not[LessEqual[x, 2.2e+212]], $MachinePrecision]], N[(t + N[(N[(y * i), $MachinePrecision] + 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 -1.4 \cdot 10^{+196} \lor \neg \left(x \leq 2.2 \cdot 10^{+212}\right):\\
\;\;\;\;t + \left(y \cdot 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 < -1.4000000000000001e196 or 2.19999999999999995e212 < x Initial 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 x around inf 84.9%
Taylor expanded in y around 0 84.9%
if -1.4000000000000001e196 < x < 2.19999999999999995e212Initial program 99.9%
Taylor expanded in x around 0 95.5%
associate-+r+95.5%
+-commutative95.5%
Simplified95.5%
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 (if (or (<= x -1.5e+196) (not (<= x 6.5e+212))) (+ t (+ (* y i) (* x (log y)))) (+ (* 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) {
double tmp;
if ((x <= -1.5e+196) || !(x <= 6.5e+212)) {
tmp = t + ((y * i) + (x * log(y)));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + z));
}
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.5d+196)) .or. (.not. (x <= 6.5d+212))) then
tmp = t + ((y * i) + (x * log(y)))
else
tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (a + z))
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.5e+196) || !(x <= 6.5e+212)) {
tmp = t + ((y * i) + (x * Math.log(y)));
} else {
tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + z));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.5e+196) or not (x <= 6.5e+212): tmp = t + ((y * i) + (x * math.log(y))) else: tmp = (y * i) + ((math.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 ((x <= -1.5e+196) || !(x <= 6.5e+212)) tmp = Float64(t + Float64(Float64(y * i) + Float64(x * log(y)))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + z))); 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.5e+196) || ~((x <= 6.5e+212)))
tmp = t + ((y * i) + (x * log(y)));
else
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + z));
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.5e+196], N[Not[LessEqual[x, 6.5e+212]], $MachinePrecision]], N[(t + N[(N[(y * i), $MachinePrecision] + 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[(a + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+196} \lor \neg \left(x \leq 6.5 \cdot 10^{+212}\right):\\
\;\;\;\;t + \left(y \cdot i + x \cdot \log y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + z\right)\right)\\
\end{array}
\end{array}
if x < -1.4999999999999999e196 or 6.49999999999999997e212 < x Initial 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 x around inf 84.9%
Taylor expanded in y around 0 84.9%
if -1.4999999999999999e196 < x < 6.49999999999999997e212Initial program 99.9%
Taylor expanded in t around 0 85.5%
Taylor expanded in x around 0 81.1%
Final simplification81.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 (if (or (<= b -7e+184) (not (<= b 9.5e+123))) (+ (* y i) (* b (log c))) (+ a (+ z (+ (* y i) (* -0.5 (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) {
double tmp;
if ((b <= -7e+184) || !(b <= 9.5e+123)) {
tmp = (y * i) + (b * log(c));
} else {
tmp = a + (z + ((y * i) + (-0.5 * log(c))));
}
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 ((b <= (-7d+184)) .or. (.not. (b <= 9.5d+123))) then
tmp = (y * i) + (b * log(c))
else
tmp = a + (z + ((y * i) + ((-0.5d0) * log(c))))
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 ((b <= -7e+184) || !(b <= 9.5e+123)) {
tmp = (y * i) + (b * Math.log(c));
} else {
tmp = a + (z + ((y * i) + (-0.5 * Math.log(c))));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (b <= -7e+184) or not (b <= 9.5e+123): tmp = (y * i) + (b * math.log(c)) else: tmp = a + (z + ((y * i) + (-0.5 * math.log(c)))) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -7e+184) || !(b <= 9.5e+123)) tmp = Float64(Float64(y * i) + Float64(b * log(c))); else tmp = Float64(a + Float64(z + Float64(Float64(y * i) + Float64(-0.5 * log(c))))); 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 ((b <= -7e+184) || ~((b <= 9.5e+123)))
tmp = (y * i) + (b * log(c));
else
tmp = a + (z + ((y * i) + (-0.5 * log(c))));
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[b, -7e+184], N[Not[LessEqual[b, 9.5e+123]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(z + N[(N[(y * i), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -7 \cdot 10^{+184} \lor \neg \left(b \leq 9.5 \cdot 10^{+123}\right):\\
\;\;\;\;y \cdot i + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;a + \left(z + \left(y \cdot i + -0.5 \cdot \log c\right)\right)\\
\end{array}
\end{array}
if b < -6.99999999999999956e184 or 9.4999999999999996e123 < b Initial program 99.7%
Taylor expanded in t around 0 98.9%
Taylor expanded in b around inf 80.0%
if -6.99999999999999956e184 < b < 9.4999999999999996e123Initial program 99.9%
Taylor expanded in t around 0 82.8%
Taylor expanded in b around 0 79.3%
Taylor expanded in x around 0 63.1%
Final simplification67.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 (<= z -1.6e+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 (z <= -1.6e+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 (z <= -1.6e+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[z, -1.6e+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}\;z \leq -1.6 \cdot 10^{+131}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, a\right)\\
\end{array}
\end{array}
if z < -1.6000000000000001e131Initial program 99.9%
Taylor expanded in t around 0 87.1%
Taylor expanded in z around inf 66.3%
if -1.6000000000000001e131 < z Initial 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 a around inf 53.6%
Final simplification55.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 (+ t (* y i))))
(if (<= z -1.6e+102)
z
(if (<= z -3.1e-53)
t_1
(if (<= z -5.5e-173) (+ t a) (if (<= z -7.5e-243) t_1 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 = t + (y * i);
double tmp;
if (z <= -1.6e+102) {
tmp = z;
} else if (z <= -3.1e-53) {
tmp = t_1;
} else if (z <= -5.5e-173) {
tmp = t + a;
} else if (z <= -7.5e-243) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = t + (y * i)
if (z <= (-1.6d+102)) then
tmp = z
else if (z <= (-3.1d-53)) then
tmp = t_1
else if (z <= (-5.5d-173)) then
tmp = t + a
else if (z <= (-7.5d-243)) then
tmp = t_1
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 t_1 = t + (y * i);
double tmp;
if (z <= -1.6e+102) {
tmp = z;
} else if (z <= -3.1e-53) {
tmp = t_1;
} else if (z <= -5.5e-173) {
tmp = t + a;
} else if (z <= -7.5e-243) {
tmp = t_1;
} else {
tmp = a;
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = t + (y * i) tmp = 0 if z <= -1.6e+102: tmp = z elif z <= -3.1e-53: tmp = t_1 elif z <= -5.5e-173: tmp = t + a elif z <= -7.5e-243: tmp = t_1 else: tmp = a return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(t + Float64(y * i)) tmp = 0.0 if (z <= -1.6e+102) tmp = z; elseif (z <= -3.1e-53) tmp = t_1; elseif (z <= -5.5e-173) tmp = Float64(t + a); elseif (z <= -7.5e-243) tmp = t_1; 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)
t_1 = t + (y * i);
tmp = 0.0;
if (z <= -1.6e+102)
tmp = z;
elseif (z <= -3.1e-53)
tmp = t_1;
elseif (z <= -5.5e-173)
tmp = t + a;
elseif (z <= -7.5e-243)
tmp = t_1;
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_] := Block[{t$95$1 = N[(t + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.6e+102], z, If[LessEqual[z, -3.1e-53], t$95$1, If[LessEqual[z, -5.5e-173], N[(t + a), $MachinePrecision], If[LessEqual[z, -7.5e-243], t$95$1, a]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := t + y \cdot i\\
\mathbf{if}\;z \leq -1.6 \cdot 10^{+102}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-53}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\
\;\;\;\;t + a\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-243}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -1.6e102Initial program 99.9%
Taylor expanded in t around 0 88.0%
Taylor expanded in b around 0 77.9%
Taylor expanded in z around inf 43.1%
if -1.6e102 < z < -3.10000000000000015e-53 or -5.50000000000000022e-173 < z < -7.5e-243Initial program 99.9%
Taylor expanded in t around inf 43.0%
if -3.10000000000000015e-53 < z < -5.50000000000000022e-173Initial 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 a around inf 74.2%
Taylor expanded in y around 0 43.5%
if -7.5e-243 < z Initial 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 a around inf 47.2%
Taylor expanded in a around inf 14.3%
Final simplification26.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
(if (<= z -6e+101)
z
(if (<= z -5e-54)
(* y i)
(if (<= z -5.5e-173) a (if (<= z -1.04e-243) (* 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 <= -6e+101) {
tmp = z;
} else if (z <= -5e-54) {
tmp = y * i;
} else if (z <= -5.5e-173) {
tmp = a;
} else if (z <= -1.04e-243) {
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 <= (-6d+101)) then
tmp = z
else if (z <= (-5d-54)) then
tmp = y * i
else if (z <= (-5.5d-173)) then
tmp = a
else if (z <= (-1.04d-243)) 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 <= -6e+101) {
tmp = z;
} else if (z <= -5e-54) {
tmp = y * i;
} else if (z <= -5.5e-173) {
tmp = a;
} else if (z <= -1.04e-243) {
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 <= -6e+101: tmp = z elif z <= -5e-54: tmp = y * i elif z <= -5.5e-173: tmp = a elif z <= -1.04e-243: 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 <= -6e+101) tmp = z; elseif (z <= -5e-54) tmp = Float64(y * i); elseif (z <= -5.5e-173) tmp = a; elseif (z <= -1.04e-243) 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 <= -6e+101)
tmp = z;
elseif (z <= -5e-54)
tmp = y * i;
elseif (z <= -5.5e-173)
tmp = a;
elseif (z <= -1.04e-243)
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, -6e+101], z, If[LessEqual[z, -5e-54], N[(y * i), $MachinePrecision], If[LessEqual[z, -5.5e-173], a, If[LessEqual[z, -1.04e-243], N[(y * i), $MachinePrecision], a]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+101}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-54}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -1.04 \cdot 10^{-243}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -5.99999999999999986e101Initial program 99.9%
Taylor expanded in t around 0 88.0%
Taylor expanded in b around 0 77.9%
Taylor expanded in z around inf 43.1%
if -5.99999999999999986e101 < z < -5.00000000000000015e-54 or -5.50000000000000022e-173 < z < -1.0400000000000001e-243Initial program 99.9%
associate-+l+100.0%
associate-+l+100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 30.5%
*-commutative30.5%
Simplified30.5%
if -5.00000000000000015e-54 < z < -5.50000000000000022e-173 or -1.0400000000000001e-243 < z Initial 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 a around inf 51.8%
Taylor expanded in a around inf 17.7%
Final simplification23.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
(if (<= z -5.6e+100)
z
(if (<= z -3.6e-53)
(* y i)
(if (<= z -5.5e-173) (+ t a) (if (<= z -5e-243) (* 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 <= -5.6e+100) {
tmp = z;
} else if (z <= -3.6e-53) {
tmp = y * i;
} else if (z <= -5.5e-173) {
tmp = t + a;
} else if (z <= -5e-243) {
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 <= (-5.6d+100)) then
tmp = z
else if (z <= (-3.6d-53)) then
tmp = y * i
else if (z <= (-5.5d-173)) then
tmp = t + a
else if (z <= (-5d-243)) 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 <= -5.6e+100) {
tmp = z;
} else if (z <= -3.6e-53) {
tmp = y * i;
} else if (z <= -5.5e-173) {
tmp = t + a;
} else if (z <= -5e-243) {
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 <= -5.6e+100: tmp = z elif z <= -3.6e-53: tmp = y * i elif z <= -5.5e-173: tmp = t + a elif z <= -5e-243: 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 <= -5.6e+100) tmp = z; elseif (z <= -3.6e-53) tmp = Float64(y * i); elseif (z <= -5.5e-173) tmp = Float64(t + a); elseif (z <= -5e-243) 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 <= -5.6e+100)
tmp = z;
elseif (z <= -3.6e-53)
tmp = y * i;
elseif (z <= -5.5e-173)
tmp = t + a;
elseif (z <= -5e-243)
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, -5.6e+100], z, If[LessEqual[z, -3.6e-53], N[(y * i), $MachinePrecision], If[LessEqual[z, -5.5e-173], N[(t + a), $MachinePrecision], If[LessEqual[z, -5e-243], N[(y * i), $MachinePrecision], a]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.6 \cdot 10^{+100}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-53}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-173}:\\
\;\;\;\;t + a\\
\mathbf{elif}\;z \leq -5 \cdot 10^{-243}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -5.5999999999999996e100Initial program 99.9%
Taylor expanded in t around 0 88.3%
Taylor expanded in b around 0 78.4%
Taylor expanded in z around inf 42.1%
if -5.5999999999999996e100 < z < -3.5999999999999999e-53 or -5.50000000000000022e-173 < z < -5e-243Initial program 99.9%
associate-+l+100.0%
associate-+l+100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 31.2%
*-commutative31.2%
Simplified31.2%
if -3.5999999999999999e-53 < z < -5.50000000000000022e-173Initial 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 a around inf 74.2%
Taylor expanded in y around 0 43.5%
if -5e-243 < z Initial 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 a around inf 47.2%
Taylor expanded in a around inf 14.3%
Final simplification24.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 (<= z -3.2e+131) (+ z (* y i)) (+ (* y i) (+ 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 (z <= -3.2e+131) {
tmp = z + (y * i);
} else {
tmp = (y * i) + (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) :: tmp
if (z <= (-3.2d+131)) then
tmp = z + (y * i)
else
tmp = (y * i) + (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 tmp;
if (z <= -3.2e+131) {
tmp = z + (y * i);
} else {
tmp = (y * i) + (t + a);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -3.2e+131: tmp = z + (y * i) else: tmp = (y * i) + (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 (z <= -3.2e+131) tmp = Float64(z + Float64(y * i)); else tmp = Float64(Float64(y * i) + 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)
tmp = 0.0;
if (z <= -3.2e+131)
tmp = z + (y * i);
else
tmp = (y * i) + (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_] := If[LessEqual[z, -3.2e+131], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+131}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t + a\right)\\
\end{array}
\end{array}
if z < -3.2000000000000002e131Initial program 99.9%
Taylor expanded in t around 0 87.1%
Taylor expanded in z around inf 66.3%
if -3.2000000000000002e131 < z Initial 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 a around inf 53.6%
Taylor expanded in t around 0 53.6%
Final simplification55.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 (<= a 2.9e+180) (+ z (* y i)) (+ 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 (a <= 2.9e+180) {
tmp = z + (y * i);
} else {
tmp = 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) :: tmp
if (a <= 2.9d+180) then
tmp = z + (y * i)
else
tmp = 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 tmp;
if (a <= 2.9e+180) {
tmp = z + (y * i);
} else {
tmp = t + 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.9e+180: tmp = z + (y * i) else: tmp = 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 (a <= 2.9e+180) tmp = Float64(z + Float64(y * i)); else tmp = 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)
tmp = 0.0;
if (a <= 2.9e+180)
tmp = z + (y * i);
else
tmp = 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_] := If[LessEqual[a, 2.9e+180], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(t + a), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;a \leq 2.9 \cdot 10^{+180}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t + a\\
\end{array}
\end{array}
if a < 2.90000000000000007e180Initial program 99.8%
Taylor expanded in t around 0 86.6%
Taylor expanded in z around inf 40.6%
if 2.90000000000000007e180 < a Initial 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 a around inf 70.6%
Taylor expanded in y around 0 65.9%
Final simplification42.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 (<= z -4.5e+130) (+ 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 (z <= -4.5e+130) {
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 (z <= (-4.5d+130)) 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 (z <= -4.5e+130) {
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 z <= -4.5e+130: 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 (z <= -4.5e+130) 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 (z <= -4.5e+130)
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[z, -4.5e+130], 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}\;z \leq -4.5 \cdot 10^{+130}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -4.50000000000000039e130Initial program 99.9%
Taylor expanded in t around 0 87.1%
Taylor expanded in z around inf 66.3%
if -4.50000000000000039e130 < z Initial 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 a around inf 53.6%
Taylor expanded in t around 0 40.6%
Final simplification44.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 (if (<= z -7.5e+132) 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 (z <= -7.5e+132) {
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 (z <= (-7.5d+132)) 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 (z <= -7.5e+132) {
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 z <= -7.5e+132: 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 (z <= -7.5e+132) 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 (z <= -7.5e+132)
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[z, -7.5e+132], z, a]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.5 \cdot 10^{+132}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -7.50000000000000017e132Initial program 99.9%
Taylor expanded in t around 0 87.1%
Taylor expanded in b around 0 81.4%
Taylor expanded in z around inf 46.2%
if -7.50000000000000017e132 < z Initial 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 a around inf 53.6%
Taylor expanded in a around inf 18.8%
Final simplification22.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)
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%
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 51.7%
Taylor expanded in a around inf 17.0%
Final simplification17.0%
herbie shell --seed 2023224
(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)))