
(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 (fma y i (fma (+ b -0.5) (log c) (+ (fma x (log y) z) (+ t a)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return fma(y, i, fma((b + -0.5), log(c), (fma(x, log(y), z) + (t + a))));
}
function code(x, y, z, t, a, b, c, i) return fma(y, i, fma(Float64(b + -0.5), log(c), Float64(fma(x, log(y), z) + Float64(t + a)))) end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(y * i + N[(N[(b + -0.5), $MachinePrecision] * N[Log[c], $MachinePrecision] + N[(N[(x * N[Log[y], $MachinePrecision] + z), $MachinePrecision] + N[(t + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, i, \mathsf{fma}\left(b + -0.5, \log c, \mathsf{fma}\left(x, \log y, z\right) + \left(t + a\right)\right)\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
fma-def99.8%
+-commutative99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
associate-+l+99.8%
fma-def99.8%
Simplified99.8%
Final simplification99.8%
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ a (+ t (+ z (* x (log y))))) (* (log c) (- b 0.5))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5d0))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return ((a + (t + (z + (x * Math.log(y))))) + (Math.log(c) * (b - 0.5))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return ((a + (t + (z + (x * math.log(y))))) + (math.log(c) * (b - 0.5))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(log(c) * Float64(b - 0.5))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = ((a + (t + (z + (x * log(y))))) + (log(c) * (b - 0.5))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + \log c \cdot \left(b - 0.5\right)\right) + y \cdot i
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (<= y 3.8e+27)
(+ t_1 (+ a (+ (* x (log y)) (+ z t))))
(fma y i (+ a (+ t_1 (+ z t)))))))
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 (y <= 3.8e+27) {
tmp = t_1 + (a + ((x * log(y)) + (z + t)));
} else {
tmp = fma(y, i, (a + (t_1 + (z + t))));
}
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 (y <= 3.8e+27) tmp = Float64(t_1 + Float64(a + Float64(Float64(x * log(y)) + Float64(z + t)))); else tmp = fma(y, i, Float64(a + Float64(t_1 + Float64(z + t)))); 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[LessEqual[y, 3.8e+27], N[(t$95$1 + N[(a + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(a + N[(t$95$1 + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;y \leq 3.8 \cdot 10^{+27}:\\
\;\;\;\;t_1 + \left(a + \left(x \cdot \log y + \left(z + t\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \left(t_1 + \left(z + t\right)\right)\right)\\
\end{array}
\end{array}
if y < 3.80000000000000022e27Initial program 99.8%
Taylor expanded in y around 0 95.4%
if 3.80000000000000022e27 < y Initial program 99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around 0 92.4%
Final simplification94.0%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (+ a (+ t (+ z (* x (log y))))) (* b (log c)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)));
}
real(8) function code(x, y, z, t, a, b, c, i)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8), intent (in) :: c
real(8), intent (in) :: i
code = (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c)))
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((a + (t + (z + (x * Math.log(y))))) + (b * Math.log(c)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + ((a + (t + (z + (x * math.log(y))))) + (b * math.log(c)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(a + Float64(t + Float64(z + Float64(x * log(y))))) + Float64(b * log(c)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + ((a + (t + (z + (x * log(y))))) + (b * log(c))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(a + N[(t + N[(z + N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\left(a + \left(t + \left(z + x \cdot \log y\right)\right)\right) + b \cdot \log c\right)
\end{array}
Initial program 99.8%
Taylor expanded in b around inf 99.5%
Final simplification99.5%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (<= y 2.9e+29)
(+ t_1 (+ (* x (log y)) (+ z a)))
(+ (* y i) (+ t_1 (+ a (+ z t)))))))
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 (y <= 2.9e+29) {
tmp = t_1 + ((x * log(y)) + (z + a));
} else {
tmp = (y * i) + (t_1 + (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) :: t_1
real(8) :: tmp
t_1 = log(c) * (b - 0.5d0)
if (y <= 2.9d+29) then
tmp = t_1 + ((x * log(y)) + (z + a))
else
tmp = (y * i) + (t_1 + (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 t_1 = Math.log(c) * (b - 0.5);
double tmp;
if (y <= 2.9e+29) {
tmp = t_1 + ((x * Math.log(y)) + (z + a));
} else {
tmp = (y * i) + (t_1 + (a + (z + t)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = math.log(c) * (b - 0.5) tmp = 0 if y <= 2.9e+29: tmp = t_1 + ((x * math.log(y)) + (z + a)) else: tmp = (y * i) + (t_1 + (a + (z + t))) 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 (y <= 2.9e+29) tmp = Float64(t_1 + Float64(Float64(x * log(y)) + Float64(z + a))); else tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + Float64(z + t)))); 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 (y <= 2.9e+29) tmp = t_1 + ((x * log(y)) + (z + a)); else tmp = (y * i) + (t_1 + (a + (z + t))); 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[LessEqual[y, 2.9e+29], N[(t$95$1 + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;y \leq 2.9 \cdot 10^{+29}:\\
\;\;\;\;t_1 + \left(x \cdot \log y + \left(z + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t_1 + \left(a + \left(z + t\right)\right)\right)\\
\end{array}
\end{array}
if y < 2.8999999999999999e29Initial program 99.8%
Taylor expanded in y around 0 95.4%
Taylor expanded in t around 0 76.9%
if 2.8999999999999999e29 < y Initial program 99.9%
Taylor expanded in x around 0 92.4%
Final simplification83.8%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (log c) (- b 0.5))))
(if (<= y 1.05e+29)
(+ t_1 (+ (* x (log y)) (+ z a)))
(fma y i (+ a (+ t_1 (+ z t)))))))
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 (y <= 1.05e+29) {
tmp = t_1 + ((x * log(y)) + (z + a));
} else {
tmp = fma(y, i, (a + (t_1 + (z + t))));
}
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 (y <= 1.05e+29) tmp = Float64(t_1 + Float64(Float64(x * log(y)) + Float64(z + a))); else tmp = fma(y, i, Float64(a + Float64(t_1 + Float64(z + t)))); 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[LessEqual[y, 1.05e+29], N[(t$95$1 + N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(a + N[(t$95$1 + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log c \cdot \left(b - 0.5\right)\\
\mathbf{if}\;y \leq 1.05 \cdot 10^{+29}:\\
\;\;\;\;t_1 + \left(x \cdot \log y + \left(z + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, a + \left(t_1 + \left(z + t\right)\right)\right)\\
\end{array}
\end{array}
if y < 1.0500000000000001e29Initial program 99.8%
Taylor expanded in y around 0 95.4%
Taylor expanded in t around 0 76.9%
if 1.0500000000000001e29 < y Initial program 99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around 0 92.4%
Final simplification83.8%
(FPCore (x y z t a b c i) :precision binary64 (+ (* y i) (+ (* (log c) (- b 0.5)) (+ a (+ z t)))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (y * i) + ((log(c) * (b - 0.5)) + (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) + ((log(c) * (b - 0.5d0)) + (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) + ((Math.log(c) * (b - 0.5)) + (a + (z + t)));
}
def code(x, y, z, t, a, b, c, i): return (y * i) + ((math.log(c) * (b - 0.5)) + (a + (z + t)))
function code(x, y, z, t, a, b, c, i) return Float64(Float64(y * i) + Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(a + Float64(z + t)))) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (y * i) + ((log(c) * (b - 0.5)) + (a + (z + t))); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(y * i), $MachinePrecision] + N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot i + \left(\log c \cdot \left(b - 0.5\right) + \left(a + \left(z + t\right)\right)\right)
\end{array}
Initial program 99.8%
Taylor expanded in x around 0 85.7%
Final simplification85.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 2.7e+101) (+ (* (log c) (- b 0.5)) (+ t (+ z a))) (fma y i (+ z a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 2.7e+101) {
tmp = (log(c) * (b - 0.5)) + (t + (z + a));
} else {
tmp = fma(y, i, (z + a));
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 2.7e+101) tmp = Float64(Float64(log(c) * Float64(b - 0.5)) + Float64(t + Float64(z + a))); else tmp = fma(y, i, Float64(z + a)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 2.7e+101], N[(N[(N[Log[c], $MachinePrecision] * N[(b - 0.5), $MachinePrecision]), $MachinePrecision] + N[(t + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * i + N[(z + a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{+101}:\\
\;\;\;\;\log c \cdot \left(b - 0.5\right) + \left(t + \left(z + a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z + a\right)\\
\end{array}
\end{array}
if y < 2.70000000000000006e101Initial program 99.8%
Taylor expanded in y around 0 93.3%
Taylor expanded in x around 0 76.9%
+-commutative76.9%
associate-+l+76.9%
+-commutative76.9%
Simplified76.9%
if 2.70000000000000006e101 < y Initial program 99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around 0 90.8%
Taylor expanded in z around inf 75.9%
Final simplification76.5%
(FPCore (x y z t a b c i)
:precision binary64
(if (<= z -1.22e+185)
z
(if (or (<= z -7.2e-113) (not (<= z -3.2e-153)))
(fma y i (+ t 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 <= -1.22e+185) {
tmp = z;
} else if ((z <= -7.2e-113) || !(z <= -3.2e-153)) {
tmp = fma(y, i, (t + a));
} else {
tmp = b * log(c);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -1.22e+185) tmp = z; elseif ((z <= -7.2e-113) || !(z <= -3.2e-153)) tmp = fma(y, i, Float64(t + a)); else tmp = Float64(b * log(c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -1.22e+185], z, If[Or[LessEqual[z, -7.2e-113], N[Not[LessEqual[z, -3.2e-153]], $MachinePrecision]], N[(y * i + N[(t + a), $MachinePrecision]), $MachinePrecision], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.22 \cdot 10^{+185}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-113} \lor \neg \left(z \leq -3.2 \cdot 10^{-153}\right):\\
\;\;\;\;\mathsf{fma}\left(y, i, t + a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \log c\\
\end{array}
\end{array}
if z < -1.22000000000000002e185Initial program 99.8%
Taylor expanded in z around inf 60.5%
if -1.22000000000000002e185 < z < -7.1999999999999995e-113 or -3.1999999999999999e-153 < z Initial program 99.8%
+-commutative99.8%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around 0 85.3%
Taylor expanded in t around inf 55.0%
if -7.1999999999999995e-113 < z < -3.1999999999999999e-153Initial program 99.4%
Taylor expanded in y around 0 79.5%
Taylor expanded in b around inf 60.5%
Final simplification55.7%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2e+105) z (if (<= z -9.6e-113) a (if (<= z 1.3e-285) (* b (log c)) a))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2e+105) {
tmp = z;
} else if (z <= -9.6e-113) {
tmp = a;
} else if (z <= 1.3e-285) {
tmp = b * log(c);
} 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 <= (-2d+105)) then
tmp = z
else if (z <= (-9.6d-113)) then
tmp = a
else if (z <= 1.3d-285) then
tmp = b * log(c)
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 <= -2e+105) {
tmp = z;
} else if (z <= -9.6e-113) {
tmp = a;
} else if (z <= 1.3e-285) {
tmp = b * Math.log(c);
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2e+105: tmp = z elif z <= -9.6e-113: tmp = a elif z <= 1.3e-285: tmp = b * math.log(c) else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2e+105) tmp = z; elseif (z <= -9.6e-113) tmp = a; elseif (z <= 1.3e-285) tmp = Float64(b * log(c)); else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -2e+105) tmp = z; elseif (z <= -9.6e-113) tmp = a; elseif (z <= 1.3e-285) tmp = b * log(c); else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2e+105], z, If[LessEqual[z, -9.6e-113], a, If[LessEqual[z, 1.3e-285], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision], a]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+105}:\\
\;\;\;\;z\\
\mathbf{elif}\;z \leq -9.6 \cdot 10^{-113}:\\
\;\;\;\;a\\
\mathbf{elif}\;z \leq 1.3 \cdot 10^{-285}:\\
\;\;\;\;b \cdot \log c\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -1.9999999999999999e105Initial program 99.9%
Taylor expanded in z around inf 40.7%
if -1.9999999999999999e105 < z < -9.60000000000000049e-113 or 1.3000000000000001e-285 < z Initial program 99.9%
Taylor expanded in a around inf 15.7%
if -9.60000000000000049e-113 < z < 1.3000000000000001e-285Initial program 99.6%
Taylor expanded in y around 0 78.8%
Taylor expanded in b around inf 34.8%
Final simplification22.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= b 1.15e+134) (fma y i (+ z 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 (b <= 1.15e+134) {
tmp = fma(y, i, (z + a));
} else {
tmp = b * log(c);
}
return tmp;
}
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (b <= 1.15e+134) tmp = fma(y, i, Float64(z + a)); else tmp = Float64(b * log(c)); end return tmp end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[b, 1.15e+134], N[(y * i + N[(z + a), $MachinePrecision]), $MachinePrecision], N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq 1.15 \cdot 10^{+134}:\\
\;\;\;\;\mathsf{fma}\left(y, i, z + a\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \log c\\
\end{array}
\end{array}
if b < 1.1499999999999999e134Initial program 99.9%
+-commutative99.9%
fma-def99.9%
+-commutative99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
associate-+l+99.9%
fma-def99.9%
Simplified99.9%
Taylor expanded in x around 0 84.9%
Taylor expanded in z around inf 56.0%
if 1.1499999999999999e134 < b Initial program 99.7%
Taylor expanded in y around 0 88.3%
Taylor expanded in b around inf 70.3%
Final simplification58.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -5.5e+108) z a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -5.5e+108) {
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 <= (-5.5d+108)) 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 <= -5.5e+108) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -5.5e+108: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -5.5e+108) 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 <= -5.5e+108) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -5.5e+108], z, a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+108}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -5.4999999999999998e108Initial program 99.9%
Taylor expanded in z around inf 40.7%
if -5.4999999999999998e108 < z Initial program 99.8%
Taylor expanded in a around inf 16.2%
Final simplification20.4%
(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.8%
Taylor expanded in a around inf 15.2%
Final simplification15.2%
herbie shell --seed 2023178
(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)))