
(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 12 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.9%
Final simplification99.9%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ (+ (+ (* x (log y)) z) t) a) (* b (log c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (((((x * log(y)) + z) + t) + a) + (b * log(c)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + (((((x * log(y)) + z) + t) + a) + (b * log(c)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (((((x * Math.log(y)) + z) + t) + a) + (b * Math.log(c)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + (((((x * math.log(y)) + z) + t) + a) + (b * math.log(c)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(b * log(c)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + (((((x * log(y)) + z) + t) + a) + (b * log(c))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + b \cdot \log c\right)
\end{array}
Initial program 99.9%
Taylor expanded in b around inf 98.8%
*-commutative98.8%
Simplified98.8%
Final simplification98.8%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= (- b 0.5) -5e+117) (not (<= (- b 0.5) 4e+125))) (+ (* y i) (+ t (+ z (* (- b 0.5) (log c))))) (+ (* y i) (+ (+ z a) (* (log c) -0.5)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((b - 0.5) <= -5e+117) || !((b - 0.5) <= 4e+125)) {
tmp = (y * i) + (t + (z + ((b - 0.5) * log(c))));
} else {
tmp = (y * i) + ((z + a) + (log(c) * -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 (((b - 0.5d0) <= (-5d+117)) .or. (.not. ((b - 0.5d0) <= 4d+125))) then
tmp = (y * i) + (t + (z + ((b - 0.5d0) * log(c))))
else
tmp = (y * i) + ((z + a) + (log(c) * (-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 (((b - 0.5) <= -5e+117) || !((b - 0.5) <= 4e+125)) {
tmp = (y * i) + (t + (z + ((b - 0.5) * Math.log(c))));
} else {
tmp = (y * i) + ((z + a) + (Math.log(c) * -0.5));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((b - 0.5) <= -5e+117) or not ((b - 0.5) <= 4e+125): tmp = (y * i) + (t + (z + ((b - 0.5) * math.log(c)))) else: tmp = (y * i) + ((z + a) + (math.log(c) * -0.5)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((Float64(b - 0.5) <= -5e+117) || !(Float64(b - 0.5) <= 4e+125)) tmp = Float64(Float64(y * i) + Float64(t + Float64(z + Float64(Float64(b - 0.5) * log(c))))); else tmp = Float64(Float64(y * i) + Float64(Float64(z + a) + Float64(log(c) * -0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((b - 0.5) <= -5e+117) || ~(((b - 0.5) <= 4e+125))) tmp = (y * i) + (t + (z + ((b - 0.5) * log(c)))); else tmp = (y * i) + ((z + a) + (log(c) * -0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[N[(b - 0.5), $MachinePrecision], -5e+117], N[Not[LessEqual[N[(b - 0.5), $MachinePrecision], 4e+125]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(t + N[(z + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(z + a), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b - 0.5 \leq -5 \cdot 10^{+117} \lor \neg \left(b - 0.5 \leq 4 \cdot 10^{+125}\right):\\
\;\;\;\;y \cdot i + \left(t + \left(z + \left(b - 0.5\right) \cdot \log c\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(z + a\right) + \log c \cdot -0.5\right)\\
\end{array}
\end{array}
if (-.f64 b 1/2) < -4.99999999999999983e117 or 3.9999999999999997e125 < (-.f64 b 1/2) Initial program 99.7%
Taylor expanded in x around 0 89.7%
Taylor expanded in a around 0 82.8%
if -4.99999999999999983e117 < (-.f64 b 1/2) < 3.9999999999999997e125Initial program 99.9%
Taylor expanded in x around 0 80.9%
Taylor expanded in b around 0 79.4%
Taylor expanded in t around 0 64.1%
associate-+r+64.1%
Simplified64.1%
Final simplification69.2%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -6.1e+150) (not (<= b 3.15e+150))) (+ (* y i) (* b (log c))) (+ (* y i) (+ (+ z a) (* (log c) -0.5)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -6.1e+150) || !(b <= 3.15e+150)) {
tmp = (y * i) + (b * log(c));
} else {
tmp = (y * i) + ((z + a) + (log(c) * -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 ((b <= (-6.1d+150)) .or. (.not. (b <= 3.15d+150))) then
tmp = (y * i) + (b * log(c))
else
tmp = (y * i) + ((z + a) + (log(c) * (-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 ((b <= -6.1e+150) || !(b <= 3.15e+150)) {
tmp = (y * i) + (b * Math.log(c));
} else {
tmp = (y * i) + ((z + a) + (Math.log(c) * -0.5));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (b <= -6.1e+150) or not (b <= 3.15e+150): tmp = (y * i) + (b * math.log(c)) else: tmp = (y * i) + ((z + a) + (math.log(c) * -0.5)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -6.1e+150) || !(b <= 3.15e+150)) tmp = Float64(Float64(y * i) + Float64(b * log(c))); else tmp = Float64(Float64(y * i) + Float64(Float64(z + a) + Float64(log(c) * -0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((b <= -6.1e+150) || ~((b <= 3.15e+150))) tmp = (y * i) + (b * log(c)); else tmp = (y * i) + ((z + a) + (log(c) * -0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -6.1e+150], N[Not[LessEqual[b, 3.15e+150]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(z + a), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.1 \cdot 10^{+150} \lor \neg \left(b \leq 3.15 \cdot 10^{+150}\right):\\
\;\;\;\;y \cdot i + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(z + a\right) + \log c \cdot -0.5\right)\\
\end{array}
\end{array}
if b < -6.10000000000000026e150 or 3.15000000000000015e150 < b Initial program 99.6%
Taylor expanded in x around 0 89.1%
Taylor expanded in b around inf 72.1%
*-commutative72.1%
Simplified72.1%
if -6.10000000000000026e150 < b < 3.15000000000000015e150Initial program 99.9%
Taylor expanded in x around 0 81.7%
Taylor expanded in b around 0 77.9%
Taylor expanded in t around 0 63.6%
associate-+r+63.6%
Simplified63.6%
Final simplification65.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= b -3.3e+151) (not (<= b 3.3e+154))) (+ (* y i) (* b (log c))) (+ (* y i) (+ z (+ t a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -3.3e+151) || !(b <= 3.3e+154)) {
tmp = (y * i) + (b * log(c));
} else {
tmp = (y * i) + (z + (t + a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((b <= (-3.3d+151)) .or. (.not. (b <= 3.3d+154))) then
tmp = (y * i) + (b * log(c))
else
tmp = (y * i) + (z + (t + a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((b <= -3.3e+151) || !(b <= 3.3e+154)) {
tmp = (y * i) + (b * Math.log(c));
} else {
tmp = (y * i) + (z + (t + a));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (b <= -3.3e+151) or not (b <= 3.3e+154): tmp = (y * i) + (b * math.log(c)) else: tmp = (y * i) + (z + (t + a)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((b <= -3.3e+151) || !(b <= 3.3e+154)) tmp = Float64(Float64(y * i) + Float64(b * log(c))); else tmp = Float64(Float64(y * i) + Float64(z + Float64(t + a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((b <= -3.3e+151) || ~((b <= 3.3e+154))) tmp = (y * i) + (b * log(c)); else tmp = (y * i) + (z + (t + a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[b, -3.3e+151], N[Not[LessEqual[b, 3.3e+154]], $MachinePrecision]], N[(N[(y * i), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.3 \cdot 10^{+151} \lor \neg \left(b \leq 3.3 \cdot 10^{+154}\right):\\
\;\;\;\;y \cdot i + b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(z + \left(t + a\right)\right)\\
\end{array}
\end{array}
if b < -3.30000000000000025e151 or 3.3e154 < b Initial program 99.6%
Taylor expanded in x around 0 89.1%
Taylor expanded in b around inf 72.1%
*-commutative72.1%
Simplified72.1%
if -3.30000000000000025e151 < b < 3.3e154Initial program 99.9%
Taylor expanded in x around 0 81.7%
add-cube-cbrt81.6%
pow381.6%
*-un-lft-identity81.6%
sub-neg81.6%
*-un-lft-identity81.6%
metadata-eval81.6%
Applied egg-rr81.6%
Taylor expanded in b around inf 77.0%
+-commutative77.0%
associate-+r+77.0%
+-commutative77.0%
associate-+l+77.0%
Simplified77.0%
Final simplification75.9%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (* (- b 0.5) (log c)) (+ a (+ z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (((b - 0.5) * log(c)) + (a + (z + t)));
}
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) + (((b - 0.5d0) * log(c)) + (a + (z + t)))
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) + (((b - 0.5) * Math.log(c)) + (a + (z + t)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + (((b - 0.5) * math.log(c)) + (a + (z + t)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(a + Float64(z + t)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + (((b - 0.5) * log(c)) + (a + (z + t))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(z + t\right)\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 83.3%
Final simplification83.3%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ z a) (* (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) + ((z + a) + (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) + ((z + a) + (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) + ((z + a) + (Math.log(c) * (b + -0.5)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + ((z + a) + (math.log(c) * (b + -0.5)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(z + a) + Float64(log(c) * Float64(b + -0.5)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + ((z + a) + (log(c) * (b + -0.5))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(z + a), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(z + a\right) + \log c \cdot \left(b + -0.5\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 83.3%
Taylor expanded in t around 0 70.1%
associate-+r+70.1%
sub-neg70.1%
metadata-eval70.1%
Simplified70.1%
Final simplification70.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -3.2e+43) (+ z (* y i)) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3.2e+43) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-3.2d+43)) then
tmp = z + (y * i)
else
tmp = a + (y * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -3.2e+43) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -3.2e+43: tmp = z + (y * i) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -3.2e+43) tmp = Float64(z + Float64(y * i)); else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -3.2e+43) tmp = z + (y * i); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -3.2e+43], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+43}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -3.20000000000000014e43Initial program 99.9%
Taylor expanded in x around 0 90.9%
Taylor expanded in b around 0 82.6%
Taylor expanded in z around inf 59.9%
if -3.20000000000000014e43 < z Initial program 99.8%
Taylor expanded in x around 0 81.2%
Taylor expanded in a around inf 40.0%
Final simplification44.4%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ z (+ t a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (z + (t + 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 = (y * i) + (z + (t + a))
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) + (z + (t + a));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + (z + (t + a))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(z + Float64(t + a))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + (z + (t + a)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(z + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(z + \left(t + a\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 83.3%
add-cube-cbrt83.1%
pow383.1%
*-un-lft-identity83.1%
sub-neg83.1%
*-un-lft-identity83.1%
metadata-eval83.1%
Applied egg-rr83.1%
Taylor expanded in b around inf 66.7%
+-commutative66.7%
associate-+r+66.7%
+-commutative66.7%
associate-+l+66.7%
Simplified66.7%
Final simplification66.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 1.8e+108) (* y i) a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (a <= 1.8e+108) {
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 (a <= 1.8d+108) 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 (a <= 1.8e+108) {
tmp = y * i;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 1.8e+108: tmp = y * i else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 1.8e+108) 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 (a <= 1.8e+108) tmp = y * i; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.8e+108], N[(y * i), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.8 \cdot 10^{+108}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < 1.8e108Initial program 99.8%
Taylor expanded in x around 0 82.1%
Taylor expanded in a around inf 33.6%
Taylor expanded in a around 0 24.6%
*-commutative24.6%
Simplified24.6%
if 1.8e108 < a Initial program 100.0%
Taylor expanded in x around 0 89.1%
Taylor expanded in a around inf 60.8%
Taylor expanded in a around inf 50.9%
Final simplification29.0%
(FPCore (x y z t a b c i) :precision binary64 (+ a (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a + (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 + (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 + (y * i);
}
def code(x, y, z, t, a, b, c, i): return a + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(a + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
a + y \cdot i
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 83.3%
Taylor expanded in a around inf 38.2%
Final simplification38.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 x around 0 83.3%
Taylor expanded in a around inf 38.2%
Taylor expanded in a around inf 18.0%
Final simplification18.0%
herbie shell --seed 2024043
(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)))