
(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.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%
Final simplification99.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))) (t_2 (+ (* y i) (+ a z))))
(if (<= t_1 -4e+112)
(+ t_1 (+ a (* y i)))
(if (<= t_1 110.0)
t_2
(if (<= t_1 2e+23)
(+ (+ a z) (* x (log y)))
(if (<= t_1 1e+99) t_2 (+ (+ a z) (+ t t_1))))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(c) * (b - 0.5);
double t_2 = (y * i) + (a + z);
double tmp;
if (t_1 <= -4e+112) {
tmp = t_1 + (a + (y * i));
} else if (t_1 <= 110.0) {
tmp = t_2;
} else if (t_1 <= 2e+23) {
tmp = (a + z) + (x * log(y));
} else if (t_1 <= 1e+99) {
tmp = t_2;
} else {
tmp = (a + z) + (t + t_1);
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = log(c) * (b - 0.5d0)
t_2 = (y * i) + (a + z)
if (t_1 <= (-4d+112)) then
tmp = t_1 + (a + (y * i))
else if (t_1 <= 110.0d0) then
tmp = t_2
else if (t_1 <= 2d+23) then
tmp = (a + z) + (x * log(y))
else if (t_1 <= 1d+99) then
tmp = t_2
else
tmp = (a + z) + (t + t_1)
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = Math.log(c) * (b - 0.5);
double t_2 = (y * i) + (a + z);
double tmp;
if (t_1 <= -4e+112) {
tmp = t_1 + (a + (y * i));
} else if (t_1 <= 110.0) {
tmp = t_2;
} else if (t_1 <= 2e+23) {
tmp = (a + z) + (x * Math.log(y));
} else if (t_1 <= 1e+99) {
tmp = t_2;
} else {
tmp = (a + z) + (t + t_1);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = math.log(c) * (b - 0.5) t_2 = (y * i) + (a + z) tmp = 0 if t_1 <= -4e+112: tmp = t_1 + (a + (y * i)) elif t_1 <= 110.0: tmp = t_2 elif t_1 <= 2e+23: tmp = (a + z) + (x * math.log(y)) elif t_1 <= 1e+99: tmp = t_2 else: tmp = (a + z) + (t + t_1) return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(c) * Float64(b - 0.5)) t_2 = Float64(Float64(y * i) + Float64(a + z)) tmp = 0.0 if (t_1 <= -4e+112) tmp = Float64(t_1 + Float64(a + Float64(y * i))); elseif (t_1 <= 110.0) tmp = t_2; elseif (t_1 <= 2e+23) tmp = Float64(Float64(a + z) + Float64(x * log(y))); elseif (t_1 <= 1e+99) tmp = t_2; else tmp = Float64(Float64(a + z) + Float64(t + t_1)); end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = log(c) * (b - 0.5);
t_2 = (y * i) + (a + z);
tmp = 0.0;
if (t_1 <= -4e+112)
tmp = t_1 + (a + (y * i));
elseif (t_1 <= 110.0)
tmp = t_2;
elseif (t_1 <= 2e+23)
tmp = (a + z) + (x * log(y));
elseif (t_1 <= 1e+99)
tmp = t_2;
else
tmp = (a + z) + (t + t_1);
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+112], N[(t$95$1 + N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 110.0], t$95$2, If[LessEqual[t$95$1, 2e+23], N[(N[(a + z), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+99], t$95$2, N[(N[(a + z), $MachinePrecision] + N[(t + t$95$1), $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 := y \cdot i + \left(a + z\right)\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+112}:\\
\;\;\;\;t_1 + \left(a + y \cdot i\right)\\
\mathbf{elif}\;t_1 \leq 110:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+23}:\\
\;\;\;\;\left(a + z\right) + x \cdot \log y\\
\mathbf{elif}\;t_1 \leq 10^{+99}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) + \left(t + t_1\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 b 1/2) (log.f64 c)) < -3.9999999999999997e112Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 89.1%
+-commutative89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in t around 0 82.5%
fma-def82.5%
sub-neg82.5%
metadata-eval82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in z around 0 74.7%
if -3.9999999999999997e112 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 110 or 1.9999999999999998e23 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 9.9999999999999997e98Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
associate-+r+100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 84.1%
+-commutative84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in i around inf 67.9%
if 110 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 1.9999999999999998e23Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 79.0%
Taylor expanded in x around inf 62.4%
if 9.9999999999999997e98 < (*.f64 (-.f64 b 1/2) (log.f64 c)) Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 90.7%
+-commutative90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in y around 0 86.2%
Final simplification70.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))) (t_2 (+ (* y i) (+ a z))))
(if (<= t_1 -4e+112)
(+ t_1 (+ a (* y i)))
(if (<= t_1 110.0)
t_2
(if (<= t_1 2e+23)
(+ (+ a z) (* x (log y)))
(if (<= t_1 1e+99) t_2 (+ (+ a z) (* b (log c)))))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = log(c) * (b - 0.5);
double t_2 = (y * i) + (a + z);
double tmp;
if (t_1 <= -4e+112) {
tmp = t_1 + (a + (y * i));
} else if (t_1 <= 110.0) {
tmp = t_2;
} else if (t_1 <= 2e+23) {
tmp = (a + z) + (x * log(y));
} else if (t_1 <= 1e+99) {
tmp = t_2;
} else {
tmp = (a + z) + (b * 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 = (y * i) + (a + z)
if (t_1 <= (-4d+112)) then
tmp = t_1 + (a + (y * i))
else if (t_1 <= 110.0d0) then
tmp = t_2
else if (t_1 <= 2d+23) then
tmp = (a + z) + (x * log(y))
else if (t_1 <= 1d+99) then
tmp = t_2
else
tmp = (a + z) + (b * 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 = (y * i) + (a + z);
double tmp;
if (t_1 <= -4e+112) {
tmp = t_1 + (a + (y * i));
} else if (t_1 <= 110.0) {
tmp = t_2;
} else if (t_1 <= 2e+23) {
tmp = (a + z) + (x * Math.log(y));
} else if (t_1 <= 1e+99) {
tmp = t_2;
} else {
tmp = (a + z) + (b * 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 = (y * i) + (a + z) tmp = 0 if t_1 <= -4e+112: tmp = t_1 + (a + (y * i)) elif t_1 <= 110.0: tmp = t_2 elif t_1 <= 2e+23: tmp = (a + z) + (x * math.log(y)) elif t_1 <= 1e+99: tmp = t_2 else: tmp = (a + z) + (b * 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(Float64(y * i) + Float64(a + z)) tmp = 0.0 if (t_1 <= -4e+112) tmp = Float64(t_1 + Float64(a + Float64(y * i))); elseif (t_1 <= 110.0) tmp = t_2; elseif (t_1 <= 2e+23) tmp = Float64(Float64(a + z) + Float64(x * log(y))); elseif (t_1 <= 1e+99) tmp = t_2; else tmp = Float64(Float64(a + z) + Float64(b * 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 = (y * i) + (a + z);
tmp = 0.0;
if (t_1 <= -4e+112)
tmp = t_1 + (a + (y * i));
elseif (t_1 <= 110.0)
tmp = t_2;
elseif (t_1 <= 2e+23)
tmp = (a + z) + (x * log(y));
elseif (t_1 <= 1e+99)
tmp = t_2;
else
tmp = (a + z) + (b * 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[(N[(y * i), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+112], N[(t$95$1 + N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 110.0], t$95$2, If[LessEqual[t$95$1, 2e+23], N[(N[(a + z), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+99], t$95$2, N[(N[(a + z), $MachinePrecision] + N[(b * N[Log[c], $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 := y \cdot i + \left(a + z\right)\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+112}:\\
\;\;\;\;t_1 + \left(a + y \cdot i\right)\\
\mathbf{elif}\;t_1 \leq 110:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+23}:\\
\;\;\;\;\left(a + z\right) + x \cdot \log y\\
\mathbf{elif}\;t_1 \leq 10^{+99}:\\
\;\;\;\;t_2\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) + b \cdot \log c\\
\end{array}
\end{array}
if (*.f64 (-.f64 b 1/2) (log.f64 c)) < -3.9999999999999997e112Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 89.1%
+-commutative89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in t around 0 82.5%
fma-def82.5%
sub-neg82.5%
metadata-eval82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in z around 0 74.7%
if -3.9999999999999997e112 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 110 or 1.9999999999999998e23 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 9.9999999999999997e98Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
associate-+r+100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 84.1%
+-commutative84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in i around inf 67.9%
if 110 < (*.f64 (-.f64 b 1/2) (log.f64 c)) < 1.9999999999999998e23Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 79.0%
Taylor expanded in x around inf 62.4%
if 9.9999999999999997e98 < (*.f64 (-.f64 b 1/2) (log.f64 c)) Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 90.7%
+-commutative90.7%
*-commutative90.7%
Simplified90.7%
Taylor expanded in b around inf 80.5%
Final simplification69.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (<= i -1.1e+101)
(+ (+ a z) (fma (+ b -0.5) (log c) (+ t (* y i))))
(if (<= i 3.5e-79)
(+ (+ a z) (+ (* x (log y)) (+ t t_1)))
(+ (* y i) (+ t_1 (+ a (+ t 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 t_1 = log(c) * (b - 0.5);
double tmp;
if (i <= -1.1e+101) {
tmp = (a + z) + fma((b + -0.5), log(c), (t + (y * i)));
} else if (i <= 3.5e-79) {
tmp = (a + z) + ((x * log(y)) + (t + t_1));
} else {
tmp = (y * i) + (t_1 + (a + (t + z)));
}
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 (i <= -1.1e+101) tmp = Float64(Float64(a + z) + fma(Float64(b + -0.5), log(c), Float64(t + Float64(y * i)))); elseif (i <= 3.5e-79) tmp = Float64(Float64(a + z) + Float64(Float64(x * log(y)) + Float64(t + t_1))); else tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + Float64(t + 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_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -1.1e+101], N[(N[(a + z), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(t + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 3.5e-79], N[(N[(a + z), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(t + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(t + z), $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}\;i \leq -1.1 \cdot 10^{+101}:\\
\;\;\;\;\left(a + z\right) + \mathsf{fma}\left(b + -0.5, \log c, t + y \cdot i\right)\\
\mathbf{elif}\;i \leq 3.5 \cdot 10^{-79}:\\
\;\;\;\;\left(a + z\right) + \left(x \cdot \log y + \left(t + t_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t_1 + \left(a + \left(t + z\right)\right)\right)\\
\end{array}
\end{array}
if i < -1.1e101Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 91.0%
+-commutative91.0%
*-commutative91.0%
Simplified91.0%
if -1.1e101 < i < 3.5000000000000003e-79Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 96.2%
if 3.5000000000000003e-79 < i Initial program 99.9%
Taylor expanded in x around 0 91.6%
+-commutative91.6%
Simplified91.6%
Final simplification93.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5))) (* y i)))
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0))) + (y * i)
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((a + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5))) + (y * i);
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return ((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5))) + (y * i)
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i
\end{array}
Initial program 99.8%
Final simplification99.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function.
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (or (<= i -2.25e+100) (not (<= i 4.5e-78)))
(+ (* y i) (+ t_1 (+ a (+ t z))))
(+ (+ a z) (+ t_1 (* 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) {
double t_1 = log(c) * (b - 0.5);
double tmp;
if ((i <= -2.25e+100) || !(i <= 4.5e-78)) {
tmp = (y * i) + (t_1 + (a + (t + z)));
} else {
tmp = (a + z) + (t_1 + (x * log(y)));
}
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 ((i <= (-2.25d+100)) .or. (.not. (i <= 4.5d-78))) then
tmp = (y * i) + (t_1 + (a + (t + z)))
else
tmp = (a + z) + (t_1 + (x * log(y)))
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 ((i <= -2.25e+100) || !(i <= 4.5e-78)) {
tmp = (y * i) + (t_1 + (a + (t + z)));
} else {
tmp = (a + z) + (t_1 + (x * Math.log(y)));
}
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 (i <= -2.25e+100) or not (i <= 4.5e-78): tmp = (y * i) + (t_1 + (a + (t + z))) else: tmp = (a + z) + (t_1 + (x * math.log(y))) 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 ((i <= -2.25e+100) || !(i <= 4.5e-78)) tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + Float64(t + z)))); else tmp = Float64(Float64(a + z) + Float64(t_1 + Float64(x * log(y)))); 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 ((i <= -2.25e+100) || ~((i <= 4.5e-78)))
tmp = (y * i) + (t_1 + (a + (t + z)));
else
tmp = (a + z) + (t_1 + (x * log(y)));
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[i, -2.25e+100], N[Not[LessEqual[i, 4.5e-78]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a + z), $MachinePrecision] + N[(t$95$1 + N[(x * N[Log[y], $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}\;i \leq -2.25 \cdot 10^{+100} \lor \neg \left(i \leq 4.5 \cdot 10^{-78}\right):\\
\;\;\;\;y \cdot i + \left(t_1 + \left(a + \left(t + z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a + z\right) + \left(t_1 + x \cdot \log y\right)\\
\end{array}
\end{array}
if i < -2.25000000000000018e100 or 4.5e-78 < i Initial program 99.9%
Taylor expanded in x around 0 91.4%
+-commutative91.4%
Simplified91.4%
if -2.25000000000000018e100 < i < 4.5e-78Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 96.2%
Taylor expanded in t around 0 81.7%
Final simplification86.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 (* (log c) (- b 0.5))))
(if (<= i -2.25e+100)
(+ (+ a z) (fma (+ b -0.5) (log c) (+ t (* y i))))
(if (<= i 1.25e-78)
(+ (+ a z) (+ t_1 (* x (log y))))
(+ (* y i) (+ t_1 (+ a (+ t 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 t_1 = log(c) * (b - 0.5);
double tmp;
if (i <= -2.25e+100) {
tmp = (a + z) + fma((b + -0.5), log(c), (t + (y * i)));
} else if (i <= 1.25e-78) {
tmp = (a + z) + (t_1 + (x * log(y)));
} else {
tmp = (y * i) + (t_1 + (a + (t + z)));
}
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 (i <= -2.25e+100) tmp = Float64(Float64(a + z) + fma(Float64(b + -0.5), log(c), Float64(t + Float64(y * i)))); elseif (i <= 1.25e-78) tmp = Float64(Float64(a + z) + Float64(t_1 + Float64(x * log(y)))); else tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + Float64(t + 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_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.25e+100], N[(N[(a + z), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(t + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[i, 1.25e-78], N[(N[(a + z), $MachinePrecision] + N[(t$95$1 + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(t + z), $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}\;i \leq -2.25 \cdot 10^{+100}:\\
\;\;\;\;\left(a + z\right) + \mathsf{fma}\left(b + -0.5, \log c, t + y \cdot i\right)\\
\mathbf{elif}\;i \leq 1.25 \cdot 10^{-78}:\\
\;\;\;\;\left(a + z\right) + \left(t_1 + x \cdot \log y\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t_1 + \left(a + \left(t + z\right)\right)\right)\\
\end{array}
\end{array}
if i < -2.25000000000000018e100Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 91.0%
+-commutative91.0%
*-commutative91.0%
Simplified91.0%
if -2.25000000000000018e100 < i < 1.2499999999999999e-78Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 96.2%
Taylor expanded in t around 0 81.7%
if 1.2499999999999999e-78 < i Initial program 99.9%
Taylor expanded in x around 0 91.6%
+-commutative91.6%
Simplified91.6%
Final simplification86.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))))
(if (<= x -2.1e+171)
(+ t (fma y i t_1))
(if (<= x 2.2e+221)
(+ (* y i) (+ t_2 (+ a (+ t z))))
(+ t_1 (+ z 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 = log(c) * (b - 0.5);
double tmp;
if (x <= -2.1e+171) {
tmp = t + fma(y, i, t_1);
} else if (x <= 2.2e+221) {
tmp = (y * i) + (t_2 + (a + (t + z)));
} else {
tmp = t_1 + (z + 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(log(c) * Float64(b - 0.5)) tmp = 0.0 if (x <= -2.1e+171) tmp = Float64(t + fma(y, i, t_1)); elseif (x <= 2.2e+221) tmp = Float64(Float64(y * i) + Float64(t_2 + Float64(a + Float64(t + z)))); else tmp = Float64(t_1 + Float64(z + 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[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -2.1e+171], N[(t + N[(y * i + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e+221], N[(N[(y * i), $MachinePrecision] + N[(t$95$2 + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(z + 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 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -2.1 \cdot 10^{+171}:\\
\;\;\;\;t + \mathsf{fma}\left(y, i, t_1\right)\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{+221}:\\
\;\;\;\;y \cdot i + \left(t_2 + \left(a + \left(t + z\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t_1 + \left(z + t_2\right)\\
\end{array}
\end{array}
if x < -2.1000000000000001e171Initial 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.3%
if -2.1000000000000001e171 < x < 2.1999999999999999e221Initial program 99.9%
Taylor expanded in x around 0 91.5%
+-commutative91.5%
Simplified91.5%
if 2.1999999999999999e221 < x Initial program 99.5%
+-commutative99.5%
associate-+l+99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
associate-+r+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r+99.5%
associate-+r+99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in y around 0 99.5%
Taylor expanded in t around 0 89.6%
fma-def89.8%
sub-neg89.8%
metadata-eval89.8%
+-commutative89.8%
Simplified89.8%
Taylor expanded in a around 0 80.5%
Final simplification90.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.06e+171) (not (<= x 5.5e+179))) (+ t (fma y i (* x (log y)))) (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ t 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.06e+171) || !(x <= 5.5e+179)) {
tmp = t + fma(y, i, (x * log(y)));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (t + 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.06e+171) || !(x <= 5.5e+179)) 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(a + Float64(t + 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[x, -1.06e+171], N[Not[LessEqual[x, 5.5e+179]], $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[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{+171} \lor \neg \left(x \leq 5.5 \cdot 10^{+179}\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(a + \left(t + z\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.06000000000000001e171 or 5.4999999999999998e179 < x 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 x around inf 83.8%
if -1.06000000000000001e171 < x < 5.4999999999999998e179Initial program 99.9%
Taylor expanded in x around 0 93.4%
+-commutative93.4%
Simplified93.4%
Final simplification91.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
(let* ((t_1 (+ (+ a z) (* b (log c))))
(t_2 (+ (* (log c) (- b 0.5)) (* y i))))
(if (<= (- b 0.5) -2e+229)
t_2
(if (<= (- b 0.5) -1e+144)
t_1
(if (<= (- b 0.5) -1e+107)
t_2
(if (<= (- b 0.5) 2e+111) (+ (* y i) (+ a z)) t_1))))))assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a + z) + (b * log(c));
double t_2 = (log(c) * (b - 0.5)) + (y * i);
double tmp;
if ((b - 0.5) <= -2e+229) {
tmp = t_2;
} else if ((b - 0.5) <= -1e+144) {
tmp = t_1;
} else if ((b - 0.5) <= -1e+107) {
tmp = t_2;
} else if ((b - 0.5) <= 2e+111) {
tmp = (y * i) + (a + z);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (a + z) + (b * log(c))
t_2 = (log(c) * (b - 0.5d0)) + (y * i)
if ((b - 0.5d0) <= (-2d+229)) then
tmp = t_2
else if ((b - 0.5d0) <= (-1d+144)) then
tmp = t_1
else if ((b - 0.5d0) <= (-1d+107)) then
tmp = t_2
else if ((b - 0.5d0) <= 2d+111) then
tmp = (y * i) + (a + z)
else
tmp = t_1
end if
code = tmp
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (a + z) + (b * Math.log(c));
double t_2 = (Math.log(c) * (b - 0.5)) + (y * i);
double tmp;
if ((b - 0.5) <= -2e+229) {
tmp = t_2;
} else if ((b - 0.5) <= -1e+144) {
tmp = t_1;
} else if ((b - 0.5) <= -1e+107) {
tmp = t_2;
} else if ((b - 0.5) <= 2e+111) {
tmp = (y * i) + (a + z);
} else {
tmp = t_1;
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = (a + z) + (b * math.log(c)) t_2 = (math.log(c) * (b - 0.5)) + (y * i) tmp = 0 if (b - 0.5) <= -2e+229: tmp = t_2 elif (b - 0.5) <= -1e+144: tmp = t_1 elif (b - 0.5) <= -1e+107: tmp = t_2 elif (b - 0.5) <= 2e+111: tmp = (y * i) + (a + z) else: tmp = t_1 return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a + z) + Float64(b * log(c))) t_2 = Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(y * i)) tmp = 0.0 if (Float64(b - 0.5) <= -2e+229) tmp = t_2; elseif (Float64(b - 0.5) <= -1e+144) tmp = t_1; elseif (Float64(b - 0.5) <= -1e+107) tmp = t_2; elseif (Float64(b - 0.5) <= 2e+111) tmp = Float64(Float64(y * i) + Float64(a + z)); else tmp = t_1; end return tmp end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp_2 = code(x, y, z, t, a, b, c, i)
t_1 = (a + z) + (b * log(c));
t_2 = (log(c) * (b - 0.5)) + (y * i);
tmp = 0.0;
if ((b - 0.5) <= -2e+229)
tmp = t_2;
elseif ((b - 0.5) <= -1e+144)
tmp = t_1;
elseif ((b - 0.5) <= -1e+107)
tmp = t_2;
elseif ((b - 0.5) <= 2e+111)
tmp = (y * i) + (a + z);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(a + z), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(b - 0.5), $MachinePrecision], -2e+229], t$95$2, If[LessEqual[N[(b - 0.5), $MachinePrecision], -1e+144], t$95$1, If[LessEqual[N[(b - 0.5), $MachinePrecision], -1e+107], t$95$2, If[LessEqual[N[(b - 0.5), $MachinePrecision], 2e+111], N[(N[(y * i), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := \left(a + z\right) + b \cdot \log c\\
t_2 := \log c \cdot \left(b - 0.5\right) + y \cdot i\\
\mathbf{if}\;b - 0.5 \leq -2 \cdot 10^{+229}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b - 0.5 \leq -1 \cdot 10^{+144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;b - 0.5 \leq -1 \cdot 10^{+107}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;b - 0.5 \leq 2 \cdot 10^{+111}:\\
\;\;\;\;y \cdot i + \left(a + z\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if (-.f64 b 1/2) < -2e229 or -1.00000000000000002e144 < (-.f64 b 1/2) < -9.9999999999999997e106Initial program 99.5%
+-commutative99.5%
associate-+l+99.5%
associate-+r+99.5%
+-commutative99.5%
associate-+r+99.5%
associate-+r+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r+99.5%
associate-+r+99.5%
fma-def99.5%
sub-neg99.5%
metadata-eval99.5%
Simplified99.5%
Taylor expanded in x around 0 95.4%
+-commutative95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in t around 0 95.4%
fma-def95.4%
sub-neg95.4%
metadata-eval95.4%
+-commutative95.4%
Simplified95.4%
Taylor expanded in z around 0 90.9%
Taylor expanded in a around 0 90.9%
if -2e229 < (-.f64 b 1/2) < -1.00000000000000002e144 or 1.99999999999999991e111 < (-.f64 b 1/2) Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 88.8%
+-commutative88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in b around inf 73.2%
if -9.9999999999999997e106 < (-.f64 b 1/2) < 1.99999999999999991e111Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 79.4%
+-commutative79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in i around inf 62.8%
Final simplification67.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
(let* ((t_1 (+ (+ a z) (* (+ b -0.5) (log c))))
(t_2 (+ (* y i) (+ a z)))
(t_3 (+ (+ a z) (* x (log y)))))
(if (<= i -2.2e+83)
t_2
(if (<= i -8.5)
t_1
(if (<= i -8.5e-144)
t_3
(if (<= i 2.1e-290)
t_1
(if (<= i 1.9e-78) t_3 (if (<= i 62000000.0) t_1 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 = (a + z) + ((b + -0.5) * log(c));
double t_2 = (y * i) + (a + z);
double t_3 = (a + z) + (x * log(y));
double tmp;
if (i <= -2.2e+83) {
tmp = t_2;
} else if (i <= -8.5) {
tmp = t_1;
} else if (i <= -8.5e-144) {
tmp = t_3;
} else if (i <= 2.1e-290) {
tmp = t_1;
} else if (i <= 1.9e-78) {
tmp = t_3;
} else if (i <= 62000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
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) :: t_3
real(8) :: tmp
t_1 = (a + z) + ((b + (-0.5d0)) * log(c))
t_2 = (y * i) + (a + z)
t_3 = (a + z) + (x * log(y))
if (i <= (-2.2d+83)) then
tmp = t_2
else if (i <= (-8.5d0)) then
tmp = t_1
else if (i <= (-8.5d-144)) then
tmp = t_3
else if (i <= 2.1d-290) then
tmp = t_1
else if (i <= 1.9d-78) then
tmp = t_3
else if (i <= 62000000.0d0) then
tmp = t_1
else
tmp = t_2
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 = (a + z) + ((b + -0.5) * Math.log(c));
double t_2 = (y * i) + (a + z);
double t_3 = (a + z) + (x * Math.log(y));
double tmp;
if (i <= -2.2e+83) {
tmp = t_2;
} else if (i <= -8.5) {
tmp = t_1;
} else if (i <= -8.5e-144) {
tmp = t_3;
} else if (i <= 2.1e-290) {
tmp = t_1;
} else if (i <= 1.9e-78) {
tmp = t_3;
} else if (i <= 62000000.0) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): t_1 = (a + z) + ((b + -0.5) * math.log(c)) t_2 = (y * i) + (a + z) t_3 = (a + z) + (x * math.log(y)) tmp = 0 if i <= -2.2e+83: tmp = t_2 elif i <= -8.5: tmp = t_1 elif i <= -8.5e-144: tmp = t_3 elif i <= 2.1e-290: tmp = t_1 elif i <= 1.9e-78: tmp = t_3 elif i <= 62000000.0: tmp = t_1 else: tmp = t_2 return tmp
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(a + z) + Float64(Float64(b + -0.5) * log(c))) t_2 = Float64(Float64(y * i) + Float64(a + z)) t_3 = Float64(Float64(a + z) + Float64(x * log(y))) tmp = 0.0 if (i <= -2.2e+83) tmp = t_2; elseif (i <= -8.5) tmp = t_1; elseif (i <= -8.5e-144) tmp = t_3; elseif (i <= 2.1e-290) tmp = t_1; elseif (i <= 1.9e-78) tmp = t_3; elseif (i <= 62000000.0) tmp = t_1; else tmp = t_2; 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 = (a + z) + ((b + -0.5) * log(c));
t_2 = (y * i) + (a + z);
t_3 = (a + z) + (x * log(y));
tmp = 0.0;
if (i <= -2.2e+83)
tmp = t_2;
elseif (i <= -8.5)
tmp = t_1;
elseif (i <= -8.5e-144)
tmp = t_3;
elseif (i <= 2.1e-290)
tmp = t_1;
elseif (i <= 1.9e-78)
tmp = t_3;
elseif (i <= 62000000.0)
tmp = t_1;
else
tmp = t_2;
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[(a + z), $MachinePrecision] + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(a + z), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[i, -2.2e+83], t$95$2, If[LessEqual[i, -8.5], t$95$1, If[LessEqual[i, -8.5e-144], t$95$3, If[LessEqual[i, 2.1e-290], t$95$1, If[LessEqual[i, 1.9e-78], t$95$3, If[LessEqual[i, 62000000.0], t$95$1, t$95$2]]]]]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
t_1 := \left(a + z\right) + \left(b + -0.5\right) \cdot \log c\\
t_2 := y \cdot i + \left(a + z\right)\\
t_3 := \left(a + z\right) + x \cdot \log y\\
\mathbf{if}\;i \leq -2.2 \cdot 10^{+83}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;i \leq -8.5:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq -8.5 \cdot 10^{-144}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;i \leq 2.1 \cdot 10^{-290}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;i \leq 1.9 \cdot 10^{-78}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;i \leq 62000000:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if i < -2.19999999999999999e83 or 6.2e7 < i Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 88.8%
+-commutative88.8%
*-commutative88.8%
Simplified88.8%
Taylor expanded in i around inf 75.0%
if -2.19999999999999999e83 < i < -8.5 or -8.49999999999999958e-144 < i < 2.1000000000000001e-290 or 1.8999999999999999e-78 < i < 6.2e7Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 87.9%
+-commutative87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in t around 0 74.5%
fma-def74.5%
sub-neg74.5%
metadata-eval74.5%
+-commutative74.5%
Simplified74.5%
Taylor expanded in i around 0 74.7%
*-commutative74.7%
sub-neg74.7%
metadata-eval74.7%
Simplified74.7%
if -8.5 < i < -8.49999999999999958e-144 or 2.1000000000000001e-290 < i < 1.8999999999999999e-78Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 95.1%
Taylor expanded in x around inf 62.2%
Final simplification71.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 (<= x -3e+173) (not (<= x 1.16e+227))) (+ (+ a z) (* x (log y))) (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ t 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 <= -3e+173) || !(x <= 1.16e+227)) {
tmp = (a + z) + (x * log(y));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (t + 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 <= (-3d+173)) .or. (.not. (x <= 1.16d+227))) then
tmp = (a + z) + (x * log(y))
else
tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (a + (t + 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 <= -3e+173) || !(x <= 1.16e+227)) {
tmp = (a + z) + (x * Math.log(y));
} else {
tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (a + (t + z)));
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -3e+173) or not (x <= 1.16e+227): tmp = (a + z) + (x * math.log(y)) else: tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (a + (t + 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 <= -3e+173) || !(x <= 1.16e+227)) tmp = Float64(Float64(a + z) + Float64(x * log(y))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(t + 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 <= -3e+173) || ~((x <= 1.16e+227)))
tmp = (a + z) + (x * log(y));
else
tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (t + 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, -3e+173], N[Not[LessEqual[x, 1.16e+227]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3 \cdot 10^{+173} \lor \neg \left(x \leq 1.16 \cdot 10^{+227}\right):\\
\;\;\;\;\left(a + z\right) + x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(t + z\right)\right)\right)\\
\end{array}
\end{array}
if x < -2.9999999999999998e173 or 1.1599999999999999e227 < x Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 86.5%
Taylor expanded in x around inf 73.7%
if -2.9999999999999998e173 < x < 1.1599999999999999e227Initial program 99.9%
Taylor expanded in x around 0 91.1%
+-commutative91.1%
Simplified91.1%
Final simplification88.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 -2.9e+176) (not (<= x 2.4e+224))) (+ (+ a z) (* 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 <= -2.9e+176) || !(x <= 2.4e+224)) {
tmp = (a + z) + (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 <= (-2.9d+176)) .or. (.not. (x <= 2.4d+224))) then
tmp = (a + z) + (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 <= -2.9e+176) || !(x <= 2.4e+224)) {
tmp = (a + z) + (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 <= -2.9e+176) or not (x <= 2.4e+224): tmp = (a + z) + (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 <= -2.9e+176) || !(x <= 2.4e+224)) tmp = Float64(Float64(a + z) + 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 <= -2.9e+176) || ~((x <= 2.4e+224)))
tmp = (a + z) + (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, -2.9e+176], N[Not[LessEqual[x, 2.4e+224]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] + N[(x * N[Log[y], $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 -2.9 \cdot 10^{+176} \lor \neg \left(x \leq 2.4 \cdot 10^{+224}\right):\\
\;\;\;\;\left(a + z\right) + x \cdot \log y\\
\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 < -2.9000000000000001e176 or 2.40000000000000001e224 < x Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 86.5%
Taylor expanded in x around inf 73.7%
if -2.9000000000000001e176 < x < 2.40000000000000001e224Initial program 99.9%
associate-+l+99.9%
add-sqr-sqrt52.6%
fma-def52.6%
Applied egg-rr52.6%
Taylor expanded in z around inf 78.4%
Final simplification77.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 0.5) -1.3e+180) (not (<= (- b 0.5) 3.5e+190))) (+ a (* (log c) (- b 0.5))) (+ (* 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 - 0.5) <= -1.3e+180) || !((b - 0.5) <= 3.5e+190)) {
tmp = a + (log(c) * (b - 0.5));
} else {
tmp = (y * i) + (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 (((b - 0.5d0) <= (-1.3d+180)) .or. (.not. ((b - 0.5d0) <= 3.5d+190))) then
tmp = a + (log(c) * (b - 0.5d0))
else
tmp = (y * i) + (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 (((b - 0.5) <= -1.3e+180) || !((b - 0.5) <= 3.5e+190)) {
tmp = a + (Math.log(c) * (b - 0.5));
} else {
tmp = (y * i) + (a + z);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((b - 0.5) <= -1.3e+180) or not ((b - 0.5) <= 3.5e+190): tmp = a + (math.log(c) * (b - 0.5)) else: tmp = (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 ((Float64(b - 0.5) <= -1.3e+180) || !(Float64(b - 0.5) <= 3.5e+190)) tmp = Float64(a + Float64(log(c) * Float64(b - 0.5))); else tmp = Float64(Float64(y * i) + 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 (((b - 0.5) <= -1.3e+180) || ~(((b - 0.5) <= 3.5e+190)))
tmp = a + (log(c) * (b - 0.5));
else
tmp = (y * i) + (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[N[(b - 0.5), $MachinePrecision], -1.3e+180], N[Not[LessEqual[N[(b - 0.5), $MachinePrecision], 3.5e+190]], $MachinePrecision]], N[(a + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -1.3 \cdot 10^{+180} \lor \neg \left(b - 0.5 \leq 3.5 \cdot 10^{+190}\right):\\
\;\;\;\;a + \log c \cdot \left(b - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + z\right)\\
\end{array}
\end{array}
if (-.f64 b 1/2) < -1.3000000000000001e180 or 3.4999999999999999e190 < (-.f64 b 1/2) Initial program 99.6%
+-commutative99.6%
associate-+l+99.6%
associate-+r+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+r+99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
associate-+r+99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around 0 92.5%
+-commutative92.5%
*-commutative92.5%
Simplified92.5%
Taylor expanded in t around 0 92.5%
fma-def92.5%
sub-neg92.5%
metadata-eval92.5%
+-commutative92.5%
Simplified92.5%
Taylor expanded in z around 0 85.2%
Taylor expanded in i around 0 72.1%
if -1.3000000000000001e180 < (-.f64 b 1/2) < 3.4999999999999999e190Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 80.3%
+-commutative80.3%
*-commutative80.3%
Simplified80.3%
Taylor expanded in i around inf 59.9%
Final simplification62.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 (or (<= (- b 0.5) -1e+107) (not (<= (- b 0.5) 2e+111))) (+ (+ a z) (* b (log c))) (+ (* 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 - 0.5) <= -1e+107) || !((b - 0.5) <= 2e+111)) {
tmp = (a + z) + (b * log(c));
} else {
tmp = (y * i) + (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 (((b - 0.5d0) <= (-1d+107)) .or. (.not. ((b - 0.5d0) <= 2d+111))) then
tmp = (a + z) + (b * log(c))
else
tmp = (y * i) + (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 (((b - 0.5) <= -1e+107) || !((b - 0.5) <= 2e+111)) {
tmp = (a + z) + (b * Math.log(c));
} else {
tmp = (y * i) + (a + z);
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if ((b - 0.5) <= -1e+107) or not ((b - 0.5) <= 2e+111): tmp = (a + z) + (b * math.log(c)) else: tmp = (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 ((Float64(b - 0.5) <= -1e+107) || !(Float64(b - 0.5) <= 2e+111)) tmp = Float64(Float64(a + z) + Float64(b * log(c))); else tmp = Float64(Float64(y * i) + 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 (((b - 0.5) <= -1e+107) || ~(((b - 0.5) <= 2e+111)))
tmp = (a + z) + (b * log(c));
else
tmp = (y * i) + (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[N[(b - 0.5), $MachinePrecision], -1e+107], N[Not[LessEqual[N[(b - 0.5), $MachinePrecision], 2e+111]], $MachinePrecision]], N[(N[(a + z), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -1 \cdot 10^{+107} \lor \neg \left(b - 0.5 \leq 2 \cdot 10^{+111}\right):\\
\;\;\;\;\left(a + z\right) + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + z\right)\\
\end{array}
\end{array}
if (-.f64 b 1/2) < -9.9999999999999997e106 or 1.99999999999999991e111 < (-.f64 b 1/2) Initial program 99.7%
+-commutative99.7%
associate-+l+99.7%
associate-+r+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
associate-+r+99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in x around 0 90.6%
+-commutative90.6%
*-commutative90.6%
Simplified90.6%
Taylor expanded in b around inf 70.6%
if -9.9999999999999997e106 < (-.f64 b 1/2) < 1.99999999999999991e111Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 79.4%
+-commutative79.4%
*-commutative79.4%
Simplified79.4%
Taylor expanded in i around inf 62.8%
Final simplification65.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.2e+139)
z
(if (<= z -1.96e+102)
(* y i)
(if (<= z -7.5e+76)
z
(if (<= z -32000.0) a (if (<= z 8.6e-239) (* 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.2e+139) {
tmp = z;
} else if (z <= -1.96e+102) {
tmp = y * i;
} else if (z <= -7.5e+76) {
tmp = z;
} else if (z <= -32000.0) {
tmp = a;
} else if (z <= 8.6e-239) {
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 <= (-1.2d+139)) then
tmp = z
else if (z <= (-1.96d+102)) then
tmp = y * i
else if (z <= (-7.5d+76)) then
tmp = z
else if (z <= (-32000.0d0)) then
tmp = a
else if (z <= 8.6d-239) 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 <= -1.2e+139) {
tmp = z;
} else if (z <= -1.96e+102) {
tmp = y * i;
} else if (z <= -7.5e+76) {
tmp = z;
} else if (z <= -32000.0) {
tmp = a;
} else if (z <= 8.6e-239) {
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 <= -1.2e+139: tmp = z elif z <= -1.96e+102: tmp = y * i elif z <= -7.5e+76: tmp = z elif z <= -32000.0: tmp = a elif z <= 8.6e-239: 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 <= -1.2e+139) tmp = z; elseif (z <= -1.96e+102) tmp = Float64(y * i); elseif (z <= -7.5e+76) tmp = z; elseif (z <= -32000.0) tmp = a; elseif (z <= 8.6e-239) 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 <= -1.2e+139)
tmp = z;
elseif (z <= -1.96e+102)
tmp = y * i;
elseif (z <= -7.5e+76)
tmp = z;
elseif (z <= -32000.0)
tmp = a;
elseif (z <= 8.6e-239)
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, -1.2e+139], z, If[LessEqual[z, -1.96e+102], N[(y * i), $MachinePrecision], If[LessEqual[z, -7.5e+76], z, If[LessEqual[z, -32000.0], a, If[LessEqual[z, 8.6e-239], N[(y * i), $MachinePrecision], a]]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{+139}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -1.96 \cdot 10^{+102}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{+76}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -32000:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{-239}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -1.20000000000000004e139 or -1.95999999999999993e102 < z < -7.4999999999999995e76Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 93.3%
+-commutative93.3%
*-commutative93.3%
Simplified93.3%
Taylor expanded in t around 0 91.3%
fma-def91.3%
sub-neg91.3%
metadata-eval91.3%
+-commutative91.3%
Simplified91.3%
Taylor expanded in z around inf 54.0%
if -1.20000000000000004e139 < z < -1.95999999999999993e102 or -32000 < z < 8.6000000000000001e-239Initial 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 inf 27.3%
*-commutative27.3%
Simplified27.3%
if -7.4999999999999995e76 < z < -32000 or 8.6000000000000001e-239 < z Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 87.3%
+-commutative87.3%
*-commutative87.3%
Simplified87.3%
Taylor expanded in t around 0 72.5%
fma-def72.5%
sub-neg72.5%
metadata-eval72.5%
+-commutative72.5%
Simplified72.5%
Taylor expanded in a around inf 17.3%
Final simplification27.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 (<= i -5.2e+207)
(* y i)
(if (<= i -2.9e+196)
z
(if (or (<= i -1.35e+101) (not (<= i 2e+91))) (* 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 (i <= -5.2e+207) {
tmp = y * i;
} else if (i <= -2.9e+196) {
tmp = z;
} else if ((i <= -1.35e+101) || !(i <= 2e+91)) {
tmp = y * i;
} else {
tmp = 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 (i <= (-5.2d+207)) then
tmp = y * i
else if (i <= (-2.9d+196)) then
tmp = z
else if ((i <= (-1.35d+101)) .or. (.not. (i <= 2d+91))) then
tmp = y * i
else
tmp = 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 (i <= -5.2e+207) {
tmp = y * i;
} else if (i <= -2.9e+196) {
tmp = z;
} else if ((i <= -1.35e+101) || !(i <= 2e+91)) {
tmp = y * i;
} else {
tmp = a + z;
}
return tmp;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): tmp = 0 if i <= -5.2e+207: tmp = y * i elif i <= -2.9e+196: tmp = z elif (i <= -1.35e+101) or not (i <= 2e+91): tmp = y * i else: tmp = 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 <= -5.2e+207) tmp = Float64(y * i); elseif (i <= -2.9e+196) tmp = z; elseif ((i <= -1.35e+101) || !(i <= 2e+91)) tmp = Float64(y * i); else tmp = 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 (i <= -5.2e+207)
tmp = y * i;
elseif (i <= -2.9e+196)
tmp = z;
elseif ((i <= -1.35e+101) || ~((i <= 2e+91)))
tmp = y * i;
else
tmp = 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[LessEqual[i, -5.2e+207], N[(y * i), $MachinePrecision], If[LessEqual[i, -2.9e+196], z, If[Or[LessEqual[i, -1.35e+101], N[Not[LessEqual[i, 2e+91]], $MachinePrecision]], N[(y * i), $MachinePrecision], N[(a + z), $MachinePrecision]]]]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;i \leq -5.2 \cdot 10^{+207}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;i \leq -2.9 \cdot 10^{+196}:\\
\;\;\;\;z\\
\mathbf{elif}\;i \leq -1.35 \cdot 10^{+101} \lor \neg \left(i \leq 2 \cdot 10^{+91}\right):\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + z\\
\end{array}
\end{array}
if i < -5.1999999999999996e207 or -2.9e196 < i < -1.35000000000000003e101 or 2.00000000000000016e91 < i 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 y around inf 59.2%
*-commutative59.2%
Simplified59.2%
if -5.1999999999999996e207 < i < -2.9e196Initial program 100.0%
+-commutative100.0%
associate-+l+100.0%
associate-+r+100.0%
+-commutative100.0%
associate-+r+100.0%
associate-+r+100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
associate-+r+100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
+-commutative100.0%
*-commutative100.0%
Simplified100.0%
Taylor expanded in t around 0 81.3%
fma-def81.3%
sub-neg81.3%
metadata-eval81.3%
+-commutative81.3%
Simplified81.3%
Taylor expanded in z around inf 40.4%
if -1.35000000000000003e101 < i < 2.00000000000000016e91Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 78.9%
+-commutative78.9%
*-commutative78.9%
Simplified78.9%
Taylor expanded in i around inf 38.1%
Taylor expanded in y around 0 33.9%
Final simplification43.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 -2.5e+138) (+ a 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 <= -2.5e+138) {
tmp = a + 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 <= (-2.5d+138)) then
tmp = a + 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 <= -2.5e+138) {
tmp = a + 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 <= -2.5e+138: tmp = a + 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 <= -2.5e+138) tmp = Float64(a + 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 <= -2.5e+138)
tmp = a + 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, -2.5e+138], N[(a + 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 -2.5 \cdot 10^{+138}:\\
\;\;\;\;a + z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -2.50000000000000008e138Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 92.8%
+-commutative92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in i around inf 76.7%
Taylor expanded in y around 0 62.7%
if -2.50000000000000008e138 < z Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around 0 80.8%
+-commutative80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in i around inf 48.2%
Taylor expanded in z around 0 40.3%
Final simplification44.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 (<= z -6e+79) (+ 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 <= -6e+79) {
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 <= (-6d+79)) 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 <= -6e+79) {
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 <= -6e+79: 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 <= -6e+79) 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 <= -6e+79)
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, -6e+79], 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 -6 \cdot 10^{+79}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -5.99999999999999948e79Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 92.2%
+-commutative92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in i around inf 75.2%
Taylor expanded in a around 0 65.4%
if -5.99999999999999948e79 < z Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.9%
Taylor expanded in x around 0 80.5%
+-commutative80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in i around inf 47.3%
Taylor expanded in z around 0 40.6%
Final simplification45.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 (+ (* 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) {
return (y * i) + (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) + (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) + (a + z);
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return (y * i) + (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(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) + (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[(a + z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
y \cdot i + \left(a + z\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 82.8%
+-commutative82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in i around inf 52.9%
Final simplification52.9%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.3e+78) 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 <= -1.3e+78) {
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 <= (-1.3d+78)) 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 <= -1.3e+78) {
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 <= -1.3e+78: 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 <= -1.3e+78) 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 <= -1.3e+78)
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, -1.3e+78], z, a]
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+78}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -1.3e78Initial program 99.9%
+-commutative99.9%
associate-+l+99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+r+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 92.2%
+-commutative92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in t around 0 90.4%
fma-def90.4%
sub-neg90.4%
metadata-eval90.4%
+-commutative90.4%
Simplified90.4%
Taylor expanded in z around inf 48.2%
if -1.3e78 < z Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.9%
Taylor expanded in x around 0 80.5%
+-commutative80.5%
*-commutative80.5%
Simplified80.5%
Taylor expanded in t around 0 66.5%
fma-def66.5%
sub-neg66.5%
metadata-eval66.5%
+-commutative66.5%
Simplified66.5%
Taylor expanded in a around inf 15.3%
Final simplification21.8%
NOTE: z, t, and a should be sorted in increasing order before calling this function. (FPCore (x y z t a b c i) :precision binary64 a)
assert(z < t && t < a);
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
NOTE: z, t, and a should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a
end function
assert z < t && t < a;
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
[z, t, a] = sort([z, t, a]) def code(x, y, z, t, a, b, c, i): return a
z, t, a = sort([z, t, a]) function code(x, y, z, t, a, b, c, i) return a end
z, t, a = num2cell(sort([z, t, a])){:}
function tmp = code(x, y, z, t, a, b, c, i)
tmp = a;
end
NOTE: z, t, and a should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}
[z, t, a] = \mathsf{sort}([z, t, a])\\
\\
a
\end{array}
Initial program 99.8%
+-commutative99.8%
associate-+l+99.8%
associate-+r+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
associate-+r+99.8%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around 0 82.8%
+-commutative82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in t around 0 71.2%
fma-def71.2%
sub-neg71.2%
metadata-eval71.2%
+-commutative71.2%
Simplified71.2%
Taylor expanded in a around inf 14.6%
Final simplification14.6%
herbie shell --seed 2023240
(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)))