
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (fma x (log y) z) (+ t a)) (+ (* (+ b -0.5) (log c)) (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (fma(x, log(y), z) + (t + a)) + (((b + -0.5) * log(c)) + (y * i));
}
function code(x, y, z, t, a, b, c, i) return Float64(Float64(fma(x, log(y), z) + Float64(t + a)) + Float64(Float64(Float64(b + -0.5) * log(c)) + Float64(y * i))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right) + \left(\left(b + -0.5\right) \cdot \log c + y \cdot i\right)
\end{array}
Initial program 99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+l+99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= (- b 0.5) -2e+212)
(+ (+ (* y i) (fma (log c) (+ b -0.5) z)) (+ t a))
(if (<= (- b 0.5) 1e+145)
(+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* -0.5 (log c))))
(+ a (+ (* (+ b -0.5) (log c)) (fma y i z))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b - 0.5) <= -2e+212) {
tmp = ((y * i) + fma(log(c), (b + -0.5), z)) + (t + a);
} else if ((b - 0.5) <= 1e+145) {
tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (-0.5 * log(c)));
} else {
tmp = a + (((b + -0.5) * log(c)) + fma(y, i, z));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(b - 0.5) <= -2e+212) tmp = Float64(Float64(Float64(y * i) + fma(log(c), Float64(b + -0.5), z)) + Float64(t + a)); elseif (Float64(b - 0.5) <= 1e+145) tmp = Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(-0.5 * log(c)))); else tmp = Float64(a + Float64(Float64(Float64(b + -0.5) * log(c)) + fma(y, i, z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(b - 0.5), $MachinePrecision], -2e+212], N[(N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + z), $MachinePrecision]), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(b - 0.5), $MachinePrecision], 1e+145], N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(y * i + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -2 \cdot 10^{+212}:\\
\;\;\;\;\left(y \cdot i + \mathsf{fma}\left(\log c, b + -0.5, z\right)\right) + \left(t + a\right)\\
\mathbf{elif}\;b - 0.5 \leq 10^{+145}:\\
\;\;\;\;y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + -0.5 \cdot \log c\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(\left(b + -0.5\right) \cdot \log c + \mathsf{fma}\left(y, i, z\right)\right)\\
\end{array}
\end{array}
if (-.f64 b 1/2) < -1.9999999999999998e212Initial program 99.9%
Taylor expanded in x around 0 99.7%
+-commutative99.7%
+-commutative99.7%
associate-+l+99.7%
Simplified99.7%
if -1.9999999999999998e212 < (-.f64 b 1/2) < 9.9999999999999999e144Initial program 99.9%
Taylor expanded in b around 0 98.2%
if 9.9999999999999999e144 < (-.f64 b 1/2) Initial program 99.7%
Taylor expanded in x around 0 91.6%
Taylor expanded in t around 0 79.1%
associate-+r+79.1%
*-commutative79.1%
sub-neg79.1%
metadata-eval79.1%
+-commutative79.1%
+-commutative79.1%
fma-def79.1%
Simplified79.1%
Final simplification95.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (or (<= x -7.2e+138) (not (<= x 1.7e+240)))
(+ 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 = log(c) * (b - 0.5);
double tmp;
if ((x <= -7.2e+138) || !(x <= 1.7e+240)) {
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(log(c) * Float64(b - 0.5)) tmp = 0.0 if ((x <= -7.2e+138) || !(x <= 1.7e+240)) 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[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -7.2e+138], N[Not[LessEqual[x, 1.7e+240]], $MachinePrecision]], 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 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -7.2 \cdot 10^{+138} \lor \neg \left(x \leq 1.7 \cdot 10^{+240}\right):\\
\;\;\;\;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 x < -7.2000000000000002e138 or 1.70000000000000004e240 < x Initial program 99.8%
Taylor expanded in y around 0 77.4%
if -7.2000000000000002e138 < x < 1.70000000000000004e240Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 96.8%
Final simplification93.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.2e+118) (not (<= x 8.5e+236))) (+ (* y i) (+ (* -0.5 (log c)) (+ a (+ t (* x (log y)))))) (fma y i (+ a (+ t (+ z (* (log c) (- b 0.5))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.2e+118) || !(x <= 8.5e+236)) {
tmp = (y * i) + ((-0.5 * log(c)) + (a + (t + (x * log(y)))));
} else {
tmp = fma(y, i, (a + (t + (z + (log(c) * (b - 0.5))))));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.2e+118) || !(x <= 8.5e+236)) tmp = Float64(Float64(y * i) + Float64(Float64(-0.5 * log(c)) + Float64(a + Float64(t + Float64(x * log(y)))))); else tmp = fma(y, i, Float64(a + Float64(t + Float64(z + Float64(log(c) * Float64(b - 0.5)))))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.2e+118], N[Not[LessEqual[x, 8.5e+236]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(N[(-0.5 * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + N[(t + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(a + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.2 \cdot 10^{+118} \lor \neg \left(x \leq 8.5 \cdot 10^{+236}\right):\\
\;\;\;\;y \cdot i + \left(-0.5 \cdot \log c + \left(a + \left(t + x \cdot \log y\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \left(t + \left(z + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.2e118 or 8.5000000000000008e236 < x Initial program 99.8%
Taylor expanded in b around 0 90.9%
Taylor expanded in z around 0 87.9%
+-commutative87.9%
Simplified87.9%
if -1.2e118 < x < 8.5000000000000008e236Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 97.2%
Final simplification95.3%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (or (<= x -7.5e+145) (not (<= x 2.4e+239)))
(+ a (+ t (+ (* x (log y)) t_1)))
(+ a (+ t (+ z (+ (* 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 = log(c) * (b - 0.5);
double tmp;
if ((x <= -7.5e+145) || !(x <= 2.4e+239)) {
tmp = a + (t + ((x * log(y)) + t_1));
} else {
tmp = a + (t + (z + ((y * i) + 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 = log(c) * (b - 0.5d0)
if ((x <= (-7.5d+145)) .or. (.not. (x <= 2.4d+239))) then
tmp = a + (t + ((x * log(y)) + t_1))
else
tmp = a + (t + (z + ((y * i) + 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 = Math.log(c) * (b - 0.5);
double tmp;
if ((x <= -7.5e+145) || !(x <= 2.4e+239)) {
tmp = a + (t + ((x * Math.log(y)) + t_1));
} else {
tmp = a + (t + (z + ((y * i) + t_1)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = math.log(c) * (b - 0.5) tmp = 0 if (x <= -7.5e+145) or not (x <= 2.4e+239): tmp = a + (t + ((x * math.log(y)) + t_1)) else: tmp = a + (t + (z + ((y * i) + t_1))) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(log(c) * Float64(b - 0.5)) tmp = 0.0 if ((x <= -7.5e+145) || !(x <= 2.4e+239)) tmp = Float64(a + Float64(t + Float64(Float64(x * log(y)) + t_1))); else tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(y * i) + t_1)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = log(c) * (b - 0.5); tmp = 0.0; if ((x <= -7.5e+145) || ~((x <= 2.4e+239))) tmp = a + (t + ((x * log(y)) + t_1)); else tmp = a + (t + (z + ((y * i) + t_1))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -7.5e+145], N[Not[LessEqual[x, 2.4e+239]], $MachinePrecision]], N[(a + N[(t + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+145} \lor \neg \left(x \leq 2.4 \cdot 10^{+239}\right):\\
\;\;\;\;a + \left(t + \left(x \cdot \log y + t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + \left(y \cdot i + t\_1\right)\right)\right)\\
\end{array}
\end{array}
if x < -7.50000000000000006e145 or 2.4e239 < x Initial program 99.8%
Taylor expanded in y around 0 77.4%
Taylor expanded in z around 0 71.6%
if -7.50000000000000006e145 < x < 2.4e239Initial program 99.9%
Taylor expanded in x around 0 96.8%
Final simplification92.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (or (<= x -7.5e+145) (not (<= x 1.1e+240)))
(+ a (+ t (+ (* 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 = log(c) * (b - 0.5);
double tmp;
if ((x <= -7.5e+145) || !(x <= 1.1e+240)) {
tmp = a + (t + ((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(log(c) * Float64(b - 0.5)) tmp = 0.0 if ((x <= -7.5e+145) || !(x <= 1.1e+240)) tmp = Float64(a + Float64(t + 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[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[x, -7.5e+145], N[Not[LessEqual[x, 1.1e+240]], $MachinePrecision]], N[(a + N[(t + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + t$95$1), $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 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;x \leq -7.5 \cdot 10^{+145} \lor \neg \left(x \leq 1.1 \cdot 10^{+240}\right):\\
\;\;\;\;a + \left(t + \left(x \cdot \log y + t\_1\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \left(t + \left(z + t\_1\right)\right)\right)\\
\end{array}
\end{array}
if x < -7.50000000000000006e145 or 1.1000000000000001e240 < x Initial program 99.8%
Taylor expanded in y around 0 77.4%
Taylor expanded in z around 0 71.6%
if -7.50000000000000006e145 < x < 1.1000000000000001e240Initial program 99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
+-commutative99.9%
associate-+r+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+l+99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
Simplified99.9%
Taylor expanded in x around 0 96.8%
Final simplification92.5%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right)
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (+ (* y i) (* (log c) (- b 0.5)))))
(if (<= a 8.5e+120)
(+ t (+ z t_1))
(if (<= a 2.6e+226) (+ a (+ t (fma y i z))) (+ a t_1)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (y * i) + (log(c) * (b - 0.5));
double tmp;
if (a <= 8.5e+120) {
tmp = t + (z + t_1);
} else if (a <= 2.6e+226) {
tmp = a + (t + fma(y, i, z));
} else {
tmp = a + t_1;
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5))) tmp = 0.0 if (a <= 8.5e+120) tmp = Float64(t + Float64(z + t_1)); elseif (a <= 2.6e+226) tmp = Float64(a + Float64(t + fma(y, i, z))); else tmp = Float64(a + t_1); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, 8.5e+120], N[(t + N[(z + t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.6e+226], N[(a + N[(t + N[(y * i + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot i + \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;a \leq 8.5 \cdot 10^{+120}:\\
\;\;\;\;t + \left(z + t\_1\right)\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+226}:\\
\;\;\;\;a + \left(t + \mathsf{fma}\left(y, i, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + t\_1\\
\end{array}
\end{array}
if a < 8.50000000000000026e120Initial program 99.9%
Taylor expanded in x around 0 85.4%
Taylor expanded in a around 0 76.7%
if 8.50000000000000026e120 < a < 2.6000000000000002e226Initial program 100.0%
Taylor expanded in x around 0 91.1%
Taylor expanded in i around inf 81.6%
*-commutative81.6%
Simplified81.6%
+-commutative81.6%
fma-def81.6%
Applied egg-rr81.6%
if 2.6000000000000002e226 < a Initial program 99.9%
Taylor expanded in x around 0 99.9%
Taylor expanded in t around 0 99.9%
associate-+r+99.9%
*-commutative99.9%
sub-neg99.9%
metadata-eval99.9%
+-commutative99.9%
+-commutative99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in z around 0 98.2%
Final simplification78.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= x -7.5e+145) (+ a (+ t (+ z (* x (log y))))) (+ a (+ t (+ z (+ (* y i) (* (log c) (- b 0.5))))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (x <= -7.5e+145) {
tmp = a + (t + (z + (x * log(y))));
} else {
tmp = a + (t + (z + ((y * i) + (log(c) * (b - 0.5)))));
}
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 <= (-7.5d+145)) then
tmp = a + (t + (z + (x * log(y))))
else
tmp = a + (t + (z + ((y * i) + (log(c) * (b - 0.5d0)))))
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 <= -7.5e+145) {
tmp = a + (t + (z + (x * Math.log(y))));
} else {
tmp = a + (t + (z + ((y * i) + (Math.log(c) * (b - 0.5)))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if x <= -7.5e+145: tmp = a + (t + (z + (x * math.log(y)))) else: tmp = a + (t + (z + ((y * i) + (math.log(c) * (b - 0.5))))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (x <= -7.5e+145) tmp = Float64(a + Float64(t + Float64(z + Float64(x * log(y))))); else tmp = Float64(a + Float64(t + Float64(z + Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (x <= -7.5e+145) tmp = a + (t + (z + (x * log(y)))); else tmp = a + (t + (z + ((y * i) + (log(c) * (b - 0.5))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[x, -7.5e+145], N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+145}:\\
\;\;\;\;a + \left(t + \left(z + x \cdot \log y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + \left(y \cdot i + \log c \cdot \left(b - 0.5\right)\right)\right)\right)\\
\end{array}
\end{array}
if x < -7.50000000000000006e145Initial program 99.8%
Taylor expanded in y around 0 81.4%
Taylor expanded in x around inf 70.7%
if -7.50000000000000006e145 < x Initial program 99.9%
Taylor expanded in x around 0 92.6%
Final simplification90.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -1.8e+228) (not (<= b 7.5e+206))) (+ a (* b (log c))) (+ a (+ t (fma y i z)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -1.8e+228) || !(b <= 7.5e+206)) {
tmp = a + (b * log(c));
} else {
tmp = a + (t + fma(y, i, z));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -1.8e+228) || !(b <= 7.5e+206)) tmp = Float64(a + Float64(b * log(c))); else tmp = Float64(a + Float64(t + fma(y, i, z))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -1.8e+228], N[Not[LessEqual[b, 7.5e+206]], $MachinePrecision]], N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(y * i + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+228} \lor \neg \left(b \leq 7.5 \cdot 10^{+206}\right):\\
\;\;\;\;a + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \mathsf{fma}\left(y, i, z\right)\right)\\
\end{array}
\end{array}
if b < -1.8e228 or 7.49999999999999958e206 < b Initial program 99.7%
Taylor expanded in x around 0 96.3%
Taylor expanded in t around 0 89.9%
associate-+r+89.9%
*-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
+-commutative89.9%
fma-def89.9%
Simplified89.9%
Taylor expanded in y around 0 73.0%
+-commutative73.0%
sub-neg73.0%
metadata-eval73.0%
fma-def73.0%
Simplified73.0%
Taylor expanded in b around inf 66.7%
*-commutative66.7%
Simplified66.7%
if -1.8e228 < b < 7.49999999999999958e206Initial program 99.9%
Taylor expanded in x around 0 84.3%
Taylor expanded in i around inf 77.9%
*-commutative77.9%
Simplified77.9%
+-commutative77.9%
fma-def77.9%
Applied egg-rr77.9%
Final simplification75.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -8.6e+69) (+ a (+ t (fma y i z))) (+ a (+ (* y i) (* (log c) (- b 0.5))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -8.6e+69) {
tmp = a + (t + fma(y, i, z));
} else {
tmp = a + ((y * i) + (log(c) * (b - 0.5)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -8.6e+69) tmp = Float64(a + Float64(t + fma(y, i, z))); else tmp = Float64(a + Float64(Float64(y * i) + Float64(log(c) * Float64(b - 0.5)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -8.6e+69], N[(a + N[(t + N[(y * i + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(N[(y * i), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{+69}:\\
\;\;\;\;a + \left(t + \mathsf{fma}\left(y, i, z\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(y \cdot i + \log c \cdot \left(b - 0.5\right)\right)\\
\end{array}
\end{array}
if z < -8.59999999999999986e69Initial program 99.9%
Taylor expanded in x around 0 88.3%
Taylor expanded in i around inf 72.1%
*-commutative72.1%
Simplified72.1%
+-commutative72.1%
fma-def72.1%
Applied egg-rr72.1%
if -8.59999999999999986e69 < z Initial program 99.9%
Taylor expanded in x around 0 86.2%
Taylor expanded in t around 0 69.6%
associate-+r+69.6%
*-commutative69.6%
sub-neg69.6%
metadata-eval69.6%
+-commutative69.6%
+-commutative69.6%
fma-def69.6%
Simplified69.6%
Taylor expanded in z around 0 60.5%
Final simplification62.9%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -1.8e+226) (not (<= b 3.1e+202))) (+ a (* b (log c))) (+ a (+ t (+ z (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -1.8e+226) || !(b <= 3.1e+202)) {
tmp = a + (b * log(c));
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((b <= (-1.8d+226)) .or. (.not. (b <= 3.1d+202))) then
tmp = a + (b * log(c))
else
tmp = a + (t + (z + (y * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -1.8e+226) || !(b <= 3.1e+202)) {
tmp = a + (b * Math.log(c));
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (b <= -1.8e+226) or not (b <= 3.1e+202): tmp = a + (b * math.log(c)) else: tmp = a + (t + (z + (y * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -1.8e+226) || !(b <= 3.1e+202)) tmp = Float64(a + Float64(b * log(c))); else tmp = Float64(a + Float64(t + Float64(z + Float64(y * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((b <= -1.8e+226) || ~((b <= 3.1e+202))) tmp = a + (b * log(c)); else tmp = a + (t + (z + (y * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -1.8e+226], N[Not[LessEqual[b, 3.1e+202]], $MachinePrecision]], N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+226} \lor \neg \left(b \leq 3.1 \cdot 10^{+202}\right):\\
\;\;\;\;a + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\
\end{array}
\end{array}
if b < -1.7999999999999999e226 or 3.09999999999999991e202 < b Initial program 99.7%
Taylor expanded in x around 0 96.3%
Taylor expanded in t around 0 89.9%
associate-+r+89.9%
*-commutative89.9%
sub-neg89.9%
metadata-eval89.9%
+-commutative89.9%
+-commutative89.9%
fma-def89.9%
Simplified89.9%
Taylor expanded in y around 0 73.0%
+-commutative73.0%
sub-neg73.0%
metadata-eval73.0%
fma-def73.0%
Simplified73.0%
Taylor expanded in b around inf 66.7%
*-commutative66.7%
Simplified66.7%
if -1.7999999999999999e226 < b < 3.09999999999999991e202Initial program 99.9%
Taylor expanded in x around 0 84.3%
Taylor expanded in i around inf 77.9%
*-commutative77.9%
Simplified77.9%
Final simplification75.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 8e+90) (+ a (+ z (* (log c) (- b 0.5)))) (+ a (+ t (+ z (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 8e+90) {
tmp = a + (z + (log(c) * (b - 0.5)));
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (y <= 8d+90) then
tmp = a + (z + (log(c) * (b - 0.5d0)))
else
tmp = a + (t + (z + (y * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 8e+90) {
tmp = a + (z + (Math.log(c) * (b - 0.5)));
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 8e+90: tmp = a + (z + (math.log(c) * (b - 0.5))) else: tmp = a + (t + (z + (y * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 8e+90) tmp = Float64(a + Float64(z + Float64(log(c) * Float64(b - 0.5)))); else tmp = Float64(a + Float64(t + Float64(z + Float64(y * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 8e+90) tmp = a + (z + (log(c) * (b - 0.5))); else tmp = a + (t + (z + (y * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 8e+90], N[(a + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 8 \cdot 10^{+90}:\\
\;\;\;\;a + \left(z + \log c \cdot \left(b - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\
\end{array}
\end{array}
if y < 7.99999999999999973e90Initial program 99.9%
Taylor expanded in x around 0 83.9%
Taylor expanded in t around 0 65.2%
associate-+r+65.2%
*-commutative65.2%
sub-neg65.2%
metadata-eval65.2%
+-commutative65.2%
+-commutative65.2%
fma-def65.2%
Simplified65.2%
Taylor expanded in y around 0 57.3%
if 7.99999999999999973e90 < y Initial program 99.9%
Taylor expanded in x around 0 91.0%
Taylor expanded in i around inf 81.2%
*-commutative81.2%
Simplified81.2%
Final simplification66.6%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -7.5e+145) (not (<= x 2.9e+240))) (* x (log y)) (+ a (+ t (+ z (* y i))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -7.5e+145) || !(x <= 2.9e+240)) {
tmp = x * log(y);
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-7.5d+145)) .or. (.not. (x <= 2.9d+240))) then
tmp = x * log(y)
else
tmp = a + (t + (z + (y * i)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -7.5e+145) || !(x <= 2.9e+240)) {
tmp = x * Math.log(y);
} else {
tmp = a + (t + (z + (y * i)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -7.5e+145) or not (x <= 2.9e+240): tmp = x * math.log(y) else: tmp = a + (t + (z + (y * i))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -7.5e+145) || !(x <= 2.9e+240)) tmp = Float64(x * log(y)); else tmp = Float64(a + Float64(t + Float64(z + Float64(y * i)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -7.5e+145) || ~((x <= 2.9e+240))) tmp = x * log(y); else tmp = a + (t + (z + (y * i))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -7.5e+145], N[Not[LessEqual[x, 2.9e+240]], $MachinePrecision]], N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision], N[(a + N[(t + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.5 \cdot 10^{+145} \lor \neg \left(x \leq 2.9 \cdot 10^{+240}\right):\\
\;\;\;\;x \cdot \log y\\
\mathbf{else}:\\
\;\;\;\;a + \left(t + \left(z + y \cdot i\right)\right)\\
\end{array}
\end{array}
if x < -7.50000000000000006e145 or 2.89999999999999998e240 < x Initial program 99.8%
Taylor expanded in x around inf 56.0%
if -7.50000000000000006e145 < x < 2.89999999999999998e240Initial program 99.9%
Taylor expanded in x around 0 96.8%
Taylor expanded in i around inf 76.4%
*-commutative76.4%
Simplified76.4%
Final simplification72.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 3e-208) z (if (<= y 4.4e-136) a (if (<= y 1.55e+83) z (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 3e-208) {
tmp = z;
} else if (y <= 4.4e-136) {
tmp = a;
} else if (y <= 1.55e+83) {
tmp = z;
} else {
tmp = 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 (y <= 3d-208) then
tmp = z
else if (y <= 4.4d-136) then
tmp = a
else if (y <= 1.55d+83) then
tmp = z
else
tmp = 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 (y <= 3e-208) {
tmp = z;
} else if (y <= 4.4e-136) {
tmp = a;
} else if (y <= 1.55e+83) {
tmp = z;
} else {
tmp = y * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 3e-208: tmp = z elif y <= 4.4e-136: tmp = a elif y <= 1.55e+83: tmp = z else: tmp = y * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 3e-208) tmp = z; elseif (y <= 4.4e-136) tmp = a; elseif (y <= 1.55e+83) tmp = z; else tmp = Float64(y * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 3e-208) tmp = z; elseif (y <= 4.4e-136) tmp = a; elseif (y <= 1.55e+83) tmp = z; else tmp = y * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 3e-208], z, If[LessEqual[y, 4.4e-136], a, If[LessEqual[y, 1.55e+83], z, N[(y * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3 \cdot 10^{-208}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-136}:\\
\;\;\;\;a\\
\mathbf{elif}\;y \leq 1.55 \cdot 10^{+83}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if y < 2.99999999999999986e-208 or 4.4000000000000002e-136 < y < 1.54999999999999996e83Initial program 99.9%
Taylor expanded in z around inf 20.9%
if 2.99999999999999986e-208 < y < 4.4000000000000002e-136Initial program 99.9%
Taylor expanded in a around inf 23.8%
if 1.54999999999999996e83 < y Initial program 99.9%
Taylor expanded in y around inf 55.9%
*-commutative55.9%
Simplified55.9%
Final simplification35.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 5.2e-209) z (if (<= y 7e-136) (+ t a) (if (<= y 1e+78) z (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 5.2e-209) {
tmp = z;
} else if (y <= 7e-136) {
tmp = t + a;
} else if (y <= 1e+78) {
tmp = z;
} else {
tmp = 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 (y <= 5.2d-209) then
tmp = z
else if (y <= 7d-136) then
tmp = t + a
else if (y <= 1d+78) then
tmp = z
else
tmp = 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 (y <= 5.2e-209) {
tmp = z;
} else if (y <= 7e-136) {
tmp = t + a;
} else if (y <= 1e+78) {
tmp = z;
} else {
tmp = y * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 5.2e-209: tmp = z elif y <= 7e-136: tmp = t + a elif y <= 1e+78: tmp = z else: tmp = y * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 5.2e-209) tmp = z; elseif (y <= 7e-136) tmp = Float64(t + a); elseif (y <= 1e+78) tmp = z; else tmp = Float64(y * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 5.2e-209) tmp = z; elseif (y <= 7e-136) tmp = t + a; elseif (y <= 1e+78) tmp = z; else tmp = y * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 5.2e-209], z, If[LessEqual[y, 7e-136], N[(t + a), $MachinePrecision], If[LessEqual[y, 1e+78], z, N[(y * i), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.2 \cdot 10^{-209}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-136}:\\
\;\;\;\;t + a\\
\mathbf{elif}\;y \leq 10^{+78}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if y < 5.19999999999999969e-209 or 7.00000000000000058e-136 < y < 1.00000000000000001e78Initial program 99.9%
Taylor expanded in z around inf 20.9%
if 5.19999999999999969e-209 < y < 7.00000000000000058e-136Initial program 99.9%
Taylor expanded in x around 0 83.7%
Taylor expanded in i around inf 61.9%
*-commutative61.9%
Simplified61.9%
Taylor expanded in t around inf 43.1%
if 1.00000000000000001e78 < y Initial program 99.9%
Taylor expanded in y around inf 55.9%
*-commutative55.9%
Simplified55.9%
Final simplification38.0%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -6.5e+120) (+ z a) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -6.5e+120) {
tmp = z + a;
} else {
tmp = a + (y * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-6.5d+120)) then
tmp = z + a
else
tmp = a + (y * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -6.5e+120) {
tmp = z + a;
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -6.5e+120: tmp = z + a else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -6.5e+120) tmp = Float64(z + a); else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -6.5e+120) tmp = z + a; else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -6.5e+120], N[(z + a), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+120}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -6.4999999999999997e120Initial program 99.9%
Taylor expanded in x around 0 93.7%
Taylor expanded in t around 0 85.6%
associate-+r+85.6%
*-commutative85.6%
sub-neg85.6%
metadata-eval85.6%
+-commutative85.6%
+-commutative85.6%
fma-def85.6%
Simplified85.6%
Taylor expanded in z around inf 49.2%
if -6.4999999999999997e120 < z Initial program 99.9%
Taylor expanded in x around 0 85.2%
Taylor expanded in t around 0 69.2%
associate-+r+69.2%
*-commutative69.2%
sub-neg69.2%
metadata-eval69.2%
+-commutative69.2%
+-commutative69.2%
fma-def69.2%
Simplified69.2%
Taylor expanded in y around inf 43.2%
Final simplification44.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2e+121) (+ a (+ z t)) (+ 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 <= -2e+121) {
tmp = a + (z + t);
} 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 <= (-2d+121)) then
tmp = a + (z + t)
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 <= -2e+121) {
tmp = a + (z + t);
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2e+121: tmp = a + (z + t) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2e+121) tmp = Float64(a + Float64(z + t)); 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 <= -2e+121) tmp = a + (z + t); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2e+121], N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+121}:\\
\;\;\;\;a + \left(z + t\right)\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -2.00000000000000007e121Initial program 99.9%
Taylor expanded in x around 0 93.7%
Taylor expanded in z around inf 56.2%
if -2.00000000000000007e121 < z Initial program 99.9%
Taylor expanded in x around 0 85.2%
Taylor expanded in t around 0 69.2%
associate-+r+69.2%
*-commutative69.2%
sub-neg69.2%
metadata-eval69.2%
+-commutative69.2%
+-commutative69.2%
fma-def69.2%
Simplified69.2%
Taylor expanded in y around inf 43.2%
Final simplification45.3%
(FPCore (x y z t a b c i) :precision binary64 (+ a (+ t (+ z (* y i)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + (t + (z + (y * i)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = a + (t + (z + (y * i)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + (t + (z + (y * i)));
}
def code(x, y, z, t, a, b, c, i): return a + (t + (z + (y * i)))
function code(x, y, z, t, a, b, c, i) return Float64(a + Float64(t + Float64(z + Float64(y * i)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a + (t + (z + (y * i))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(t + N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + \left(t + \left(z + y \cdot i\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 86.6%
Taylor expanded in i around inf 68.1%
*-commutative68.1%
Simplified68.1%
Final simplification68.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 1.7e+105) (+ 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 (y <= 1.7e+105) {
tmp = z + a;
} else {
tmp = 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 (y <= 1.7d+105) then
tmp = z + a
else
tmp = 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 (y <= 1.7e+105) {
tmp = z + a;
} else {
tmp = y * i;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 1.7e+105: tmp = z + a else: tmp = y * i return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 1.7e+105) tmp = Float64(z + a); else tmp = Float64(y * i); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 1.7e+105) tmp = z + a; else tmp = y * i; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 1.7e+105], N[(z + a), $MachinePrecision], N[(y * i), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.7 \cdot 10^{+105}:\\
\;\;\;\;z + a\\
\mathbf{else}:\\
\;\;\;\;y \cdot i\\
\end{array}
\end{array}
if y < 1.7e105Initial program 99.9%
Taylor expanded in x around 0 84.0%
Taylor expanded in t around 0 66.1%
associate-+r+66.1%
*-commutative66.1%
sub-neg66.1%
metadata-eval66.1%
+-commutative66.1%
+-commutative66.1%
fma-def66.1%
Simplified66.1%
Taylor expanded in z around inf 36.1%
if 1.7e105 < y Initial program 99.9%
Taylor expanded in y around inf 61.2%
*-commutative61.2%
Simplified61.2%
Final simplification45.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.95e+86) 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.95e+86) {
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.95d+86)) 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.95e+86) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -1.95e+86: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -1.95e+86) 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.95e+86) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.95e+86], z, a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.95 \cdot 10^{+86}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -1.9500000000000001e86Initial program 99.9%
Taylor expanded in z around inf 35.3%
if -1.9500000000000001e86 < z Initial program 99.9%
Taylor expanded in a around inf 15.2%
Final simplification19.2%
(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 14.1%
Final simplification14.1%
herbie shell --seed 2024031
(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)))