
(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 13 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 (if (or (<= x -1.9e+211) (not (<= x 3.8e+180))) (+ (* x (log y)) (* y i)) (+ (* y i) (+ t (+ z (fma (log c) (+ b -0.5) a))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.9e+211) || !(x <= 3.8e+180)) {
tmp = (x * log(y)) + (y * i);
} else {
tmp = (y * i) + (t + (z + fma(log(c), (b + -0.5), a)));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.9e+211) || !(x <= 3.8e+180)) tmp = Float64(Float64(x * log(y)) + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(t + Float64(z + fma(log(c), Float64(b + -0.5), a)))); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.9e+211], N[Not[LessEqual[x, 3.8e+180]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.9 \cdot 10^{+211} \lor \neg \left(x \leq 3.8 \cdot 10^{+180}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t + \left(z + \mathsf{fma}\left(\log c, b + -0.5, a\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.90000000000000008e211 or 3.8e180 < x Initial program 99.6%
Taylor expanded in x around inf 80.5%
if -1.90000000000000008e211 < x < 3.8e180Initial program 99.9%
Taylor expanded in x around 0 96.5%
+-commutative96.5%
associate-+r+96.5%
+-commutative96.5%
sub-neg96.5%
metadata-eval96.5%
*-commutative96.5%
associate-+r+96.5%
+-commutative96.5%
+-commutative96.5%
associate-+l+96.5%
+-commutative96.5%
*-commutative96.5%
fma-def96.5%
+-commutative96.5%
Simplified96.5%
Final simplification94.4%
(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 (+ (* y i) (+ (* b (log c)) (+ (+ (* x (log y)) z) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((b * log(c)) + (((x * log(y)) + z) + 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) + ((b * log(c)) + (((x * log(y)) + z) + 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) + ((b * Math.log(c)) + (((x * Math.log(y)) + z) + a));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + ((b * math.log(c)) + (((x * math.log(y)) + z) + a))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(b * log(c)) + Float64(Float64(Float64(x * log(y)) + z) + a))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + ((b * log(c)) + (((x * log(y)) + z) + a)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(b \cdot \log c + \left(\left(x \cdot \log y + z\right) + a\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in b around inf 98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in t around 0 83.5%
Final simplification83.5%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.8e+211) (not (<= x 8e+180))) (+ (* x (log y)) (* y i)) (+ (* y i) (+ (+ t a) (+ 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.8e+211) || !(x <= 8e+180)) {
tmp = (x * log(y)) + (y * i);
} else {
tmp = (y * i) + ((t + a) + (z + (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 <= (-1.8d+211)) .or. (.not. (x <= 8d+180))) then
tmp = (x * log(y)) + (y * i)
else
tmp = (y * i) + ((t + a) + (z + (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 <= -1.8e+211) || !(x <= 8e+180)) {
tmp = (x * Math.log(y)) + (y * i);
} else {
tmp = (y * i) + ((t + a) + (z + (Math.log(c) * (b + -0.5))));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.8e+211) or not (x <= 8e+180): tmp = (x * math.log(y)) + (y * i) else: tmp = (y * i) + ((t + a) + (z + (math.log(c) * (b + -0.5)))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.8e+211) || !(x <= 8e+180)) tmp = Float64(Float64(x * log(y)) + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(Float64(t + a) + Float64(z + 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 <= -1.8e+211) || ~((x <= 8e+180))) tmp = (x * log(y)) + (y * i); else tmp = (y * i) + ((t + a) + (z + (log(c) * (b + -0.5)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.8e+211], N[Not[LessEqual[x, 8e+180]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(t + a), $MachinePrecision] + N[(z + N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+211} \lor \neg \left(x \leq 8 \cdot 10^{+180}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(t + a\right) + \left(z + \log c \cdot \left(b + -0.5\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.80000000000000001e211 or 8.0000000000000001e180 < x Initial program 99.6%
Taylor expanded in x around inf 80.5%
if -1.80000000000000001e211 < x < 8.0000000000000001e180Initial program 99.9%
Taylor expanded in x around 0 96.5%
associate-+r+96.5%
sub-neg96.5%
metadata-eval96.5%
+-commutative96.5%
Simplified96.5%
Final simplification94.4%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.8e+211) (not (<= x 9e+180))) (+ (* x (log y)) (* y i)) (+ (* y i) (+ (* b (log c)) (+ a (+ z t))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.8e+211) || !(x <= 9e+180)) {
tmp = (x * log(y)) + (y * i);
} else {
tmp = (y * i) + ((b * log(c)) + (a + (z + t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-1.8d+211)) .or. (.not. (x <= 9d+180))) then
tmp = (x * log(y)) + (y * i)
else
tmp = (y * i) + ((b * log(c)) + (a + (z + t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.8e+211) || !(x <= 9e+180)) {
tmp = (x * Math.log(y)) + (y * i);
} else {
tmp = (y * i) + ((b * Math.log(c)) + (a + (z + t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.8e+211) or not (x <= 9e+180): tmp = (x * math.log(y)) + (y * i) else: tmp = (y * i) + ((b * math.log(c)) + (a + (z + t))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.8e+211) || !(x <= 9e+180)) tmp = Float64(Float64(x * log(y)) + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(Float64(b * log(c)) + Float64(a + Float64(z + t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -1.8e+211) || ~((x <= 9e+180))) tmp = (x * log(y)) + (y * i); else tmp = (y * i) + ((b * log(c)) + (a + (z + t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.8e+211], N[Not[LessEqual[x, 9e+180]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+211} \lor \neg \left(x \leq 9 \cdot 10^{+180}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(b \cdot \log c + \left(a + \left(z + t\right)\right)\right)\\
\end{array}
\end{array}
if x < -1.80000000000000001e211 or 8.99999999999999962e180 < x Initial program 99.6%
Taylor expanded in x around inf 80.5%
if -1.80000000000000001e211 < x < 8.99999999999999962e180Initial program 99.9%
Taylor expanded in b around inf 98.6%
*-commutative98.6%
Simplified98.6%
Taylor expanded in x around 0 95.2%
Final simplification93.3%
(FPCore (x y z t a b c i) :precision binary64 (if (or (<= x -1.8e+211) (not (<= x 7.8e+180))) (+ (* x (log y)) (* y i)) (+ (* y i) (+ t (+ z a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.8e+211) || !(x <= 7.8e+180)) {
tmp = (x * log(y)) + (y * i);
} else {
tmp = (y * i) + (t + (z + a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if ((x <= (-1.8d+211)) .or. (.not. (x <= 7.8d+180))) then
tmp = (x * log(y)) + (y * i)
else
tmp = (y * i) + (t + (z + a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if ((x <= -1.8e+211) || !(x <= 7.8e+180)) {
tmp = (x * Math.log(y)) + (y * i);
} else {
tmp = (y * i) + (t + (z + a));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if (x <= -1.8e+211) or not (x <= 7.8e+180): tmp = (x * math.log(y)) + (y * i) else: tmp = (y * i) + (t + (z + a)) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if ((x <= -1.8e+211) || !(x <= 7.8e+180)) tmp = Float64(Float64(x * log(y)) + Float64(y * i)); else tmp = Float64(Float64(y * i) + Float64(t + Float64(z + a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if ((x <= -1.8e+211) || ~((x <= 7.8e+180))) tmp = (x * log(y)) + (y * i); else tmp = (y * i) + (t + (z + a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[Or[LessEqual[x, -1.8e+211], N[Not[LessEqual[x, 7.8e+180]], $MachinePrecision]], N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.8 \cdot 10^{+211} \lor \neg \left(x \leq 7.8 \cdot 10^{+180}\right):\\
\;\;\;\;x \cdot \log y + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t + \left(z + a\right)\right)\\
\end{array}
\end{array}
if x < -1.80000000000000001e211 or 7.8000000000000002e180 < x Initial program 99.6%
Taylor expanded in x around inf 80.5%
if -1.80000000000000001e211 < x < 7.8000000000000002e180Initial program 99.9%
Taylor expanded in x around 0 96.5%
+-commutative96.5%
associate-+r+96.5%
+-commutative96.5%
sub-neg96.5%
metadata-eval96.5%
*-commutative96.5%
associate-+r+96.5%
+-commutative96.5%
+-commutative96.5%
associate-+l+96.5%
+-commutative96.5%
*-commutative96.5%
fma-def96.5%
+-commutative96.5%
Simplified96.5%
Taylor expanded in a around inf 78.7%
Final simplification78.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -4e+113) (+ (* y i) (+ t (+ z a))) (+ (* y i) (+ a (* b (log c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -4e+113) {
tmp = (y * i) + (t + (z + a));
} else {
tmp = (y * i) + (a + (b * log(c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-4d+113)) then
tmp = (y * i) + (t + (z + a))
else
tmp = (y * i) + (a + (b * log(c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -4e+113) {
tmp = (y * i) + (t + (z + a));
} else {
tmp = (y * i) + (a + (b * Math.log(c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -4e+113: tmp = (y * i) + (t + (z + a)) else: tmp = (y * i) + (a + (b * math.log(c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -4e+113) tmp = Float64(Float64(y * i) + Float64(t + Float64(z + a))); else tmp = Float64(Float64(y * i) + Float64(a + Float64(b * log(c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -4e+113) tmp = (y * i) + (t + (z + a)); else tmp = (y * i) + (a + (b * log(c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -4e+113], N[(N[(y * i), $MachinePrecision] + N[(t + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(a + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+113}:\\
\;\;\;\;y \cdot i + \left(t + \left(z + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(a + b \cdot \log c\right)\\
\end{array}
\end{array}
if z < -4e113Initial program 100.0%
Taylor expanded in x around 0 92.9%
+-commutative92.9%
associate-+r+92.9%
+-commutative92.9%
sub-neg92.9%
metadata-eval92.9%
*-commutative92.9%
associate-+r+92.9%
+-commutative92.9%
+-commutative92.9%
associate-+l+92.9%
+-commutative92.9%
*-commutative92.9%
fma-def92.9%
+-commutative92.9%
Simplified92.9%
Taylor expanded in a around inf 83.4%
if -4e113 < z Initial program 99.9%
Taylor expanded in b around inf 98.5%
*-commutative98.5%
Simplified98.5%
Taylor expanded in a around inf 55.0%
Final simplification59.6%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ t (+ z a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + (t + (z + 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) + (t + (z + 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) + (t + (z + a));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + (t + (z + a))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(t + Float64(z + a))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + (t + (z + a)); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(t + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(t + \left(z + a\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0 86.5%
+-commutative86.5%
associate-+r+86.5%
+-commutative86.5%
sub-neg86.5%
metadata-eval86.5%
*-commutative86.5%
associate-+r+86.5%
+-commutative86.5%
+-commutative86.5%
associate-+l+86.5%
+-commutative86.5%
*-commutative86.5%
fma-def86.4%
+-commutative86.4%
Simplified86.4%
Taylor expanded in a around inf 70.3%
Final simplification70.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -1.46e+78) (+ z (* y i)) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.46e+78) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-1.46d+78)) then
tmp = z + (y * i)
else
tmp = a + (y * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -1.46e+78) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -1.46e+78: tmp = z + (y * i) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -1.46e+78) tmp = Float64(z + Float64(y * i)); else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -1.46e+78) tmp = z + (y * i); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.46e+78], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.46 \cdot 10^{+78}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -1.46000000000000005e78Initial program 99.9%
Taylor expanded in z around inf 62.2%
if -1.46000000000000005e78 < z Initial program 99.9%
Taylor expanded in a around inf 40.0%
Final simplification44.6%
(FPCore (x y z t a b c i) :precision binary64 (if (<= a 1.16e+107) (* 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.16e+107) {
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.16d+107) 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.16e+107) {
tmp = y * i;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if a <= 1.16e+107: tmp = y * i else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (a <= 1.16e+107) 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.16e+107) tmp = y * i; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[a, 1.16e+107], N[(y * i), $MachinePrecision], a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.16 \cdot 10^{+107}:\\
\;\;\;\;y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if a < 1.1600000000000001e107Initial program 99.9%
Taylor expanded in y around inf 24.6%
*-commutative24.6%
Simplified24.6%
if 1.1600000000000001e107 < a Initial program 99.9%
Taylor expanded in a around inf 62.0%
Taylor expanded in a around inf 44.7%
Final simplification28.6%
(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 a around inf 39.2%
Final simplification39.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 39.2%
Taylor expanded in a around inf 17.9%
Final simplification17.9%
herbie shell --seed 2023275
(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)))