
(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 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (fma y i (fma (+ b -0.5) (log c) (+ (fma x (log y) z) (+ t a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, fma((b + -0.5), log(c), (fma(x, log(y), z) + (t + a))));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(fma(x, log(y), z) + Float64(t + a)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)
\end{array}
Initial program 99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5))) (* y i)))
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);
}
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
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);
}
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)
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
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
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}
\\
\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.15e+206) (not (<= x 2.55e+104))) (+ (* y i) (+ (* x (log y)) (+ a (+ z t)))) (fma y i (+ a (+ (* (log c) (- b 0.5)) (+ z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.15e+206) || !(x <= 2.55e+104)) {
tmp = (y * i) + ((x * log(y)) + (a + (z + t)));
} else {
tmp = fma(y, i, (a + ((log(c) * (b - 0.5)) + (z + t))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.15e+206) || !(x <= 2.55e+104)) tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + Float64(a + Float64(z + t)))); else tmp = fma(y, i, Float64(a + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + t)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.15e+206], N[Not[LessEqual[x, 2.55e+104]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(a + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+206} \lor \neg \left(x \leq 2.55 \cdot 10^{+104}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(z + t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \left(\log c \cdot \left(b - 0.5\right) + \left(z + t\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.15000000000000008e206 or 2.5500000000000001e104 < x Initial program 99.9%
Taylor expanded in b around inf 99.9%
Taylor expanded in b around 0 96.1%
if -1.15000000000000008e206 < x < 2.5500000000000001e104Initial program 99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around 0 98.8%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* b (log c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * Math.log(y))))) + (b * Math.log(c)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (b * math.log(c)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(b * log(c)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + b \cdot \log c\right)
\end{array}
Initial program 99.9%
Taylor expanded in b around inf 98.8%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (- b 0.5) -2e+134) (not (<= (- b 0.5) 1e+163))) (+ (* y i) (+ z (* b (log c)))) (+ (* y i) (+ (* x (log y)) (+ a (+ z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((b - 0.5) <= -2e+134) || !((b - 0.5) <= 1e+163)) {
tmp = (y * i) + (z + (b * log(c)));
} else {
tmp = (y * i) + ((x * log(y)) + (a + (z + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((b - 0.5d0) <= (-2d+134)) .or. (.not. ((b - 0.5d0) <= 1d+163))) then
tmp = (y * i) + (z + (b * log(c)))
else
tmp = (y * i) + ((x * log(y)) + (a + (z + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((b - 0.5) <= -2e+134) || !((b - 0.5) <= 1e+163)) {
tmp = (y * i) + (z + (b * Math.log(c)));
} else {
tmp = (y * i) + ((x * Math.log(y)) + (a + (z + t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((b - 0.5) <= -2e+134) or not ((b - 0.5) <= 1e+163): tmp = (y * i) + (z + (b * math.log(c))) else: tmp = (y * i) + ((x * math.log(y)) + (a + (z + t))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(b - 0.5) <= -2e+134) || !(Float64(b - 0.5) <= 1e+163)) tmp = Float64(Float64(y * i) + Float64(z + Float64(b * log(c)))); else tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + Float64(a + Float64(z + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((b - 0.5) <= -2e+134) || ~(((b - 0.5) <= 1e+163))) tmp = (y * i) + (z + (b * log(c))); else tmp = (y * i) + ((x * log(y)) + (a + (z + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(b - 0.5), $MachinePrecision], -2e+134], N[Not[LessEqual[N[(b - 0.5), $MachinePrecision], 1e+163]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(z + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -2 \cdot 10^{+134} \lor \neg \left(b - 0.5 \leq 10^{+163}\right):\\
\;\;\;\;y \cdot i + \left(z + b \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(z + t\right)\right)\right)\\
\end{array}
\end{array}
if (-.f64 b 1/2) < -1.99999999999999984e134 or 9.9999999999999994e162 < (-.f64 b 1/2) Initial program 99.7%
Taylor expanded in x around 0 95.3%
+-commutative95.3%
+-commutative95.3%
associate-+l+95.3%
+-commutative95.3%
Simplified95.3%
Taylor expanded in b around inf 95.3%
Taylor expanded in a around 0 93.0%
Taylor expanded in t around 0 82.5%
if -1.99999999999999984e134 < (-.f64 b 1/2) < 9.9999999999999994e162Initial program 99.9%
Taylor expanded in b around inf 98.5%
Taylor expanded in b around 0 95.9%
Final simplification92.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.45e+206) (not (<= x 1.5e+100))) (+ (* y i) (+ (* x (log y)) (+ a (+ z t)))) (+ (* y i) (+ (* (log c) (- b 0.5)) (+ z (+ 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.45e+206) || !(x <= 1.5e+100)) {
tmp = (y * i) + ((x * log(y)) + (a + (z + t)));
} else {
tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-1.45d+206)) .or. (.not. (x <= 1.5d+100))) then
tmp = (y * i) + ((x * log(y)) + (a + (z + t)))
else
tmp = (y * i) + ((log(c) * (b - 0.5d0)) + (z + (t + a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.45e+206) || !(x <= 1.5e+100)) {
tmp = (y * i) + ((x * Math.log(y)) + (a + (z + t)));
} else {
tmp = (y * i) + ((Math.log(c) * (b - 0.5)) + (z + (t + a)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.45e+206) or not (x <= 1.5e+100): tmp = (y * i) + ((x * math.log(y)) + (a + (z + t))) else: tmp = (y * i) + ((math.log(c) * (b - 0.5)) + (z + (t + a))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.45e+206) || !(x <= 1.5e+100)) tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + Float64(a + Float64(z + t)))); else tmp = Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(z + Float64(t + a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -1.45e+206) || ~((x <= 1.5e+100))) tmp = (y * i) + ((x * log(y)) + (a + (z + t))); else tmp = (y * i) + ((log(c) * (b - 0.5)) + (z + (t + a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.45e+206], N[Not[LessEqual[x, 1.5e+100]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $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}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.45 \cdot 10^{+206} \lor \neg \left(x \leq 1.5 \cdot 10^{+100}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(z + t\right)\right)\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.45e206 or 1.49999999999999993e100 < x Initial program 99.9%
Taylor expanded in b around inf 99.9%
Taylor expanded in b around 0 96.1%
if -1.45e206 < x < 1.49999999999999993e100Initial program 99.9%
Taylor expanded in x around 0 98.7%
+-commutative98.7%
+-commutative98.7%
associate-+l+98.7%
+-commutative98.7%
Simplified98.7%
Final simplification98.0%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.15e+206) (not (<= x 4.5e+101))) (+ (* y i) (+ (* x (log y)) (+ a (+ z t)))) (+ (* y i) (+ (* b (log c)) (+ z (+ 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.15e+206) || !(x <= 4.5e+101)) {
tmp = (y * i) + ((x * log(y)) + (a + (z + t)));
} else {
tmp = (y * i) + ((b * log(c)) + (z + (t + a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-1.15d+206)) .or. (.not. (x <= 4.5d+101))) then
tmp = (y * i) + ((x * log(y)) + (a + (z + t)))
else
tmp = (y * i) + ((b * log(c)) + (z + (t + a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.15e+206) || !(x <= 4.5e+101)) {
tmp = (y * i) + ((x * Math.log(y)) + (a + (z + t)));
} else {
tmp = (y * i) + ((b * Math.log(c)) + (z + (t + a)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.15e+206) or not (x <= 4.5e+101): tmp = (y * i) + ((x * math.log(y)) + (a + (z + t))) else: tmp = (y * i) + ((b * math.log(c)) + (z + (t + a))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.15e+206) || !(x <= 4.5e+101)) tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + Float64(a + Float64(z + t)))); else tmp = Float64(Float64(y * i) + Float64(Float64(b * log(c)) + Float64(z + Float64(t + a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -1.15e+206) || ~((x <= 4.5e+101))) tmp = (y * i) + ((x * log(y)) + (a + (z + t))); else tmp = (y * i) + ((b * log(c)) + (z + (t + a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.15e+206], N[Not[LessEqual[x, 4.5e+101]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.15 \cdot 10^{+206} \lor \neg \left(x \leq 4.5 \cdot 10^{+101}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + \left(a + \left(z + t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(b \cdot \log c + \left(z + \left(t + a\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.15000000000000008e206 or 4.5000000000000002e101 < x Initial program 99.9%
Taylor expanded in b around inf 99.9%
Taylor expanded in b around 0 96.1%
if -1.15000000000000008e206 < x < 4.5000000000000002e101Initial program 99.9%
Taylor expanded in x around 0 98.7%
+-commutative98.7%
+-commutative98.7%
associate-+l+98.7%
+-commutative98.7%
Simplified98.7%
Taylor expanded in b around inf 97.2%
Final simplification96.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* x (log y)) (+ a (+ z t)))))
(if (<= y 7e-224)
t_1
(if (<= y 1.4e-55)
(+ a (+ t (+ z (* b (log c)))))
(if (<= y 1.4e+38) t_1 (+ (+ t a) (fma i y z)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (x * log(y)) + (a + (z + t));
double tmp;
if (y <= 7e-224) {
tmp = t_1;
} else if (y <= 1.4e-55) {
tmp = a + (t + (z + (b * log(c))));
} else if (y <= 1.4e+38) {
tmp = t_1;
} else {
tmp = (t + a) + fma(i, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(x * log(y)) + Float64(a + Float64(z + t))) tmp = 0.0 if (y <= 7e-224) tmp = t_1; elseif (y <= 1.4e-55) tmp = Float64(a + Float64(t + Float64(z + Float64(b * log(c))))); elseif (y <= 1.4e+38) tmp = t_1; else tmp = Float64(Float64(t + a) + fma(i, y, z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 7e-224], t$95$1, If[LessEqual[y, 1.4e-55], N[(a + N[(t + N[(z + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.4e+38], t$95$1, N[(N[(t + a), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \log y + \left(a + \left(z + t\right)\right)\\
\mathbf{if}\;y \leq 7 \cdot 10^{-224}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{-55}:\\
\;\;\;\;a + \left(t + \left(z + b \cdot \log c\right)\right)\\
\mathbf{elif}\;y \leq 1.4 \cdot 10^{+38}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + \mathsf{fma}\left(i, y, z\right)\\
\end{array}
\end{array}
if y < 7.00000000000000037e-224 or 1.39999999999999992e-55 < y < 1.4e38Initial program 99.9%
Taylor expanded in b around inf 97.0%
Taylor expanded in b around 0 86.6%
Taylor expanded in y around 0 81.8%
if 7.00000000000000037e-224 < y < 1.39999999999999992e-55Initial program 99.8%
Taylor expanded in x around 0 92.8%
+-commutative92.8%
+-commutative92.8%
associate-+l+92.8%
+-commutative92.8%
Simplified92.8%
Taylor expanded in b around inf 91.4%
Taylor expanded in y around 0 82.9%
if 1.4e38 < y Initial program 99.9%
Taylor expanded in x around 0 92.1%
+-commutative92.1%
+-commutative92.1%
associate-+l+92.1%
+-commutative92.1%
Simplified92.1%
Taylor expanded in b around inf 92.1%
Taylor expanded in b around 0 81.6%
associate-+r+81.6%
+-commutative81.6%
fma-udef81.6%
Simplified81.6%
Final simplification82.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= a 7.6e-280)
(+ (* x (log y)) (+ t (+ z (* y i))))
(if (<= a 1.2e+143)
(+ (* y i) (+ (* b (log c)) (+ z t)))
(+ (+ t a) (fma i y z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 7.6e-280) {
tmp = (x * log(y)) + (t + (z + (y * i)));
} else if (a <= 1.2e+143) {
tmp = (y * i) + ((b * log(c)) + (z + t));
} else {
tmp = (t + a) + fma(i, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 7.6e-280) tmp = Float64(Float64(x * log(y)) + Float64(t + Float64(z + Float64(y * i)))); elseif (a <= 1.2e+143) tmp = Float64(Float64(y * i) + Float64(Float64(b * log(c)) + Float64(z + t))); else tmp = Float64(Float64(t + a) + fma(i, y, z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 7.6e-280], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(t + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e+143], N[(N[(y * i), $MachinePrecision] + N[(N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 7.6 \cdot 10^{-280}:\\
\;\;\;\;x \cdot \log y + \left(t + \left(z + y \cdot i\right)\right)\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{+143}:\\
\;\;\;\;y \cdot i + \left(b \cdot \log c + \left(z + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + \mathsf{fma}\left(i, y, z\right)\\
\end{array}
\end{array}
if a < 7.6000000000000003e-280Initial program 99.9%
Taylor expanded in b around inf 98.0%
Taylor expanded in b around 0 84.7%
Taylor expanded in a around 0 71.9%
if 7.6000000000000003e-280 < a < 1.1999999999999999e143Initial program 99.8%
Taylor expanded in x around 0 85.7%
+-commutative85.7%
+-commutative85.7%
associate-+l+85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in b around inf 85.6%
Taylor expanded in a around 0 85.5%
if 1.1999999999999999e143 < a Initial program 100.0%
Taylor expanded in x around 0 88.3%
+-commutative88.3%
+-commutative88.3%
associate-+l+88.3%
+-commutative88.3%
Simplified88.3%
Taylor expanded in b around inf 88.3%
Taylor expanded in b around 0 82.2%
associate-+r+82.2%
+-commutative82.2%
fma-udef82.2%
Simplified82.2%
Final simplification77.3%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= a 9e-282)
(+ (* x (log y)) (+ t (+ z (* y i))))
(if (<= a 1.6e+143)
(+ (* y i) (+ z (* b (log c))))
(+ (+ t a) (fma i y z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 9e-282) {
tmp = (x * log(y)) + (t + (z + (y * i)));
} else if (a <= 1.6e+143) {
tmp = (y * i) + (z + (b * log(c)));
} else {
tmp = (t + a) + fma(i, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 9e-282) tmp = Float64(Float64(x * log(y)) + Float64(t + Float64(z + Float64(y * i)))); elseif (a <= 1.6e+143) tmp = Float64(Float64(y * i) + Float64(z + Float64(b * log(c)))); else tmp = Float64(Float64(t + a) + fma(i, y, z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 9e-282], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(t + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e+143], N[(N[(y * i), $MachinePrecision] + N[(z + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 9 \cdot 10^{-282}:\\
\;\;\;\;x \cdot \log y + \left(t + \left(z + y \cdot i\right)\right)\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+143}:\\
\;\;\;\;y \cdot i + \left(z + b \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + \mathsf{fma}\left(i, y, z\right)\\
\end{array}
\end{array}
if a < 9.00000000000000017e-282Initial program 99.9%
Taylor expanded in b around inf 98.0%
Taylor expanded in b around 0 84.7%
Taylor expanded in a around 0 71.9%
if 9.00000000000000017e-282 < a < 1.60000000000000008e143Initial program 99.8%
Taylor expanded in x around 0 85.7%
+-commutative85.7%
+-commutative85.7%
associate-+l+85.7%
+-commutative85.7%
Simplified85.7%
Taylor expanded in b around inf 85.6%
Taylor expanded in a around 0 85.5%
Taylor expanded in t around 0 73.0%
if 1.60000000000000008e143 < a Initial program 100.0%
Taylor expanded in x around 0 88.3%
+-commutative88.3%
+-commutative88.3%
associate-+l+88.3%
+-commutative88.3%
Simplified88.3%
Taylor expanded in b around inf 88.3%
Taylor expanded in b around 0 82.2%
associate-+r+82.2%
+-commutative82.2%
fma-udef82.2%
Simplified82.2%
Final simplification73.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -3.6e+251) (not (<= b 1.05e+194))) (+ a (+ t (* b (log c)))) (+ a (+ t (+ z (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -3.6e+251) || !(b <= 1.05e+194)) {
tmp = a + (t + (b * log(c)));
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((b <= (-3.6d+251)) .or. (.not. (b <= 1.05d+194))) then
tmp = a + (t + (b * log(c)))
else
tmp = a + (t + (z + (y * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -3.6e+251) || !(b <= 1.05e+194)) {
tmp = a + (t + (b * Math.log(c)));
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (b <= -3.6e+251) or not (b <= 1.05e+194): tmp = a + (t + (b * math.log(c))) else: tmp = a + (t + (z + (y * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -3.6e+251) || !(b <= 1.05e+194)) tmp = Float64(a + Float64(t + Float64(b * log(c)))); else tmp = Float64(a + Float64(t + Float64(z + Float64(y * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((b <= -3.6e+251) || ~((b <= 1.05e+194))) tmp = a + (t + (b * log(c))); else tmp = a + (t + (z + (y * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -3.6e+251], N[Not[LessEqual[b, 1.05e+194]], $MachinePrecision]], N[(a + N[(t + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.6 \cdot 10^{+251} \lor \neg \left(b \leq 1.05 \cdot 10^{+194}\right):\\
\;\;\;\;a + \left(t + b \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\
\end{array}
\end{array}
if b < -3.59999999999999997e251 or 1.05000000000000008e194 < b Initial program 99.6%
Taylor expanded in x around 0 97.5%
+-commutative97.5%
+-commutative97.5%
associate-+l+97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in b around inf 97.5%
Taylor expanded in y around 0 86.7%
Taylor expanded in b around inf 81.3%
if -3.59999999999999997e251 < b < 1.05000000000000008e194Initial program 99.9%
Taylor expanded in x around 0 84.7%
+-commutative84.7%
+-commutative84.7%
associate-+l+84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in b around inf 83.4%
Taylor expanded in b around 0 77.8%
Final simplification78.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -1.75e+251) (not (<= b 2.4e+194))) (+ a (+ t (* b (log c)))) (+ (+ t a) (fma i y z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -1.75e+251) || !(b <= 2.4e+194)) {
tmp = a + (t + (b * log(c)));
} else {
tmp = (t + a) + fma(i, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -1.75e+251) || !(b <= 2.4e+194)) tmp = Float64(a + Float64(t + Float64(b * log(c)))); else tmp = Float64(Float64(t + a) + fma(i, y, z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -1.75e+251], N[Not[LessEqual[b, 2.4e+194]], $MachinePrecision]], N[(a + N[(t + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.75 \cdot 10^{+251} \lor \neg \left(b \leq 2.4 \cdot 10^{+194}\right):\\
\;\;\;\;a + \left(t + b \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + \mathsf{fma}\left(i, y, z\right)\\
\end{array}
\end{array}
if b < -1.75000000000000002e251 or 2.4e194 < b Initial program 99.6%
Taylor expanded in x around 0 97.5%
+-commutative97.5%
+-commutative97.5%
associate-+l+97.5%
+-commutative97.5%
Simplified97.5%
Taylor expanded in b around inf 97.5%
Taylor expanded in y around 0 86.7%
Taylor expanded in b around inf 81.3%
if -1.75000000000000002e251 < b < 2.4e194Initial program 99.9%
Taylor expanded in x around 0 84.7%
+-commutative84.7%
+-commutative84.7%
associate-+l+84.7%
+-commutative84.7%
Simplified84.7%
Taylor expanded in b around inf 83.4%
Taylor expanded in b around 0 77.8%
associate-+r+77.8%
+-commutative77.8%
fma-udef77.8%
Simplified77.8%
Final simplification78.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 6.5e+50) (+ a (+ t (+ z (* b (log c))))) (+ (+ t a) (fma i y z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 6.5e+50) {
tmp = a + (t + (z + (b * log(c))));
} else {
tmp = (t + a) + fma(i, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 6.5e+50) tmp = Float64(a + Float64(t + Float64(z + Float64(b * log(c))))); else tmp = Float64(Float64(t + a) + fma(i, y, z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 6.5e+50], N[(a + N[(t + N[(z + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.5 \cdot 10^{+50}:\\
\;\;\;\;a + \left(t + \left(z + b \cdot \log c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + \mathsf{fma}\left(i, y, z\right)\\
\end{array}
\end{array}
if y < 6.5000000000000003e50Initial program 99.8%
Taylor expanded in x around 0 82.5%
+-commutative82.5%
+-commutative82.5%
associate-+l+82.5%
+-commutative82.5%
Simplified82.5%
Taylor expanded in b around inf 80.5%
Taylor expanded in y around 0 72.4%
if 6.5000000000000003e50 < y Initial program 99.9%
Taylor expanded in x around 0 91.6%
+-commutative91.6%
+-commutative91.6%
associate-+l+91.6%
+-commutative91.6%
Simplified91.6%
Taylor expanded in b around inf 91.6%
Taylor expanded in b around 0 84.0%
associate-+r+84.0%
+-commutative84.0%
fma-udef84.0%
Simplified84.0%
Final simplification77.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 1.1e+143) (+ (* y i) (+ z (* b (log c)))) (+ (+ t a) (fma i y z))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 1.1e+143) {
tmp = (y * i) + (z + (b * log(c)));
} else {
tmp = (t + a) + fma(i, y, z);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 1.1e+143) tmp = Float64(Float64(y * i) + Float64(z + Float64(b * log(c)))); else tmp = Float64(Float64(t + a) + fma(i, y, z)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.1e+143], N[(N[(y * i), $MachinePrecision] + N[(z + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t + a), $MachinePrecision] + N[(i * y + z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.1 \cdot 10^{+143}:\\
\;\;\;\;y \cdot i + \left(z + b \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;\left(t + a\right) + \mathsf{fma}\left(i, y, z\right)\\
\end{array}
\end{array}
if a < 1.10000000000000007e143Initial program 99.9%
Taylor expanded in x around 0 86.3%
+-commutative86.3%
+-commutative86.3%
associate-+l+86.3%
+-commutative86.3%
Simplified86.3%
Taylor expanded in b around inf 85.0%
Taylor expanded in a around 0 76.9%
Taylor expanded in t around 0 61.8%
if 1.10000000000000007e143 < a Initial program 100.0%
Taylor expanded in x around 0 88.3%
+-commutative88.3%
+-commutative88.3%
associate-+l+88.3%
+-commutative88.3%
Simplified88.3%
Taylor expanded in b around inf 88.3%
Taylor expanded in b around 0 82.2%
associate-+r+82.2%
+-commutative82.2%
fma-udef82.2%
Simplified82.2%
Final simplification64.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -1.3e+255) (not (<= b 2.85e+195))) (* b (log c)) (+ a (+ t (+ z (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -1.3e+255) || !(b <= 2.85e+195)) {
tmp = b * log(c);
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((b <= (-1.3d+255)) .or. (.not. (b <= 2.85d+195))) then
tmp = b * log(c)
else
tmp = a + (t + (z + (y * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -1.3e+255) || !(b <= 2.85e+195)) {
tmp = b * Math.log(c);
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (b <= -1.3e+255) or not (b <= 2.85e+195): tmp = b * math.log(c) else: tmp = a + (t + (z + (y * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -1.3e+255) || !(b <= 2.85e+195)) tmp = Float64(b * log(c)); else tmp = Float64(a + Float64(t + Float64(z + Float64(y * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((b <= -1.3e+255) || ~((b <= 2.85e+195))) tmp = b * log(c); else tmp = a + (t + (z + (y * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -1.3e+255], N[Not[LessEqual[b, 2.85e+195]], $MachinePrecision]], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.3 \cdot 10^{+255} \lor \neg \left(b \leq 2.85 \cdot 10^{+195}\right):\\
\;\;\;\;b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\
\end{array}
\end{array}
if b < -1.30000000000000005e255 or 2.8500000000000001e195 < b Initial program 99.6%
Taylor expanded in b around inf 99.6%
Taylor expanded in b around inf 78.9%
if -1.30000000000000005e255 < b < 2.8500000000000001e195Initial program 99.9%
Taylor expanded in x around 0 84.9%
+-commutative84.9%
+-commutative84.9%
associate-+l+84.9%
+-commutative84.9%
Simplified84.9%
Taylor expanded in b around inf 83.6%
Taylor expanded in b around 0 77.5%
Final simplification77.7%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= z -3e+156)
z
(if (<= z -6.6e+53)
(* y i)
(if (<= z -240000000000.0)
a
(if (<= z -2.4e-45)
(* y i)
(if (<= z -3.7e-87) a (if (<= z -1.9e-300) (* y i) a)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3e+156) {
tmp = z;
} else if (z <= -6.6e+53) {
tmp = y * i;
} else if (z <= -240000000000.0) {
tmp = a;
} else if (z <= -2.4e-45) {
tmp = y * i;
} else if (z <= -3.7e-87) {
tmp = a;
} else if (z <= -1.9e-300) {
tmp = y * i;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-3d+156)) then
tmp = z
else if (z <= (-6.6d+53)) then
tmp = y * i
else if (z <= (-240000000000.0d0)) then
tmp = a
else if (z <= (-2.4d-45)) then
tmp = y * i
else if (z <= (-3.7d-87)) then
tmp = a
else if (z <= (-1.9d-300)) then
tmp = y * i
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3e+156) {
tmp = z;
} else if (z <= -6.6e+53) {
tmp = y * i;
} else if (z <= -240000000000.0) {
tmp = a;
} else if (z <= -2.4e-45) {
tmp = y * i;
} else if (z <= -3.7e-87) {
tmp = a;
} else if (z <= -1.9e-300) {
tmp = y * i;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -3e+156: tmp = z elif z <= -6.6e+53: tmp = y * i elif z <= -240000000000.0: tmp = a elif z <= -2.4e-45: tmp = y * i elif z <= -3.7e-87: tmp = a elif z <= -1.9e-300: tmp = y * i else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -3e+156) tmp = z; elseif (z <= -6.6e+53) tmp = Float64(y * i); elseif (z <= -240000000000.0) tmp = a; elseif (z <= -2.4e-45) tmp = Float64(y * i); elseif (z <= -3.7e-87) tmp = a; elseif (z <= -1.9e-300) tmp = Float64(y * i); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -3e+156) tmp = z; elseif (z <= -6.6e+53) tmp = y * i; elseif (z <= -240000000000.0) tmp = a; elseif (z <= -2.4e-45) tmp = y * i; elseif (z <= -3.7e-87) tmp = a; elseif (z <= -1.9e-300) tmp = y * i; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -3e+156], z, If[LessEqual[z, -6.6e+53], N[(y * i), $MachinePrecision], If[LessEqual[z, -240000000000.0], a, If[LessEqual[z, -2.4e-45], N[(y * i), $MachinePrecision], If[LessEqual[z, -3.7e-87], a, If[LessEqual[z, -1.9e-300], N[(y * i), $MachinePrecision], a]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+156}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -6.6 \cdot 10^{+53}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq -240000000000:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-45}:\\
\;\;\;\;y \cdot i\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{-87}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -1.9 \cdot 10^{-300}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -3e156Initial program 100.0%
Taylor expanded in z around inf 59.0%
if -3e156 < z < -6.6000000000000004e53 or -2.4e11 < z < -2.3999999999999999e-45 or -3.7000000000000002e-87 < z < -1.90000000000000006e-300Initial program 99.9%
Taylor expanded in y around inf 37.6%
*-commutative37.6%
Simplified37.6%
if -6.6000000000000004e53 < z < -2.4e11 or -2.3999999999999999e-45 < z < -3.7000000000000002e-87 or -1.90000000000000006e-300 < z Initial program 99.8%
Taylor expanded in a around inf 17.5%
Final simplification29.3%
(FPCore (x y z t a b c i) :precision binary64 (+ a (+ t (+ z (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + (t + (z + (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 = a + (t + (z + (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 a + (t + (z + (y * i)));
}
def code(x, y, z, t, a, b, c, i): return a + (t + (z + (y * i)))
function code(x, y, z, t, a, b, c, i) return Float64(a + Float64(t + Float64(z + Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a + (t + (z + (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(t + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \left(t + \left(z + y \cdot i\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 86.5%
+-commutative86.5%
+-commutative86.5%
associate-+l+86.5%
+-commutative86.5%
Simplified86.5%
Taylor expanded in b around inf 85.4%
Taylor expanded in b around 0 70.2%
Final simplification70.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -6.2e+180) z (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -6.2e+180) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-6.2d+180)) then
tmp = z
else
tmp = a + (y * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -6.2e+180) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -6.2e+180: tmp = z else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -6.2e+180) tmp = z; else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -6.2e+180) tmp = z; else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -6.2e+180], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.2 \cdot 10^{+180}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -6.19999999999999997e180Initial program 100.0%
Taylor expanded in z around inf 70.4%
if -6.19999999999999997e180 < z Initial program 99.9%
Taylor expanded in b around inf 98.6%
Taylor expanded in b around 0 82.4%
Taylor expanded in a around inf 42.3%
Final simplification45.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -3.7e+170) (+ z (* y i)) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3.7e+170) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-3.7d+170)) then
tmp = z + (y * i)
else
tmp = a + (y * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3.7e+170) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -3.7e+170: tmp = z + (y * i) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -3.7e+170) tmp = Float64(z + Float64(y * i)); else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -3.7e+170) tmp = z + (y * i); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -3.7e+170], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.7 \cdot 10^{+170}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -3.69999999999999987e170Initial program 100.0%
Taylor expanded in b around inf 100.0%
Taylor expanded in b around 0 92.0%
Taylor expanded in z around inf 75.6%
if -3.69999999999999987e170 < z Initial program 99.9%
Taylor expanded in b around inf 98.6%
Taylor expanded in b around 0 82.2%
Taylor expanded in a around inf 42.2%
Final simplification46.4%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -3e+170) z a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3e+170) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-3d+170)) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3e+170) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -3e+170: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -3e+170) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -3e+170) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -3e+170], z, a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+170}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -2.99999999999999997e170Initial program 100.0%
Taylor expanded in z around inf 66.4%
if -2.99999999999999997e170 < z Initial program 99.9%
Taylor expanded in a around inf 14.5%
Final simplification21.0%
(FPCore (x y z t a b c i) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
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
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
def code(x, y, z, t, a, b, c, i): return a
function code(x, y, z, t, a, b, c, i) return a end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 99.9%
Taylor expanded in a around inf 13.1%
Final simplification13.1%
herbie shell --seed 2023171
(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)))