
(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 17 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 (+ (+ (+ (+ (+ (* 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}
Initial program 99.5%
Final simplification99.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -9e+179) (not (<= x 1.55e+252))) (+ z (+ (* (log c) -0.5) (+ (* x (log y)) (* y i)))) (+ a (+ t (+ z (+ (* (- 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) {
double tmp;
if ((x <= -9e+179) || !(x <= 1.55e+252)) {
tmp = z + ((log(c) * -0.5) + ((x * log(y)) + (y * i)));
} else {
tmp = a + (t + (z + (((b - 0.5) * log(c)) + (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 ((x <= (-9d+179)) .or. (.not. (x <= 1.55d+252))) then
tmp = z + ((log(c) * (-0.5d0)) + ((x * log(y)) + (y * i)))
else
tmp = a + (t + (z + (((b - 0.5d0) * log(c)) + (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 ((x <= -9e+179) || !(x <= 1.55e+252)) {
tmp = z + ((Math.log(c) * -0.5) + ((x * Math.log(y)) + (y * i)));
} else {
tmp = a + (t + (z + (((b - 0.5) * Math.log(c)) + (y * i))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -9e+179) or not (x <= 1.55e+252): tmp = z + ((math.log(c) * -0.5) + ((x * math.log(y)) + (y * i))) else: tmp = a + (t + (z + (((b - 0.5) * math.log(c)) + (y * i)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -9e+179) || !(x <= 1.55e+252)) tmp = Float64(z + Float64(Float64(log(c) * -0.5) + Float64(Float64(x * log(y)) + Float64(y * i)))); else tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(y * i))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -9e+179) || ~((x <= 1.55e+252))) tmp = z + ((log(c) * -0.5) + ((x * log(y)) + (y * i))); else tmp = a + (t + (z + (((b - 0.5) * log(c)) + (y * i)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -9e+179], N[Not[LessEqual[x, 1.55e+252]], $MachinePrecision]], N[(z + N[(N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -9 \cdot 10^{+179} \lor \neg \left(x \leq 1.55 \cdot 10^{+252}\right):\\
\;\;\;\;z + \left(\log c \cdot -0.5 + \left(x \cdot \log y + y \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)\right)\right)\\
\end{array}
\end{array}
if x < -9.0000000000000005e179 or 1.54999999999999991e252 < x Initial program 99.8%
Taylor expanded in b around 0 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in a around 0 85.7%
Taylor expanded in t around 0 83.5%
if -9.0000000000000005e179 < x < 1.54999999999999991e252Initial program 99.5%
Taylor expanded in x around 0 93.7%
Final simplification92.1%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.16e+180) (not (<= x 1.55e+252))) (+ z (+ (* (log c) -0.5) (+ (* x (log y)) (* y i)))) (fma y i (+ a (+ t (+ z (* (- 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 ((x <= -1.16e+180) || !(x <= 1.55e+252)) {
tmp = z + ((log(c) * -0.5) + ((x * log(y)) + (y * i)));
} else {
tmp = fma(y, i, (a + (t + (z + ((b - 0.5) * log(c))))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.16e+180) || !(x <= 1.55e+252)) tmp = Float64(z + Float64(Float64(log(c) * -0.5) + Float64(Float64(x * log(y)) + Float64(y * i)))); else tmp = fma(y, i, Float64(a + Float64(t + Float64(z + Float64(Float64(b - 0.5) * log(c)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.16e+180], N[Not[LessEqual[x, 1.55e+252]], $MachinePrecision]], N[(z + N[(N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(a + N[(t + N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.16 \cdot 10^{+180} \lor \neg \left(x \leq 1.55 \cdot 10^{+252}\right):\\
\;\;\;\;z + \left(\log c \cdot -0.5 + \left(x \cdot \log y + y \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \left(t + \left(z + \left(b - 0.5\right) \cdot \log c\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.16000000000000008e180 or 1.54999999999999991e252 < x Initial program 99.8%
Taylor expanded in b around 0 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in a around 0 85.7%
Taylor expanded in t around 0 83.5%
if -1.16000000000000008e180 < x < 1.54999999999999991e252Initial program 99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in x around 0 93.7%
Final simplification92.1%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (- b 0.5) (log c))))
(if (<= y 8.4e+24)
(+ a (+ t (+ z (+ (* x (log y)) t_1))))
(fma y i (+ a (+ t (+ z t_1)))))))
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 (y <= 8.4e+24) {
tmp = a + (t + (z + ((x * log(y)) + t_1)));
} else {
tmp = fma(y, i, (a + (t + (z + t_1))));
}
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 (y <= 8.4e+24) tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(x * log(y)) + t_1)))); else tmp = fma(y, i, Float64(a + Float64(t + Float64(z + t_1)))); end return 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[LessEqual[y, 8.4e+24], N[(a + N[(t + N[(z + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;y \leq 8.4 \cdot 10^{+24}:\\
\;\;\;\;a + \left(t + \left(z + \left(x \cdot \log y + t\_1\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \left(t + \left(z + t\_1\right)\right)\right)\\
\end{array}
\end{array}
if y < 8.4000000000000005e24Initial program 99.9%
Taylor expanded in y around 0 97.7%
if 8.4000000000000005e24 < y Initial program 99.1%
associate-+l+99.1%
associate-+l+99.1%
+-commutative99.1%
associate-+l+99.1%
+-commutative99.1%
associate-+l+99.1%
+-commutative99.1%
associate-+l+99.1%
+-commutative99.1%
fma-define99.1%
+-commutative99.1%
fma-define99.1%
Simplified99.1%
Taylor expanded in x around 0 92.7%
Final simplification95.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (* b (log c)))) (t_2 (* z (+ 1.0 (* i (/ y z))))))
(if (<= z -4.1e+176)
t_2
(if (<= z -3.6e+169)
t_1
(if (<= z -8e+145)
t_2
(if (or (<= z -3.5e+99) (not (<= z -1.6e-102)))
(+ a (* y i))
t_1))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (b * log(c));
double t_2 = z * (1.0 + (i * (y / z)));
double tmp;
if (z <= -4.1e+176) {
tmp = t_2;
} else if (z <= -3.6e+169) {
tmp = t_1;
} else if (z <= -8e+145) {
tmp = t_2;
} else if ((z <= -3.5e+99) || !(z <= -1.6e-102)) {
tmp = a + (y * i);
} else {
tmp = 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) :: t_2
real(8) :: tmp
t_1 = a + (b * log(c))
t_2 = z * (1.0d0 + (i * (y / z)))
if (z <= (-4.1d+176)) then
tmp = t_2
else if (z <= (-3.6d+169)) then
tmp = t_1
else if (z <= (-8d+145)) then
tmp = t_2
else if ((z <= (-3.5d+99)) .or. (.not. (z <= (-1.6d-102)))) then
tmp = a + (y * i)
else
tmp = 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 = a + (b * Math.log(c));
double t_2 = z * (1.0 + (i * (y / z)));
double tmp;
if (z <= -4.1e+176) {
tmp = t_2;
} else if (z <= -3.6e+169) {
tmp = t_1;
} else if (z <= -8e+145) {
tmp = t_2;
} else if ((z <= -3.5e+99) || !(z <= -1.6e-102)) {
tmp = a + (y * i);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (b * math.log(c)) t_2 = z * (1.0 + (i * (y / z))) tmp = 0 if z <= -4.1e+176: tmp = t_2 elif z <= -3.6e+169: tmp = t_1 elif z <= -8e+145: tmp = t_2 elif (z <= -3.5e+99) or not (z <= -1.6e-102): tmp = a + (y * i) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(b * log(c))) t_2 = Float64(z * Float64(1.0 + Float64(i * Float64(y / z)))) tmp = 0.0 if (z <= -4.1e+176) tmp = t_2; elseif (z <= -3.6e+169) tmp = t_1; elseif (z <= -8e+145) tmp = t_2; elseif ((z <= -3.5e+99) || !(z <= -1.6e-102)) tmp = Float64(a + Float64(y * i)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (b * log(c)); t_2 = z * (1.0 + (i * (y / z))); tmp = 0.0; if (z <= -4.1e+176) tmp = t_2; elseif (z <= -3.6e+169) tmp = t_1; elseif (z <= -8e+145) tmp = t_2; elseif ((z <= -3.5e+99) || ~((z <= -1.6e-102))) tmp = a + (y * i); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(1.0 + N[(i * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.1e+176], t$95$2, If[LessEqual[z, -3.6e+169], t$95$1, If[LessEqual[z, -8e+145], t$95$2, If[Or[LessEqual[z, -3.5e+99], N[Not[LessEqual[z, -1.6e-102]], $MachinePrecision]], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + b \cdot \log c\\
t_2 := z \cdot \left(1 + i \cdot \frac{y}{z}\right)\\
\mathbf{if}\;z \leq -4.1 \cdot 10^{+176}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{+169}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -8 \cdot 10^{+145}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{+99} \lor \neg \left(z \leq -1.6 \cdot 10^{-102}\right):\\
\;\;\;\;a + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.0999999999999999e176 or -3.6000000000000001e169 < z < -7.9999999999999999e145Initial program 99.9%
Taylor expanded in z around -inf 99.8%
Taylor expanded in i around inf 64.1%
associate-/l*64.1%
Simplified64.1%
if -4.0999999999999999e176 < z < -3.6000000000000001e169 or -3.4999999999999998e99 < z < -1.59999999999999993e-102Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 82.7%
Taylor expanded in t around 0 59.6%
Taylor expanded in b around inf 38.7%
*-commutative38.7%
Simplified38.7%
if -7.9999999999999999e145 < z < -3.4999999999999998e99 or -1.59999999999999993e-102 < z Initial program 99.3%
associate-+l+99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
associate-+l+99.3%
+-commutative99.3%
fma-define99.3%
+-commutative99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in x around 0 85.3%
Taylor expanded in t around 0 69.9%
Taylor expanded in i around inf 39.9%
Final simplification42.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ a (+ z (* (- b 0.5) (log c))))))
(if (<= y 2.8e+57)
t_1
(if (<= y 8.2e+95)
(* z (+ 1.0 (* i (/ y z))))
(if (<= y 1.12e+161) t_1 (+ a (* y i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = a + (z + ((b - 0.5) * log(c)));
double tmp;
if (y <= 2.8e+57) {
tmp = t_1;
} else if (y <= 8.2e+95) {
tmp = z * (1.0 + (i * (y / z)));
} else if (y <= 1.12e+161) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a + (z + ((b - 0.5d0) * log(c)))
if (y <= 2.8d+57) then
tmp = t_1
else if (y <= 8.2d+95) then
tmp = z * (1.0d0 + (i * (y / z)))
else if (y <= 1.12d+161) then
tmp = t_1
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 t_1 = a + (z + ((b - 0.5) * Math.log(c)));
double tmp;
if (y <= 2.8e+57) {
tmp = t_1;
} else if (y <= 8.2e+95) {
tmp = z * (1.0 + (i * (y / z)));
} else if (y <= 1.12e+161) {
tmp = t_1;
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = a + (z + ((b - 0.5) * math.log(c))) tmp = 0 if y <= 2.8e+57: tmp = t_1 elif y <= 8.2e+95: tmp = z * (1.0 + (i * (y / z))) elif y <= 1.12e+161: tmp = t_1 else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(a + Float64(z + Float64(Float64(b - 0.5) * log(c)))) tmp = 0.0 if (y <= 2.8e+57) tmp = t_1; elseif (y <= 8.2e+95) tmp = Float64(z * Float64(1.0 + Float64(i * Float64(y / z)))); elseif (y <= 1.12e+161) tmp = t_1; else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = a + (z + ((b - 0.5) * log(c))); tmp = 0.0; if (y <= 2.8e+57) tmp = t_1; elseif (y <= 8.2e+95) tmp = z * (1.0 + (i * (y / z))); elseif (y <= 1.12e+161) tmp = t_1; else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(a + N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.8e+57], t$95$1, If[LessEqual[y, 8.2e+95], N[(z * N[(1.0 + N[(i * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.12e+161], t$95$1, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a + \left(z + \left(b - 0.5\right) \cdot \log c\right)\\
\mathbf{if}\;y \leq 2.8 \cdot 10^{+57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+95}:\\
\;\;\;\;z \cdot \left(1 + i \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq 1.12 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if y < 2.8e57 or 8.19999999999999972e95 < y < 1.12e161Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around 0 82.6%
Taylor expanded in t around 0 66.2%
Taylor expanded in i around 0 59.0%
if 2.8e57 < y < 8.19999999999999972e95Initial program 99.9%
Taylor expanded in z around -inf 75.6%
Taylor expanded in i around inf 42.7%
associate-/l*42.7%
Simplified42.7%
if 1.12e161 < y Initial program 98.5%
associate-+l+98.5%
associate-+l+98.5%
+-commutative98.5%
associate-+l+98.5%
+-commutative98.5%
associate-+l+98.5%
+-commutative98.5%
associate-+l+98.5%
+-commutative98.5%
fma-define98.5%
+-commutative98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in x around 0 94.1%
Taylor expanded in t around 0 83.3%
Taylor expanded in i around inf 64.1%
Final simplification59.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ z (* (- b 0.5) (log c)))))
(if (<= y 2.85e+57)
(+ a (+ t t_1))
(if (<= y 7.2e+95)
(* z (+ 1.0 (* i (/ y z))))
(if (<= y 5.5e+161) (+ a t_1) (+ a (* y i)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = z + ((b - 0.5) * log(c));
double tmp;
if (y <= 2.85e+57) {
tmp = a + (t + t_1);
} else if (y <= 7.2e+95) {
tmp = z * (1.0 + (i * (y / z)));
} else if (y <= 5.5e+161) {
tmp = a + t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = z + ((b - 0.5d0) * log(c))
if (y <= 2.85d+57) then
tmp = a + (t + t_1)
else if (y <= 7.2d+95) then
tmp = z * (1.0d0 + (i * (y / z)))
else if (y <= 5.5d+161) then
tmp = a + t_1
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 t_1 = z + ((b - 0.5) * Math.log(c));
double tmp;
if (y <= 2.85e+57) {
tmp = a + (t + t_1);
} else if (y <= 7.2e+95) {
tmp = z * (1.0 + (i * (y / z)));
} else if (y <= 5.5e+161) {
tmp = a + t_1;
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = z + ((b - 0.5) * math.log(c)) tmp = 0 if y <= 2.85e+57: tmp = a + (t + t_1) elif y <= 7.2e+95: tmp = z * (1.0 + (i * (y / z))) elif y <= 5.5e+161: tmp = a + t_1 else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(z + Float64(Float64(b - 0.5) * log(c))) tmp = 0.0 if (y <= 2.85e+57) tmp = Float64(a + Float64(t + t_1)); elseif (y <= 7.2e+95) tmp = Float64(z * Float64(1.0 + Float64(i * Float64(y / z)))); elseif (y <= 5.5e+161) tmp = Float64(a + t_1); else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = z + ((b - 0.5) * log(c)); tmp = 0.0; if (y <= 2.85e+57) tmp = a + (t + t_1); elseif (y <= 7.2e+95) tmp = z * (1.0 + (i * (y / z))); elseif (y <= 5.5e+161) tmp = a + t_1; else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, 2.85e+57], N[(a + N[(t + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 7.2e+95], N[(z * N[(1.0 + N[(i * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 5.5e+161], N[(a + t$95$1), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z + \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;y \leq 2.85 \cdot 10^{+57}:\\
\;\;\;\;a + \left(t + t\_1\right)\\
\mathbf{elif}\;y \leq 7.2 \cdot 10^{+95}:\\
\;\;\;\;z \cdot \left(1 + i \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;y \leq 5.5 \cdot 10^{+161}:\\
\;\;\;\;a + t\_1\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if y < 2.8499999999999999e57Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around 0 80.3%
Taylor expanded in y around 0 76.4%
if 2.8499999999999999e57 < y < 7.19999999999999955e95Initial program 99.9%
Taylor expanded in z around -inf 75.6%
Taylor expanded in i around inf 42.7%
associate-/l*42.7%
Simplified42.7%
if 7.19999999999999955e95 < y < 5.5000000000000005e161Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-define99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in x around 0 95.9%
Taylor expanded in t around 0 87.9%
Taylor expanded in i around 0 61.6%
if 5.5000000000000005e161 < y Initial program 98.5%
associate-+l+98.5%
associate-+l+98.5%
+-commutative98.5%
associate-+l+98.5%
+-commutative98.5%
associate-+l+98.5%
+-commutative98.5%
associate-+l+98.5%
+-commutative98.5%
fma-define98.5%
+-commutative98.5%
fma-define98.5%
Simplified98.5%
Taylor expanded in x around 0 94.1%
Taylor expanded in t around 0 83.3%
Taylor expanded in i around inf 64.1%
Final simplification69.6%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (- b 0.5) (log c))))
(if (<= z -9e+229)
(* z (+ 1.0 (* i (/ y z))))
(if (<= z -8.5e+145) (+ a (+ t (+ z t_1))) (+ a (+ t_1 (* y i)))))))
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 (z <= -9e+229) {
tmp = z * (1.0 + (i * (y / z)));
} else if (z <= -8.5e+145) {
tmp = a + (t + (z + t_1));
} else {
tmp = a + (t_1 + (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) :: t_1
real(8) :: tmp
t_1 = (b - 0.5d0) * log(c)
if (z <= (-9d+229)) then
tmp = z * (1.0d0 + (i * (y / z)))
else if (z <= (-8.5d+145)) then
tmp = a + (t + (z + t_1))
else
tmp = a + (t_1 + (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 t_1 = (b - 0.5) * Math.log(c);
double tmp;
if (z <= -9e+229) {
tmp = z * (1.0 + (i * (y / z)));
} else if (z <= -8.5e+145) {
tmp = a + (t + (z + t_1));
} else {
tmp = a + (t_1 + (y * i));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (b - 0.5) * math.log(c) tmp = 0 if z <= -9e+229: tmp = z * (1.0 + (i * (y / z))) elif z <= -8.5e+145: tmp = a + (t + (z + t_1)) else: tmp = a + (t_1 + (y * i)) 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 (z <= -9e+229) tmp = Float64(z * Float64(1.0 + Float64(i * Float64(y / z)))); elseif (z <= -8.5e+145) tmp = Float64(a + Float64(t + Float64(z + t_1))); else tmp = Float64(a + Float64(t_1 + Float64(y * i))); 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 (z <= -9e+229) tmp = z * (1.0 + (i * (y / z))); elseif (z <= -8.5e+145) tmp = a + (t + (z + t_1)); else tmp = a + (t_1 + (y * i)); 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[LessEqual[z, -9e+229], N[(z * N[(1.0 + N[(i * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -8.5e+145], N[(a + N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t$95$1 + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;z \leq -9 \cdot 10^{+229}:\\
\;\;\;\;z \cdot \left(1 + i \cdot \frac{y}{z}\right)\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;a + \left(t + \left(z + t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(t\_1 + y \cdot i\right)\\
\end{array}
\end{array}
if z < -9.00000000000000047e229Initial program 99.9%
Taylor expanded in z around -inf 99.8%
Taylor expanded in i around inf 66.2%
associate-/l*66.2%
Simplified66.2%
if -9.00000000000000047e229 < z < -8.49999999999999977e145Initial program 100.0%
associate-+l+100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+l+100.0%
+-commutative100.0%
fma-define100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in x around 0 100.0%
Taylor expanded in y around 0 92.1%
if -8.49999999999999977e145 < z Initial program 99.4%
associate-+l+99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.5%
+-commutative99.5%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 84.8%
Taylor expanded in t around 0 68.2%
Taylor expanded in z around 0 57.8%
Final simplification60.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x 1.55e+252) (+ a (+ t (+ z (+ (* (- b 0.5) (log c)) (* y i))))) (* x (* z (+ (/ (log y) z) (/ 1.0 x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= 1.55e+252) {
tmp = a + (t + (z + (((b - 0.5) * log(c)) + (y * i))));
} else {
tmp = x * (z * ((log(y) / z) + (1.0 / x)));
}
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.55d+252) then
tmp = a + (t + (z + (((b - 0.5d0) * log(c)) + (y * i))))
else
tmp = x * (z * ((log(y) / z) + (1.0d0 / x)))
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.55e+252) {
tmp = a + (t + (z + (((b - 0.5) * Math.log(c)) + (y * i))));
} else {
tmp = x * (z * ((Math.log(y) / z) + (1.0 / x)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= 1.55e+252: tmp = a + (t + (z + (((b - 0.5) * math.log(c)) + (y * i)))) else: tmp = x * (z * ((math.log(y) / z) + (1.0 / x))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= 1.55e+252) tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(y * i))))); else tmp = Float64(x * Float64(z * Float64(Float64(log(y) / z) + Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= 1.55e+252) tmp = a + (t + (z + (((b - 0.5) * log(c)) + (y * i)))); else tmp = x * (z * ((log(y) / z) + (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, 1.55e+252], N[(a + N[(t + N[(z + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * N[(N[(N[Log[y], $MachinePrecision] / z), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.55 \cdot 10^{+252}:\\
\;\;\;\;a + \left(t + \left(z + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(\frac{\log y}{z} + \frac{1}{x}\right)\right)\\
\end{array}
\end{array}
if x < 1.54999999999999991e252Initial program 99.5%
Taylor expanded in x around 0 89.5%
if 1.54999999999999991e252 < x Initial program 99.6%
Taylor expanded in x around -inf 99.6%
Taylor expanded in z around inf 77.8%
Taylor expanded in z around inf 77.6%
mul-1-neg77.6%
Simplified77.6%
Final simplification88.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x 1.55e+252) (+ a (+ z (+ (* (- b 0.5) (log c)) (* y i)))) (+ (* x (log y)) z)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= 1.55e+252) {
tmp = a + (z + (((b - 0.5) * log(c)) + (y * i)));
} else {
tmp = (x * log(y)) + 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.55d+252) then
tmp = a + (z + (((b - 0.5d0) * log(c)) + (y * i)))
else
tmp = (x * log(y)) + 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.55e+252) {
tmp = a + (z + (((b - 0.5) * Math.log(c)) + (y * i)));
} else {
tmp = (x * Math.log(y)) + z;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= 1.55e+252: tmp = a + (z + (((b - 0.5) * math.log(c)) + (y * i))) else: tmp = (x * math.log(y)) + z return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= 1.55e+252) tmp = Float64(a + Float64(z + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(y * i)))); else tmp = Float64(Float64(x * log(y)) + z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= 1.55e+252) tmp = a + (z + (((b - 0.5) * log(c)) + (y * i))); else tmp = (x * log(y)) + z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, 1.55e+252], N[(a + N[(z + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.55 \cdot 10^{+252}:\\
\;\;\;\;a + \left(z + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \log y + z\\
\end{array}
\end{array}
if x < 1.54999999999999991e252Initial program 99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in x around 0 89.5%
Taylor expanded in t around 0 72.3%
if 1.54999999999999991e252 < x Initial program 99.6%
Taylor expanded in x around -inf 99.6%
Taylor expanded in z around inf 77.8%
Taylor expanded in x around 0 77.8%
mul-1-neg77.8%
unsub-neg77.8%
mul-1-neg77.8%
Simplified77.8%
Final simplification72.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x 1.55e+252) (+ a (+ z (+ (* (- b 0.5) (log c)) (* y i)))) (* x (* z (+ (/ (log y) z) (/ 1.0 x))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= 1.55e+252) {
tmp = a + (z + (((b - 0.5) * log(c)) + (y * i)));
} else {
tmp = x * (z * ((log(y) / z) + (1.0 / x)));
}
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.55d+252) then
tmp = a + (z + (((b - 0.5d0) * log(c)) + (y * i)))
else
tmp = x * (z * ((log(y) / z) + (1.0d0 / x)))
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.55e+252) {
tmp = a + (z + (((b - 0.5) * Math.log(c)) + (y * i)));
} else {
tmp = x * (z * ((Math.log(y) / z) + (1.0 / x)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= 1.55e+252: tmp = a + (z + (((b - 0.5) * math.log(c)) + (y * i))) else: tmp = x * (z * ((math.log(y) / z) + (1.0 / x))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= 1.55e+252) tmp = Float64(a + Float64(z + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(y * i)))); else tmp = Float64(x * Float64(z * Float64(Float64(log(y) / z) + Float64(1.0 / x)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= 1.55e+252) tmp = a + (z + (((b - 0.5) * log(c)) + (y * i))); else tmp = x * (z * ((log(y) / z) + (1.0 / x))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, 1.55e+252], N[(a + N[(z + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(z * N[(N[(N[Log[y], $MachinePrecision] / z), $MachinePrecision] + N[(1.0 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 1.55 \cdot 10^{+252}:\\
\;\;\;\;a + \left(z + \left(\left(b - 0.5\right) \cdot \log c + y \cdot i\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(z \cdot \left(\frac{\log y}{z} + \frac{1}{x}\right)\right)\\
\end{array}
\end{array}
if x < 1.54999999999999991e252Initial program 99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+l+99.5%
+-commutative99.5%
fma-define99.5%
+-commutative99.5%
fma-define99.5%
Simplified99.5%
Taylor expanded in x around 0 89.5%
Taylor expanded in t around 0 72.3%
if 1.54999999999999991e252 < x Initial program 99.6%
Taylor expanded in x around -inf 99.6%
Taylor expanded in z around inf 77.8%
Taylor expanded in z around inf 77.6%
mul-1-neg77.6%
Simplified77.6%
Final simplification72.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -8.6e+145) z (if (<= z -1.35e+121) a (if (<= z -1350.0) (* 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 <= -8.6e+145) {
tmp = z;
} else if (z <= -1.35e+121) {
tmp = a;
} else if (z <= -1350.0) {
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 <= (-8.6d+145)) then
tmp = z
else if (z <= (-1.35d+121)) then
tmp = a
else if (z <= (-1350.0d0)) 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 <= -8.6e+145) {
tmp = z;
} else if (z <= -1.35e+121) {
tmp = a;
} else if (z <= -1350.0) {
tmp = y * i;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -8.6e+145: tmp = z elif z <= -1.35e+121: tmp = a elif z <= -1350.0: tmp = y * i else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -8.6e+145) tmp = z; elseif (z <= -1.35e+121) tmp = a; elseif (z <= -1350.0) 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 <= -8.6e+145) tmp = z; elseif (z <= -1.35e+121) tmp = a; elseif (z <= -1350.0) tmp = y * i; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -8.6e+145], z, If[LessEqual[z, -1.35e+121], a, If[LessEqual[z, -1350.0], N[(y * i), $MachinePrecision], a]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+145}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{+121}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq -1350:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -8.59999999999999996e145Initial program 99.9%
Taylor expanded in z around inf 52.7%
if -8.59999999999999996e145 < z < -1.3500000000000001e121 or -1350 < z Initial program 99.4%
Taylor expanded in a around inf 15.4%
if -1.3500000000000001e121 < z < -1350Initial program 99.9%
Taylor expanded in y around inf 12.0%
Final simplification19.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -9.2e+145) (* z (+ 1.0 (* i (/ y 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 <= -9.2e+145) {
tmp = z * (1.0 + (i * (y / 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 <= (-9.2d+145)) then
tmp = z * (1.0d0 + (i * (y / 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 <= -9.2e+145) {
tmp = z * (1.0 + (i * (y / z)));
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -9.2e+145: tmp = z * (1.0 + (i * (y / z))) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -9.2e+145) tmp = Float64(z * Float64(1.0 + Float64(i * Float64(y / 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 <= -9.2e+145) tmp = z * (1.0 + (i * (y / z))); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -9.2e+145], N[(z * N[(1.0 + N[(i * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+145}:\\
\;\;\;\;z \cdot \left(1 + i \cdot \frac{y}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -9.2e145Initial program 99.9%
Taylor expanded in z around -inf 99.8%
Taylor expanded in i around inf 64.1%
associate-/l*64.1%
Simplified64.1%
if -9.2e145 < z Initial program 99.4%
associate-+l+99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.5%
+-commutative99.5%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 84.8%
Taylor expanded in t around 0 68.2%
Taylor expanded in i around inf 38.4%
Final simplification41.5%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -9.8e+145) (* z (+ 1.0 (/ a 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 <= -9.8e+145) {
tmp = z * (1.0 + (a / 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 <= (-9.8d+145)) then
tmp = z * (1.0d0 + (a / 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 <= -9.8e+145) {
tmp = z * (1.0 + (a / z));
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -9.8e+145: tmp = z * (1.0 + (a / z)) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -9.8e+145) tmp = Float64(z * Float64(1.0 + Float64(a / 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 <= -9.8e+145) tmp = z * (1.0 + (a / z)); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -9.8e+145], N[(z * N[(1.0 + N[(a / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+145}:\\
\;\;\;\;z \cdot \left(1 + \frac{a}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -9.80000000000000006e145Initial program 99.9%
Taylor expanded in z around -inf 99.8%
Taylor expanded in a around inf 53.0%
if -9.80000000000000006e145 < z Initial program 99.4%
associate-+l+99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.5%
+-commutative99.5%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 84.8%
Taylor expanded in t around 0 68.2%
Taylor expanded in i around inf 38.4%
Final simplification40.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -9.8e+145) 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 <= -9.8e+145) {
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 <= (-9.8d+145)) 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 <= -9.8e+145) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -9.8e+145: tmp = z else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -9.8e+145) 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 <= -9.8e+145) tmp = z; else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -9.8e+145], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.8 \cdot 10^{+145}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -9.80000000000000006e145Initial program 99.9%
Taylor expanded in z around inf 52.7%
if -9.80000000000000006e145 < z Initial program 99.4%
associate-+l+99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
associate-+l+99.4%
+-commutative99.4%
fma-define99.5%
+-commutative99.5%
fma-define99.4%
Simplified99.4%
Taylor expanded in x around 0 84.8%
Taylor expanded in t around 0 68.2%
Taylor expanded in i around inf 38.4%
Final simplification40.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -8.5e+145) z a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -8.5e+145) {
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 <= (-8.5d+145)) 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 <= -8.5e+145) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -8.5e+145: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -8.5e+145) 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 <= -8.5e+145) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -8.5e+145], z, a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.5 \cdot 10^{+145}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -8.49999999999999977e145Initial program 99.9%
Taylor expanded in z around inf 52.7%
if -8.49999999999999977e145 < z Initial program 99.4%
Taylor expanded in a around inf 14.9%
Final simplification19.5%
(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.5%
Taylor expanded in a around inf 13.4%
Final simplification13.4%
herbie shell --seed 2024115
(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)))