
(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 18 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) (+ t (fma x (log y) (+ z 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), (t + fma(x, log(y), (z + a)))));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(Float64(b - 0.5), log(c), Float64(t + fma(x, log(y), Float64(z + 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[(t + N[(x * N[Log[y], $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b - 0.5, \log c, t + \mathsf{fma}\left(x, \log y, z + a\right)\right)\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.4e+52) (not (<= x 1.9e+125))) (+ (* y i) (+ a (+ z (+ (* x (log y)) (* (log c) -0.5))))) (+ (* y i) (+ (* (- b 0.5) (log c)) (+ a (+ t z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.4e+52) || !(x <= 1.9e+125)) {
tmp = (y * i) + (a + (z + ((x * log(y)) + (log(c) * -0.5))));
} else {
tmp = (y * i) + (((b - 0.5) * log(c)) + (a + (t + z)));
}
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.4d+52)) .or. (.not. (x <= 1.9d+125))) then
tmp = (y * i) + (a + (z + ((x * log(y)) + (log(c) * (-0.5d0)))))
else
tmp = (y * i) + (((b - 0.5d0) * log(c)) + (a + (t + z)))
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.4e+52) || !(x <= 1.9e+125)) {
tmp = (y * i) + (a + (z + ((x * Math.log(y)) + (Math.log(c) * -0.5))));
} else {
tmp = (y * i) + (((b - 0.5) * Math.log(c)) + (a + (t + z)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.4e+52) or not (x <= 1.9e+125): tmp = (y * i) + (a + (z + ((x * math.log(y)) + (math.log(c) * -0.5)))) else: tmp = (y * i) + (((b - 0.5) * math.log(c)) + (a + (t + z))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.4e+52) || !(x <= 1.9e+125)) tmp = Float64(Float64(y * i) + Float64(a + Float64(z + Float64(Float64(x * log(y)) + Float64(log(c) * -0.5))))); else tmp = Float64(Float64(y * i) + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(a + Float64(t + z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -1.4e+52) || ~((x <= 1.9e+125))) tmp = (y * i) + (a + (z + ((x * log(y)) + (log(c) * -0.5)))); else tmp = (y * i) + (((b - 0.5) * log(c)) + (a + (t + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.4e+52], N[Not[LessEqual[x, 1.9e+125]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(a + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.4 \cdot 10^{+52} \lor \neg \left(x \leq 1.9 \cdot 10^{+125}\right):\\
\;\;\;\;y \cdot i + \left(a + \left(z + \left(x \cdot \log y + \log c \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(t + z\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.4e52 or 1.90000000000000001e125 < x Initial program 99.8%
Taylor expanded in t around 0 89.4%
+-commutative89.4%
associate-+r+89.4%
+-commutative89.4%
+-commutative89.4%
fma-def89.4%
Simplified89.4%
Taylor expanded in b around 0 84.4%
if -1.4e52 < x < 1.90000000000000001e125Initial program 99.9%
Taylor expanded in x around 0 98.6%
Final simplification93.0%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ a (+ t (+ z (* x (log y))))) (* (- 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 ((a + (t + (z + (x * log(y))))) + ((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 = ((a + (t + (z + (x * log(y))))) + ((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 ((a + (t + (z + (x * Math.log(y))))) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return ((a + (t + (z + (x * math.log(y))))) + ((b - 0.5) * math.log(c))) + (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(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((a + (t + (z + (x * log(y))))) + ((b - 0.5) * log(c))) + (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[(b - 0.5), $MachinePrecision] * N[Log[c], $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) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
Initial program 99.9%
Final simplification99.9%
(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.9%
*-commutative48.6%
Simplified98.9%
Final simplification98.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -2.5e+213) (not (<= x 5e+153))) (+ (* y i) (+ (* x (log y)) (* b (log c)))) (+ (* y i) (+ (* (- b 0.5) (log c)) (+ a (+ t z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -2.5e+213) || !(x <= 5e+153)) {
tmp = (y * i) + ((x * log(y)) + (b * log(c)));
} else {
tmp = (y * i) + (((b - 0.5) * log(c)) + (a + (t + z)));
}
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 <= (-2.5d+213)) .or. (.not. (x <= 5d+153))) then
tmp = (y * i) + ((x * log(y)) + (b * log(c)))
else
tmp = (y * i) + (((b - 0.5d0) * log(c)) + (a + (t + z)))
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 <= -2.5e+213) || !(x <= 5e+153)) {
tmp = (y * i) + ((x * Math.log(y)) + (b * Math.log(c)));
} else {
tmp = (y * i) + (((b - 0.5) * Math.log(c)) + (a + (t + z)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -2.5e+213) or not (x <= 5e+153): tmp = (y * i) + ((x * math.log(y)) + (b * math.log(c))) else: tmp = (y * i) + (((b - 0.5) * math.log(c)) + (a + (t + z))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -2.5e+213) || !(x <= 5e+153)) tmp = Float64(Float64(y * i) + Float64(Float64(x * log(y)) + Float64(b * log(c)))); else tmp = Float64(Float64(y * i) + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(a + Float64(t + z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -2.5e+213) || ~((x <= 5e+153))) tmp = (y * i) + ((x * log(y)) + (b * log(c))); else tmp = (y * i) + (((b - 0.5) * log(c)) + (a + (t + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -2.5e+213], N[Not[LessEqual[x, 5e+153]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.5 \cdot 10^{+213} \lor \neg \left(x \leq 5 \cdot 10^{+153}\right):\\
\;\;\;\;y \cdot i + \left(x \cdot \log y + b \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(t + z\right)\right)\right)\\
\end{array}
\end{array}
if x < -2.4999999999999999e213 or 5.00000000000000018e153 < x Initial program 99.7%
Taylor expanded in x around inf 85.8%
Taylor expanded in b around inf 85.8%
*-commutative26.1%
Simplified85.8%
if -2.4999999999999999e213 < x < 5.00000000000000018e153Initial program 99.9%
Taylor expanded in x around 0 94.7%
Final simplification92.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (- b 0.5) (log c))))
(if (or (<= x -9.6e+236) (not (<= x 1.2e+163)))
(+ (* x (log y)) t_1)
(+ (* y i) (+ t_1 (+ a (+ t z)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (b - 0.5) * log(c);
double tmp;
if ((x <= -9.6e+236) || !(x <= 1.2e+163)) {
tmp = (x * log(y)) + t_1;
} else {
tmp = (y * i) + (t_1 + (a + (t + z)));
}
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) :: t_1
real(8) :: tmp
t_1 = (b - 0.5d0) * log(c)
if ((x <= (-9.6d+236)) .or. (.not. (x <= 1.2d+163))) then
tmp = (x * log(y)) + t_1
else
tmp = (y * i) + (t_1 + (a + (t + z)))
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 t_1 = (b - 0.5) * Math.log(c);
double tmp;
if ((x <= -9.6e+236) || !(x <= 1.2e+163)) {
tmp = (x * Math.log(y)) + t_1;
} else {
tmp = (y * i) + (t_1 + (a + (t + z)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (b - 0.5) * math.log(c) tmp = 0 if (x <= -9.6e+236) or not (x <= 1.2e+163): tmp = (x * math.log(y)) + t_1 else: tmp = (y * i) + (t_1 + (a + (t + z))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(b - 0.5) * log(c)) tmp = 0.0 if ((x <= -9.6e+236) || !(x <= 1.2e+163)) tmp = Float64(Float64(x * log(y)) + t_1); else tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + Float64(t + z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (b - 0.5) * log(c); tmp = 0.0; if ((x <= -9.6e+236) || ~((x <= 1.2e+163))) tmp = (x * log(y)) + t_1; else tmp = (y * i) + (t_1 + (a + (t + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -9.6e+236], N[Not[LessEqual[x, 1.2e+163]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;x \leq -9.6 \cdot 10^{+236} \lor \neg \left(x \leq 1.2 \cdot 10^{+163}\right):\\
\;\;\;\;x \cdot \log y + t_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t_1 + \left(a + \left(t + z\right)\right)\right)\\
\end{array}
\end{array}
if x < -9.60000000000000051e236 or 1.1999999999999999e163 < x Initial program 99.7%
Taylor expanded in x around inf 85.0%
Taylor expanded in y around 0 73.1%
if -9.60000000000000051e236 < x < 1.1999999999999999e163Initial program 99.9%
Taylor expanded in x around 0 94.7%
Final simplification90.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -4e+237) (not (<= x 1.2e+163))) (* x (log y)) (+ (* y i) (+ (* (- b 0.5) (log c)) (+ a (+ t z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -4e+237) || !(x <= 1.2e+163)) {
tmp = x * log(y);
} else {
tmp = (y * i) + (((b - 0.5) * log(c)) + (a + (t + z)));
}
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 <= (-4d+237)) .or. (.not. (x <= 1.2d+163))) then
tmp = x * log(y)
else
tmp = (y * i) + (((b - 0.5d0) * log(c)) + (a + (t + z)))
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 <= -4e+237) || !(x <= 1.2e+163)) {
tmp = x * Math.log(y);
} else {
tmp = (y * i) + (((b - 0.5) * Math.log(c)) + (a + (t + z)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -4e+237) or not (x <= 1.2e+163): tmp = x * math.log(y) else: tmp = (y * i) + (((b - 0.5) * math.log(c)) + (a + (t + z))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -4e+237) || !(x <= 1.2e+163)) tmp = Float64(x * log(y)); else tmp = Float64(Float64(y * i) + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(a + Float64(t + z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -4e+237) || ~((x <= 1.2e+163))) tmp = x * log(y); else tmp = (y * i) + (((b - 0.5) * log(c)) + (a + (t + z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -4e+237], N[Not[LessEqual[x, 1.2e+163]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4 \cdot 10^{+237} \lor \neg \left(x \leq 1.2 \cdot 10^{+163}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(t + z\right)\right)\right)\\
\end{array}
\end{array}
if x < -3.99999999999999976e237 or 1.1999999999999999e163 < x Initial program 99.7%
Taylor expanded in x around inf 85.0%
Taylor expanded in x around inf 65.4%
if -3.99999999999999976e237 < x < 1.1999999999999999e163Initial program 99.9%
Taylor expanded in x around 0 94.7%
Final simplification88.8%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -5e+68) (+ (* y i) (+ a (+ t (+ z (* (log c) -0.5))))) (+ (* y i) (+ a (* (- b 0.5) (log c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -5e+68) {
tmp = (y * i) + (a + (t + (z + (log(c) * -0.5))));
} else {
tmp = (y * i) + (a + ((b - 0.5) * log(c)));
}
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 <= (-5d+68)) then
tmp = (y * i) + (a + (t + (z + (log(c) * (-0.5d0)))))
else
tmp = (y * i) + (a + ((b - 0.5d0) * log(c)))
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 <= -5e+68) {
tmp = (y * i) + (a + (t + (z + (Math.log(c) * -0.5))));
} else {
tmp = (y * i) + (a + ((b - 0.5) * Math.log(c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -5e+68: tmp = (y * i) + (a + (t + (z + (math.log(c) * -0.5)))) else: tmp = (y * i) + (a + ((b - 0.5) * math.log(c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -5e+68) tmp = Float64(Float64(y * i) + Float64(a + Float64(t + Float64(z + Float64(log(c) * -0.5))))); else tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(b - 0.5) * log(c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -5e+68) tmp = (y * i) + (a + (t + (z + (log(c) * -0.5)))); else tmp = (y * i) + (a + ((b - 0.5) * log(c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5e+68], N[(N[(y * i), $MachinePrecision] + N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+68}:\\
\;\;\;\;y \cdot i + \left(a + \left(t + \left(z + \log c \cdot -0.5\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(b - 0.5\right) \cdot \log c\right)\\
\end{array}
\end{array}
if z < -5.0000000000000004e68Initial program 99.8%
Taylor expanded in x around 0 84.2%
associate-+r+84.2%
sub-neg84.2%
metadata-eval84.2%
*-commutative84.2%
associate-+r+84.2%
+-commutative84.2%
+-commutative84.2%
associate-+r+84.2%
associate-+l+84.2%
+-commutative84.2%
*-commutative84.2%
fma-def84.2%
+-commutative84.2%
Simplified84.2%
Taylor expanded in b around 0 76.6%
+-commutative76.6%
*-commutative76.6%
Simplified76.6%
if -5.0000000000000004e68 < z Initial program 99.9%
Taylor expanded in a around inf 52.4%
Final simplification56.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -3e+96) (+ (* y i) (+ z (* b (log c)))) (+ (* y i) (+ a (* (- b 0.5) (log c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3e+96) {
tmp = (y * i) + (z + (b * log(c)));
} else {
tmp = (y * i) + (a + ((b - 0.5) * log(c)));
}
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+96)) then
tmp = (y * i) + (z + (b * log(c)))
else
tmp = (y * i) + (a + ((b - 0.5d0) * log(c)))
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+96) {
tmp = (y * i) + (z + (b * Math.log(c)));
} else {
tmp = (y * i) + (a + ((b - 0.5) * Math.log(c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -3e+96: tmp = (y * i) + (z + (b * math.log(c))) else: tmp = (y * i) + (a + ((b - 0.5) * math.log(c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -3e+96) tmp = Float64(Float64(y * i) + Float64(z + Float64(b * log(c)))); else tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(b - 0.5) * log(c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -3e+96) tmp = (y * i) + (z + (b * log(c))); else tmp = (y * i) + (a + ((b - 0.5) * log(c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -3e+96], N[(N[(y * i), $MachinePrecision] + N[(z + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3 \cdot 10^{+96}:\\
\;\;\;\;y \cdot i + \left(z + b \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + \left(b - 0.5\right) \cdot \log c\right)\\
\end{array}
\end{array}
if z < -3e96Initial program 99.9%
Taylor expanded in z around inf 74.2%
Taylor expanded in b around inf 74.2%
*-commutative32.9%
Simplified74.2%
if -3e96 < z Initial program 99.9%
Taylor expanded in a around inf 52.1%
Final simplification55.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -9e+66) (+ z (* y i)) (if (<= z -6.2e-192) (+ a (* (- b 0.5) (log c))) (+ 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 <= -9e+66) {
tmp = z + (y * i);
} else if (z <= -6.2e-192) {
tmp = a + ((b - 0.5) * log(c));
} 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 <= (-9d+66)) then
tmp = z + (y * i)
else if (z <= (-6.2d-192)) then
tmp = a + ((b - 0.5d0) * log(c))
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 <= -9e+66) {
tmp = z + (y * i);
} else if (z <= -6.2e-192) {
tmp = a + ((b - 0.5) * Math.log(c));
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -9e+66: tmp = z + (y * i) elif z <= -6.2e-192: tmp = a + ((b - 0.5) * math.log(c)) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -9e+66) tmp = Float64(z + Float64(y * i)); elseif (z <= -6.2e-192) tmp = Float64(a + Float64(Float64(b - 0.5) * log(c))); 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 <= -9e+66) tmp = z + (y * i); elseif (z <= -6.2e-192) tmp = a + ((b - 0.5) * log(c)); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -9e+66], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6.2e-192], N[(a + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+66}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-192}:\\
\;\;\;\;a + \left(b - 0.5\right) \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -8.9999999999999997e66Initial program 99.8%
Taylor expanded in t around 0 85.1%
+-commutative85.1%
associate-+r+85.1%
+-commutative85.1%
+-commutative85.1%
fma-def85.1%
Simplified85.1%
Taylor expanded in z around inf 60.8%
if -8.9999999999999997e66 < z < -6.2000000000000001e-192Initial program 99.9%
Taylor expanded in a around inf 65.9%
Taylor expanded in y around 0 48.2%
if -6.2000000000000001e-192 < z Initial program 99.9%
Taylor expanded in a around inf 48.4%
Taylor expanded in b around inf 47.7%
*-commutative47.7%
Simplified47.7%
Taylor expanded in b around 0 36.9%
*-commutative36.9%
Simplified36.9%
Final simplification43.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -5.4e+191) (+ z (* y i)) (+ (* y i) (+ a (* b (log c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -5.4e+191) {
tmp = z + (y * i);
} else {
tmp = (y * i) + (a + (b * log(c)));
}
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 <= (-5.4d+191)) then
tmp = z + (y * i)
else
tmp = (y * i) + (a + (b * log(c)))
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 <= -5.4e+191) {
tmp = z + (y * i);
} else {
tmp = (y * i) + (a + (b * Math.log(c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -5.4e+191: tmp = z + (y * i) else: tmp = (y * i) + (a + (b * math.log(c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -5.4e+191) tmp = Float64(z + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(a + Float64(b * log(c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -5.4e+191) tmp = z + (y * i); else tmp = (y * i) + (a + (b * log(c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5.4e+191], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{+191}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\
\end{array}
\end{array}
if z < -5.39999999999999992e191Initial program 99.9%
Taylor expanded in t around 0 90.3%
+-commutative90.3%
associate-+r+90.3%
+-commutative90.3%
+-commutative90.3%
fma-def90.3%
Simplified90.3%
Taylor expanded in z around inf 85.1%
if -5.39999999999999992e191 < z Initial program 99.9%
Taylor expanded in a around inf 51.1%
Taylor expanded in b around inf 50.0%
*-commutative50.0%
Simplified50.0%
Final simplification52.5%
(FPCore (x y z t a b c i) :precision binary64 (let* ((t_1 (* b (log c)))) (if (<= z -4.1e+96) (+ (* y i) (+ z t_1)) (+ (* y i) (+ a t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = b * log(c);
double tmp;
if (z <= -4.1e+96) {
tmp = (y * i) + (z + t_1);
} else {
tmp = (y * i) + (a + t_1);
}
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) :: t_1
real(8) :: tmp
t_1 = b * log(c)
if (z <= (-4.1d+96)) then
tmp = (y * i) + (z + t_1)
else
tmp = (y * i) + (a + t_1)
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 t_1 = b * Math.log(c);
double tmp;
if (z <= -4.1e+96) {
tmp = (y * i) + (z + t_1);
} else {
tmp = (y * i) + (a + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = b * math.log(c) tmp = 0 if z <= -4.1e+96: tmp = (y * i) + (z + t_1) else: tmp = (y * i) + (a + t_1) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(b * log(c)) tmp = 0.0 if (z <= -4.1e+96) tmp = Float64(Float64(y * i) + Float64(z + t_1)); else tmp = Float64(Float64(y * i) + Float64(a + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = b * log(c); tmp = 0.0; if (z <= -4.1e+96) tmp = (y * i) + (z + t_1); else tmp = (y * i) + (a + t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+96], N[(N[(y * i), $MachinePrecision] + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \log c\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+96}:\\
\;\;\;\;y \cdot i + \left(z + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + t_1\right)\\
\end{array}
\end{array}
if z < -4.09999999999999998e96Initial program 99.9%
Taylor expanded in z around inf 74.2%
Taylor expanded in b around inf 74.2%
*-commutative32.9%
Simplified74.2%
if -4.09999999999999998e96 < z Initial program 99.9%
Taylor expanded in a around inf 52.1%
Taylor expanded in b around inf 51.0%
*-commutative51.0%
Simplified51.0%
Final simplification54.0%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= z -5.8e+95)
(+ z (* y i))
(if (or (<= z -7.4e-47) (not (<= z -8.5e-93)))
(+ a (* y i))
(* x (log y)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -5.8e+95) {
tmp = z + (y * i);
} else if ((z <= -7.4e-47) || !(z <= -8.5e-93)) {
tmp = a + (y * i);
} else {
tmp = x * log(y);
}
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 <= (-5.8d+95)) then
tmp = z + (y * i)
else if ((z <= (-7.4d-47)) .or. (.not. (z <= (-8.5d-93)))) then
tmp = a + (y * i)
else
tmp = x * log(y)
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 <= -5.8e+95) {
tmp = z + (y * i);
} else if ((z <= -7.4e-47) || !(z <= -8.5e-93)) {
tmp = a + (y * i);
} else {
tmp = x * Math.log(y);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -5.8e+95: tmp = z + (y * i) elif (z <= -7.4e-47) or not (z <= -8.5e-93): tmp = a + (y * i) else: tmp = x * math.log(y) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -5.8e+95) tmp = Float64(z + Float64(y * i)); elseif ((z <= -7.4e-47) || !(z <= -8.5e-93)) tmp = Float64(a + Float64(y * i)); else tmp = Float64(x * log(y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -5.8e+95) tmp = z + (y * i); elseif ((z <= -7.4e-47) || ~((z <= -8.5e-93))) tmp = a + (y * i); else tmp = x * log(y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5.8e+95], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -7.4e-47], N[Not[LessEqual[z, -8.5e-93]], $MachinePrecision]], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+95}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{-47} \lor \neg \left(z \leq -8.5 \cdot 10^{-93}\right):\\
\;\;\;\;a + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y\\
\end{array}
\end{array}
if z < -5.80000000000000027e95Initial program 99.9%
Taylor expanded in t around 0 86.0%
+-commutative86.0%
associate-+r+86.0%
+-commutative86.0%
+-commutative86.0%
fma-def86.0%
Simplified86.0%
Taylor expanded in z around inf 65.3%
if -5.80000000000000027e95 < z < -7.4000000000000001e-47 or -8.5000000000000007e-93 < z Initial program 99.9%
Taylor expanded in a around inf 52.9%
Taylor expanded in b around inf 52.1%
*-commutative52.1%
Simplified52.1%
Taylor expanded in b around 0 38.6%
*-commutative38.6%
Simplified38.6%
if -7.4000000000000001e-47 < z < -8.5000000000000007e-93Initial program 100.0%
Taylor expanded in x around inf 100.0%
Taylor expanded in x around inf 67.8%
Final simplification43.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -5.5e+66) (+ z (* y i)) (if (<= z -5.5e-192) (+ a (* b (log c))) (+ 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 <= -5.5e+66) {
tmp = z + (y * i);
} else if (z <= -5.5e-192) {
tmp = a + (b * log(c));
} 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 <= (-5.5d+66)) then
tmp = z + (y * i)
else if (z <= (-5.5d-192)) then
tmp = a + (b * log(c))
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 <= -5.5e+66) {
tmp = z + (y * i);
} else if (z <= -5.5e-192) {
tmp = a + (b * Math.log(c));
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -5.5e+66: tmp = z + (y * i) elif z <= -5.5e-192: tmp = a + (b * math.log(c)) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -5.5e+66) tmp = Float64(z + Float64(y * i)); elseif (z <= -5.5e-192) tmp = Float64(a + Float64(b * log(c))); 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 <= -5.5e+66) tmp = z + (y * i); elseif (z <= -5.5e-192) tmp = a + (b * log(c)); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5.5e+66], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -5.5e-192], N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+66}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-192}:\\
\;\;\;\;a + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -5.5e66Initial program 99.8%
Taylor expanded in t around 0 85.1%
+-commutative85.1%
associate-+r+85.1%
+-commutative85.1%
+-commutative85.1%
fma-def85.1%
Simplified85.1%
Taylor expanded in z around inf 60.8%
if -5.5e66 < z < -5.49999999999999995e-192Initial program 99.9%
Taylor expanded in a around inf 65.9%
Taylor expanded in b around inf 62.8%
*-commutative62.8%
Simplified62.8%
Taylor expanded in y around 0 45.1%
if -5.49999999999999995e-192 < z Initial program 99.9%
Taylor expanded in a around inf 48.4%
Taylor expanded in b around inf 47.7%
*-commutative47.7%
Simplified47.7%
Taylor expanded in b around 0 36.9%
*-commutative36.9%
Simplified36.9%
Final simplification42.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -3.2e+232) 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 <= -3.2e+232) {
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 <= (-3.2d+232)) 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 <= -3.2e+232) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -3.2e+232: tmp = z else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -3.2e+232) 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 <= -3.2e+232) tmp = z; else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -3.2e+232], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+232}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -3.2000000000000002e232Initial program 100.0%
Taylor expanded in z around inf 93.5%
Taylor expanded in z around inf 72.4%
if -3.2000000000000002e232 < z Initial program 99.9%
Taylor expanded in a around inf 51.3%
Taylor expanded in b around inf 50.3%
*-commutative50.3%
Simplified50.3%
Taylor expanded in b around 0 36.8%
*-commutative36.8%
Simplified36.8%
Final simplification38.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.3e+97) (+ 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 <= -1.3e+97) {
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 <= (-1.3d+97)) 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 <= -1.3e+97) {
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 <= -1.3e+97: 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 <= -1.3e+97) 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 <= -1.3e+97) 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, -1.3e+97], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+97}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -1.3e97Initial program 99.9%
Taylor expanded in t around 0 86.0%
+-commutative86.0%
associate-+r+86.0%
+-commutative86.0%
+-commutative86.0%
fma-def86.0%
Simplified86.0%
Taylor expanded in z around inf 65.3%
if -1.3e97 < z Initial program 99.9%
Taylor expanded in a around inf 52.1%
Taylor expanded in b around inf 51.0%
*-commutative51.0%
Simplified51.0%
Taylor expanded in b around 0 37.6%
*-commutative37.6%
Simplified37.6%
Final simplification41.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.32e+97) z a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.32e+97) {
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 <= (-1.32d+97)) 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 <= -1.32e+97) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -1.32e+97: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -1.32e+97) 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 <= -1.32e+97) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.32e+97], z, a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.32 \cdot 10^{+97}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -1.31999999999999994e97Initial program 99.9%
Taylor expanded in z around inf 74.2%
Taylor expanded in z around inf 42.2%
if -1.31999999999999994e97 < z Initial program 99.9%
Taylor expanded in a around inf 52.1%
Taylor expanded in a around inf 16.8%
Final simplification20.1%
(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 49.6%
Taylor expanded in a around inf 15.0%
Final simplification15.0%
herbie shell --seed 2023290
(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)))